Skip to content

Commit

Permalink
Fix zoom-to-point in OsmMapFragment (setZoom() does not preserve setC…
Browse files Browse the repository at this point in the history
…enter()).
  • Loading branch information
zestyping committed Oct 2, 2018
1 parent 51931fc commit cb47762
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ public MapView getMapView() {

@Override public void zoomToPoint(@Nullable MapPoint center, double zoom) {
if (center != null) {
map.getController().setCenter(toGeoPoint(center));
// setCenter() must be done last; setZoom() does not preserve the center.
map.getController().setZoom((int) Math.round(zoom));
map.getController().setCenter(toGeoPoint(center));
}
}

Expand Down

0 comments on commit cb47762

Please sign in to comment.