Add support for 'link' component - button to get hard link to current view

This commit is contained in:
Mike Primm 2012-01-06 03:09:53 -06:00
parent 5a0983d867
commit b66008c262
5 changed files with 93 additions and 0 deletions

View file

@ -829,6 +829,14 @@ DynMap.prototype = {
break;
}
}
},
getLink: function() {
var me = this;
var url = window.location.pathname;
var center = me.maptype.getProjection().fromLatLngToLocation(me.map.getCenter(), 64);
url = url + "?worldname=" + me.world.name + "&mapname=" + me.maptype.options.name + "&zoom=" + me.map.getZoom() + "&x=" + center.x + "&y=" +
center.y + "&z=" + center.z;
return url;
}
// TODO: Enable hash-links.
/* updateLink: function() {