代码改变世界

google maps Marker

2012-09-24 23:56  youxin  阅读(495)  评论(0)    收藏  举报

Marker(opts?:MarkerOptions)    Creates a marker with the options specified. If a map is specified, the marker is added to the map upon construction. Note that the position must be set for the marker to display.

新建一个Marker

var marker=new google.maps.Marker({
position:myLatlng,
map:map,
title:'hello world'
});

通常我们会指定map。Map on which to display Marker.

title:Rollover text 鼠标浮在Marker上显示的文字。

还有很多:

https://developers.google.com/maps/documentation/javascript/reference#MarkerOptions