Fix scheduledZoom/scheduledPan handling on map change
This commit is contained in:
parent
0c1ca36be1
commit
e46a97df15
@ -139,8 +139,14 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
currentMap(newValue, oldValue) {
|
currentMap(newValue, oldValue) {
|
||||||
if(this.leaflet && newValue && oldValue) {
|
if(this.leaflet && newValue) {
|
||||||
const panTarget = this.scheduledPan || oldValue.latLngToLocation(this.leaflet.getCenter(), 64);
|
let panTarget = this.scheduledPan;
|
||||||
|
|
||||||
|
if(!panTarget && oldValue) {
|
||||||
|
panTarget = oldValue.latLngToLocation(this.leaflet.getCenter(), 64);
|
||||||
|
} else if(!panTarget) {
|
||||||
|
panTarget = {x: 0, y: 0, z: 0};
|
||||||
|
}
|
||||||
|
|
||||||
if(this.scheduledZoom) {
|
if(this.scheduledZoom) {
|
||||||
this.leaflet!.setZoom(this.scheduledZoom, {
|
this.leaflet!.setZoom(this.scheduledZoom, {
|
||||||
|
Loading…
Reference in New Issue
Block a user