Remove unneeded type cast in examples
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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'
|
||||
}))
|
||||
})
|
||||
}));
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
}))
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -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)
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user