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

Set Viewfinder zoom height based on latitude and longitude decimal precision #2267

Open
robyngit opened this issue Feb 13, 2024 · 0 comments
Labels
cesium enhancement pdg Permafrost Discovery Gateway

Comments

@robyngit
Copy link
Member

The soon-to-be released Viewfinder will allow users to zoom to any location on the map by entering lat, long pairs. For the first release, the view zooms to the coordinates at a hard-coded camera height, see

this.model.zoomTo({ ...coords, height: 10000 /* meters */ });

As @iannesbitt suggested:

One possibility would be to zoom tighter based on the number of decimals supplied by the user, so for example entering 42,-71 might give you a zoom level that includes most of the state of Massachusetts, whereas 42.7, -73.1 might zoom to the town of North Adams. A calculation that makes this possible in a 2-D map wouldn't be too hard I don't think—we could just zoom to a bounding box that includes ± the last decimal values in the query to get rough extents to zoom to. This might be somewhat harder in an application like Cesium, however, and may need its own feature request depending on whether others think this is a good idea.

To summarize: zoom level should be much lower at least, and at most may be able to be calculated based on the decimal precision.

@robyngit robyngit added enhancement pdg Permafrost Discovery Gateway cesium labels Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cesium enhancement pdg Permafrost Discovery Gateway
Projects
None yet
Development

No branches or pull requests

1 participant