add permalink feature

This commit is contained in:
Stefan Breunig
2013-02-10 23:49:01 +01:00
parent e1c3c9e73b
commit e92a9e13b1
3 changed files with 13 additions and 1 deletions

View File

@ -198,3 +198,11 @@ if (typeof String.prototype.startsWith !== 'function') {
window.prettyEnergy = function(nrg) {
return nrg> 1000 ? Math.round(nrg/1000) + 'k': nrg;
}
window.setPermaLink = function(elm) {
var c = map.getCenter();
var lat = Math.round(c.lat*1E6);
var lng = Math.round(c.lng*1E6);
var qry = 'latE6='+lat+'&lngE6='+lng+'&z=' + map.getZoom();
$(elm).attr('href', 'http://www.ingress.com/intel?' + qry);
}