使用Google地图API v3显示多个标记

Display multiple markers with Google maps API v3

本文关键字:显示 v3 Google 地图 API 使用      更新时间:2023-09-26

我在谷歌地图上不能显示超过10个标记。我的坐标保存在csv文件中,低于10个标记,所有标记都显示在我的地图中。API是否使用限制?谢谢你的帮助。

这是我的代码:我必须添加大约50个标记

csTextMarkers.Append("var infowindow = new google.maps.InfoWindow();");
csTextMarkers.Append("var marker = new google.maps.Marker({ position: new google.maps.LatLng(");
csTextMarkers.AppendFormat("{0}, {1}", geo.Latitude.Replace(',', '.'), geo.Longitude.Replace(',', '.'));
csTextMarkers.Append("), map: map, ");
//Filtre "N/D"
if (geo.Dimension_Ent == "null")
{
    csTextMarkers.Append("icon: 'http://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=%7c9E7151%7c000000&.png%3f', ");
}
//Filtre "< 500 K"
else if (geo.Dimension_Ent == "500 K")
{
    csTextMarkers.Append("icon: 'http://maps.google.com/mapfiles/ms/icons/purple-dot.png' ");
}
csTextMarkers.Append("});");
csTextMarkers.Append("google.maps.event.addListener(marker, 'click', function() {infowindow.setContent('"" + "Nom : " + geo.Nom + "<br/> Adresse : " + geo.Adresse1 + " " + geo.Code_Postal + " " + geo.Ville + "<br/> Dimension entreprise : " + geo.Dimension_Ent + "'"); infowindow.open(map,this);});");