<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html, body { height: 100%; margin: 0; padding: 0; }
#map { height: 100%; }
</style>
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: 42.367112, lng: -71.080964},
zoom: 16,
styles: [
{
"featureType": "poi",
"stylers": [
{ "visibility": "off" }
]
}
]
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?callback=initMap">
</script>
</body>
</html>Run Code Online (Sandbox Code Playgroud)
只需转到 Google 地图样式向导,然后关闭兴趣点的可见性,然后将 JSON 用于您的地图样式。
在您的地图构造函数中,指定:
styles: [
{
"featureType": "poi",
"stylers": [
{ "visibility": "off" }
]
}
]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3194 次 |
| 最近记录: |