Skip to content

Commit

Permalink
Add option for changing the crossOrigin property of image requests in…
Browse files Browse the repository at this point in the history
… TiledImageLayer #76 (#268)
  • Loading branch information
AkeluX authored and Beak-man committed Nov 8, 2017
1 parent 44b7766 commit e5660f2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/layer/TiledImageLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@ define([
*/
this.detailControl = 1.75;

/**
* Indicates whether credentials are sent when requesting images from a different origin.
*
* Allowed values are anonymous and use-credentials.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-crossorigin
* @type {string}
* @default anonymous
*/
this.crossOrigin = 'anonymous';

/* Intentionally not documented.
* Indicates the time at which this layer's imagery expire. Expired images are re-retrieved
* when the current time exceeds the specified expiry time. If null, images do not expire.
Expand Down Expand Up @@ -477,7 +488,7 @@ define([
};

this.currentRetrievals.push(imagePath);
image.crossOrigin = 'anonymous';
image.crossOrigin = this.crossOrigin;
image.src = url;
}
};
Expand Down

0 comments on commit e5660f2

Please sign in to comment.