nst-guide / web

Mapping website for National Scenic Trails

Home Page:https://nst.guide

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parse map hash parameters from URL

kylebarron opened this issue · comments

Now that I turned on the map hash
b8cb333

The URL is displayed like this:
http://localhost:8000/#11.93/36.89305/-118.43338

However, initialViewState is a static object:

// Initial viewport settings
const initialViewState = {
bearing: 0,
latitude: 37.8759,
longitude: -119.3629,
pitch: 0,
zoom: 8,
};

This means that pasting a url with a map hash does nothing.

Figure out how to parse the URL parameters, and if they exist, set as the initial view state.

Fixed in 9959afe