Skip to content

Commit

Permalink
- Use SetView on refreshZoom to guaratee the center is the lastest; (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoFerreira-FrontEnd authored Jun 21, 2024
1 parent 4fe46c0 commit cf4e934
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Providers/Maps/Leaflet/Features/Zoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Provider.Maps.Leaflet.Feature {
}
this._map.provider.fitBounds(bounds);
this._map.provider.panInsideBounds(bounds);
this._map.features.center.setCurrentCenter(this._map.provider.getCenter());
this._map.features.center.setCurrentCenter(bounds.getCenter());
}

public build(): void {
Expand All @@ -56,7 +56,10 @@ namespace Provider.Maps.Leaflet.Feature {
) {
this._setBounds(this._map.config.autoZoomOnShapes);
} else {
this._map.provider.setZoom(OSFramework.Maps.Helper.Constants.zoomAutofit);
this._map.provider.setView(
this._map.features.center.getCurrentCenter() as L.LatLngExpression,
OSFramework.Maps.Helper.Constants.zoomAutofit
);
}
} else {
this._map.provider.setZoom(this._map.features.zoom.level);
Expand Down

0 comments on commit cf4e934

Please sign in to comment.