Giter Site home page Giter Site logo

yangyanggu / vue-amap Goto Github PK

View Code? Open in Web Editor NEW
233.0 1.0 12.0 15.75 MB

高德地图封装 for vue2 vue3.0

Home Page: https://vue-amap.guyixi.cn/

License: MIT License

JavaScript 1.97% TypeScript 35.97% Shell 0.19% Vue 61.77% HTML 0.10%
vue map amap vue3 vue2 vue-amap

vue-amap's People

Contributors

cherry-ran avatar megasu avatar yangyanggu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vue-amap's Issues

1.1.8新功能列表

✅1. GLTF图层位置移动的位置插帧计算
✅2. videolayer图层
✅3. Three基础图层能力扩展,提供后续自定义扩展能力
✅4. Loca新图层接入

地图上绘制贴地点时内存泄漏问题

使用版本

"@vuemap/vue-amap": "^2.0.5",
"@vuemap/vue-amap-extra": "^2.0.1",
"@vuemap/vue-amap-loca": "^2.0.3",
"vue": "^3.2.37"

问题描述

当使用使用vue3的ref引用数据源对象时,更新此对象会导致内存占用一直增加,无法释放,使用正常的非ref引用数据没有问题.
代码如下:

image

image

之前这个数据源更新依靠的是setInterval()定时更新,那时就出现了上述问题,为了定位问题的具体原因,我使用了不同方式(控制变量法(doge)),比较明显的一种方式就是,我将数据源更新由定时改为了手动(通过一个按钮),在不点击按钮时,内存是稳定的,当点击之后,内存开始增加,增加后不会不下降。

解决方案

暂时未找到具体的解决方案,只是将响应式数据改为了静态数据。

WMTS bug

使用版本

请填写使用版本:
dev

问题描述

WMTS组件实际调用的 AMap.TileLayer.WMS

###解决方案
src/vue-amap/packages/layer/standard/WMTS/WMTS.vue line32:

replace("this.$amapComponent = new AMap.TileLayer.WMS(options)", "this.$amapComponent = new AMap.TileLayer.WMTS(options)")

test/views/layer/Standard.vue line22:

replace(":param="params"", ":params="params"")

el-amap-search-box无法正常使用

Vue: 2.6.12
vue-amap: 0.1.7

使用el-amap-search-box,搜索框可以显示出来,但是输入搜索关键词,会发送搜索请求,但是suggesiton list不显示,dom里面也没有。

自动化部署el-amap-marker 位置错误

@vuemap/vue-amap: "^1.0.3", nodejs 14.17.3 本地运行正常 ,自动化环境与本地一致, 打包后控制台报 TypeError: Cannot read properties of undefined (reading 'setZooms') 的错误 全局也没找到这个函数

折线组件<el-amap-polyline /> 属性类型报错

描述: 使用折线组件<el-amap-polyline />时,按照文档示例输入属性,类型报错

code

报错内容:

不能将类型“{ editable: true; visible: boolean; draggable: boolean; path: number[][]; }”分配给类型“ComponentProps<SFCWithInstall<DefineComponent<Readonly<ComponentPropsOptions<{ [x: string]: unknown; }>>, unknown, { converters: {}; }, {}, { __initComponent(options: any): void; bindModelEvents(): void; ... 17 more ...; __editable(flag: any): void; }, ... 6 more ..., {} | { ...; }>> & Record<...>>”。

不能将类型“{ editable: true; visible: boolean; draggable: boolean; path: number[][]; }”分配给类型“Record<string, unknown> & Partial<{ visible: boolean; reEventWhenUpdate: boolean; } & { editable: boolean; } & { [x: number]: string; }> & Omit<(Readonly<ExtractPropTypes<{ visible: { type: BooleanConstructor; default: boolean; }; zIndex: { ...; }; reEventWhenUpdate: { ...; }; extraOptions: { ...; }; }>> & { ...; } ...”。ts(2322)

怎么修改zoom缩放

使用版本

请填写使用版本:vue3版本

问题描述

怎么设置zoom缩放呀,想点击过后恢复到最初的缩放等级,改变没效果

image
image
试了两种方式都不行

覆盖物绑定响应式数据,造成内存泄漏。

使用版本

使用版本:2.0.4

涉及组件

ElAmap, ElAmapControlScale, ElAmapPolyline, ElAmapMarkerCluster, ElAmapInfoWindow,

问题描述

覆盖物绑定响应式数据,递归超过vue3的最大限制,造成内存泄漏,页面白屏卡死。

报错信息

[Vue warn]: Maximum recursive updates exceeded. 
This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. 
Possible sources include component template, render function, updated hook or watcher source function.

尝试解决

  • 使用computed —— 无果,效果一致
  • 使用字面量 —— 不卡死,但失去响应式

polygon点拖拽后path数据没有更新

使用版本

请填写使用版本:2.0.3

问题描述

目前我通过v-for实现动态添加el-amap-polygon,但是遇到一个新问题,在地图中编辑了之后,data里的path并没有更新
image
image
如图,经过拖拽,地图中有5个点,但是polygon中path只有四个点(还是初始值),并没有更新,
ps:想通过getPath手动修改path值,之前我用原生高德地图的时候有个方法getPath,但是在这个组件库封装了之后不知道在哪里使用getPath

1.x.x版本进入维护

Vue3的1.x.x版本进入维护状态,只做BUG修复,不再增加组件和新的特性

组件库2.0版本计划

❌破坏性变更

  • 2.0版本不再使用next标签,直接使用last标签,也就是说从2.0开始直接安装@vuemap/vue-amap时将会直接安装为Vue3版本
  • initAMapApiLoader默认参数里不再加载loca,只加载JSAPI
  • 整个组件库将进行拆包,拆分为@vuemap/vue-amap@vuemap/vue-amap-loca@vuemap/vue-amap-extra,主包只提供JSAPI相关的组件,loca组件一刀loca库,extra提供threejs等相关扩展的组件

VueAMap.initAMapApiLoader AMap.Geocoder is not work

import VueAMap from '@vuemap/vue-amap';
VueAMap.initAMapApiLoader({
key: 'myKey',
plugin: [
'AMap.Geocoder',
'AMap.Autocomplete',
'AMap.PlaceSearch',
'AMap.Scale',
'AMap.OverView',
'AMap.ToolBar',
'AMap.MapType',
'AMap.PolyEditor',
'AMap.CircleEditor',
'AMap.Geolocation'
],
v: '2.0',
uiVersion: '1.1'
})

use on map @click="test"

test: () => {
new AMap.Geocoder({
radius: 1000,
extensions: 'all'
});
}

[Vue warn]: Error in v-on handler: "TypeError: AMap.Geocoder is not a constructor"

VueCli项目下载@vuemap/vue-amap后,找不到 @vuemap/vue-amap-util 包。

使用版本

请填写使用版本:
"@vuemap/vue-amap": "^2.0.3",

问题描述

@vuemap/vue-amap-util 包存在,但是webpack没有识别到。

问题原因:

@vuemap/vue-amap-util包的package.json 文件中没有指定main属性。

解决办法:

@vuemap/vue-amap-util包的package.json 中添加 "main": "dist/index-cjs.js",

{
  "name": "@vuemap/vue-amap-util",
   ...
   
  "main": "dist/index-cjs.js",
  
  ...
}

自定义图层使用 url 连接,会自动将 http 协议转换成 https 协议

使用 vue3 + ts

期望结果:使用 http 协议不进行协议装换;

代码:

<el-amap
      vid={"amap-vue"}
      onInit={(m: any) => this.init(m)}
      onClick={(m: any) => this.mapAddMark(m)}
      center={this.center}
 >
      <el-amap-layer-tile
          tile-url={
            "http://192.168.62.6:29980/tSlice?x=[x]&y=[y]&z=[z].png"
          }
          visible
          tileSize={256}
          zIndex={1}
          zooms={[11, 16]}
        ></el-amap-layer-tile>
</el-amap>

实际效果:
image

ThreeJS 无法使用 Failed to resolve component: el-amap-layer-three

使用版本

"@vuemap/vue-amap": "^2.0.4",
"@vuemap/vue-amap-extra": "^2.0.1",
"@vuemap/vue-amap-loca": "^2.0.2",

问题描述

参考ThreeJS的图层示例
el-amap-layer-three
el-amap-three-light-ambient
el-amap-three-light-directional
el-amap-three-light-hemisphere
el-amap-three-gltf
都出现错误
[Vue warn]: Failed to resolve component: el-amap-three-gltf
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
at <Model onVnodeUnmounted=fn ref=Ref< undefined > >
at
at
at
at
at <Home onVnodeUnmounted=fn ref=Ref< undefined > >
at
at
[Vue warn]: Failed to resolve component: el-amap-layer-three
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
at <Model onVnodeUnmounted=fn ref=Ref< undefined > >
at
at
at
at
at <Home onVnodeUnmounted=fn ref=Ref< undefined > >
at
at

1.1.9功能

🔲1. threejs立体墙效果(暂不开发)
✅2. threejs立体视频
✅3. threejs建筑图层
🔲4. threejs光波扫描效果(暂时放弃)
✅5. threejs灯光组件

自动导入出现问题

Failed to resolve import "element-plus/es/components/amap/style/css" from "src\components\global-map\index.vue". Does the file exist?

1 | /* unplugin-vue-components disabled */import { ElAmap as __unplugin_components_0 } from 'element-plus/es';import 'element-plus/es/components/amap/style/css'; ^
2 | import { ref } from 'vue';
3 | import { defineComponent as _defineComponent } from "vue";

如何动态添加编辑矢量图形

使用版本

请填写使用版本:v2.0.3

问题描述

遇到一个问题,我想编辑矢量图形,但是不知道改如何动态的添加

怎么让标记一直展示

地图缩放之后,一部分的标记就自动隐藏了,放大后才会显示。
怎么让这些标记一直展示

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.