nypl-spacetime/surveyor

Feature Request: Add a location search bar

Opened this issue · 6 comments

Each time a new photograph loads, the map zooms out to the default position. Panning and zooming becomes tiring pretty quickly. Adding a geocoding search bar would speed things up if you have an idea of the location.

@emanuelfeld, thanks for your comment! We should indeed add search. And Surveyor included a search bar in its earlier iterations. We've experimented with the Mapbox Geocoding API and Mapzen Search. Both APIs didn't provide very satisfying results: not being able to search for just streets (only with house numbers, try searching "fifth avenue" in Mapbox), searching "broadway" returns Broadway in San Diego, etc. Google's geocoder is much better, however, its policies don't allow for using that API on a different, non-Google, map.

And last but not least, non of these geocoders allow people to search for historical addresses and street names.

But I agree, a search bar which can quickly bring you to a location would be a huge improvement. What should I do?

Options:

  1. Use Mapbox, but sanitize people's input to add "New York, NY". Might improve things enough.
  2. Try the NYC Department of City Planning's geocoding API. Searching a street name alone won't work, but intersections and place names do.
  3. Switch to a Google map
  4. Build a historical geocoder based on https://github.com/nypl-spacetime/etl-nyc-streets (but you're already using a present-day basemap, so I think that if someone doesn't recognize a building or address they'll have a hard time placing it anyways).

Those are good suggestions, thanks. However:

  1. I tried this, improves things slightly, but also makes things confusing and unpredictable. Also, this collection!
  2. Again, only works for NYC...
  3. Would love to, but then I cannot use Leaflet.GeotagPhoto, and all bars and bus stops and pizza places will be on the map
  4. This is what I should do! I'm working on a search API for NYC Space/Time Directory data, but it's not finished yet...

Maybe I'll just reintroduce Mapbox Search, works good enough most of the time. And if people end up in San Diego, they can always go back to NYC.

Oh, I figured Surveyor was only being used for NYC photos. That's what it sounds like from the about page. Plus all the currently included collections seem to be photos of places NYC. Could always change the geocoding tactic if/when you use it for the wider collection.

You're right, it's almost all NYC now (except a few New Jersey/Westchester/Long Island photos)... But I wanted to keep Surveyor not too NYC-focused.

I'll look some more into adding Mapbox Search soon!

I think they have a bounding box option for geocoding.