bartromgens/petanque-map-client

share a map location/scale

axd1967 opened this issue · 7 comments

as a web user, I want to share a view as an URL (for example, https://www.openstreetmap.org/#map=16/47.9004/106.9430) so that i can direct people to a specific place and they don't have to search for it.

(currently, the map seems to centre on The Nethelands, which makes me suspect the developer lives there )

(the problem is even more acute: just refreshing the page jumps back to The Netherlands).

That would be nice and not too difficult to add coordinates and zoom to the url.

Note that you can send a link to a terrain like http://petanquemap.com/terrain/5804202286 (click on a marker to get the url).

the map seems to centre on The Nethelands, which makes me suspect the developer lives there

Correct :) It's a simple project to help me and friends find places to play. Although I think it can be of use to many. Happy to improve it. Thanks for creating the issues.

We could ask the browser for location data to zoom in on a specific user area, although I find that browser pop-up request a bit intrusive.

Do you have an idea on how to start the map on the user location?

So, a good idea is already to bookmark a given location.

Asking for a location seems to become standard practice: for example, if I want to go to my location, I get this:

image

(But you know this.)

An alternative could be to continue from a previous session location: the user pans/zooms in, and next time (s) continues there.

I think cookies can help: e.g. https://www.daftlogic.com/sandbox-google-maps-remember-last-location.htm (should be similar on OSM)

But remember that the idea is to share an URL which contains center and scale info.

You can now share a map location via url. The url is updated with zoom and location on move/zoom. Example: http://petanquemap.com/17/4.598693/50.645216/

I will create a new issue to use user location as initial location and close this issue.