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

SetVisibleExtent not working #58

Closed
GuerraAlan opened this issue May 16, 2024 · 3 comments · Fixed by #59
Closed

SetVisibleExtent not working #58

GuerraAlan opened this issue May 16, 2024 · 3 comments · Fixed by #59

Comments

@GuerraAlan
Copy link

I am trying to after doing an address search and adding a couple markers on the map i need to center and zoom the map to show every marker, i tried using a new extent with SetVisibleExtent and changing the current extent, both without success, based on my searches the use of extents to do this has been deprecated by openLayers and the new recomended way of doing it is with a Fit https://stackoverflow.com/questions/23682286/zoomtoextent-openlayers-3
i could not however find a way of doing so using the OpenLayers.Blazor.

@GuerraAlan
Copy link
Author

I am able to change the center easily and also able to change the zoom, but cant calculate the required zoom to show every marker since the map size changes according to the display resolution

@lolochristen
Copy link
Owner

Actually, map.getView().fit() is internally used when calling SetVisibleExtent and SetZoomToExtend. But it didn't take different projections of the view into account. It's fixed with #59.

@GuerraAlan
Copy link
Author

Thank you, the push has received a 403 from the nuget repo, as soon as its updated ill get it, will help a lot.

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

Successfully merging a pull request may close this issue.

2 participants