Skip to content

Commit 4d1b79d

Browse files
yhy0217prushforth
authored andcommitted
update mapmlvectors.options before addZoomLimit is called, ensuring zoom limits set via map-meta can be updated properly
1 parent 1d53250 commit 4d1b79d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/map-feature.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,13 @@ export class MapFeature extends HTMLElement {
229229
// todo: dynamically update layer bounds of vector layer
230230
mapmlvectors.layerBounds = M.getBounds(this._layer._content);
231231
// update map's zoom limit
232-
//this._map._addZoomLimit(mapmlvectors);
232+
// the mapmlvectors.options should be updated with the new zoomBounds,
233+
// to ensure the _addZoomLimit function call can read updated zoom info
234+
// and update map zoom limit properly
235+
L.extend(mapmlvectors.options, mapmlvectors.zoomBounds);
236+
this._map._addZoomLimit(mapmlvectors);
233237
// TODO: can be set as a handler of featureLayer
234238
mapmlvectors._resetFeatures();
235-
L.extend(mapmlvectors.options, mapmlvectors.zoomBounds);
236239
}
237240
}
238241

0 commit comments

Comments
 (0)