From 417dc199edaafdb57d15236c6a290edfcda82480 Mon Sep 17 00:00:00 2001 From: wangzijun Date: Wed, 3 Aug 2022 08:38:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=9C=B0=E5=9B=BE=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E5=90=B8=E9=99=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/demo/index-gaode.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/demo/index-gaode.vue b/src/demo/index-gaode.vue index 037d4e1..fe9b927 100644 --- a/src/demo/index-gaode.vue +++ b/src/demo/index-gaode.vue @@ -83,8 +83,6 @@ export default { this.initGraph(); this.initStencil() this.initGaodeMap() - - }, methods:{ onRender() { @@ -224,6 +222,8 @@ export default { center:[105.602725,37.076636],//初始化地图中心位置 }) + + //var x6Dom = document.createElement('container'); var x6Dom = this.$refs.container var x6 = document.getElementsByClassName("x6-graph-svg")[1]; @@ -247,6 +247,8 @@ export default { initGraph(){ console.log("x6图层",this.$refs.container) let mapZoom = this.zoom + let mapp = this.map + console.log("地图地图",this.map) this.graph = new Graph({ container: this.$refs.container, background: {//背景 @@ -433,6 +435,16 @@ export default { // //console.log("平移ty",ty) // this.mapScrollBy(tx,ty) // }) + + this.graph.on('blank:mousedown',(e)=>{ + this.changeMapDrag(true) + }) + + //鼠标在空白画布上抬起 + this.graph.on('blank:mouseup',(e)=>{ + this.changeMapDrag(false) + }) + }, //初始化拖拽Stencil initStencil(){