[OSM-dev] Too many decimal places in permalinks

John McKerrell john at mckerrell.net
Tue Oct 23 11:10:03 BST 2007

On 23 Oct 2007, at 10:25, Tom Hughes wrote:

> In message <4714CFF7.1080000 at arjam.net>
>         Robert Munro <rjmunro at arjam.net> wrote:
>> I noticed the other day that the permalinks on the view tab of
>> www.openstreetmap.org have way more decimal places than is useful.
>> Below is a little (untested) patch to site.js that should make the  
>> links
>> much shorter. It rounds the numbers to the (current zoom level)/3
>> decimal places, which at zoom level 2 (the worst case) is accurate to
>> less than 3 pixels - zoom level 2 is:
>>  (1024 pixels wide)/(360 degrees)= 2.8 pixels/degree.
> Applied and deployed.

Hi, I'd suggest not linking this to zoom level as you may find that  
when you click on a link you've copied (perhaps after zooming out a  
few times), and then zoom in, you end up somewhere you don't expect  
to be due to the rounding. I'd suggest just rounding to 5 decimal  
places should be fine for our purposes at all zoom factors (sorry,  
patch not provided but should be fairly simple).


More information about the dev mailing list