[OSM-dev] [OSM-talk] OSM home page map with permlink or

John McKerrell john at mckerrell.net
Sun Oct 21 13:29:11 BST 2007


On 21 Oct 2007, at 12:24, Tom Hughes wrote:

>
> You misunderstand entirely I'm afraid - the parsing is largely done
> by rails on the server which then generates javascript that assigns
> values to javascript variables which are then used in the OL setup
> code. So you get things like this in the template on the server:
>
>   var lat = params[:lat]
>
> which is taking a valud from the params array filled in by rails when
> it parsed the request URL.

It would be fairly simple to, in the JS, follow that by a bit of code  
that says "but if window.location.hash has a useful value, use that  
instead".

That said though, Safari can be annoying in how it handles this - the  
activity spinner keeps going constantly and you can have problems  
using innerHTML on elements. So for that browser at least I'd say to  
disable it (disable setting location.hash, no reason to stop parsing  
it).

John




More information about the dev mailing list