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

View File

@@ -13,9 +13,9 @@ var map = new ol.Map({
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: [0, 0],

View File

@@ -22,9 +22,9 @@ var map = new ol.Map({
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: ol.proj.transform(

View File

@@ -51,9 +51,9 @@ var map = new ol.Map({
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: view
});

View File

@@ -59,9 +59,9 @@ ol.inherits(app.RotateNorthControl, ol.control.Control);
var map = new ol.Map({
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}).extend([
new app.RotateNorthControl()
]),

View File

@@ -92,8 +92,7 @@ app.Drag.prototype.handleDragEvent = function(evt) {
var deltaX = evt.coordinate[0] - this.coordinate_[0];
var deltaY = evt.coordinate[1] - this.coordinate_[1];
var geometry = /** @type {ol.geom.SimpleGeometry} */
(this.feature_.getGeometry());
var geometry = this.feature_.getGeometry();
geometry.translate(deltaX, deltaY);
this.coordinate_[0] = evt.coordinate[0];

View File

@@ -22,9 +22,9 @@ var map = new ol.Map({
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: view
});

View File

@@ -23,9 +23,9 @@ var map = new ol.Map({
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: [0, 0],

View File

@@ -30,9 +30,9 @@ var map = new ol.Map({
layers: [raster, vector],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: [0, 0],

View File

@@ -24,9 +24,9 @@ var map = new ol.Map({
})
],
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
target: 'map',
view: new ol.View({

View File

@@ -180,9 +180,9 @@ var map = new ol.Map({
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: [0, 0],

View File

@@ -23,9 +23,9 @@ var map = new ol.Map({
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: view
});
@@ -46,14 +46,14 @@ var positions = new ol.geom.LineString([],
/** @type {ol.geom.GeometryLayout} */ ('XYZM'));
// Geolocation Control
var geolocation = new ol.Geolocation(/** @type {olx.GeolocationOptions} */ ({
var geolocation = new ol.Geolocation({
projection: view.getProjection(),
trackingOptions: {
maximumAge: 10000,
enableHighAccuracy: true,
timeout: 600000
}
}));
});
var deltaMean = 500; // the geolocation sampling period mean in ms

View File

@@ -26,9 +26,9 @@ var map = new ol.Map({
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: view
});

View File

@@ -99,9 +99,9 @@ var map = new ol.Map({
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: [703365.7089403362, 5714629.865071137],

View File

@@ -22,9 +22,9 @@ if (!ol.has.WEBGL) {
renderer: /** @type {Array<ol.renderer.Type>} */ (['webgl', 'canvas']),
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: [0, 0],

View File

@@ -12,9 +12,9 @@ var map = new ol.Map({
layers: [osm],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: [0, 0],

View File

@@ -19,9 +19,9 @@ var map = new ol.Map({
layers: [osm, bing],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: [0, 0],

View File

@@ -35,9 +35,9 @@ var map = new ol.Map({
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
maxZoom: 18,

View File

@@ -27,9 +27,9 @@ var map = new ol.Map({
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: [653600, 5723680],

View File

@@ -18,9 +18,9 @@ var mousePositionControl = new ol.control.MousePosition({
var map = new ol.Map({
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}).extend([mousePositionControl]),
layers: [
new ol.layer.Tile({

View File

@@ -15,9 +15,9 @@ var map = new ol.Map({
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: [0, 0],

View File

@@ -8,9 +8,9 @@ goog.require('ol.source.OSM');
var map = new ol.Map({
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}).extend([
new ol.control.ZoomToExtent({
extent: [

View File

@@ -30,9 +30,9 @@ var map = new ol.Map({
})
],
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
target: 'map',
view: new ol.View({

View File

@@ -18,13 +18,13 @@ var closer = document.getElementById('popup-closer');
/**
* 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,
autoPan: true,
autoPanAnimation: {
duration: 250
}
}));
});
/**

View File

@@ -13,9 +13,9 @@ var map = new ol.Map({
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: [14200000, 4130000],

View File

@@ -10,9 +10,9 @@ var scaleLineControl = new ol.control.ScaleLine();
var map = new ol.Map({
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}).extend([
scaleLineControl
]),

View File

@@ -12,9 +12,9 @@ var map = new ol.Map({
})
],
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: [0, 0],

View File

@@ -127,9 +127,9 @@ map = new ol.Map({
layers: [raster, vector],
target: document.getElementById('map'),
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: [739218, 5906096],

View File

@@ -41,7 +41,7 @@ var layers = [
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
'FORMAT': 'image/jpeg'
},
serverType: /** @type {ol.source.WMSServerType} */ ('mapserver')
serverType: 'mapserver'
})
}),
new ol.layer.Image({
@@ -52,7 +52,7 @@ var layers = [
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">National parks / geo.admin.ch</a>',
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
serverType: /** @type {ol.source.WMSServerType} */ ('mapserver')
serverType: 'mapserver'
})
})
];

View File

@@ -23,11 +23,11 @@ var layers = [
}),
new ol.layer.Tile({
extent: extent,
source: new ol.source.TileWMS(/** @type {olx.source.TileWMSOptions} */ ({
source: new ol.source.TileWMS({
attributions: ['Iowa State University'],
url: 'https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r-t.cgi',
params: {'LAYERS': 'nexrad-n0r-wmst'}
}))
})
})
];
var map = new ol.Map({

View File

@@ -11,9 +11,9 @@ goog.require('ol.tilegrid.WMTS');
var map = new ol.Map({
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
zoom: 5,

View File

@@ -49,9 +49,9 @@ var map = new ol.Map({
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
attributionOptions: {
collapsible: false
})
}
}),
view: new ol.View({
center: [-11158582, 4813697],