分享一个逼格很高的地图配色地址,你也可以让你的地图高级起来,多达几百种配色,总有你喜欢的,效果如图,使用方法也在下方。
上地址:Explore Styles - Snazzy Maps - Free Styles for Google Maps
配色代码就在地图详情左侧,使用方法如下:
var map = new google.maps.Map(mapBox, {
center: { lat: 23.33471125889383, lng: 113.28933872210398 },
zoom: 4,
styles: [
{
"featureType": "all",
"elementType": "all",
"stylers": [
{
"invert_lightness": true
},
{
"saturation": 20
},
{
"lightness": 50
},
{
"gamma": 0.4
},
{
"hue": "#00ffee"
}
]
},
{
"featureType": "all",
"elementType": "geometry",
"stylers": [
{
"visibility": "simplified"
}
]
},
{
"featureType": "all",
"elementType": "labels",
"stylers": [
{
"visibility": "on"
}
]
},
{
"featureType": "administrative",
"elementType": "all",
"stylers": [
{
"color": "#ffffff"
},
{
"visibility": "simplified"
}
]
},
{
"featureType": "administrative.land_parcel",
"elementType": "geometry.stroke",
"stylers": [
{
"visibility": "simplified"
}
]
},
{
"featureType": "landscape",
"elementType": "all",
"stylers": [
{
"color": "#405769"
}
]
},
{
"featureType": "water",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#232f3a"
}
]
}
]
});
除此之外,googleMap也提供了自定义地图的方式, 用户可以直接操作,并预览,开发者可根据实际情况操作。