解决地图鼠标吸附问题
This commit is contained in:
parent
b54020cdb8
commit
417dc199ed
|
@ -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(){
|
||||||
|
|
Loading…
Reference in New Issue