vue-baidu-map设置百度地图类型 普通地图 混合地图 卫星地图

vue yekong 3371℃
<baidu-map
      class="map"
      :scroll-wheel-zoom="true"
      :center="center"
      v-if="show"
      :zoom="zoom"
      @ready="handler"
      @moving="syncCenterAndZoom"
      @moveend="syncCenterAndZoom"
      @zoomend="syncCenterAndZoom">
    </baidu-map>
    
methods: {
    syncCenterAndZoom(e) {
      const {lng, lat} = e.target.getCenter()
      this.center.lng = lng
      this.center.lat = lat
      this.zoom = e.target.getZoom()
    },
    handler({
              BMap,
              map
            }) {
      let mapStyle = {style: 'midnight'}
      map.setMapStyle(mapStyle)
      map.setMapType(BMAP_SATELLITE_MAP);
    },
  }
 map.setMapType(BMAP_PERSPECTIVE_MAP);     //修改地图类型为3D地图
    //map.setMapType(BMAP_NORMAL_MAP); //普通地图
    //map.setMapType(BMAP_HYBRID_MAP); //混合地图
    //map.setMapType(BMAP_SATELLITE_MAP); //卫星地图
喜欢 (0)