-1
我想在自定义地图上显示100个标记,我应该在单个标记代码下面重复100次,并且有大量文件,或者有其他更紧凑的方法来创建多个标记吗?如何在Google地图上创建多个标记100+
var marker = new google.maps.Marker({
position: new google.maps.LatLng(34.052661,-118.269976),
title:"Hello World!",
map:map,
animation: google.maps.Animation.DROP
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
var infowindow = new google.maps.InfoWindow({
content: '<div id="content">'+
'<div id="siteNotice">'+
'</div>'+
'<h1 id="firstHeading" class="firstHeading">Uluru</h1>'+
'<div id="bodyContent">'+
'<p><b>Uluru</b>, also referred to as <b>Ayers Rock</b>, is a large ' +
'sandstone rock formation in the southern part of the '+
'Northern Territory, central Australia. It lies 335 km (208 mi) '+
'south west of the nearest large town, Alice Springs; 450 km '+
'(280 mi) by road. Kata Tjuta and Uluru are the two major '+
'features of the Uluru - Kata Tjuta National Park. Uluru is '+
'sacred to the Pitjantjatjara and Yankunytjatjara, the '+
'Aboriginal people of the area. It has many springs, waterholes, '+
'rock caves and ancient paintings. Uluru is listed as a World '+
'Heritage Site.</p>'+
'<p>Attribution: Uluru, <a href="http://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
'http://en.wikipedia.org/w/index.php?title=Uluru</a> '+
'(last visited June 22, 2009).</p>'+
'</div>'+
'</div>',
});
我是保持客户端下载更小的更值得关注,认为谷歌有更有效的方式来增加航点 –
你可以试试库多标记与甚至1000个标记快速度似乎作品: https://code.google.com/p/multimarker/ – cesare
multimarker似乎是一个被遗弃的项目,只是fyi –