Remove unneeded type cast in examples

This commit is contained in:
Frederic Junod
2018-12-07 09:39:04 +01:00
parent 4ce5379a4b
commit cd3e65e3df
8 changed files with 16 additions and 16 deletions

View File

@@ -141,13 +141,13 @@ const map = new Map({
features: [pointFeature, lineFeature, polygonFeature]
}),
style: new Style({
image: new Icon(/** @type {module:ol/style/Icon~Options} */ ({
image: new Icon({
anchor: [0.5, 46],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
opacity: 0.95,
src: 'data/icon.png'
})),
}),
stroke: new Stroke({
width: 3,
color: [255, 0, 0, 1]

View File

@@ -36,7 +36,7 @@ map.addOverlay(marker);
// LineString to store the different geolocation positions. This LineString
// is time aware.
// The Z dimension is actually used to store the rotation (heading).
const positions = new LineString([], /** @type {module:ol/geom/GeometryLayout} */ ('XYZM'));
const positions = new LineString([], 'XYZM');
// Geolocation Control
const geolocation = new Geolocation({

View File

@@ -22,27 +22,27 @@ const madrid = new Feature({
});
rome.setStyle(new Style({
image: new Icon(/** @type {module:ol/style/Icon~Options} */ ({
image: new Icon({
color: '#8959A8',
crossOrigin: 'anonymous',
src: 'data/dot.png'
}))
})
}));
london.setStyle(new Style({
image: new Icon(/** @type {module:ol/style/Icon~Options} */ ({
image: new Icon({
color: '#4271AE',
crossOrigin: 'anonymous',
src: 'data/dot.png'
}))
})
}));
madrid.setStyle(new Style({
image: new Icon(/** @type {module:ol/style/Icon~Options} */ ({
image: new Icon({
color: [113, 140, 0],
crossOrigin: 'anonymous',
src: 'data/dot.png'
}))
})
}));

View File

@@ -11,13 +11,13 @@ import {Icon, Style} from '../src/ol/style.js';
function createStyle(src, img) {
return new Style({
image: new Icon(/** @type {module:ol/style/Icon~Options} */ ({
image: new Icon({
anchor: [0.5, 0.96],
crossOrigin: 'anonymous',
src: src,
img: img,
imgSize: img ? [img.width, img.height] : undefined
}))
})
});
}

View File

@@ -17,12 +17,12 @@ const iconFeature = new Feature({
});
const iconStyle = new Style({
image: new Icon(/** @type {module:ol/style/Icon~Options} */ ({
image: new Icon({
anchor: [0.5, 46],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
src: 'data/icon.png'
}))
})
});
iconFeature.setStyle(iconStyle);

View File

@@ -109,7 +109,7 @@ fetch(url).then(function(response) {
options.projection = 'EPSG:3413';
options.wrapX = false;
layers['wmts3413'] = new TileLayer({
source: new WMTS(/** @type {!module:ol/source/WMTS~Options} */ (options))
source: new WMTS(options)
});
});

View File

@@ -34,6 +34,6 @@ fetch(capabilitiesUrl).then(function(response) {
});
options.tilePixelRatio = tilePixelRatio;
map.addLayer(new TileLayer({
source: new WMTS(/** @type {!module:ol/source/WMTS~Options} */ (options))
source: new WMTS(options)
}));
});

View File

@@ -25,7 +25,7 @@ fetch('data/WMTSCapabilities.xml').then(function(response) {
}),
new TileLayer({
opacity: 1,
source: new WMTS(/** @type {!module:ol/source/WMTS~Options} */ (options))
source: new WMTS(options)
})
],
target: 'map',