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(){