Verified Commit 0a5c524a authored by jxtxzzw's avatar jxtxzzw

修复:只能从菜单跳转而不能整个刷新的问题(nuxt 下只能通过 plugin 的方式引入 l7)

Signed-off-by: jxtxzzw's avatarjxtxzzw <jxtxzzw@126.com>
parent 4218edd6
Pipeline #161 passed with stages
in 7 minutes and 58 seconds
import { PointLayer, Popup, Scene } from '@antv/l7'
import { GaodeMap, Mapbox } from '@antv/l7-maps'
// nuxt 下不能用 import 引入整个依赖,只能用 plugin 的方式引入
function getPointLayer(data, that) {
const { PointLayer } = that.$l7
function getPointLayer(data) {
return new PointLayer({
name: 'layer',
})
......@@ -29,6 +30,9 @@ function getPointLayer(data) {
}
export function constructMapAndScene(map, source, that) {
const { Scene, Popup } = that.$l7
const { GaodeMap, Mapbox } = that.$l7maps
// Step 1: 创建 Scene 对象
const config = {
center: [108.5525, 34.3227], // 大地原点
......@@ -64,7 +68,7 @@ export function constructMapAndScene(map, source, that) {
}
// Step 3:创建图形语法
const pointLayer = getPointLayer(data)
const pointLayer = getPointLayer(data, that)
pointLayer.on('mousemove', (e) => {
let popMessage = '<span>'
if (e.feature.cluster) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment