OpenLayers地图中心点修改无效,可能的原因及解决方案?-灵析社区

001

OpenLayers 地图设置中心点不生效 ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20240917/f5b53b88a301c3af108f665ed063985c.png)初始化是设置了一个默认点 ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20240917/273dd78459bbcea2091421c0e1a62c35.png)在后面定义了一个方法去修改他的中心点位置及缩放程度 ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20240917/05ee19d25bf5a8e0133bde9ad64de27e.png)在其他页面使用时 无论怎么修改都不生效 我不用这个方法使用默认点依旧没有生效 求求各位大佬看看,小弟没有搞过这个 但是我看了他的文档好像确实这么写的

阅读量:177

点赞量:0

问AI
577739990
如果代码从官方复制的,试试这个 mounted(){ this.$nextTick(() => { this.initMap('vmap') // this.blackTianDiTuLayerAdd() this.gaoDeAdd()this.setcenterAndzoom([117.36150707678796,38.95435533678361],10.5) this.initLayer() this.addoverlayer() }) }