[OpenLayers-Dev] [OpenLayers-Trac] [OpenLayers] #758: BaseLayer switching in Opera, Safari

Christopher Schmidt crschmidt at metacarta.com
Sun Oct 14 11:02:39 EDT 2007


On Sun, Oct 14, 2007 at 02:12:12PM -0000, OpenLayers wrote:
> Ticket URL: <http://trac.openlayers.org/ticket/758#comment:6>
> #758: BaseLayer switching in Opera, Safari
> Comment:
> 
>  For Safari, this is:
> 
>  Bug 9582: img.onload event ONLY fires when .src changes
>  http://bugs.webkit.org/show_bug.cgi?id=9582
> 
>  A workaround is to make layer.getUrl() return a URL with additional
>  parameters, so that the src is always changed, but that's kind of ugly.
> 
>  Attaching a patch with a second workaround, which sets the Tile URL to
>  blank.gif in clear() (which will then be reset shortly after in draw()).

I'd love to have some feedback on this. It's just a workaround for
Safari. An alternative, more invasive, workaround would be to check in
moveTo if the URL has changed, and if it hasn't, not call display:none
in the first place. That would require overriding moveTo to actually
call getURL on the tile before setting display:none, but might end up
being a better solution, since we don't have to 'flicker' the tiles in
that case. 

I just tried to hack that together, and failed, but I spent from 1am -> 
5am finding the bug and talking it over with webkit devs, so I'm
probably not really well qualified. I would really like to get this
fixed in 2.6, now that I know it's fixable, though. 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list