Giter Club home page Giter Club logo

Comments (17)

AxeMea avatar AxeMea commented on August 22, 2024
AMap.initAMapApiLoader({
  // 高德的key
  key: 'YOUR_KEY',
  // 插件集合
  plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor']
});

初始化的时候,插件加了吗?

from vue-amap.

MertensMing avatar MertensMing commented on August 22, 2024

噢,发现是版本太低了,升级到最新的 0.1.2 editable 属性生效了,但是 zoom 属性又不生效了

from vue-amap.

AxeMea avatar AxeMea commented on August 22, 2024

不是版本太低,是新版本,把editor的插件默认加载了。你之前没有生效应该就是因为,没有initAMapApiLoader 中加载插件。

from vue-amap.

MertensMing avatar MertensMing commented on August 22, 2024

有的,我是直接 copy 整个
image
的内容来创建的项目,有调用 AMap.initAMapApiLoade 这个方法

from vue-amap.

AxeMea avatar AxeMea commented on August 22, 2024

抱歉由于新版本更新的问题给你带来的不便。请更新到最新的0.1.3初始化参数的问题解决了,比如你所说的zoom的问题。

from vue-amap.

MertensMing avatar MertensMing commented on August 22, 2024

image

from vue-amap.

AxeMea avatar AxeMea commented on August 22, 2024

恩,知道问题了,你更新下版本到0.1.3就ok了。

from vue-amap.

MertensMing avatar MertensMing commented on August 22, 2024

噢,好的,我更新一下

from vue-amap.

AxeMea avatar AxeMea commented on August 22, 2024

问题如果解决了,麻烦close issue,谢谢。

from vue-amap.

MertensMing avatar MertensMing commented on August 22, 2024

已经升级到 0.1.3 ,问题还是没解决,是不是我的用法有问题

<template>
  <div id="app">
    <div class="amap-wrapper">
      <el-amap vid="amap" :zoom="zoom" :center="center">
        <el-amap-polygon 
          v-for="polygon in polygons" 
          :path="polygon.path"
          :events="polygon.events"
          :visible="polygon.visible"
          :editable="polygon.editable"
          :strokeColor="polygon.strokeColor"
          :strokeOpacity="polygon.strokeOpacity"
          :strokeWeight="polygon.strokeWeight"
          :fillColor="polygon.fillColor"
          :fillOpacity="polygon.fillOpacity"
        ></el-amap-polygon>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      zoom: 19,
      polygons: [
        {
          path: [
            [121.5273285, 31.21515044],
            [121.5293285, 31.21515044],
            [121.5293285, 31.21915044],
            [121.5273285, 31.21515044]
          ],
          events: {},
          visible: true,
          editable: true,
          strokeColor: '#38f',
          strokeOpacity: 1,
          strokeWeight: 3,
          fillColor: '#38f',
          fillOpacity: 0.2
        }
      ],
      circles: [
        {
          center: [121.5273285, 31.21515044],
          radius: 200,
          fillOpacity: 0.5,
          visible: false,
          editable: true
        }
      ]
    }
  }
}
</script>

<style>
html,
body,
#app,
.amap-wrapper {
  height: 100%;
}
</style>

from vue-amap.

MertensMing avatar MertensMing commented on August 22, 2024

image

from vue-amap.

AxeMea avatar AxeMea commented on August 22, 2024

你的el-amap标签是不是没闭合

from vue-amap.

MertensMing avatar MertensMing commented on August 22, 2024

额,是忘了闭合,不过好像是没影响的,我加上了还是一样

from vue-amap.

AxeMea avatar AxeMea commented on August 22, 2024

= =

image

看看是不是,你这个center,没定义造成的。看下控制台有没有报错

from vue-amap.

MertensMing avatar MertensMing commented on August 22, 2024

image
center 没定义是 undefined,应该不会报错的,这次我加了 center,刷新之后就是这样的

from vue-amap.

AxeMea avatar AxeMea commented on August 22, 2024

image

具体原因,得细看下。

加下这个vue-amap的客服群吧。如何?

from vue-amap.

MertensMing avatar MertensMing commented on August 22, 2024

好的,感谢

from vue-amap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.