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