[OpenLayers-Users] Pink tiles displayed with firefox 11 even if
tiles are correctly fetched from server. Ok with chromium or older
firefox.
Eric Lemoine
eric.lemoine at camptocamp.com
Thu Mar 29 16:35:08 EDT 2012
On Thu, Mar 29, 2012 at 8:39 PM, Arnd Wippermann <arnd.wippermann at web.de> wrote:
> 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,
The discussion <http://lists.osgeo.org/pipermail/openlayers-dev/2012-February/008392.html>
might also help understand the issue.
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
More information about the Users
mailing list