Merge pull request #6659 from openlayers/icon_examples_crossOrigin

Add crossOrigin to examples using ol.style.Icon
This commit is contained in:
Frédéric Junod
2017-04-01 06:10:04 +02:00
committed by GitHub
3 changed files with 5 additions and 0 deletions
+3
View File
@@ -26,6 +26,7 @@ var madrid = new ol.Feature({
rome.setStyle(new ol.style.Style({ rome.setStyle(new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({ image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
color: '#8959A8', color: '#8959A8',
crossOrigin: 'anonymous',
src: 'data/dot.png' src: 'data/dot.png'
})) }))
})); }));
@@ -33,6 +34,7 @@ rome.setStyle(new ol.style.Style({
london.setStyle(new ol.style.Style({ london.setStyle(new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({ image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
color: '#4271AE', color: '#4271AE',
crossOrigin: 'anonymous',
src: 'data/dot.png' src: 'data/dot.png'
})) }))
})); }));
@@ -40,6 +42,7 @@ london.setStyle(new ol.style.Style({
madrid.setStyle(new ol.style.Style({ madrid.setStyle(new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({ image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
color: [113, 140, 0], color: [113, 140, 0],
crossOrigin: 'anonymous',
src: 'data/dot.png' src: 'data/dot.png'
})) }))
})); }));
+1
View File
@@ -15,6 +15,7 @@ function createStyle(src, img) {
return new ol.style.Style({ return new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({ image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 0.96], anchor: [0.5, 0.96],
crossOrigin: 'anonymous',
src: src, src: src,
img: img, img: img,
imgSize: img ? [img.width, img.height] : undefined imgSize: img ? [img.width, img.height] : undefined
+1
View File
@@ -51,6 +51,7 @@ for (i = 0; i < iconCount; ++i) {
rotation: info.rotation, rotation: info.rotation,
scale: info.scale, scale: info.scale,
size: info.size, size: info.size,
crossOrigin: 'anonymous',
src: 'data/Butterfly.png' src: 'data/Butterfly.png'
}); });
} }