Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zoom to extent #14

Closed
bonnojold opened this issue Oct 7, 2014 · 3 comments
Closed

Zoom to extent #14

bonnojold opened this issue Oct 7, 2014 · 3 comments

Comments

@bonnojold
Copy link

I'm stuck in a project where I need to zoom to a specific extent. I have a boundingbox but it seems that I'm only allowed to zoom to a specific center/resolution, the extent/viewport seem to be access only. How can I implement zooming to a specific bounding box?

@pauldendulk
Copy link
Member

What platforms are you using? SL, WPF, Android, iOS?

@pauldendulk
Copy link
Member

You could use this helper to calculate the center and resolution:
public static void ZoomToBoudingbox(double xMin, double yMin, double xMax, double yMax, double screenWidth, out double x, out double y, out double resolution)
https://github.com/pauldendulk/Mapsui/blob/master/Mapsui/Utilities/ZoomHelper.cs

@bonnojold
Copy link
Author

Just noticed I answered a bit too quick, calculation the x, y and resolution work perfectly! Thanks for the quick help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants