iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
989 stars 552 forks source link

Permalink does not include pll= when portal is selected (with solution) #1182

Closed awozniak closed 7 years ago

awozniak commented 7 years ago

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); }

awozniak commented 7 years ago

(of course immediately after I post this I find the "Portal Link" and "Map Links". Doh!)

PrinterElf commented 7 years ago

Oh boy.... You know there's a Portal Link link? Permalink is for the map location, not a portal.

PrinterElf commented 7 years ago

Beat me to it 😂

miron341 commented 7 years ago

pomozesz mi?