yohanboniface / Leaflet.RevealOSM

Very simple but extendable Leaflet plugin to display OSM POIs data on map click

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Put in a link to access the OSM object's details webpage

stevevance opened this issue · comments

When revealing an OpenStreetMap object, add a link that would open a new browser tab and load the object's details webpage. Example 'way' details page.

Why not simply creating your own class inheriting from L.Control.RevealOSM, and extending formatContent?

Something like:

MyControl = L.Control.RevealOSM.extend({

    formatContent: function (element) {
         var content = L.Control.RevealOSM.prototype.formatContent.call(this, element);
         content = content + '<a href="xxxx">Go to details page</a>';
         return content
    }

});

@yohanboniface I didn't know that would have been possible.