[OpenStreetMap] #4872: Add "markerlink" to main map view
OpenStreetMap
trac at noreply.openstreetmap.org
Thu Jun 6 02:54:41 UTC 2013
#4872: Add "markerlink" to main map view
--------------------------+-------------------------
Reporter: gs25 | Owner: rails-dev@…
Type: enhancement | Status: closed
Priority: minor | Milestone:
Component: website | Version:
Resolution: wontfix | Keywords:
--------------------------+-------------------------
Comment (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="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!
--
Ticket URL: <https://trac.openstreetmap.org/ticket/4872#comment:8>
OpenStreetMap <http://www.openstreetmap.org/>
OpenStreetMap is a free editable map of the whole world
More information about the rails-dev
mailing list