在Google地图应用中更改标记图标

Kim*_*ho6 2 google-maps

使用Jquery/javascript嵌入googlemap时,是否有一种简单的方法来更改标记?

编辑奖金问题有没有办法使用地址而不是LatLng?

Rob*_*ett 5

Google Maps API V3现在是官方版本.

http://code.google.com/apis/maps/documentation/javascript/overlays.html#Icons

声明标记时,使用"icon"属性设置图像.

从文档:

 var image = 'beachflag.png';
  var myLatLng = new google.maps.LatLng(-33.890542, 151.274856);
  var beachMarker = new google.maps.Marker({
      position: myLatLng,
      map: map,
      icon: image
  });
Run Code Online (Sandbox Code Playgroud)

您还可以使用图表API生成标记图像.

例如http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=A|FF0000|000000为红色别针

http://groups.google.com/group/google-chart-api/web/chart-types-for-map-pins?pli=1