Open madfour opened 3 years ago
styleJSON
(取消了县级以下城乡的显示,取消了所有道路以及标志的显示等等)[
{
"featureType": "continent",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "country",
"elementType": "labels",
"stylers": {
"visibility": "on"
}
},
{
"featureType": "road",
"elementType": "geometry",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "road",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "poilabel",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "poilabel",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "town",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "town",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "village",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "tertiaryway",
"elementType": "geometry",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "tertiaryway",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "tertiaryway",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "highwaysign",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "highwaysign",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "nationalwaysign",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "nationalwaysign",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "provincialwaysign",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "provincialwaysign",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "subwaylabel",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "subwaylabel",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "tertiarywaysign",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "tertiarywaysign",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "subway",
"elementType": "geometry",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "subway",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "subway",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "railway",
"elementType": "geometry",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "vacationway",
"elementType": "geometry",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "scenicspotsway",
"elementType": "geometry",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "local",
"elementType": "geometry",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "local",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "roadarrow",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "footbridge",
"elementType": "geometry",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "crosswalk",
"elementType": "geometry",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "underpass",
"elementType": "geometry",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "parkingspace",
"elementType": "geometry",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "laneline",
"elementType": "geometry",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "financelabel",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "financelabel",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "transportationlabel",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "transportationlabel",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "carservicelabel",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "carservicelabel",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "lifeservicelabel",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "lifeservicelabel",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "shoppinglabel",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "shoppinglabel",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "hotellabel",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "hotellabel",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "restaurantlabel",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "restaurantlabel",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "governmentlabel",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "governmentlabel",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "companylabel",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "companylabel",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "businesstowerlabel",
"elementType": "labels",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "businesstowerlabel",
"elementType": "labels.icon",
"stylers": {
"visibility": "off"
}
},
{
"featureType": "district",
"elementType": "labels",
"stylers": {
"visibility": "on"
}
}
]
准备
项目的创建,以及
Echarts5.x
的安装,这里都不用说了,如何使用百度地图:
在
public/index.html
的body
结束标签引入一下代码:百度地图的 个性地图 支持用户使用
JavaScript API
设置地图底图的样式风格以及控制组成地图底图的元素类的显示和隐藏。可以在个性化编辑平台定制适合自己项目的地图。编辑生成的
JSON
就是bmap.mapStyle.styleJson
的值。绘制地图