Cross origin handling to make example work in Firefox

The WMS used in the example does not send CORS headers (I think
not many WMS services do). It seems that the WebGL renderer
needs script access to the image data, so the example only works
with the DOM renderer in Firefox.
This commit is contained in:
ahocevar
2012-10-27 09:16:09 +02:00
parent 433b12c39a
commit b872b5a74f
3 changed files with 5 additions and 3 deletions

View File

@@ -21,13 +21,15 @@ var layers = new ol.Collection([
new ol.layer.TileLayer({
source: new ol.source.TiledWMS({
url: 'http://demo.opengeo.org/geoserver/wms',
crossOrigin: null,
params: {'LAYERS': 'topp:states', 'TILED': true}
})
})
]);
var map = new ol.Map({
center: new ol.Coordinate(-10997148, 4569099),
renderer: ol.RendererHint.DOM,
layers: layers,
target: 'map',
center: new ol.Coordinate(-10997148, 4569099),
zoom: 4
});

View File

@@ -17,7 +17,7 @@ goog.require('ol.tilegrid.TileGrid');
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* params: Object,
* version: (string|undefined),
* crossOrigin: (string|undefined),
* crossOrigin: (null|string|undefined),
* extent: (ol.Extent|undefined),
* tileGrid: (ol.tilegrid.TileGrid|undefined),
* maxZoom: (number|undefined),

View File

@@ -14,7 +14,7 @@ goog.require('ol.tilegrid.TileGrid');
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* crossOrigin: (string|undefined),
* crossOrigin: (null|string|undefined),
* extent: (ol.Extent|undefined),
* projection: (ol.Projection|undefined),
* tileGrid: (ol.tilegrid.TileGrid|undefined),