百度地图如何去除路网图,建筑物,建筑物名称

关键代码如下:

   var bm = new BMap.Map("container");
            bm.centerAndZoom(ggPoint, 15);
            bm.addControl(new BMap.NavigationControl());


            //去除路网
            bm.setMapStyle({
                    styleJson:[
                      {
                                "featureType": "road",
                                "elementType": "all",
                                "stylers": {
                                          "color": "#ffffff",
                                          "visibility": "off"
                                }
                      },
                      {
                              "featureType": "building",
                              "elementType": "all",
                              "stylers": {
                                        "visibility": "off"
                              }
                      },
                      {
                              "featureType": "poilabel",
                              "elementType": "all",
                              "stylers": {
                                        "visibility": "off"
                              }
                      },
                      {
                              "featureType": "manmade",
                              "elementType": "all",
                              "stylers": {
                                        "visibility": "off"
                              }
                      },
                ]
            });

没去掉路网的效果图:

去掉之后效果:

再加上去掉建筑物建筑物名字的图层

 

猜你喜欢

转载自blog.csdn.net/u013455430/article/details/80528931