Correct type for Icon options
This commit is contained in:
@@ -157,7 +157,7 @@ const map = new Map({
|
|||||||
features: [pointFeature, lineFeature, polygonFeature]
|
features: [pointFeature, lineFeature, polygonFeature]
|
||||||
}),
|
}),
|
||||||
style: new Style({
|
style: new Style({
|
||||||
image: new Icon(/** @type {olx.style.IconOptions} */ ({
|
image: new Icon(/** @type {module:ol/style/Icon~Options} */ ({
|
||||||
anchor: [0.5, 46],
|
anchor: [0.5, 46],
|
||||||
anchorXUnits: 'fraction',
|
anchorXUnits: 'fraction',
|
||||||
anchorYUnits: 'pixels',
|
anchorYUnits: 'pixels',
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const madrid = new Feature({
|
|||||||
});
|
});
|
||||||
|
|
||||||
rome.setStyle(new Style({
|
rome.setStyle(new Style({
|
||||||
image: new Icon(/** @type {olx.style.IconOptions} */ ({
|
image: new Icon(/** @type {module:ol/style/Icon~Options} */ ({
|
||||||
color: '#8959A8',
|
color: '#8959A8',
|
||||||
crossOrigin: 'anonymous',
|
crossOrigin: 'anonymous',
|
||||||
src: 'data/dot.png'
|
src: 'data/dot.png'
|
||||||
@@ -32,7 +32,7 @@ rome.setStyle(new Style({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
london.setStyle(new Style({
|
london.setStyle(new Style({
|
||||||
image: new Icon(/** @type {olx.style.IconOptions} */ ({
|
image: new Icon(/** @type {module:ol/style/Icon~Options} */ ({
|
||||||
color: '#4271AE',
|
color: '#4271AE',
|
||||||
crossOrigin: 'anonymous',
|
crossOrigin: 'anonymous',
|
||||||
src: 'data/dot.png'
|
src: 'data/dot.png'
|
||||||
@@ -40,7 +40,7 @@ london.setStyle(new Style({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
madrid.setStyle(new Style({
|
madrid.setStyle(new Style({
|
||||||
image: new Icon(/** @type {olx.style.IconOptions} */ ({
|
image: new Icon(/** @type {module:ol/style/Icon~Options} */ ({
|
||||||
color: [113, 140, 0],
|
color: [113, 140, 0],
|
||||||
crossOrigin: 'anonymous',
|
crossOrigin: 'anonymous',
|
||||||
src: 'data/dot.png'
|
src: 'data/dot.png'
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import Style from '../src/ol/style/Style.js';
|
|||||||
|
|
||||||
function createStyle(src, img) {
|
function createStyle(src, img) {
|
||||||
return new Style({
|
return new Style({
|
||||||
image: new Icon(/** @type {olx.style.IconOptions} */ ({
|
image: new Icon(/** @type {module:ol/style/Icon~Options} */ ({
|
||||||
anchor: [0.5, 0.96],
|
anchor: [0.5, 0.96],
|
||||||
crossOrigin: 'anonymous',
|
crossOrigin: 'anonymous',
|
||||||
src: src,
|
src: src,
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const iconFeature = new Feature({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const iconStyle = new Style({
|
const iconStyle = new Style({
|
||||||
image: new Icon(/** @type {olx.style.IconOptions} */ ({
|
image: new Icon(/** @type {module:ol/style/Icon~Options} */ ({
|
||||||
anchor: [0.5, 46],
|
anchor: [0.5, 46],
|
||||||
anchorXUnits: 'fraction',
|
anchorXUnits: 'fraction',
|
||||||
anchorYUnits: 'pixels',
|
anchorYUnits: 'pixels',
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ describe('ol.rendering.style.Icon', function() {
|
|||||||
img.onload = function() {
|
img.onload = function() {
|
||||||
imgInfo.img = img;
|
imgInfo.img = img;
|
||||||
feature.setStyle(new Style({
|
feature.setStyle(new Style({
|
||||||
image: new Icon(/** @type {olx.style.IconOptions} */ (imgInfo))
|
image: new Icon(/** @type {module:ol/style/Icon~Options} */ (imgInfo))
|
||||||
}));
|
}));
|
||||||
vectorSource.addFeature(feature);
|
vectorSource.addFeature(feature);
|
||||||
callback();
|
callback();
|
||||||
|
|||||||
Reference in New Issue
Block a user