admin管理员组文章数量:1390442
I am new to googlemaps. I have already read the Overlapping Marker Spiderfier documentation but I am still confused about how to implement it into my maps.
Here is my attempt:
function initialize() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 7,
center: new google.maps.LatLng(40.0000, 48.0000),
mapTypeId: google.maps.MapTypeId.ROADMAP,
disableDefaultUI: true,
zoomControl: true
});
var locations = [[40.0000, 48.0000], [40.0000, 48.0000], [40.0000, 48.0000]];
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][0], locations[i][1]),
map: map
});
}
}
google.maps.event.addDomListener(window, 'load', initialize);
You can find this code in jsfiddle.
I am new to googlemaps. I have already read the Overlapping Marker Spiderfier documentation but I am still confused about how to implement it into my maps.
Here is my attempt:
function initialize() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 7,
center: new google.maps.LatLng(40.0000, 48.0000),
mapTypeId: google.maps.MapTypeId.ROADMAP,
disableDefaultUI: true,
zoomControl: true
});
var locations = [[40.0000, 48.0000], [40.0000, 48.0000], [40.0000, 48.0000]];
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][0], locations[i][1]),
map: map
});
}
}
google.maps.event.addDomListener(window, 'load', initialize);
You can find this code in jsfiddle.
Share Improve this question edited Feb 14, 2017 at 1:20 Anis LOUNIS aka AnixPasBesoin 4,9666 gold badges34 silver badges64 bronze badges asked Jul 29, 2013 at 9:47 KrichevskoyKrichevskoy 2542 silver badges17 bronze badges1 Answer
Reset to default 5Here is your code updated...
function initialize() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 7,
center: new google.maps.LatLng(40.0000, 48.0000),
mapTypeId: google.maps.MapTypeId.ROADMAP,
disableDefaultUI: true,
zoomControl: true
});
var locations =[ [40.0000, 48.0000],[40.0000, 48.0000],[40.0000, 48.0000]];
oms = new OverlappingMarkerSpiderfier(map,
{markersWontMove: true, markersWontHide: true, keepSpiderfied: true, circleSpiralSwitchover: 40 });
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][0], locations[i][1]),
map: map
});
oms.addMarker(marker);
}
}
google.maps.event.addDomListener(window, 'load', initialize);
本文标签: javascripthow to add Spiderfier in Googlemaps api v3Stack Overflow
版权声明:本文标题:javascript - how to add Spiderfier in Googlemaps api v3? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744744571a2622806.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论