This is pretty cool. I'd advise not changing the URL with every map movement and instead let the user generate a linkable URL upon demand. This created quite the enormous history list after only using a few minutes.
You can keep your urls sharable and avoid breaking the back button by storing the map state in the url hash.
something like:
`location.hash = '#map/' + mapLat + '/' + mapLng + '/'+ mapZoom;` Here's an example of one I made for a client recently.
http://www.btforasthma.com/find-a-clinic?ctry=US&state=NY&lo... Incidentally, if anyone is looking to hire a consultant with mapping experience, hit me up.
Comments (136) 66 threads
Show all comments
Showing thread 2 of 66
something like: `location.hash = '#map/' + mapLat + '/' + mapLng + '/'+ mapZoom;`
Here's an example of one I made for a client recently. http://www.btforasthma.com/find-a-clinic?ctry=US&state=NY&lo...
Incidentally, if anyone is looking to hire a consultant with mapping experience, hit me up.
replaceState() works a lot better:
https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/M...