[OSM-dev] Too many decimal places in permalinks

Tom Hughes tom at compton.nu
Tue Oct 23 11:14:20 BST 2007


In message <739E7C03-69D1-49BF-A519-A353C6A99060 at mckerrell.net>
        John McKerrell <john at mckerrell.net> wrote:

> 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).

I don't understand... As things stand any link you take should
position you within three pixels of the original position when
you go back to it so you should then get essentially the same as
the other person would have when zooming in surely?

Tom

-- 
Tom Hughes (tom at compton.nu)
http://www.compton.nu/




More information about the dev mailing list