diff --git a/src/ol/style/literal.js b/src/ol/style/literal.js index 3fc310126a..6f73f338aa 100644 --- a/src/ol/style/literal.js +++ b/src/ol/style/literal.js @@ -32,6 +32,7 @@ export const SymbolType = { * @property {ExpressionValue|Array} size Size, mandatory. * @property {SymbolType} symbolType Symbol type to use, either a regular shape or an image. * @property {string} [src] Path to the image to be used for the symbol. Only required with `symbolType: 'image'`. + * @property {string} [crossOrigin='anonymous'] The `crossOrigin` attribute for loading `src`. * @property {import("../color.js").Color|Array|string} [color='#FFFFFF'] Color used for the representation (either fill, line or symbol). * @property {ExpressionValue} [opacity=1] Opacity. * @property {ExpressionValue} [rotation=0] Symbol rotation in radians. diff --git a/src/ol/webgl/ShaderBuilder.js b/src/ol/webgl/ShaderBuilder.js index 5c9ae52b65..60913ac8f0 100644 --- a/src/ol/webgl/ShaderBuilder.js +++ b/src/ol/webgl/ShaderBuilder.js @@ -548,6 +548,8 @@ export function parseLiteralStyle(style) { if (symbStyle.symbolType === 'image' && symbStyle.src) { const texture = new Image(); + texture.crossOrigin = + symbStyle.crossOrigin === undefined ? 'anonymous' : symbStyle.crossOrigin; texture.src = symbStyle.src; builder .addUniform('sampler2D u_texture')