MediaWiki:Wikiminiatlas.js: Difference between revisions
rewrite href for the quicklink feature
No edit summary |
(rewrite href for the quicklink feature) |
||
Line 211: | Line 211: | ||
// jump straight to the preferred map-service | // jump straight to the preferred map-service | ||
qlURL : function( lat, lon, zoom ) | |||
{ | { | ||
var url = wikiminiatlas.config.quicklinkurl; | var url = wikiminiatlas.config.quicklinkurl; | ||
url = url.replace( /\{latdecdeg\}/g, | url = url.replace( /\{latdecdeg\}/g, lat ); | ||
url = url.replace( /\{ | url = url.replace( /\{londecdeg\}/g, lon ); | ||
url = url.replace( /\{span\}/g, pow( 2.0, | url = url.replace( /\{span\}/g, pow( 2.0, zoom) / 1500.0 ); | ||
return url; | |||
}, | }, | ||
Line 404: | Line 403: | ||
if ( config.quicklink ) { | if ( config.quicklink ) { | ||
link. | link.href = qlURL( marker.lat, marker.lon, zoomlevel ); | ||
addEvent( link, 'mouseover', qlStart ); | addEvent( link, 'mouseover', qlStart ); | ||
addEvent( link, 'mouseout', qlStop ); | addEvent( link, 'mouseout', qlStop ); | ||
} | } | ||
} | } |