Opened 7 years ago

Closed 7 years ago

#4872 closed enhancement (fixed)

Add "markerlink" to main map view

Reported by: gs25 Owned by: rails-dev@…
Priority: minor Milestone:
Component: website Version:
Keywords: Cc: Stemby


Following a short discussion on the OSM-talk list (topic: Permalink with marker), which had generally positive responses, I am proposing an enhancement to the OSM main map.

On the main map at there is a 'permalink' hyperlink, which generates a URL encoding the current view of the map. I think it would be very useful to have another similar link called 'markerlink' which builds a marker link in the same way as 'permalink', but changes "lat" and "lon" to "mlat" and "mlon". Users can then quickly make a URL that can be pasted into email or chat sessions to indicate a point on the map.

Thank you.

Change History (18)

comment:1 Changed 7 years ago by Ldp

Component: mapnikwebsite
Owner: changed from mapnik-team@… to rails-dev@…

comment:2 Changed 7 years ago by Tom Hughes

Resolution: wontfix
Status: newclosed

No way are we adding a third version of a permalink.

This has been discussed many times before and the basic plan is to include this in the export tab when they is rewritten. I believe there are already one or more tickets covering that.

comment:3 Changed 7 years ago by gs25

Shouldn't the fact that this has been discussed many times before tell you something? People clearly want this feature.

comment:4 Changed 7 years ago by Tom Hughes

Did I say people didn't want it? No, I didn't. However nobody has stepped up to implement it in an acceptable way.

We don't have a crack squad of coders waiting to write things as soon as enough users ask for them - we rely on volunteers writing things.

comment:5 Changed 7 years ago by gs25

Ok, but by setting the status to "wontfix" you are sending the message that this won't happen (or indeed shouldn't be allowed to happen). I have found maybe 3 related tickets for this issue, the first one being from 4 years ago. So, someone suggested it would be a good idea then, but it is also marked "wontfix".

I never suggested that you had a crack squad of coders standing idly by until someone suggested something interesting for them to do, however if requests like this are marked "wontfix" then a volunteer who is interested in implementing it will see that it is not to be done.

I had a very quick look at the code, and it seems that 'Permalink' relies on an inbuilt function in OpenLayers?, so generating a marker might also require something added into OpenLayers?, which is probably complicated. However, it might be possible to have a tiny piece of javascript that fetches the permalink URL and does a string substitution of lon/lat with mlon/mlat and returns the new string.

comment:6 Changed 7 years ago by Tom Hughes

Adding dozens of different tickets for the same thing doesn't help anybody - the main reason why I closed it was that it was in effect a duplicate. I closed "wontfix" rather than "duplicate" because the actual proposed solution wasn't acceptable.

Also we haven't been using OpenLayers? for some time, so anything you have looked at in OpenLayers? is completely irrelevant - we are using Leaflet now.

comment:7 Changed 7 years ago by gs25

Point taken, but I didn't add the ticket because I thought surely one more ticket would make it happen. I came up with the idea independently and canvassed support on the mailing list, with a very positive response. I have since found other discussions of the same idea on mailing lists and forums, all expressing a desire for this feature.

I have made a local copy the page source for the OSM slippy map, and edited it to add absolute instead of relative paths to the scripts etc. I added a 'markerlink' link, and wrote a tiny piece of javascript to do string substitution (replace lat/lon with mlat/mlon). What I want to do is to make the 'markerlink' fetch the 'permalink' URL and pass it to the string substitution function, it doesn't work yet but I am still fiddling with that.

I also found some of your (?) code here:

I assume the 'permalinkanchor' code has been moved somewhere else, but can it be copied/pasted/edited like this?:

node = $("markerlinkanchor");
if (node) {
  var args = getArgs(node.href);
  args["mlat"] = lat;
  args["mlon"] = lon;
  args["zoom"] = zoom;
  if (layers) {
    args["layers"] = layers;
  if (objtype && objid) {
    args[objtype] = objid;
  node.href = setArgs(node.href, args);

I know you are not supportive of this idea, but thank you for discussing it.

comment:8 Changed 7 years ago by gs25

Ok, I made it work. I had to do two things. In the main slippymap page, near the end, is the code that produces the links for 'permalink', 'shortlink' and 'add a note'

It looks like this:

<div id="map">
  <div id="permalink">
    <ul class="secondary-actions">
      <li><a href="/" id="permalinkanchor" class="geolink llz layers object">Permalink</a></li>
      <li><a href="/" id="shortlinkanchor">Shortlink</a></li>
      <li><a href="" class="geolink" data-minzoom="12" id="createnoteanchor" title="">Add a note</a></li>

I added a line to make a new link:

<div id="map">
  <div id="permalink">
    <ul class="secondary-actions">

      <li><a href="/" id="markerlinkanchor" class="geolink mllz layers object">Markerlink</a></li>

      <li><a href="/" id="permalinkanchor" class="geolink llz layers object">Permalink</a></li>
      <li><a href="/" id="shortlinkanchor">Shortlink</a></li>
      <li><a href="" class="geolink" data-minzoom="12" id="createnoteanchor" title="">Add a note</a></li>

Note that the class="" string refers to "mllz", not "llz".

Next, the first script that is loaded by the slippymap page is called "/assets/application-7e0818efda3f211e209b9b8901f57c7c.js"

In there is the 'geolink' function. I found the part '.hasClass("llz")' and I pasted a copy immediately after it, then edited it to this:



comment:9 Changed 7 years ago by gs25

So, who do I have to convince to make this happen?

I have identified a requirement (independently, but it seems others have had the same idea), and I have written the code to implement it (two lines, but still).

I would use this feature a lot, and so would others.

comment:10 Changed 7 years ago by woodpeck

I think the best way to make this happen is by providing a suitable option in the "Export" tab, as has been suggested to you already. The fact that you can find 10 people who say "yeah would be nice" is not enough justification to clutter the main map view with more features (the shortlink and permalink are already one too many).

Have you thought about the fact that people will surely want to move the marker after it has been placed (because it will be placed at the centre of the current map view and people have no visual indication where that centre is exactly)? We'd either have to provide a way to move the marker, or at least provide visual indication (e.g. when hovering over the placement button or so).

comment:11 Changed 7 years ago by gs25

Putting it in the Export tab is not what I want. I am the researcher, designer, programmer and user, and I want a single click, like Permalink. If the map view is too cluttered then move "Add a note" to the "Edit" tab, but on my local version I can assure you it is not cluttered at all.

And yes, I have thought about moving the marker. It's a non-issue. The key point is that the marker doesn't actually exist. It's encoded in the URL and nowhere else. If a user was to view the map and then click "Markerlink" he would get the same view, but with a marker in the centre. If the marker is in the wrong place then he can move the slippy map, zoom in/out whatever and click "Markerlink" again. It is exactly the same as following these instructions but in one click:

comment:12 Changed 7 years ago by gs25

Someone on the [OSM-newbies] mailing list has complained about the lack of this feature. Who is working on providing it via the "Export" tab, and when will it be ready? I disagree that that is the best place to put it, and I have offered working code for my solution, which I think is better and immediately useful. I have no doubt it could be replaced with something even better later, but for now I'd prefer something that actually existed.

comment:13 Changed 7 years ago by woodpeck

You created a patch which is laudable - better than requesting a feature and not doing anything about it. However, it seems from reading the discussion that your patch was considered not good enough (as it clutters the main page and, while perhaps of use to some newbies, will certainly provide additional confusion to others).

Submitting a patch that is not good enough for the site maintainers to apply is not something uncommon; many patches go through several iterations before they are accepted, and some are rejected altogether (it certainly happened to many of mine!). It may be a bit frustrating, especially if making the patch has cost you some time, but on the other hand I think that none of us want a main page where every patch that makes something better for a certain user group is automatically accepted without regard for what this particular patch might make worse.

I am also not convinced by your statement regarding the user interface ("if the marker is wrong the user can simply move the map and click markerlink again"); I can immediately see people asking "duh, the marker is at the wrong location, what can I do to fix hat".

You said that you are "the researcher, designer, programmer and user" and that you want it that way and not on the export tab. But you are not the person making the decision and you have to accept that. Either play the game, discuss, improve, and compromise; or if you want things your way, then run your own web page where the placing of markers is handled exactly like you want it.

comment:14 Changed 7 years ago by gs25

Well, we could try it and see, instead of being afraid of what might happen. It is trivial to add this feature, and easy to remove it if complaints arise. I have not seen a good reason not to do it. It does not clutter the map. It is immediately useful. It will not cause confusion.

I understand that changes must be evaluated carefully, but the problem that arises is stasis. We will do nothing for fear that it upsets or confuses someone.

So, since my proposed feature and its implementation is not acceptable, who is working on adding this to the "Export" tab, and when will it be ready? I can't find a trac ticket for that feature request. Is there one or shall I add one?

comment:15 Changed 7 years ago by Stemby

Cc: Stemby added

A good solution for the user interface could be this one:

(moving the map instead of moving the marker)

I'd like to see this feature integrated in OSM...

comment:16 Changed 7 years ago by Stemby

I try to explain my idea.

We only need a new checkbox ("Show Marker"), near "Browse Map Data" and "Browse Notes".

If this checkbox is checked, a marker is shown in the middle of the screen; the user can move and zoom the map. When he finds the good position, he can click the current "Permalink" link to get a mlat/mlon link.


Last edited 7 years ago by Stemby (previous) (diff)

comment:17 Changed 7 years ago by Stemby

Resolution: wontfix
Status: closedreopened

My idea has been implemented. Thank you!

comment:18 Changed 7 years ago by Stemby

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.