Remove unnecessary typecasts in examples

This commit is contained in:
Frederic Junod
2015-03-30 10:58:34 +02:00
parent 254039a6ab
commit 778ccd3999
3 changed files with 43 additions and 48 deletions
+39 -44
View File
@@ -15,58 +15,53 @@ var fill = new ol.style.Fill({color: 'red'});
var styles = { var styles = {
'square': [new ol.style.Style({ 'square': [new ol.style.Style({
image: new ol.style.RegularShape( image: new ol.style.RegularShape({
/** @type {olx.style.RegularShapeOptions} */({ fill: fill,
fill: fill, stroke: stroke,
stroke: stroke, points: 4,
points: 4, radius: 10,
radius: 10, angle: Math.PI / 4
angle: Math.PI / 4 })
}))
})], })],
'triangle': [new ol.style.Style({ 'triangle': [new ol.style.Style({
image: new ol.style.RegularShape( image: new ol.style.RegularShape({
/** @type {olx.style.RegularShapeOptions} */({ fill: fill,
fill: fill, stroke: stroke,
stroke: stroke, points: 3,
points: 3, radius: 10,
radius: 10, rotation: Math.PI / 4,
rotation: Math.PI / 4, angle: 0
angle: 0 })
}))
})], })],
'star': [new ol.style.Style({ 'star': [new ol.style.Style({
image: new ol.style.RegularShape( image: new ol.style.RegularShape({
/** @type {olx.style.RegularShapeOptions} */({ fill: fill,
fill: fill, stroke: stroke,
stroke: stroke, points: 5,
points: 5, radius: 10,
radius: 10, radius2: 4,
radius2: 4, angle: 0
angle: 0 })
}))
})], })],
'cross': [new ol.style.Style({ 'cross': [new ol.style.Style({
image: new ol.style.RegularShape( image: new ol.style.RegularShape({
/** @type {olx.style.RegularShapeOptions} */({ fill: fill,
fill: fill, stroke: stroke,
stroke: stroke, points: 4,
points: 4, radius: 10,
radius: 10, radius2: 0,
radius2: 0, angle: 0
angle: 0 })
}))
})], })],
'x': [new ol.style.Style({ 'x': [new ol.style.Style({
image: new ol.style.RegularShape( image: new ol.style.RegularShape({
/** @type {olx.style.RegularShapeOptions} */({ fill: fill,
fill: fill, stroke: stroke,
stroke: stroke, points: 4,
points: 4, radius: 10,
radius: 10, radius2: 0,
radius2: 0, angle: Math.PI / 4
angle: Math.PI / 4 })
}))
})] })]
}; };
+2 -2
View File
@@ -10,12 +10,12 @@ var layers = [
source: new ol.source.MapQuest({layer: 'sat'}) source: new ol.source.MapQuest({layer: 'sat'})
}), }),
new ol.layer.Tile({ new ol.layer.Tile({
source: new ol.source.TileWMS(/** @type {olx.source.TileWMSOptions} */ ({ source: new ol.source.TileWMS({
url: 'http://demo.boundlessgeo.com/geoserver/ne/wms', url: 'http://demo.boundlessgeo.com/geoserver/ne/wms',
params: {'LAYERS': 'ne:ne_10m_admin_0_countries', 'TILED': true}, params: {'LAYERS': 'ne:ne_10m_admin_0_countries', 'TILED': true},
serverType: 'geoserver', serverType: 'geoserver',
wrapX: true wrapX: true
})) })
}) })
]; ];
var map = new ol.Map({ var map = new ol.Map({
+2 -2
View File
@@ -11,11 +11,11 @@ var layers = [
}), }),
new ol.layer.Tile({ new ol.layer.Tile({
extent: [-13884991, 2870341, -7455066, 6338219], extent: [-13884991, 2870341, -7455066, 6338219],
source: new ol.source.TileWMS(/** @type {olx.source.TileWMSOptions} */ ({ source: new ol.source.TileWMS({
url: 'http://demo.boundlessgeo.com/geoserver/wms', url: 'http://demo.boundlessgeo.com/geoserver/wms',
params: {'LAYERS': 'topp:states', 'TILED': true}, params: {'LAYERS': 'topp:states', 'TILED': true},
serverType: 'geoserver' serverType: 'geoserver'
})) })
}) })
]; ];
var map = new ol.Map({ var map = new ol.Map({