StrandedKitty / streets-gl

🗺 OpenStreetMap 3D renderer powered by WebGL2
http://streets.gl
MIT License
658 stars 49 forks source link

Ability to jump directly to map coordinates by pasting an OSM map hyperlink #89

Open sekerob opened 1 year ago

sekerob commented 1 year ago

For instance mapped a farmyard in detail today which took some searching to locate it in Streets.gl. With JOSM one can copy an OSM browser address e.g. https://www.openstreetmap.org/changeset/136013326#map=19/42.56415/13.94334 which then when pasted into the Ctrl+J opened pane goes to the mapping location in JOSM or alternate allows entering coordinates directly.

image

which in SGL would then go to this

image

Kovoschiz commented 1 year ago

You can already paste coords with coma 42.56415,13.94334 in the url, as well as spaced 42.56415 13.94334 in the search by Nominatim. Meanwhile, you could use the OSM Smart Menu browser extension with a custom https://streets.gl/#{latitude},{longitude},45.00,0.00,2000.00 link, downside being the long time to re-validate the cache in opening a new tab. Does the zoom need to be respected? Which may need to be transformed. Or some default can do?

sekerob commented 1 year ago

Default on zoom is fine. No matter the zoom from the OSM map view or the present zoom in JOSM it always goes to the 10m zoom level. The other functionalities like the mentioned coma (?) I need to first learn what it is/how that works. Added the OSM Smart Menu extension to the Vivaldi browser and see a new icon on the toolbar and when on a OSM tab the button hit lists

image

I suppose that suffixing the lat/lon to the present url would do. When looking at the current streets.gl link address I see https://streets.gl/#42.5637,13.9425,**45.00,0.00,1461.69** I figure the lat/lon but what's the bolded?(it is part of the bookmarked url I saved at the start of first visiting streets.gl and never changes wherever navigating opposed to OSM that constantly updates the address.

JOSM does have a copy coordinates function which only works when a node is selected which outputs e.g. 42.5651596, 13.9396467 of the present node pick. If that can be grabbed from the copy buffer that'd be perfectly fine to get to the wanted SGL area and ogle the newly added objects, that is, guess you'd have to fetch the newly added data first.

StrandedKitty commented 1 year ago

When looking at the current streets.gl link address I see https://streets.gl/#42.5637,13.9425,**45.00,0.00,1461.69** I figure the lat/lon but what's the bolded?

The URL hash is in this format: {lat},{lon},{camera pitch in degrees},{camera yaw in degrees},{distance to the ground in meters}. It's supported to update every second or so when navigating the map.