Marco Krage
unread,Mar 20, 2013, 3:01:06 AM3/20/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to leafl...@googlegroups.com
Hello,
i try to generate a permalink. Below is my permalink function for now.
How do i get the current activated baselayer?
function updatePermalink() {
var s = ''
,center = map.getCenter()
,lat = center.lat
,lng = center.lng
,zoom = map.getZoom()
,baselayer = 'TODO'
,activeTracks = (function(){ var r=[]; for(track in tracks) { r.push(track) } return r.join(','); })();
if(lat) {s += '~lat='+center.lat;}
if(lng) {s += '~lng='+center.lng;}
if(zoom) {s += '~zoom='+zoom;}
if(baselayer) {s += '~baselayer='+baselayer;}
if(activeTracks) {s += '~tracks='+activeTracks;}
$('#permalink').attr('href', '#'+s);
}
Ideas? Anything?