ElemeFE / vue-amap

🌍 基于 Vue 2.x 和高德地图的地图组件
https://elemefe.github.io/vue-amap/
MIT License
3.34k stars 582 forks source link

无法精确到10-20米 #467

Open shiyafei opened 5 years ago

shiyafei commented 5 years ago

问题

zoom在PC端无法放大到20,精度无法被到20米左右

VueAMap 版本

^0.5.8

Vue 版本

2.5.2

预期

放大到20

shiyafei commented 5 years ago

网址https://elemefe.github.io/vue-amap/#/zh-cn/base/amap下的代码为

<template>
    <div class="amap-page-container">
      <el-amap ref="map" vid="amapDemo" 
          :amap-manager="amapManager" 
          :zoom="17"
          :zooms="[3, 20]"
          :center="center"
          :expandZoomRange="true"
          :plugin="plugin" :events="events" class="amap-demo">
      </el-amap>

      <div class="toolbar">
        <button @click="getMap()">get map</button>
      </div>
    </div>
  </template>

  <style>
    .amap-demo {
      height: 300px;
    }
  </style>

  <script>
    // NPM 方式
    // import { AMapManager } from 'vue-amap';
    // CDN 方式
    let amapManager = new VueAMap.AMapManager();
    module.exports = {
      data: function() {
        return {
          amapManager,
          zoom: 12,
          center: [121.59996, 31.197646],
          events: {
            init: (o) => {
              console.log(o.getCenter())
              console.log(this.$refs.map.$$getInstance())
              o.getCity(result => {
                console.log(result)
              })
            },
            'moveend': () => {
            },
            'zoomchange': () => {
            },
            'click': (e) => {
              alert('map clicked');
            }
          },
          plugin: ['ToolBar', 'Scale', {
            pName: 'MapType',
            defaultType: 0,
            events: {
              init(o) {
                console.log(o);
              }
            }
          }]
        };
      },

      methods: {
        getMap() {
          // amap vue component
          console.log(amapManager._componentMap);
          // gaode map instance
          console.log(amapManager._map);
        }
      }
    };
</script>
TothingWay commented 5 years ago

解决了吗,设置expandZoomRange后还是无效

shiyafei commented 5 years ago

解决了吗,设置expandZoomRange后还是无效

目前看,还没有结局