Remove unneeded type cast from examples

This commit is contained in:
Frederic Junod
2017-11-22 10:44:37 +01:00
parent 5d71dde8dd
commit 8aa591c04d
31 changed files with 63 additions and 64 deletions
+2 -2
View File
@@ -13,9 +13,9 @@ var map = new ol.Map({
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: [0, 0], center: [0, 0],
+2 -2
View File
@@ -22,9 +22,9 @@ var map = new ol.Map({
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: ol.proj.transform( center: ol.proj.transform(
+2 -2
View File
@@ -51,9 +51,9 @@ var map = new ol.Map({
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: view view: view
}); });
+2 -2
View File
@@ -59,9 +59,9 @@ ol.inherits(app.RotateNorthControl, ol.control.Control);
var map = new ol.Map({ var map = new ol.Map({
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}).extend([ }).extend([
new app.RotateNorthControl() new app.RotateNorthControl()
]), ]),
+1 -2
View File
@@ -92,8 +92,7 @@ app.Drag.prototype.handleDragEvent = function(evt) {
var deltaX = evt.coordinate[0] - this.coordinate_[0]; var deltaX = evt.coordinate[0] - this.coordinate_[0];
var deltaY = evt.coordinate[1] - this.coordinate_[1]; var deltaY = evt.coordinate[1] - this.coordinate_[1];
var geometry = /** @type {ol.geom.SimpleGeometry} */ var geometry = this.feature_.getGeometry();
(this.feature_.getGeometry());
geometry.translate(deltaX, deltaY); geometry.translate(deltaX, deltaY);
this.coordinate_[0] = evt.coordinate[0]; this.coordinate_[0] = evt.coordinate[0];
+2 -2
View File
@@ -22,9 +22,9 @@ var map = new ol.Map({
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: view view: view
}); });
+2 -2
View File
@@ -23,9 +23,9 @@ var map = new ol.Map({
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: [0, 0], center: [0, 0],
+2 -2
View File
@@ -30,9 +30,9 @@ var map = new ol.Map({
layers: [raster, vector], layers: [raster, vector],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: [0, 0], center: [0, 0],
+2 -2
View File
@@ -24,9 +24,9 @@ var map = new ol.Map({
}) })
], ],
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
target: 'map', target: 'map',
view: new ol.View({ view: new ol.View({
+2 -2
View File
@@ -180,9 +180,9 @@ var map = new ol.Map({
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: [0, 0], center: [0, 0],
+4 -4
View File
@@ -23,9 +23,9 @@ var map = new ol.Map({
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: view view: view
}); });
@@ -46,14 +46,14 @@ var positions = new ol.geom.LineString([],
/** @type {ol.geom.GeometryLayout} */ ('XYZM')); /** @type {ol.geom.GeometryLayout} */ ('XYZM'));
// Geolocation Control // Geolocation Control
var geolocation = new ol.Geolocation(/** @type {olx.GeolocationOptions} */ ({ var geolocation = new ol.Geolocation({
projection: view.getProjection(), projection: view.getProjection(),
trackingOptions: { trackingOptions: {
maximumAge: 10000, maximumAge: 10000,
enableHighAccuracy: true, enableHighAccuracy: true,
timeout: 600000 timeout: 600000
} }
})); });
var deltaMean = 500; // the geolocation sampling period mean in ms var deltaMean = 500; // the geolocation sampling period mean in ms
+2 -2
View File
@@ -26,9 +26,9 @@ var map = new ol.Map({
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: view view: view
}); });
+2 -2
View File
@@ -99,9 +99,9 @@ var map = new ol.Map({
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: [703365.7089403362, 5714629.865071137], center: [703365.7089403362, 5714629.865071137],
+2 -2
View File
@@ -22,9 +22,9 @@ if (!ol.has.WEBGL) {
renderer: /** @type {Array<ol.renderer.Type>} */ (['webgl', 'canvas']), renderer: /** @type {Array<ol.renderer.Type>} */ (['webgl', 'canvas']),
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: [0, 0], center: [0, 0],
+2 -2
View File
@@ -12,9 +12,9 @@ var map = new ol.Map({
layers: [osm], layers: [osm],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: [0, 0], center: [0, 0],
+2 -2
View File
@@ -19,9 +19,9 @@ var map = new ol.Map({
layers: [osm, bing], layers: [osm, bing],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: [0, 0], center: [0, 0],
+2 -2
View File
@@ -35,9 +35,9 @@ var map = new ol.Map({
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
maxZoom: 18, maxZoom: 18,
+2 -2
View File
@@ -27,9 +27,9 @@ var map = new ol.Map({
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: [653600, 5723680], center: [653600, 5723680],
+2 -2
View File
@@ -18,9 +18,9 @@ var mousePositionControl = new ol.control.MousePosition({
var map = new ol.Map({ var map = new ol.Map({
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}).extend([mousePositionControl]), }).extend([mousePositionControl]),
layers: [ layers: [
new ol.layer.Tile({ new ol.layer.Tile({
+2 -2
View File
@@ -15,9 +15,9 @@ var map = new ol.Map({
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: [0, 0], center: [0, 0],
+2 -2
View File
@@ -8,9 +8,9 @@ goog.require('ol.source.OSM');
var map = new ol.Map({ var map = new ol.Map({
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}).extend([ }).extend([
new ol.control.ZoomToExtent({ new ol.control.ZoomToExtent({
extent: [ extent: [
+2 -2
View File
@@ -30,9 +30,9 @@ var map = new ol.Map({
}) })
], ],
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
target: 'map', target: 'map',
view: new ol.View({ view: new ol.View({
+2 -2
View File
@@ -18,13 +18,13 @@ var closer = document.getElementById('popup-closer');
/** /**
* Create an overlay to anchor the popup to the map. * Create an overlay to anchor the popup to the map.
*/ */
var overlay = new ol.Overlay(/** @type {olx.OverlayOptions} */ ({ var overlay = new ol.Overlay({
element: container, element: container,
autoPan: true, autoPan: true,
autoPanAnimation: { autoPanAnimation: {
duration: 250 duration: 250
} }
})); });
/** /**
+2 -2
View File
@@ -13,9 +13,9 @@ var map = new ol.Map({
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: [14200000, 4130000], center: [14200000, 4130000],
+2 -2
View File
@@ -10,9 +10,9 @@ var scaleLineControl = new ol.control.ScaleLine();
var map = new ol.Map({ var map = new ol.Map({
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}).extend([ }).extend([
scaleLineControl scaleLineControl
]), ]),
+2 -2
View File
@@ -12,9 +12,9 @@ var map = new ol.Map({
}) })
], ],
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: [0, 0], center: [0, 0],
+2 -2
View File
@@ -127,9 +127,9 @@ map = new ol.Map({
layers: [raster, vector], layers: [raster, vector],
target: document.getElementById('map'), target: document.getElementById('map'),
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: [739218, 5906096], center: [739218, 5906096],
+2 -2
View File
@@ -41,7 +41,7 @@ var layers = [
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale', 'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
'FORMAT': 'image/jpeg' 'FORMAT': 'image/jpeg'
}, },
serverType: /** @type {ol.source.WMSServerType} */ ('mapserver') serverType: 'mapserver'
}) })
}), }),
new ol.layer.Image({ new ol.layer.Image({
@@ -52,7 +52,7 @@ var layers = [
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' + attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">National parks / geo.admin.ch</a>', 'en/home.html">National parks / geo.admin.ch</a>',
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'}, params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
serverType: /** @type {ol.source.WMSServerType} */ ('mapserver') serverType: 'mapserver'
}) })
}) })
]; ];
+2 -2
View File
@@ -23,11 +23,11 @@ var layers = [
}), }),
new ol.layer.Tile({ new ol.layer.Tile({
extent: extent, extent: extent,
source: new ol.source.TileWMS(/** @type {olx.source.TileWMSOptions} */ ({ source: new ol.source.TileWMS({
attributions: ['Iowa State University'], attributions: ['Iowa State University'],
url: 'https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r-t.cgi', url: 'https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r-t.cgi',
params: {'LAYERS': 'nexrad-n0r-wmst'} params: {'LAYERS': 'nexrad-n0r-wmst'}
})) })
}) })
]; ];
var map = new ol.Map({ var map = new ol.Map({
+2 -2
View File
@@ -11,9 +11,9 @@ goog.require('ol.tilegrid.WMTS');
var map = new ol.Map({ var map = new ol.Map({
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
zoom: 5, zoom: 5,
+2 -2
View File
@@ -49,9 +49,9 @@ var map = new ol.Map({
], ],
target: 'map', target: 'map',
controls: ol.control.defaults({ controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ attributionOptions: {
collapsible: false collapsible: false
}) }
}), }),
view: new ol.View({ view: new ol.View({
center: [-11158582, 4813697], center: [-11158582, 4813697],