ProjectSidewalk / SidewalkWebpage

Project Sidewalk web page
http://projectsidewalk.org
MIT License
84 stars 25 forks source link

Prefetch speed limit calls on validate page #3735

Open jsomeara opened 1 week ago

jsomeara commented 1 week ago

Resolves #3665

This now prefetches speed limit OSM API calls on the validate pages (regular validate and new validate beta). It achieves this by creating a cache object and caching the API responses and calculations ahead of time. Since camera position was not originally available, I had to add cameraLng and cameraLat properties to the ValidationLabelMetadata on the backend and Label.js (specifically the SVValidate data structure, not the one for SVLabel) on the frontend.

Testing instructions
  1. Go to project sidewalk validation page
  2. Observe that the speed limits are loaded in "instantly" upon moving to new labels
  3. Also verify that they are being prefetched in the network devtools tab
Things to check before submitting the PR