You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to zoom the map with existing markers (minLat, minLng, maxLat, maxLng). Is there any way to initialize MapViewPosition with bounding paramaters.
The text was updated successfully, but these errors were encountered:
Interesting problem. The position is easy. It is the center of the bounding box.
With the help of PixelProjection.latLonToPixel() you could calculate the absolute pixels for the left-upper and right-bottom bounding box. So you know how many pixels must be visible in the view.
ViewModel.mapDimension gives you the current width/height of the view or determine it by yourself e.g. with LayoutBuilder.
scaleFactor can be calculated then by dividing the necessary mappixels by the available screenpixels.
Since the scaleFactor is a function of 2^zoomLevel (see ScaleFactor.dart) with a little play-around you should be able to calculate the correct zoomLevel.
I would be happy if you create a PullRequest with this new feature so that it is availabe to others too.
PixelProjection constructor needs PixelProjection(int zoomLevel, this.tileSize) what's the correct init values. BTW, I found left-upper and right bottom coordinates but couldn't calculate the mappixels with Mappoint values.
I want to zoom the map with existing markers (minLat, minLng, maxLat, maxLng). Is there any way to initialize MapViewPosition with bounding paramaters.
The text was updated successfully, but these errors were encountered: