Update GPX Viewer

My GPX-Viewer had a problem in Firefox: For some visitors OpenStreeMap maps would be displayed with pink tiles and not the real map tiles. This is a known problem which occurs when the server being used to load the tiles does not send an appriopriate HTTP header for CORS.

I don’t have control over these servers – but fortunately there is a workaround in the OpenLayers library which I use, so the “pink tile” problem with OpenStreetMap maps in Firefox should not occur any longer.

The solution was to add the option crossOriginKeyword: null when adding the map layers:

map.addLayer(new OpenLayers.Layer.OSM.Mapnik(
        "OpenStreetMap Mapnik",
        { tileOptions : { crossOriginKeyword: null } } )

Also see http://dev.openlayers.org/apidocs/files/OpenLayers/Layer/OSM-js.html#OpenLayers.Layer.OSM.tileOptions.

Leave a public comment

Your email address will not be published. This is not a contact form! If you want to send me a personal message, use my e-mail address in the imprint.

You can use the following HTML tags in the comment:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>