nrenner / brouter-web

Web client for BRouter, a routing engine based on OpenStreetMap
https://brouter.de/brouter-web/
MIT License
374 stars 74 forks source link

Parse URL hash without map parameter #265

Open nrenner opened 5 years ago

nrenner commented 5 years ago

URL hash parsing currently can't handle a hash without a map parameter, but that would sometimes be needed, e.g. for abrensch/brouter#188:

http://brouter.de/brouter-web/#lonlats=9.272386,47.693804;9.176143,47.663689

Additional parameters are only parsed if mapsArgs are set.

The map position could be set by calling Map.fitBounds with the bounds of the passed route lonlats (L.latLngBounds + extend or L.polyline(latlngs) + getBounds).

bagage commented 4 years ago

Similarly or related, but you cannot reload URL if base layer is not present, eg:

  1. Open BRouter on some URL eg. http://brouter.de/brouter-web/#map=16/43.5982/4.5635/standard
  2. Try to update URL with:

We should fallback to default layer in the second case.