Zoom to all vector layers when auto-updating the map.

This commit is contained in:
paul121 2020-06-26 11:27:10 -07:00 committed by Michael Stenta
parent 6f231744f1
commit 1bb243b576
1 changed files with 3 additions and 3 deletions

View File

@ -41,7 +41,7 @@
wkt: wkt,
};
this.currentLocationLayer = this.instance.addLayer('wkt', opts);
this.instance.zoomToLayer(this.currentLocationLayer);
this.instance.zoomToVectors();
},
// Recreate the Movement map layer.
@ -66,8 +66,8 @@
// Make the layer editable.
this.instance.addBehavior('edit', { layer: this.movementLayer });
// Zoom to the new layer.
this.instance.zoomToLayer(this.movementLayer);
// Zoom to all vector layers.
this.instance.zoomToVectors();
// Save the map instance ID.
const target = this.instance.target;