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] features: [pointFeature, lineFeature, polygonFeature]
}), }),
style: new Style({ style: new Style({
image: new Icon(/** @type {module:ol/style/Icon~Options} */ ({ image: new Icon({
anchor: [0.5, 46], anchor: [0.5, 46],
anchorXUnits: 'fraction', anchorXUnits: 'fraction',
anchorYUnits: 'pixels', anchorYUnits: 'pixels',
opacity: 0.95, opacity: 0.95,
src: 'data/icon.png' src: 'data/icon.png'
})), }),
stroke: new Stroke({ stroke: new Stroke({
width: 3, width: 3,
color: [255, 0, 0, 1] color: [255, 0, 0, 1]

View File

@@ -36,7 +36,7 @@ map.addOverlay(marker);
// LineString to store the different geolocation positions. This LineString // LineString to store the different geolocation positions. This LineString
// is time aware. // is time aware.
// The Z dimension is actually used to store the rotation (heading). // 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 // Geolocation Control
const geolocation = new Geolocation({ const geolocation = new Geolocation({

View File

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

View File

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

View File

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

View File

@@ -109,7 +109,7 @@ fetch(url).then(function(response) {
options.projection = 'EPSG:3413'; options.projection = 'EPSG:3413';
options.wrapX = false; options.wrapX = false;
layers['wmts3413'] = new TileLayer({ 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; options.tilePixelRatio = tilePixelRatio;
map.addLayer(new TileLayer({ 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({ new TileLayer({
opacity: 1, opacity: 1,
source: new WMTS(/** @type {!module:ol/source/WMTS~Options} */ (options)) source: new WMTS(options)
}) })
], ],
target: 'map', target: 'map',