更改Google地图标记 [英] Change Google map marker
本文介绍了更改Google地图标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
感谢,
同伴
解决方案
它非常简单 - 请参阅 http://code.google.com/intl/zh-CN/apis/maps/documentation/javascript/overlays.html#SimpleIcons
直接来自Google文档的示例
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
});
如果您想要做更复杂的事情,您还可以扩展Google覆盖类并执行自定义渲染。 ..
How i change my marker in google map.is possible to add our custome image to map?
Thanks, Companion
解决方案
it is really simple - see http://code.google.com/intl/en-US/apis/maps/documentation/javascript/overlays.html#SimpleIcons
example straight from the google docs
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
});
if you want to do more complex stuff, you can also extend googles overlay classes and perform custom rendering ...
这篇关于更改Google地图标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文