如果你只想赤道並刪除了國際日期變更線。看起來你需要刪除所有的管理幾何。
{
"featureType": "administrative",
"elementType": "geometry",
"stylers": [
{ "visibility": "off" }
]
}
,去除所有其他的行政邊界爲好,把他們帶回你需要將它們重新添加獨立:
{
"featureType": "administrative.country",
"elementType": "geometry.stroke",
"stylers": [
{ "visibility": "on" }
]
},{
"featureType": "administrative.province",
"elementType": "geometry.stroke",
"stylers": [
{ "visibility": "on" }
]
},{
"featureType": "administrative.locality",
"elementType": "geometry.stroke",
"stylers": [
{ "visibility": "on" }
]
},{
"featureType": "administrative.neighborhood",
"elementType": "geometry.stroke",
"stylers": [
{ "visibility": "on" }
]
},{
"featureType": "administrative.land_parcel",
"elementType": "geometry.stroke",
"stylers": [
{ "visibility": "on" }
]
}
代碼片段:
var geocoder;
var map;
function initialize() {
var map = new google.maps.Map(
document.getElementById("map_canvas"), {
center: new google.maps.LatLng(37.4419, -122.1419),
zoom: 2,
mapTypeId: google.maps.MapTypeId.ROADMAP,
styles: [{
"featureType": "administrative",
"elementType": "geometry",
"stylers": [{
"visibility": "off"
}]
}, {
"featureType": "administrative.country",
"elementType": "geometry.stroke",
"stylers": [{
"visibility": "on"
}]
}, {
"featureType": "administrative.province",
"elementType": "geometry.stroke",
"stylers": [{
"visibility": "on"
}]
}, {
"featureType": "administrative.locality",
"elementType": "geometry.stroke",
"stylers": [{
"visibility": "on"
}]
}, {
"featureType": "administrative.neighborhood",
"elementType": "geometry.stroke",
"stylers": [{
"visibility": "on"
}]
}, {
"featureType": "administrative.land_parcel",
"elementType": "geometry.stroke",
"stylers": [{
"visibility": "on"
}]
}]
});
}
google.maps.event.addDomListener(window, "load", initialize);
html,
body,
#map_canvas {
height: 100%;
width: 100%;
margin: 0px;
padding: 0px
}
<script src="https://maps.googleapis.com/maps/api/js"></script>
<div id="map_canvas"></div>
它的工作,谷歌的精彩選項 –