Skip to content

Commit

Permalink
Set crossOrigin tags everywhere to. Fixes wegue-oss#52 again.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevage committed Apr 30, 2020
1 parent ffc3363 commit 558b6d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/factory/Layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export const LayerFactory = {
'TILED': lConf.tiled
},
serverType: lConf.serverType,
attributions: lConf.attributions
attributions: lConf.attributions,
crossOrigin: 'Anonymous'
})
});

Expand All @@ -106,6 +107,7 @@ export const LayerFactory = {
opacity: lConf.opacity,
source: new XyzSource({
url: lConf.url,
crossOrigin: 'Anonymous',
attributions: lConf.attributions
})
});
Expand All @@ -127,7 +129,7 @@ export const LayerFactory = {
selectable: lConf.selectable || false,
visible: lConf.visible,
opacity: lConf.opacity,
source: new OsmSource()
source: new OsmSource({ crossOrigin: 'Anonymous' })
});

return layer;
Expand Down
6 changes: 4 additions & 2 deletions src/factory/OlStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,17 @@ export const OlStyleFactory = {
imgSize: [32, 32],
anchor: [anchorX, anchorY - 0.2],
anchorXUnits: styleConf.iconAnchorXUnits,
anchorYUnits: styleConf.iconAnchorYUnits
anchorYUnits: styleConf.iconAnchorYUnits,
crossOrigin: 'Anonymous'
}))
});
const inner = new Style({
image: new IconStyle(({
src: styleConf.iconUrl,
anchor: styleConf.iconAnchor,
anchorXUnits: styleConf.iconAnchorXUnits,
anchorYUnits: styleConf.iconAnchorYUnits
anchorYUnits: styleConf.iconAnchorYUnits,
crossOrigin: 'Anonymous'
}))
});
pointStyle = [outer, inner];
Expand Down

0 comments on commit 558b6d7

Please sign in to comment.