[OSM-dev] Leaflet.EditInOSM

Jochen Topf jochen at remote.org
Mon Jan 28 17:43:35 GMT 2013

On Mon, Jan 28, 2013 at 04:56:19PM +0000, Andy Allan wrote:
> On 28 January 2013 16:39, Jochen Topf <jochen at remote.org> wrote:
> > That approach might work for in-browser editors, but I don't want to go to
> > a different web page first before my JOSM is opened at the right place. I
> > want to stay in the context of the web page where I am opening the editor
> > from.
> Fair enough.
> > Maybe we could make the editor setting for a user available through an API on
> > osm.org, then every site can fetch this setting and directly do the right
> > thing.
> That's a good idea - but how would that work for Yohan's example?
> You'd need to give his website your username or something similar,
> right?

I am not sure. If you are logged in to osm.org, you'll have a cookie from
osm.org, so an API call to osm.org could return the right information. But this
means we'd have to give out your editor preference to anybody who asks, which
we might not want. Or the external website has to go through the whole oauth
thing, which shoudn't really be needed for something like this.

We could give back from the API call a json file which contains a list of all
editors available and, if the user is logged in and has allowed their editor
setting to be made publicly available, that setting. Any external site could
offer a selection box for the editor. If the the user has chosen one, it will
be the default. If not the site can choose a default.

We gain flexible editor settings which will always work on all sites even if new
editors are added. The user can choose to set a default or not.

> > Well, actually it is not that easy. I am almost never logged in to the main OSM
> > site. About the only reason I log onto the site is to use the editor. But not
> > my actual preferred editor (which is JOSM). I have set my preferred editor to
> > Potlatch 1, because that is the easiest way to still access Potlatch 1, which
> > I don't need that often, but I still need it for one thing, namely reviving
> > deleted objects. So I don't actually want this "preferred" editor at all most
> > of the time...
> Well, I can think of a few bugs that need solving, going by your
> explanation! Staying logged in for longer, accessing p1 more easily
> when duty calls, implemented deleted map calls in the API, then
> implemented the undo in other editors, etc.
> I'd say the only showstopper that you describe above is that you want
> to stay on the same page when triggering the remote control plugin.
> Would it work if openstreetmap.org/edit responds with a 30x code
> (307?) pointing to the remote control url? Or would your browser still
> show an empty page?

Yes, it would. So we really have to treat the in-browser and external
applications in a different way.

And it is a bit more complex. JOSM can, for instance, be given a URL instead of
a bbox. It will download some OSM XML from the URL and you can edit that.
(Great for requesting from XAPI for instance.) I don't believe Potlatch can do
that. But even if it can, I am sure editor authors will come up with extra
things you can do with one editor and not the other through this remote control
thing. And for different things you also need different ways to access them so
the external sites still need to know about the editors.

So I don't think we can hide the different editors behind some consistent
interface. Maybe we can do it for part of the functionality though which would
already be a win. On the other hand, maybe it is too early to try to standardize
this. There aren't really that many editors around.

What I do think would be helpful is some general way of linking from one map
to another. There are many many OSM-based maps out there and I constantly find
myself on one map and want to quickly switch to a different site, which generally
means clicking on the permalink and then copy-and-pasting the coordinates out
and tag it onto a different sites' URL. There are many more maps out there than
editors... (And before somebody misunderstands, I don't want one site that has
all those different maps as layers. Map sites are often much more than layers,
with different functions such as routing, several overlays, and, yes, editing.)
So maybe the problem is more general than just for editors.

Jochen Topf  jochen at remote.org  http://www.remote.org/jochen/  +49-721-388298

More information about the dev mailing list