yangyanggu / vue-amap Goto Github PK
View Code? Open in Web Editor NEW高德地图封装 for vue2 vue3.0
Home Page: https://vue-amap.guyixi.cn/
License: MIT License
高德地图封装 for vue2 vue3.0
Home Page: https://vue-amap.guyixi.cn/
License: MIT License
✅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引用数据没有问题.
代码如下:
之前这个数据源更新依靠的是setInterval()定时更新,那时就出现了上述问题,为了定位问题的具体原因,我使用了不同方式(控制变量法(doge)),比较明显的一种方式就是,我将数据源更新由定时改为了手动(通过一个按钮),在不点击按钮时,内存是稳定的,当点击之后,内存开始增加,增加后不会不下降。
暂时未找到具体的解决方案,只是将响应式数据改为了静态数据。
请填写使用版本:@2.0.5
如何只显示一个省
请填写使用版本:
如题。
请填写使用版本:
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"")
Vue: 2.6.12
vue-amap: 0.1.7
使用el-amap-search-box,搜索框可以显示出来,但是输入搜索关键词,会发送搜索请求,但是suggesiton list不显示,dom里面也没有。
@vuemap/vue-amap: "^1.0.3", nodejs 14.17.3 本地运行正常 ,自动化环境与本地一致, 打包后控制台报 TypeError: Cannot read properties of undefined (reading 'setZooms') 的错误 全局也没找到这个函数
@amap,@types/three,three与官方版本不同,导致与安装官方的插件冲突,无法同时使用,希望能同步新版本
<el-amap-polyline />
时,按照文档示例输入属性,类型报错不能将类型“{ 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)
使用配置项配置插件总是报上面错
最新版本
海量标记AMap.LabelMarker的extData绑定不上?
在点击事件回调中 data.data.exData 为 {}
vue-amap: “2.0.3 ”
vite: “4.1.0”
vue" "3.2.45"
vue3.0 使用vue-amap挂载到APP上会导致vite热更新失效
使用版本: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.
Vue3的1.x.x版本进入维护状态,只做BUG修复,不再增加组件和新的特性
❌破坏性变更
initAMapApiLoader
默认参数里不再加载loca,只加载JSAPI@vuemap/vue-amap
、@vuemap/vue-amap-loca
、@vuemap/vue-amap-extra
,主包只提供JSAPI相关的组件,loca组件一刀loca库,extra提供threejs等相关扩展的组件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"
Rt
第一第一;留个名;
请填写使用版本:
"@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",
...
}
使用时 编辑和移动无法共存
使用 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>
Loca.PolygonLayer被区划聚合图层遮挡导致点击事件不响应,而且Loca.PolygonLayer的label点击事件不响应(版本都是最新的)
怎么把echarts地图放到amap地图上
最近项目在集成高德地图,用到了作者的框架,请问el-amap-search-box可以增加placeholder吗?
1.地图怎么只展示某个城市,屏蔽掉其他城市?
2.城市里的区县怎么分别用不同的颜色?
el-amap-mouse-tool关闭清除不掉鼠标样式
"@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
drawOptions已经设置 先设置drawOptions后设置的type
🔲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";
Loca.PolygonLayer点击事件不响应
现在标记点的事件对页面数据进行了修改(非标记点相关数据),也会导致标记点的重新渲染
请填写使用版本:v2.0.3
遇到一个问题,我想编辑矢量图形,但是不知道改如何动态的添加
AMap.LabelMarker是否有缓存? 更新数据后 有时候原来的数据还存在地图上?(偶发性) (computed)
地图缩放之后,一部分的标记就自动隐藏了,放大后才会显示。
怎么让这些标记一直展示
mapMarkers循环的时候,数据从2个更新到1个,但是渲染的时候依然是两个坐标
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.