将默认图标更改为MarkerWithLabel

Jua*_*uan 2 javascript google-maps-api-3

我一直在搜索使用谷歌地图api V3用标记显示动态文本的方法.最后,我找到了一个使用MarkerWithLabel的简单解决方案.链接后的完整文档

链接

我现在的问题是我想要更改markerwithlabel的默认图标,或者如果不可能只是不显示它.

我真的很想知道是否有人有同样的问题Cose我无法在网上找到任何相关内容

谢谢

Tin*_*ehr 6

我认为您所要做的就是将'icon'参数传递给构造函数,如下所示:MarkerWithLabel扩展了Marker,它说.

x = new MarkerWithLabel({
  icon: 'http://www.mysite.com/myimage.png'
});
Run Code Online (Sandbox Code Playgroud)

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