[OSM-dev] Bug Bounties

Stefan de Konink skinkie at xs4all.nl
Tue Apr 24 01:33:46 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Stefan de Konink schreef:
> SteveC schreef:
>> £10 slippy map permalink a-la infofreeway but lat/lng
>> http://trac.openstreetmap.org/ticket/77

I want to claim this one as *hunted* using the *current* OpenLayers
implementation used at OSM. The new OpenLayers thing seems to lack
'likegoogle' functions but has constructors to update 'permalink', which
is now done by site.js.

The code is running locally and is working, so if I like a missing thing
in the diff under please keep me informed.

Here the diff in text:

index.html:

<div id="map" style="width: 700px; height: 500px; border: 1px solid
black;"><a href="permalink" id="permalink" style="position: absolute;
z-index: 1; top: 500px; left: 10px;">Permalink</a></div>

The map gets an extra permalink.


The Javascript URL parsing is taken from a public source:

map.addControl(new OpenLayers.Control.LayerSwitcher());

           var getVars = new Array();
           var locvartemp = ( window.location.href.indexOf( "?" ) + 1 )
? window.location.href.substr( window.location.href.indexOf( "?" ) + 1 )
: "";
           locvartemp = locvartemp.split( "&" );
           for( var x = 0; x < locvartemp.length; x++ ) {
               var lvTempVar = locvartemp[x].split( "=" );
               getVars[ unescape( lvTempVar[0] ) ] = unescape(
lvTempVar[1] );
           }

           if (getVars['lon'] != undefined) lon_map = (getVars['lon'] /
180) * 20037508.34;
           if (getVars['lat'] != undefined) {
                var PI = 3.14159265358979323846;
                lat_map = Math.log(Math.tan((getVars['lat']/(180/PI) +
(PI / 2)) / 2)) * 20037508.34 / PI;
           }
           if (getVars['zoom'] != undefined) zoom = getVars['zoom'];

map.setCenter(new OpenLayers.LonLat(lon_map, lat_map), zoom);

(the probably pathetic lat_map calculation is done by myself)


In javascript/site.js:

links['permalink'] = '/index.html';



Yours Sincerely,

Stefan de Konink
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGLVBqYH1+F2Rqwn0RCmBJAKCAJxnQX/Qfj6NRfTtgeyCpYlqz8QCfQPqN
Edx9XJPPHaulfD3aW7+r9+I=
=br2q
-----END PGP SIGNATURE-----




More information about the dev mailing list