解决地图鼠标吸附问题

This commit is contained in:
wangzijun 2022-08-03 08:38:12 +08:00
parent b54020cdb8
commit 417dc199ed
1 changed files with 14 additions and 2 deletions

View File

@ -83,8 +83,6 @@ export default {
this.initGraph(); this.initGraph();
this.initStencil() this.initStencil()
this.initGaodeMap() this.initGaodeMap()
}, },
methods:{ methods:{
onRender() { onRender() {
@ -224,6 +222,8 @@ export default {
center:[105.602725,37.076636],// center:[105.602725,37.076636],//
}) })
//var x6Dom = document.createElement('container'); //var x6Dom = document.createElement('container');
var x6Dom = this.$refs.container var x6Dom = this.$refs.container
var x6 = document.getElementsByClassName("x6-graph-svg")[1]; var x6 = document.getElementsByClassName("x6-graph-svg")[1];
@ -247,6 +247,8 @@ export default {
initGraph(){ initGraph(){
console.log("x6图层",this.$refs.container) console.log("x6图层",this.$refs.container)
let mapZoom = this.zoom let mapZoom = this.zoom
let mapp = this.map
console.log("地图地图",this.map)
this.graph = new Graph({ this.graph = new Graph({
container: this.$refs.container, container: this.$refs.container,
background: {// background: {//
@ -433,6 +435,16 @@ export default {
// //console.log("ty",ty) // //console.log("ty",ty)
// this.mapScrollBy(tx,ty) // this.mapScrollBy(tx,ty)
// }) // })
this.graph.on('blank:mousedown',(e)=>{
this.changeMapDrag(true)
})
//
this.graph.on('blank:mouseup',(e)=>{
this.changeMapDrag(false)
})
}, },
//Stencil //Stencil
initStencil(){ initStencil(){