editor-layer-index icon indicating copy to clipboard operation
editor-layer-index copied to clipboard

Feature request: launch iD editor on clicked location

Open Binnette opened this issue 5 years ago • 5 comments
trafficstars

On https://osmlab.github.io/editor-layer-index/

  1. Click anywhere on the map
  2. A popup is displayed
  3. Click on one of the "iD" button
  4. iD editor is opened but in wrong location

image

Can you please, "register" the latitude, longitude and zoom level when the user click on the map. Then in the popup, add latitude, longitude and zoom in the iD editor url

For exemple the URL: https://www.openstreetmap.org/edit?editor=id&background=custom%3ASPOT

Should become: https://www.openstreetmap.org/edit?editor=id&background=custom%3ASPOT#map=19/45.3460/36.2891

(I added #map=ZOOM/LATITUDE/LONGITUDE)

Thank you & have a nice day.

Binnette avatar Oct 23 '20 22:10 Binnette

Yeah I agree we should do this.

andrewharvey avatar Oct 23 '20 23:10 andrewharvey

Salut @Binnette I implemented that the link now should jump to the position of the map when clicked. However, it seems that iD does not open always the custom layer passed with the URL. Not sure if this is something I introduced or there is something else going on.

rbuffat avatar Mar 19 '21 21:03 rbuffat

Hi @rbuffat, thank for your fix. Here is the documentation for the url parameters for id https://github.com/openstreetmap/iD/blob/develop/API.md

And yes, there are still some errors in editor-layer-index links:

  • Url: https://www.openstreetmap.org/edit?editor=id&background=custom:https://{switch:a,b,c}.tile.openstreetmap.fr/route500/{zoom}/{x}/{y}.png#map=18/45.18956/5.74343
    • Should be: https://www.openstreetmap.org/edit?editor=id&background=custom:https://{switch:a,b,c}.tile.openstreetmap.fr/route500/{zoom}/{x}/{y}.png&map=18/45.18956/5.74343
  • Url: https://www.openstreetmap.org/edit?editor=id&background=custom:https://{switch:a,b,c}.tile.openstreetmap.fr/route500hydro/{zoom}/{x}/{y}.png#map=18/45.18956/5.74343
    • Should be: https://www.openstreetmap.org/edit?editor=id&background=custom:https://{switch:a,b,c}.tile.openstreetmap.fr/route500hydro/{zoom}/{x}/{y}.png&map=18/45.18956/5.74343

The fix is easy 👍 You have to change the '#' just before 'map=' by '&'. In fact 'map' in an url parameter like the others 😊

Have a nice day... Merci et bonne journée.

Binnette avatar Mar 27 '21 09:03 Binnette

@Binnette Thanks for the link to the API. I was not aware that iD has an API and did not think about looking for one!

I'm a bit confused:

This opens iD at the correct location but no imagery:

https://www.openstreetmap.org/edit?editor=id&background=custom%3Ahttps%3A%2F%2Fwww.geoservice.apps.be.ch%2Fgeoservice2%2Fservices%2Fa42geo%2Fa42geo_hoehenwms_d_fk%2FMapServer%2FWMSServer%3FLAYERS%3DGEODB.LDOM50CM_LORELIEF_KMGDM1%26STYLES%3Ddefault%26FORMAT%3Dimage%2Fjpeg%26CRS%3D%7Bproj%7D%26WIDTH%3D%7Bwidth%7D%26HEIGHT%3D%7Bheight%7D%26BBOX%3D%7Bbbox%7D%26VERSION%3D1.3.0%26SERVICE%3DWMS%26REQUEST%3DGetMap&lat=46.74557&lon=7.63367&zoom=15.00

These URL opens iD with the correct imagery but no location:

https://www.openstreetmap.org/edit?editor=id&background=custom%3Ahttps%3A%2F%2Fwww.geoservice.apps.be.ch%2Fgeoservice2%2Fservices%2Fa42geo%2Fa42geo_hoehenwms_d_fk%2FMapServer%2FWMSServer%3FLAYERS%3DGEODB.LDOM50CM_LORELIEF_KMGDM1%26STYLES%3Ddefault%26FORMAT%3Dimage%2Fjpeg%26CRS%3D%7Bproj%7D%26WIDTH%3D%7Bwidth%7D%26HEIGHT%3D%7Bheight%7D%26BBOX%3D%7Bbbox%7D%26VERSION%3D1.3.0%26SERVICE%3DWMS%26REQUEST%3DGetMap

https://www.openstreetmap.org/edit?editor=id&background=custom%3Ahttps%3A%2F%2Fwww.geoservice.apps.be.ch%2Fgeoservice2%2Fservices%2Fa42geo%2Fa42geo_hoehenwms_d_fk%2FMapServer%2FWMSServer%3FLAYERS%3DGEODB.LDOM50CM_LORELIEF_KMGDM1%26STYLES%3Ddefault%26FORMAT%3Dimage%2Fjpeg%26CRS%3D%7Bproj%7D%26WIDTH%3D%7Bwidth%7D%26HEIGHT%3D%7Bheight%7D%26BBOX%3D%7Bbbox%7D%26VERSION%3D1.3.0%26SERVICE%3DWMS%26REQUEST%3DGetMap&map=15/46.74557/7.63367

https://www.openstreetmap.org/edit?editor=id&background=custom%3Ahttps%3A%2F%2Fwww.geoservice.apps.be.ch%2Fgeoservice2%2Fservices%2Fa42geo%2Fa42geo_hoehenwms_d_fk%2FMapServer%2FWMSServer%3FLAYERS%3DGEODB.LDOM50CM_LORELIEF_KMGDM1%26STYLES%3Ddefault%26FORMAT%3Dimage%2Fjpeg%26CRS%3D%7Bproj%7D%26WIDTH%3D%7Bwidth%7D%26HEIGHT%3D%7Bheight%7D%26BBOX%3D%7Bbbox%7D%26VERSION%3D1.3.0%26SERVICE%3DWMS%26REQUEST%3DGetMap&map=15%2F46.74557%2F7.63367

rbuffat avatar Mar 28 '21 13:03 rbuffat

Thank you for opening this issue 👍 Let's wait for an answer from the iD maintainers/developers 😊

Binnette avatar Mar 28 '21 18:03 Binnette