Google Maps v3上的不同标记 [英] different markers on google maps v3
本文介绍了Google Maps v3上的不同标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何向Google Map v3添加不同的标记?
How can I add different markers to google map v3?
以下是我的标记示例:
var latlng = new google.maps.LatLng(lat,lng);
var image = "../img/hotel_icon.png";
var locationDescription = this.locationDescription;
var marker = new google.maps.Marker({
map: map,
position: latlng,
title:'pk:'+name,
icon: image
});
bounds.extend(latlng);
setMarkes(map, marker, name, locationDescription);
});//close each
map.fitBounds(bounds);
});//close getjson
}//close initialize
function setMarkes(map, marker, name, locationDescription){
google.maps.event.addListener(marker, 'mouseover', function() {
infowindow.close();
infowindow.setContent('<h3>'+name+'</h3><em>'+locationDescription+'</em>');
infowindow.open(map, marker);
});
}
推荐答案
以下是一个可能有帮助的示例: http://www.geocodezip.com/v3_markers_normal_colored_infowindows.html
Here is one example that may help: http://www.geocodezip.com/v3_markers_normal_colored_infowindows.html
这篇关于Google Maps v3上的不同标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文