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

Add zoom to point #614

Merged
merged 6 commits into from
May 18, 2023
Merged

Conversation

dchirst
Copy link
Contributor

@dchirst dchirst commented Mar 21, 2023

What I am changing

  • To be able to zoom to a specific point in the COG and STAC viewers

How I did it

  • I used vanilla JavaScript and HTML to make a form that specifies a latitude and longitude
    • I chose a form because it can set min and max values when you click the submit values for sanity check
  • I used the Mapbox flyTo function to fly to the point in an animated way and added a marker to the specified point.
  • I specified zoom level 10 for the flyTo destination, but am not sure if that's the best idea if the user is already zoomed in further than this
  • I chose not to implement this inside the /map endpoint because it does not currently have a sidebar. However, if you think this would be a useful feature for this endpoint, I can add it there too!

How you can test it

  1. Run the viewer by specifying a COG or STAC
  2. Select a valid latitude and longitude
  3. Click "Zoom to point"

Related Issues

zoom-to-point

@dchirst dchirst marked this pull request as draft March 21, 2023 16:46
@dchirst dchirst marked this pull request as ready for review March 21, 2023 16:49
@vincentsarago
Copy link
Member

@dchirst sorry for taking too long to review this, I'll look at it early next week

@vincentsarago vincentsarago merged commit 90f44e1 into developmentseed:main May 18, 2023
@vincentsarago
Copy link
Member

thanks @dchirst 🙏
sorry it took me so long 😅

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 this pull request may close these issues.

2 participants