goeuropa / onebusaway-react-webapp

React web application for OBA backend
GNU Affero General Public License v3.0
0 stars 1 forks source link

Use `stops-for-location` to populate the map viewport #5

Open aaronbrethorst opened 4 months ago

aaronbrethorst commented 4 months ago

You can read more about stops-for-location on the developer docs website: https://developer.onebusaway.org/api/where/methods/stops-for-location

When a user opens the site, we should call stops-for-location with the map's center point as the location, render the stops returned, and then progressively continue to call stops-for-location as the user pans and zooms. There should be a debounce applied to the rate at which calls to stops-for-location are made to prevent us from making too many API calls. I think a 300ms delay is probably about right.

Acceptance criteria:

  1. Call stops-for-location on map load and for every subsequent pan and zoom (with a 300ms debounce)
  2. Render the resulting stops as annotations on the map.

This is related to issue #4

Michal-Radomski commented 4 months ago

The same answer like this one: https://github.com/goeuropa/onebusaway-react-webapp/issues/4#issuecomment-2178597614