[OSM-dev] Openlayers cyclemap permalinks
grand.edgemaster at gmail.com
Sat May 17 23:51:33 BST 2008
On Sat, 2008-05-17 at 21:47 +0100, OJ W wrote:
> The cycle map seems to have the openlayers permalink bug  - is it
> possible to apply the latest openlayers corrections so that it uses
> lat/long in permalinks?
> Can someone from OL also reply to this, saying how to do the correction?
>  http://www.gravitystorm.co.uk/osm/?zoom=13&lat=6781599.86453&lon=-126905.18782&layers=B00
> 6781599 degrees north is not the usual way of representing positions
> dev mailing list
> dev at openstreetmap.org
As noted on IRC, this is not a bug, but a raw expression of the way we
make our tiles, the numbers represent the distance in meters from the
origin. I guess they're not strictly lats and lons, but its just OL's
terms for the permalink.
Attached is a modified copy of the map.js used on gravitystorm.co.uk
which uses the projection features in OpenLayers 2.6, it sets
displayProjection to fix the bug, and changes the existing reprojection
functions to be wrappers around the OL code.
It should just slot in, but is untested. It should also handle the
existing permalinks semi-intelligently, assuming they're the old format
a) The OL permalink control puts the position outside of the map's
maxExtent (ie: sets centre to 0,0)
b) lat, lon, zoom params are numbers (checked to be outside the expected
range for lat lons)
Hope this helps,
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2890 bytes
Desc: not available
More information about the dev