jonstapleton / trail-guide

0 stars 0 forks source link

Develop Map route API #6

Open jonstapleton opened 5 months ago

jonstapleton commented 5 months ago

Right now, interactions between the UI and the map are really under-specified. I'd like interactions with the Map to go through the URL bar, allowing us to modify the map using <a> elements rather than through complicated Javascript nonsense.

The Map API should support the following query fields:

Field Description
focus={x},{y} Pans the camera to focus on a particular set of coordinates
zoom={x} Zooms in or out on the coordinates provided by focus based on the value provided. If no focus is provided, zooms in on the coordinate at the center of the viewport.
node={path} Selects a node to select on the Map. If focus and zoom aren't passed, the Map will redirect to a URL with appropriate focus and zoom parameters
project={path} Highlights the nodes in the provided project sequence. If focus and zoom are not provided, pans to the center of the project sequence and zooms out to fit the sequence within the viewport.
jonstapleton commented 3 months ago

This is sort of working now as of this commit

There's a lot of cleaning up left to do, but that may have to wait until a later release. ugh.