Right now, the map only loads stops on first load. We need to improve this by continuing to load more stops whenever the user pans the map (i.e. moves left/right/up/down) or zooms in or out. Check out GoogleMaps.svelte's loadStopsForLocation function to see how to load more stops from the server. The (lat, lng) params should come from the current center of the Google Map.
It's ok to leave all of the existing stops on the map—i.e. for now we are only going to add more stops to the map as the user pans and zooms.
The only thing to watch out for is the possibility of loading duplicate stops. We must not load a stop twice on the map. For instance, if the server returns the stop "15th Ave E & Galer St" from two invocations of loadStopsForLocation(), we should ensure that only one marker for that stop is added to the map.
Acceptance criteria
[x] Add event handlers for pans and zooms
[x] Call loadStopsForLocation whenever the event handlers fire and append its results to the map. (there should probably be some sort of debounce applied to this)
Right now, the map only loads stops on first load. We need to improve this by continuing to load more stops whenever the user pans the map (i.e. moves left/right/up/down) or zooms in or out. Check out GoogleMaps.svelte's loadStopsForLocation function to see how to load more stops from the server. The
(lat, lng)
params should come from the current center of the Google Map.It's ok to leave all of the existing stops on the map—i.e. for now we are only going to add more stops to the map as the user pans and zooms.
The only thing to watch out for is the possibility of loading duplicate stops. We must not load a stop twice on the map. For instance, if the server returns the stop "15th Ave E & Galer St" from two invocations of
loadStopsForLocation()
, we should ensure that only one marker for that stop is added to the map.Acceptance criteria
loadStopsForLocation
whenever the event handlers fire and append its results to the map. (there should probably be some sort of debounce applied to this)