AW: [OpenLayers-Users] Pink tiles displayed with firefox 11 even if tiles are correctly fetched from server. Ok with chromium or older firefox.

Arnd Wippermann arnd.wippermann at web.de
Thu Mar 29 14:39:34 EDT 2012


To convince FF11 to display the tiles set tileOptions on the OSM layer: 

lyrOSM = new OpenLayers.Layer.OSM("CycleMap",
    "http://a.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
    {tileOptions : {crossOriginKeyword: null}}
    );

It should solve your problem. 

Perhaps someone can explain, why this is necessary for FF11 
and not for other browsers (bug with FF or incorrect behaviour of the
others).


...\OpenLayers-2.12-rc1\notes\2.12.md

The `OpenLayers.Tile.Image` class now has a method to get a canvas 
context for processing tiles. Since both OSM and Bing set Access-
Control-Allow-Origin headers for their tiles, it is possible to 
manipulate a canvas that these tiles were rendered to even if the 
tiles come from a remote origin. Especially when working with custom 
OSM tilesets from servers that do not send Access-Control-Allow-Origin 
headers, it is now necessary to configure the layer with

    tileOptions: {crossOriginKeyword: null}


...\OpenLayers-2.12-rc1\lib\OpenLayers\Layer\OSM.js

    /** APIProperty: tileOptions
     *  {Object} optional configuration options for <OpenLayers.Tile>
instances
     *  created by this Layer. Default is
     *
     *  (code)
     *  {crossOriginKeyword: 'anonymous'}
     *  (end)
     *
     *  When using OSM tilesets other than the default ones, it may be
     *  necessary to set this to
     *
     *  (code)
     *  {crossOriginKeyword: null}
     *  (end)
     *
     *  if the server does not send Access-Control-Allow-Origin headers.
     */
    tileOptions: null,

Good luck,
Arnd
 

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von Marc
Gesendet: Donnerstag, 29. März 2012 09:50
An: openlayers-users at lists.osgeo.org
Betreff: [OpenLayers-Users] Pink tiles displayed with firefox 11 even if
tiles are correctly fetched from server. Ok with chromium or older firefox.

Hello,

I've been trying to find why my layer is correctly displayed in chromium or
firefox 3.5.16, but not with firefox 11 (pink tiles).

I getting tiles from http://a.tile.opencyclemap.org .

 From what I've read, pink tiles are usually displayed when the tiles can't
be fetched from the server... which is not the case here, as in firebug, I
can't see any error! I can even see the tiles being loaded and can display
the thumbnails... I tried to load the page from a fresh (ie. empty) profile
to avoid any side effect from left-overs... But still no luck.

Is there any known issue with FF 11 ?

You can see the problem here (first, change the layer using the switch on
the right, as by default, it is still using t at h):

  http://airspace.kataplop.net/airspace/amap/

I can't reproduce the problem with dev examples, but none of them are using
OSM (or the few that are are referring to *.tile.openstreetmap.org).

I'm using OL 2.12-rc + some small addition in GPX.js. But to be 100% sure, I
also tried with the version hosted on openlayers.org and the problem is
still here.

Any help/hint/clue is welcome

Thanks!
Marc
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list