Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Add "markerlink" to main map view #4872

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 16 comments
Closed

Add "markerlink" to main map view #4872

openstreetmap-trac opened this issue Jul 23, 2021 · 16 comments

Comments

@openstreetmap-trac
Copy link

Reporter: gs25
[Submitted to the original trac issue database at 6.55am, Monday, 3rd June 2013]

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 osm.org 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.

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 12.38pm, Monday, 3rd June 2013]

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.

@openstreetmap-trac
Copy link
Author

Author: gs25
[Added to the original trac issue at 9.12am, Wednesday, 5th June 2013]

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

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 9.14am, Wednesday, 5th June 2013]

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.

@openstreetmap-trac
Copy link
Author

Author: gs25
[Added to the original trac issue at 10.26am, Wednesday, 5th June 2013]

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.

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 10.28am, Wednesday, 5th June 2013]

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.

@openstreetmap-trac
Copy link
Author

Author: gs25
[Added to the original trac issue at 2.13am, Thursday, 6th June 2013]

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:
http://rcos.rpi.edu/projects/jumpstart/commit/implement-a-generic-system-for-updating-coordinates-on-links/

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.

@openstreetmap-trac
Copy link
Author

Author: gs25
[Added to the original trac issue at 2.54am, Thursday, 6th June 2013]

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="http://www.openstreetmap.org/api/0.6/notes.json" class="geolink" data-minzoom="12" id="createnoteanchor" title="javascripts.site.createnote_tooltip">Add a note</a></li>
    </ul>
  </div>
</div>

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="http://www.openstreetmap.org/api/0.6/notes.json" class="geolink" data-minzoom="12" id="createnoteanchor" title="javascripts.site.createnote_tooltip">Add a note</a></li>
    </ul>
  </div>
</div>

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:

.hasClass("mllz")?(m.mlat=t,m.mlon=e,m.zoom=a):i&&$(u)

Done!

@openstreetmap-trac
Copy link
Author

Author: gs25
[Added to the original trac issue at 2.08pm, Saturday, 8th June 2013]

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.

@openstreetmap-trac
Copy link
Author

Author: woodpeck
[Added to the original trac issue at 3.14pm, Saturday, 8th June 2013]

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).

@openstreetmap-trac
Copy link
Author

Author: gs25
[Added to the original trac issue at 12.58am, Sunday, 9th June 2013]

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:

http://wiki.openstreetmap.org/wiki/Marker#Adding_a_Marker

@openstreetmap-trac
Copy link
Author

Author: gs25
[Added to the original trac issue at 1.45pm, Sunday, 16th June 2013]

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.

@openstreetmap-trac
Copy link
Author

Author: woodpeck
[Added to the original trac issue at 5.36pm, Sunday, 16th June 2013]

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.

@openstreetmap-trac
Copy link
Author

Author: gs25
[Added to the original trac issue at 2.07am, Monday, 17th June 2013]

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?

@openstreetmap-trac
Copy link
Author

Author: Stemby
[Added to the original trac issue at 3.55pm, Wednesday, 17th July 2013]

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

http://gll.petschge.de/

(moving the map instead of moving the marker)

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

@openstreetmap-trac
Copy link
Author

Author: Stemby
[Added to the original trac issue at 8.57am, Friday, 19th July 2013]

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.

Ciao!

@openstreetmap-trac
Copy link
Author

Author: Stemby
[Added to the original trac issue at 1.09pm, Thursday, 22nd August 2013]

My idea has been implemented. Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant