Closed awozniak closed 7 years ago
(of course immediately after I post this I find the "Portal Link" and "Map Links". Doh!)
Oh boy.... You know there's a Portal Link link? Permalink is for the map location, not a portal.
Beat me to it 😂
pomozesz mi?
I get annoyed that Permalink does not have the pll= with the actual lat/lng of the portal. I often need the actual lat/lng to port into something else, like google maps.
I'm too lazy to git clone and all that, but here's the fix for the problem:
window.setPermaLink = function(elm) { var c = map.getCenter(); var lat = Math.round(c.lat1E6)/1E6; var lng = Math.round(c.lng1E6)/1E6; var qry = 'll='+lat+','+lng+'&z=' + map.getZoom();
// BEGIN ADDITIONAL CODE if(window.selectedPortal && window.portals[window.selectedPortal]) { var p = window.portals[window.selectedPortal].getLatLng(); lat = Math.round(p.lat1E6)/1E6; lng = Math.round(p.lng1E6)/1E6; qry += '&pll='+lat+','+lng; } // END ADDITIONAL CODE
$(elm).attr('href', '/intel?' + qry); }