Jim Liu's Blog
liuji-jim / amap-vue Goto Github PK
View Code? Open in Web Editor NEWUsing AMap with Vue in an easy way.
Home Page: https://liuji-jim.github.io/amap-vue/
Using AMap with Vue in an easy way.
Home Page: https://liuji-jim.github.io/amap-vue/
使用文档方法按需引入,在组件中
import Amap from '@amap/amap-vue/lib/Amap';
import AmapMarker from '@amap/amap-vue/lib/Marker';
出现以下报错,翻看安装的依赖文件夹中并未找到对应文件
These dependencies were not found:
To install them, you can run: npm install --save @amap/amap-vue/lib/Amap @amap/amap-vue/lib/Marker
polyline开启编辑属性(editable),进行节点移除操作时,节点可以被完全移除,也就是说polyline通过这种方式被移除了。此外,在移除最后两个节点时,控制台报错:“poly.js:1 Uncaught TypeError: Cannot read property 'getPath' of undefined“。
试了一下高德原生的PolyEditor,在节点只剩两个时,就不允许进行节点移除了。
使用 amap-labels-layer 和 amap-label-marker 进行标注时性能低下,data 数据小于100 时还比较流畅,但如果标注点达到 500 个左右就开始卡顿,2000 个页面无响应。
但官方文档渲染 30000 点都没有明显卡顿:https://lbs.amap.com/api/jsapi-v2/example/mass-markers/labelmarker-mass
<template lang="pug">
v-container.fill-height
amap(key="key" map-style="amap://styles/whitesmoke" :center="data[0]")
amap-labels-layer(:zooms="[3, 20]")
amap-label-marker(v-for="(pos, i) in data.slice(0, 100)" :key="i" :position="pos" :icon="icon")
</template>
大佬, 参考示例里面的 <demo-view hide-control @map-complete="ready = true"> 这个 demo-view 组件在哪里啊?
大佬您好 您写的插件确实非常棒列如
https://jimnox.gitee.io/amap-vue/examples/coord-picker.html
但是很遗憾 我没法引入项目里面
https://gitee.com/y_project/RuoYi-Vue/tree/master/ruoyi-ui
您项目依赖js库太多 导致用这个项目想引入您的插件失败
建议
希望能引入很少的类库
类似高德地图 一个js 就可以
用文档上所说的this.$refs.xxx.$map(xxx为自定义的ref id),打印结果为null。
mixins.js:1 Uncaught (in promise) TypeError: n.default.mixin is not a function
at node_modules/@amap/amap-vue/lib/mixins/mixins.js (mixins.js:1)
at __require2 (chunk-YOHASWQG.js?v=419e2a24:15)
at node_modules/@amap/amap-vue/lib/amap.js (amap.js:formatted:311)
at __require2 (chunk-YOHASWQG.js?v=419e2a24:15)
at amap.js:formatted:311
在windows下 map-style失效
mac下面没问题
Uncaught Error: Invalid Object: LngLat(NaN, 89.99991016847159)
https://webapi.amap.com/
之前配置一切正常,能移动
非常紧急的问题,希望得到帮助!
如题,如果有计划的话,发布的时间点大概是什么时候?
可以画圆,画矩形报错
TypeError: Cannot read properties of null (reading '0')
at VueComponent.y (amap-helpers.js:1:1591)
at c (amap-helpers.js:1:1018)
at VueComponent. (base.js:1:1102)
at _tslib.js:15:1419
at Object.next (_tslib.js:15:1528)
at l (_tslib.js:15:292)
@LiuJi-Jim 现在用的是2.0.9版本,关于事件的用法,没有一个完整的例子,做复杂的处理时不知道怎么用
关于polyline动态加载path画线不显示
复现步骤:
1.页面A、页面B都包含地图
2.页面A发生滚动后,跳转至页面B
3.从页面B返回至页面A,页面A的地图显示
注:页面A不滚动直接跳转页面B,返回后页面A地图显示正常,这时页面再滚动后跳转至页面B后返回显示还是正常
文档中的页面也是可以复现这个bug的,例如,地图与Marker两个文档例子之间的跳转
@LiuJi-Jim 我用的是1.4.1的amap-vue包,在编译的时候提示Cannot find type definition file for 'amap-js-api'.
相关报错代码如上
这种情况该如何解决
请问作者啥时候支持vue3.0啊
当绘制完成时会自动切换回none
怎么设置他不自动切换none
await loadPlugins(['AMap.DistrictSearch'])
const opts = {
subdistrict: 0,
extensions: 'all',
level: 'city',
}
const district = new AMap.DistrictSearch(opts)
console.log(district)
district.search('北京市', (status, result) => {
if (result.info === 'OK') {
const bounds = result.districtList[0].boundaries
// let mask = bounds.map(v => [v])
this.amap.mask = bounds.map(v => [v])
// new Map('container', {
// mask: mask,
// center: [116.472804, 39.995725],
// viewMode: '3D',
// showLabel: false,
// labelzIndex: 130,
// pitch: 40,
// zoom: 9,
// layers: [
// new AMap.TileLayer.RoadNet({
// // rejectMapMask:true
// }),
// new AMap.TileLayer.Satellite(),
// ],
// })
// let maskerIn = new AMap.Marker({
// position: [116.501415, 39.926055],
// map: map,
// })
// let maskerOut = new AMap.Marker({// 区域外的不会显示
// position: [117.001415, 39.926055],
// map: map,
// })
// // 添加描边
// for (var i = 0; i < bounds.length; i += 1) {
// new AMap.Polyline({
// path: bounds[i],
// strokeColor: '#99ffff',
// strokeWeight: 4,
// map: map,
// })
// }
// for(var i = 0; i < bounds.length; i+=1){
// mask.push([bounds[i]])
// }
} else {
console.warn('AMap.DistrictSearch 查询错误!')
}
})
当获取驾驶路线和地图画线时会造成页面卡屏。 等待页面完成时才能够其他操作
Does not work in the IE11 browser
需要用到new Amap.ContextMenu()等其他东西时,会报错 AMap is not defined
新申请的key,必须配合安全密钥使用。希望做一下升级。PlaceSearch等插件会报错。
怎么使用官方 SDK 方法,点击按钮定位?
有示例吗,作者大大
请问怎么只更新一个对象如果地图上已经有100个对象的情况下。
请问有没有方法,只 更新地图上的某个对象。而不用把其它的对象都重新画一遍。
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.