在嵌入式Google地图上(例如,这里-https://www.familienfreunde.de/4.php?Nummer=132700000302),您可以看到很多景点。我想删除它们。<script>function initMap() { var latlng = new google.maps.LatLng(51.3267379,12.3653812); var myOptions = { zoom: 19, center: latlng, mapTypeControlOptions: { mapTypeIds: ["roadmap", "satellite"]} }; map = new google.maps.Map(document.getElementById("map"), myOptions); var box_html = "<h5>Gymnasium Gerda Taro Schule</h5><p>04107 Leipzig<br /><b><a href=\"4.php?Nummer=132700000302\">Profil anzeigen</a></b></p>"; var icon = new google.maps.MarkerImage('/bilder/marker4.png'); var marker = add_marker(51.3267379,12.3653812,'Gymnasium Gerda Taro Schule',box_html,icon); marker.setMap(map); var box_html = "<h5>Rechtsanwalt Henry Bach</h5><p>04107 Leipzig<br /><b><a href=\"22.php?Nummer=378\">Profil anzeigen</a></b></p>"; var icon = new google.maps.MarkerImage('/bilder/marker22.png'); var marker = add_marker(51.3339224,12.3741322,'Rechtsanwalt Henry Bach',box_html,icon); marker.setMap(map); }function add_marker(lat,lng,title,box_html,icon) { var infowindow = new google.maps.InfoWindow({ content: box_html }); var marker = new google.maps.Marker({ position: new google.maps.LatLng(lat,lng), map: map, icon: icon, title: title }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); google.maps.event.addListener(map, 'dragstart', function() { infowindow.close(); }); return marker; }</script> <script src="https://maps.googleapis.com/maps/api/js?key=UNSERKEY&callback=initMap" async defer></script>(为了清楚起见,我仅删除了一些其他标记。)
1 回答

眼眸繁星
TA贡献1873条经验 获得超9个赞
您可以尝试使用styles属性查看POI的可见性
function initMap() {
var latlng = new google.maps.LatLng(51.3267379,12.3653812);
var myOptions = {
zoom: 19,
center: latlng,
styles = [
{
featureType: "poi",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}
];
mapTypeControlOptions: {
mapTypeIds: ["roadmap", "satellite"]
}
添加回答
举报
0/150
提交
取消