Compare commits
251 Commits
v3.18.1
...
v3.19.0-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8046a2acc1 | ||
|
|
f8bcd725ad | ||
|
|
0ae73632cc | ||
|
|
1fffd0d749 | ||
|
|
f444800fc6 | ||
|
|
3026fda02b | ||
|
|
d8fbc09326 | ||
|
|
27cdbf9c00 | ||
|
|
5083e7a395 | ||
|
|
b92dc1b55d | ||
|
|
0b1e16bf58 | ||
|
|
66854c0669 | ||
|
|
833247d24e | ||
|
|
78af52d62d | ||
|
|
addc23b20e | ||
|
|
1d43ee38e6 | ||
|
|
d27b057969 | ||
|
|
b20a9ac1e9 | ||
|
|
84c50ca6b2 | ||
|
|
22014f2454 | ||
|
|
ae61fcfb34 | ||
|
|
474e5a0a98 | ||
|
|
8bf2ebb38d | ||
|
|
096506ed37 | ||
|
|
90cfde39b3 | ||
|
|
36aeccdac2 | ||
|
|
a88f150c4b | ||
|
|
d4024846cf | ||
|
|
e9056c9d30 | ||
|
|
76605e232a | ||
|
|
9950e97c54 | ||
|
|
b0a654534c | ||
|
|
e87c198eef | ||
|
|
7d5635092a | ||
|
|
49e2e55063 | ||
|
|
c80918c8d8 | ||
|
|
000207016f | ||
|
|
932269c8b6 | ||
|
|
415105c4db | ||
|
|
d812804b2e | ||
|
|
d108658cff | ||
|
|
97ececb470 | ||
|
|
a4504b0e00 | ||
|
|
175727c782 | ||
|
|
589c6b7ded | ||
|
|
e416a884b7 | ||
|
|
2591f61fd3 | ||
|
|
bdced57162 | ||
|
|
f12a407a7d | ||
|
|
752b4c6247 | ||
|
|
d2291360ba | ||
|
|
7ec100f3f8 | ||
|
|
4864306d0c | ||
|
|
1372f98822 | ||
|
|
057f60e4f1 | ||
|
|
f5d82ff7bd | ||
|
|
dfbeba02c8 | ||
|
|
e48fda6bef | ||
|
|
c8c1578928 | ||
|
|
7392db0f57 | ||
|
|
7b8b300b31 | ||
|
|
bb43a45f91 | ||
|
|
e7bc7121d6 | ||
|
|
430aee95fd | ||
|
|
129757578d | ||
|
|
51776ed79e | ||
|
|
640307d8f1 | ||
|
|
6192234e4e | ||
|
|
ef0300b828 | ||
|
|
c5ba4af2a6 | ||
|
|
2ac33073cf | ||
|
|
37a11c89b9 | ||
|
|
b86a12e121 | ||
|
|
9f32e8d566 | ||
|
|
147f091998 | ||
|
|
a183c66704 | ||
|
|
c561f1587b | ||
|
|
ae16b9ed63 | ||
|
|
f61a43b3c6 | ||
|
|
e7ff7786a6 | ||
|
|
c7e743805b | ||
|
|
46908bad18 | ||
|
|
6c56d34330 | ||
|
|
5f9855bf5a | ||
|
|
09d3028ece | ||
|
|
e5ac575eb3 | ||
|
|
f860c94840 | ||
|
|
c6a9bc66d6 | ||
|
|
c30a97ef59 | ||
|
|
fa40b59c53 | ||
|
|
82d172545c | ||
|
|
3d1b1d5ac5 | ||
|
|
3e4ed489a4 | ||
|
|
9a9b22ec5e | ||
|
|
d35537e975 | ||
|
|
302f37ae7a | ||
|
|
151e9866ea | ||
|
|
cfc1337cde | ||
|
|
d08e9e65b4 | ||
|
|
36b50ab491 | ||
|
|
7ced5e68be | ||
|
|
107dd6a85f | ||
|
|
a40717b7c9 | ||
|
|
14c9212992 | ||
|
|
dfa0c00810 | ||
|
|
6c7b395024 | ||
|
|
ac26a2cfcd | ||
|
|
d55e4cd028 | ||
|
|
db2b8666b6 | ||
|
|
f6daa99082 | ||
|
|
7135cec0fd | ||
|
|
86c1513062 | ||
|
|
00c62f4db7 | ||
|
|
860aa9ff46 | ||
|
|
d06b5dc818 | ||
|
|
df6eee5d79 | ||
|
|
ed4401e15e | ||
|
|
cd7bc2e4bf | ||
|
|
d863cff28d | ||
|
|
6c7f50a38e | ||
|
|
1deedd5b7a | ||
|
|
6bb3301b7d | ||
|
|
a3a2e82696 | ||
|
|
c4ea5e60c2 | ||
|
|
956aed7eb4 | ||
|
|
f4b40ab28e | ||
|
|
ae41b83a78 | ||
|
|
9b61e8f44c | ||
|
|
8af5dd7157 | ||
|
|
64e44009e0 | ||
|
|
ed17cbc6f0 | ||
|
|
69fc9edb4d | ||
|
|
9bf524a288 | ||
|
|
98aba50735 | ||
|
|
02c1e78412 | ||
|
|
5afd5c838e | ||
|
|
36281373b7 | ||
|
|
58e4bad459 | ||
|
|
794abed395 | ||
|
|
0586a3d98a | ||
|
|
ae929c1b6d | ||
|
|
7c58794b6f | ||
|
|
f3979d47db | ||
|
|
5448871029 | ||
|
|
ae67419f76 | ||
|
|
3740f05d5b | ||
|
|
2c4060a38d | ||
|
|
e8fed9c21f | ||
|
|
870ddceafd | ||
|
|
46272fbaa4 | ||
|
|
d5691676de | ||
|
|
e962b6f801 | ||
|
|
eddfc04ccc | ||
|
|
651c6959ab | ||
|
|
785639338b | ||
|
|
0fd834b4e1 | ||
|
|
617dca34f5 | ||
|
|
a445d80c03 | ||
|
|
394c338ff8 | ||
|
|
a112dd83e2 | ||
|
|
c6aef2a7da | ||
|
|
7911ab1d18 | ||
|
|
6e0b406c7b | ||
|
|
935348fdca | ||
|
|
0ea5ded807 | ||
|
|
0a60eced25 | ||
|
|
54357bbc2b | ||
|
|
c11c4e4d17 | ||
|
|
c469241bee | ||
|
|
ca5a858b21 | ||
|
|
bd89d1f227 | ||
|
|
5ce55d39ba | ||
|
|
11e4675337 | ||
|
|
ff8a84a220 | ||
|
|
9e1a3f59e3 | ||
|
|
d1d3e6a37a | ||
|
|
74047e747d | ||
|
|
c316e5f39a | ||
|
|
00a50b3f66 | ||
|
|
e757c014d1 | ||
|
|
1d2e4fed4a | ||
|
|
f9bbaed717 | ||
|
|
cc87a092fd | ||
|
|
fcdeda7f14 | ||
|
|
af29aa7d21 | ||
|
|
db741a1530 | ||
|
|
0b2d183009 | ||
|
|
8b3536fc85 | ||
|
|
f09460b717 | ||
|
|
7df8b2bb2b | ||
|
|
556e443705 | ||
|
|
1fa91717bd | ||
|
|
3972ec42f6 | ||
|
|
21d436e529 | ||
|
|
5457917e75 | ||
|
|
cda8a5a8b7 | ||
|
|
1de3f99123 | ||
|
|
14e3914b7d | ||
|
|
11c8b99602 | ||
|
|
d0801036d2 | ||
|
|
e402d1db30 | ||
|
|
fe16cf9702 | ||
|
|
2972917bb9 | ||
|
|
843a6a4bf4 | ||
|
|
a8d8942fba | ||
|
|
1beddcd99a | ||
|
|
b44685494f | ||
|
|
6e52f61011 | ||
|
|
e4091051a2 | ||
|
|
bb5c1664d0 | ||
|
|
00905e8131 | ||
|
|
d1e4b33760 | ||
|
|
92ab5a079c | ||
|
|
367f0923c5 | ||
|
|
5bb887d3ce | ||
|
|
784c19a9b3 | ||
|
|
3b6f1f99bc | ||
|
|
d93bb74068 | ||
|
|
c7eeec018d | ||
|
|
f3ca9e4bf5 | ||
|
|
5583a09889 | ||
|
|
92f05f40c8 | ||
|
|
70792a1610 | ||
|
|
f57896d848 | ||
|
|
cf9683dc03 | ||
|
|
b9a7fb2421 | ||
|
|
854b20a8fd | ||
|
|
389ae13cea | ||
|
|
f16e40742c | ||
|
|
710c95c5cd | ||
|
|
bed95e3b5b | ||
|
|
1fecb6fd16 | ||
|
|
c393d43005 | ||
|
|
edfbbc4b40 | ||
|
|
fcc854bcea | ||
|
|
d35e978c35 | ||
|
|
7128e86e3c | ||
|
|
2037e725b3 | ||
|
|
5d00edfc1d | ||
|
|
cb7c15c767 | ||
|
|
fe6fe702b2 | ||
|
|
4b97612900 | ||
|
|
3f7d884d4f | ||
|
|
0d0f2d454b | ||
|
|
4b2884f10f | ||
|
|
7ed96f69f7 | ||
|
|
3118df320b | ||
|
|
e0d75555c5 | ||
|
|
a44cc1a3a6 | ||
|
|
50e314adbd | ||
|
|
9e7a2ae17a |
@@ -1,7 +1,66 @@
|
||||
## Upgrade notes
|
||||
|
||||
#### `goog.DEBUG` define was renamed to `ol.DEBUG`
|
||||
|
||||
As last step in the removal of the dependency on Google Closure Library, the `goog.DEBUG` compiler define was renamed to `ol.DEBUG`. Please change accordingly in your custom build configuration json files.
|
||||
|
||||
#### `ol.format.ogc.filter` namespace was renamed to `ol.format.filter`
|
||||
|
||||
`ol.format.ogc.filter` was simplified to `ol.format.filter`; to upgrade your code, simply remove the `ogc` string from the name.
|
||||
For example: `ol.format.ogc.filter.and` to `ol.format.filter.and`.
|
||||
|
||||
#### Changes only relevant to those who compile their applications together with the Closure Compiler
|
||||
|
||||
A number of internal types have been renamed. This will not affect those who use the API provided by the library, but if you are compiling your application together with OpenLayers and using type names, you'll need to do the following:
|
||||
|
||||
* rename `ol.CollectionProperty` to `ol.Collection.Property`
|
||||
* rename `ol.DeviceOrientationProperty` to `ol.DeviceOrientation.Property`
|
||||
* rename `ol.DragBoxEvent` to `ol.interaction.DragBox.Event`
|
||||
* rename `ol.DragBoxEventType` to `ol.interaction.DragBox.EventType`
|
||||
* rename `ol.GeolocationProperty` to `ol.Geolocation.Property`
|
||||
* rename `ol.OverlayPositioning` to `ol.Overlay.Positioning`
|
||||
* rename `ol.OverlayProperty` to `ol.Overlay.Property`
|
||||
* rename `ol.control.MousePositionProperty` to `ol.control.MousePosition.Property`
|
||||
* rename `ol.format.IGCZ` to `ol.format.IGC.Z`
|
||||
* rename `ol.interaction.DrawMode` to `ol.interaction.Draw.Mode`
|
||||
* rename `ol.interaction.DrawEvent` to `ol.interaction.Draw.Event`
|
||||
* rename `ol.interaction.DrawEventType` to `ol.interaction.Draw.EventType`
|
||||
* rename `ol.interaction.ExtentEvent` to `ol.interaction.Extent.Event`
|
||||
* rename `ol.interaction.ExtentEventType` to `ol.interaction.Extent.EventType`
|
||||
* rename `ol.interaction.DragAndDropEvent` to `ol.interaction.DragAndDrop.Event`
|
||||
* rename `ol.interaction.DragAndDropEventType` to `ol.interaction.DragAndDrop.EventType`
|
||||
* rename `ol.interaction.ModifyEvent` to `ol.interaction.Modify.Event`
|
||||
* rename `ol.interaction.SelectEvent` to `ol.interaction.Select.Event`
|
||||
* rename `ol.interaction.SelectEventType` to `ol.interaction.Select.EventType`
|
||||
* rename `ol.interaction.TranslateEvent` to `ol.interaction.Translate.Event`
|
||||
* rename `ol.interaction.TranslateEventType` to `ol.interaction.Translate.EventType`
|
||||
* rename `ol.layer.GroupProperty` to `ol.layer.Group.Property`
|
||||
* rename `ol.layer.HeatmapLayerProperty` to `ol.layer.Heatmap.Property`
|
||||
* rename `ol.layer.TileProperty` to `ol.layer.Tile.Property`
|
||||
* rename `ol.layer.VectorTileRenderType` to `ol.layer.VectorTile.RenderType`
|
||||
* rename `ol.MapEventType` to `ol.MapEvent.Type`
|
||||
* rename `ol.MapProperty` to `ol.Map.Property`
|
||||
* rename `ol.ModifyEventType` to `ol.interaction.Modify.EventType`
|
||||
* rename `ol.RendererType` to `ol.renderer.Type`
|
||||
* rename `ol.source.ImageEvent` to `ol.source.Image.Event`
|
||||
* rename `ol.source.ImageEventType` to `ol.source.Image.EventType`
|
||||
* rename `ol.source.RasterEvent` to `ol.source.Raster.Event`
|
||||
* rename `ol.source.RasterEventType` to `ol.source.Raster.EventType`
|
||||
* rename `ol.source.TileEvent` to `ol.source.Tile.Event`
|
||||
* rename `ol.source.TileEventType` to `ol.source.Tile.EventType`
|
||||
* rename `ol.source.VectorEvent` to `ol.source.Vector.Event`
|
||||
* rename `ol.source.VectorEventType` to `ol.source.Vector.EventType`
|
||||
* rename `ol.source.wms.ServerType` to `ol.source.WMSServerType`
|
||||
* rename `ol.source.WMTSRequestEncoding` to `ol.source.WMTS.RequestEncoding`
|
||||
* rename `ol.style.IconAnchorUnits` to `ol.style.Icon.AnchorUnits`
|
||||
* rename `ol.style.IconOrigin` to `ol.style.Icon.Origin`
|
||||
|
||||
### v3.18.0
|
||||
|
||||
#### Removal of the DOM renderer
|
||||
|
||||
The DOM renderer has been removed. Instead, the Canvas renderer should be used. If you were previously constructing a map with `'dom'` as the `renderer` option, you will see an error message in the console in debug mode and the Canvas renderer will be used instead. To remove the warning, remove the `renderer` option from your map constructor.
|
||||
|
||||
#### Changes in the way assertions are handled
|
||||
|
||||
Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on http://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks in debug mode when the `goog.DEBUG` compiler flag is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.'
|
||||
|
||||
9
changelog/v3.18.2.md
Normal file
9
changelog/v3.18.2.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# v3.18.2
|
||||
|
||||
## Summary
|
||||
|
||||
The v3.18.2 release is a patch release that addresses a regression in the v3.18.1 release. See the [v3.18.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.18.0) for details on upgrading from v3.17.x.
|
||||
|
||||
## Fixes
|
||||
|
||||
* [#5828](https://github.com/openlayers/ol3/pull/5828) - Always close polygon rings ([@ahocevar](https://github.com/ahocevar))
|
||||
@@ -24,7 +24,7 @@
|
||||
"externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.DEBUG=false"
|
||||
"ol.DEBUG=false"
|
||||
],
|
||||
"jscomp_error": [
|
||||
"*"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.DEBUG=false"
|
||||
"ol.DEBUG=false"
|
||||
],
|
||||
"jscomp_error": [
|
||||
"*"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.DEBUG=false"
|
||||
"ol.DEBUG=false"
|
||||
],
|
||||
"jscomp_error": [
|
||||
"*"
|
||||
|
||||
@@ -169,8 +169,7 @@ The minimum config file looks like this:
|
||||
"node_modules/openlayers/externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.DEBUG=false",
|
||||
"ol.ENABLE_DOM=false",
|
||||
"ol.DEBUG=false",
|
||||
"ol.ENABLE_WEBGL=false"
|
||||
],
|
||||
"js": [
|
||||
@@ -221,8 +220,7 @@ Here is a version of `config.json` with more compilation checks enabled:
|
||||
"node_modules/openlayers/externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.DEBUG=false",
|
||||
"ol.ENABLE_DOM=false",
|
||||
"ol.DEBUG=false",
|
||||
"ol.ENABLE_WEBGL=false"
|
||||
],
|
||||
"js": [
|
||||
|
||||
@@ -60,7 +60,7 @@ Creating a custom build requires writing a build configuration file. The format
|
||||
"externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.DEBUG=false"
|
||||
"ol.DEBUG=false"
|
||||
],
|
||||
"extra_annotation_name": [
|
||||
"api", "observable"
|
||||
@@ -156,7 +156,6 @@ Setting some of these to `false` means that the portions of the code relating to
|
||||
|
||||
You might have noticed that the build file you've just created is considerably smaller than the full build, but it can be reduced further. This is because all three renderers and all layer types are included by default. We only need one renderer, and only need the tile layer, so can exclude the others by setting these properties with `define`s. So add the following to the define section of the config above:
|
||||
```
|
||||
"ol.ENABLE_DOM=false",
|
||||
"ol.ENABLE_WEBGL=false",
|
||||
"ol.ENABLE_PROJ4JS=false",
|
||||
"ol.ENABLE_IMAGE=false",
|
||||
@@ -191,7 +190,7 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openla
|
||||
"ol.format.KML",
|
||||
"ol.layer.Heatmap#getSource",
|
||||
"ol.source.Vector#on",
|
||||
"ol.source.VectorEvent#feature",
|
||||
"ol.source.Vector.Event#feature",
|
||||
"ol.Feature#get",
|
||||
"ol.Feature#set",
|
||||
"ol.layer.Tile",
|
||||
@@ -207,11 +206,10 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openla
|
||||
"externs/oli.js"
|
||||
],
|
||||
"define": [
|
||||
"ol.ENABLE_DOM=false",
|
||||
"ol.ENABLE_WEBGL=false",
|
||||
"ol.ENABLE_PROJ4JS=false",
|
||||
"ol.ENABLE_IMAGE=false",
|
||||
"goog.DEBUG=false"
|
||||
"ol.DEBUG=false"
|
||||
],
|
||||
"compilation_level": "ADVANCED",
|
||||
"manage_closure_dependencies": true
|
||||
@@ -219,7 +217,7 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openla
|
||||
}
|
||||
```
|
||||
|
||||
The exports are given here in the order in which they occur in the `heatmaps-earthquakes` example's JavaScript code. In this example we not only use the `ol.` functions and constructors, but also `prototype` methods where the `ol` namespace is not directly used. In the code, we have for example `vector.getSource().on()`. This means we are using the `getSource` method of `layer.Heatmap` and the `on` method of `source.KML`, so this is what has to be exported. Similarly, `event.feature.get()` means we are using the `feature` property of `source.VectorEvent` and the `get` method of `Feature`. If any of these names are left out, the compile will complete successfully, but the missing names will be obfuscated and you will get a 'property undefined' error when you try and run the script.
|
||||
The exports are given here in the order in which they occur in the `heatmaps-earthquakes` example's JavaScript code. In this example we not only use the `ol.` functions and constructors, but also `prototype` methods where the `ol` namespace is not directly used. In the code, we have for example `vector.getSource().on()`. This means we are using the `getSource` method of `layer.Heatmap` and the `on` method of `source.KML`, so this is what has to be exported. Similarly, `event.feature.get()` means we are using the `feature` property of `source.Vector.Event` and the `get` method of `Feature`. If any of these names are left out, the compile will complete successfully, but the missing names will be obfuscated and you will get a 'property undefined' error when you try and run the script.
|
||||
|
||||
As this example uses a vector layer it is necessary to remove `"ol.ENABLE_VECTOR=false"` in the `define` section of the configuration.
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
|
||||
@@ -54,7 +54,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
// Improve user experience by loading tiles while animating. Will make
|
||||
// animations stutter on mobile or slow devices.
|
||||
loadTilesWhileAnimating: true,
|
||||
|
||||
@@ -15,7 +15,6 @@ var map = new ol.Map({
|
||||
})
|
||||
],
|
||||
controls: ol.control.defaults({attribution: false}).extend([attribution]),
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -28,7 +28,6 @@ for (i = 0, ii = styles.length; i < ii; ++i) {
|
||||
}
|
||||
var map = new ol.Map({
|
||||
layers: layers,
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
// Improve user experience by loading tiles while dragging/zooming. Will make
|
||||
// zooming choppy on mobile or slow devices.
|
||||
loadTilesWhileInteracting: true,
|
||||
|
||||
@@ -25,7 +25,6 @@ var map = new ol.Map({
|
||||
source: vectorSource
|
||||
})
|
||||
],
|
||||
renderer: 'canvas',
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -9,7 +9,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [-8730000, 5930000],
|
||||
|
||||
5
examples/canvas-gradient-pattern.css
Normal file
5
examples/canvas-gradient-pattern.css
Normal file
File diff suppressed because one or more lines are too long
12
examples/canvas-gradient-pattern.html
Normal file
12
examples/canvas-gradient-pattern.html
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Styling feature with CanvasGradient or CanvasPattern
|
||||
shortdesc: Example showing the countries vector layer styled with patterns and gradients.
|
||||
docs: >
|
||||
First this example creates a reusable [`CanvasPattern`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern)
|
||||
and a [`CanvasGradient`](https://developer.mozilla.org/en/docs/Web/API/CanvasGradient). The countries are loaded from
|
||||
a GeoJSON file. A style function determines for each country whether to use a fill with the pregenerated
|
||||
CanvasGradient (rainbow colors) or a CanvasPattern (repeating stacked circles).
|
||||
tags: "canvas, gradient, pattern, style"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
109
examples/canvas-gradient-pattern.js
Normal file
109
examples/canvas-gradient-pattern.js
Normal file
@@ -0,0 +1,109 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.format.GeoJSON');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
// Will contain ol.Style instances key by country.
|
||||
var styleLookup = {};
|
||||
|
||||
// Generate a rainbow gradient
|
||||
var gradient = (function() {
|
||||
var canvas = document.createElement('canvas');
|
||||
var context = canvas.getContext('2d');
|
||||
var grad = context.createLinearGradient(0,0,1000,0);
|
||||
grad.addColorStop(0, 'red');
|
||||
grad.addColorStop(1 / 6, 'orange');
|
||||
grad.addColorStop(2 / 6, 'yellow');
|
||||
grad.addColorStop(3 / 6, 'green');
|
||||
grad.addColorStop(4 / 6, 'aqua');
|
||||
grad.addColorStop(5 / 6, 'blue');
|
||||
grad.addColorStop(1, 'purple');
|
||||
return grad;
|
||||
}());
|
||||
|
||||
// Generate a canvasPattern with two circles
|
||||
var pattern = (function() {
|
||||
var canvas = document.createElement('canvas');
|
||||
var context = canvas.getContext('2d');
|
||||
canvas.width = 11;
|
||||
canvas.height = 11;
|
||||
context.fillStyle = 'rgba(102, 0, 102, 0.5)';
|
||||
context.beginPath();
|
||||
context.arc(5, 5, 4, 0, 2 * Math.PI);
|
||||
context.fill();
|
||||
context.fillStyle = 'rgb(55, 0, 170)';
|
||||
context.beginPath();
|
||||
context.arc(5, 5, 2, 0, 2 * Math.PI);
|
||||
context.fill();
|
||||
return context.createPattern(canvas, 'repeat');
|
||||
}());
|
||||
|
||||
// Generate a background style that all features will reuse
|
||||
var backgroundStyle = new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#333',
|
||||
width: 2
|
||||
}),
|
||||
fill: new ol.style.Fill({
|
||||
color: '#fff'
|
||||
})
|
||||
});
|
||||
|
||||
/**
|
||||
* The styling function for the vector layer, will return an array of styles
|
||||
* which either contains the aboove gradient or pattern.
|
||||
*
|
||||
* @param {ol.Feature} feature the feature to style.
|
||||
* @return {Array<ol.style.Style>} the styles to use for the feature.
|
||||
*/
|
||||
var getStackedStyle = function(feature) {
|
||||
var id = feature.getId();
|
||||
if (!styleLookup[id]) {
|
||||
var patternOrGradient;
|
||||
if (id > 'J') { // some shall get the gradient, others the pattern.
|
||||
patternOrGradient = gradient;
|
||||
} else {
|
||||
patternOrGradient = pattern;
|
||||
}
|
||||
// Store the style in the lookup, next call will just return the stored
|
||||
// style for the feature.
|
||||
styleLookup[id] = [
|
||||
// 1. Use the common background style
|
||||
// (white fill and blackish stroke)
|
||||
backgroundStyle,
|
||||
// 2. On top of that, draw the pattern or gradient
|
||||
new ol.style.Style({
|
||||
fill: new ol.style.Fill({
|
||||
color: patternOrGradient
|
||||
})
|
||||
})
|
||||
];
|
||||
}
|
||||
return styleLookup[id];
|
||||
};
|
||||
|
||||
// Create a vector layer that makes use of the style function above…
|
||||
var vectorLayer = new ol.layer.Vector({
|
||||
source: new ol.source.Vector({
|
||||
url: 'data/geojson/countries.geojson',
|
||||
format: new ol.format.GeoJSON()
|
||||
}),
|
||||
style: getStackedStyle
|
||||
});
|
||||
|
||||
// … finally create a map with that layer.
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
vectorLayer
|
||||
],
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: ol.proj.fromLonLat([7, 52]),
|
||||
zoom: 3
|
||||
})
|
||||
});
|
||||
@@ -20,7 +20,6 @@ var map = new ol.Map({
|
||||
})
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
|
||||
@@ -69,7 +69,6 @@ var raster = new ol.layer.Tile({
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [raster, clusters],
|
||||
renderer: 'canvas',
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -70,7 +70,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -19,7 +19,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
|
||||
@@ -104,7 +104,6 @@ var map = new ol.Map({
|
||||
})
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -15,7 +15,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -38,7 +38,6 @@ var vector = new ol.layer.Vector({
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [raster, vector],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [-11000000, 4600000],
|
||||
|
||||
@@ -16,7 +16,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
12
examples/extent-interaction.html
Normal file
12
examples/extent-interaction.html
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Extent Interaction
|
||||
shortdesc: Using an Extent interaction to draw an extent.
|
||||
docs: >
|
||||
<p>This example shows how to use an <code>Extent</code> interaction to draw a modifiable extent.</p>
|
||||
<p>Use <code>Shift+Drag</code> to draw an extent.
|
||||
<code>Shift+Drag</code> on the corners or edges of the extent to resize it. <code>Shift+Click</code> off the extent to remove it.
|
||||
</p>
|
||||
tags: "Extent, interaction, box"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
48
examples/extent-interaction.js
Normal file
48
examples/extent-interaction.js
Normal file
@@ -0,0 +1,48 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.events.condition');
|
||||
goog.require('ol.format.GeoJSON');
|
||||
goog.require('ol.interaction.Extent');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
|
||||
var vectorSource = new ol.source.Vector({
|
||||
url: 'data/geojson/countries.geojson',
|
||||
format: new ol.format.GeoJSON()
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Vector({
|
||||
source: vectorSource
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
})
|
||||
});
|
||||
|
||||
var extent = new ol.interaction.Extent({
|
||||
condition: ol.events.condition.platformModifierKeyOnly
|
||||
});
|
||||
map.addInteraction(extent);
|
||||
extent.setActive(false);
|
||||
|
||||
//Enable interaction by holding shift
|
||||
this.addEventListener('keydown', function(event) {
|
||||
if (event.keyCode == 16) {
|
||||
extent.setActive(true);
|
||||
}
|
||||
});
|
||||
this.addEventListener('keyup', function(event) {
|
||||
if (event.keyCode == 16) {
|
||||
extent.setActive(false);
|
||||
}
|
||||
});
|
||||
@@ -28,7 +28,6 @@ var map = new ol.Map({
|
||||
collapsible: false
|
||||
})
|
||||
}),
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -22,7 +22,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: view
|
||||
});
|
||||
|
||||
@@ -23,7 +23,6 @@ var map = new ol.Map({
|
||||
})
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: view
|
||||
});
|
||||
|
||||
@@ -21,7 +21,6 @@ var view = new ol.View({
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
layers: [wmsLayer],
|
||||
target: 'map',
|
||||
view: view
|
||||
|
||||
@@ -21,7 +21,6 @@ var view = new ol.View({
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
layers: [wmsLayer],
|
||||
target: 'map',
|
||||
view: view
|
||||
|
||||
@@ -13,7 +13,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: 'canvas',
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: ol.proj.fromLonLat([4.8, 47.75]),
|
||||
|
||||
@@ -69,7 +69,6 @@ for (i = 0, ii = hereLayers.length; i < ii; ++i) {
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: layers,
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
// Improve user experience by loading tiles while dragging/zooming. Will make
|
||||
// zooming choppy on mobile or slow devices.
|
||||
loadTilesWhileInteracting: true,
|
||||
|
||||
@@ -61,7 +61,6 @@ var rasterLayer = new ol.layer.Tile({
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
layers: [rasterLayer, vectorLayer],
|
||||
target: document.getElementById('map'),
|
||||
view: new ol.View({
|
||||
|
||||
@@ -79,7 +79,7 @@ var vector = new ol.layer.Vector({
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
renderer: common.getRendererFromQueryString('webgl'),
|
||||
renderer: /** @type {ol.renderer.Type} */ ('webgl'),
|
||||
layers: [vector],
|
||||
target: document.getElementById('map'),
|
||||
view: new ol.View({
|
||||
|
||||
@@ -45,7 +45,6 @@ var rasterLayer = new ol.layer.Tile({
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
layers: [rasterLayer, vectorLayer],
|
||||
target: document.getElementById('map'),
|
||||
view: new ol.View({
|
||||
|
||||
@@ -99,7 +99,6 @@ var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Image({source: source})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [-10997148, 4569099],
|
||||
|
||||
@@ -19,7 +19,7 @@ if (!ol.has.WEBGL) {
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [osm],
|
||||
renderer: 'webgl',
|
||||
renderer: /** @type {ol.renderer.Type} */ ('webgl'),
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
|
||||
@@ -32,7 +32,6 @@ var overlay = new ol.layer.Tile({
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [base, overlay],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -27,7 +27,6 @@ var map = new ol.Map({
|
||||
]
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: ol.proj.fromLonLat([37.40570, 8.81566]),
|
||||
|
||||
@@ -9,7 +9,6 @@ var layer = new ol.layer.Tile();
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [layer],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -53,7 +53,6 @@ var vector = new ol.layer.Vector({
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [raster, vector],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [-11000000, 4600000],
|
||||
|
||||
@@ -25,7 +25,6 @@ var map = new ol.Map({
|
||||
maxResolution: 20000
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
|
||||
@@ -19,7 +19,6 @@ var map = new ol.Map({
|
||||
})
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: view
|
||||
});
|
||||
|
||||
@@ -28,7 +28,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -13,7 +13,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
|
||||
@@ -24,7 +24,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
goog.require('ol.Attribution');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.format.TopoJSON');
|
||||
|
||||
@@ -13,7 +13,6 @@ var layer = new ol.layer.Tile({
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [layer],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -50,7 +50,6 @@ var map = new ol.Map({
|
||||
})
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
overlays: [overlay],
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
|
||||
@@ -19,7 +19,6 @@ var map1 = new ol.Map({
|
||||
})
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map1',
|
||||
view: view
|
||||
});
|
||||
@@ -34,7 +33,6 @@ var map2 = new ol.Map({
|
||||
})
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map2',
|
||||
view: view
|
||||
});
|
||||
|
||||
@@ -13,7 +13,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
projection: 'EPSG:3857',
|
||||
|
||||
@@ -29,7 +29,6 @@ var map = new ol.Map({
|
||||
})
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: ol.proj.transform(
|
||||
|
||||
@@ -9,7 +9,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
projection: 'EPSG:4326',
|
||||
|
||||
@@ -148,7 +148,6 @@ var map = new ol.Map({
|
||||
layers['osm'],
|
||||
layers['bng']
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
projection: 'EPSG:3857',
|
||||
|
||||
@@ -79,24 +79,3 @@
|
||||
|
||||
container.appendChild(form);
|
||||
})();
|
||||
|
||||
var common = {};
|
||||
|
||||
common.getRendererFromQueryString = function(opt_default) {
|
||||
var obj = {};
|
||||
var queryString = location.search.slice(1);
|
||||
var re = /([^&=]+)=([^&]*)/g;
|
||||
|
||||
var m = re.exec(queryString);
|
||||
while (m) {
|
||||
obj[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
|
||||
m = re.exec(queryString);
|
||||
}
|
||||
if ('renderers' in obj) {
|
||||
return obj['renderers'].split(',');
|
||||
} else if ('renderer' in obj) {
|
||||
return [obj['renderer']];
|
||||
} else {
|
||||
return opt_default;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,7 +11,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
|
||||
@@ -21,7 +21,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -18,7 +18,6 @@ var map = new ol.Map({
|
||||
})
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: ol.proj.fromLonLat([-77.93255, 37.9555]),
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Shared Views
|
||||
shortdesc: The three maps, one WebGL, one Canvas, one DOM, share the same center, resolution, rotation and layers.
|
||||
shortdesc: Two maps with different renderers share view properties
|
||||
docs: >
|
||||
The three maps, one WebGL, one Canvas, one DOM, share the same center, resolution, rotation and layers.
|
||||
tags: "side-by-side, canvas, webgl, dom, canvas, sync, object"
|
||||
Two maps (one with the Canvas renderer, one with the WebGL renderer) share the same center, resolution, rotation and layers.
|
||||
tags: "side-by-side, canvas, webgl"
|
||||
---
|
||||
<h4>Canvas</h4>
|
||||
<div id="canvasMap" class="map"></div>
|
||||
@@ -13,5 +13,3 @@ tags: "side-by-side, canvas, webgl, dom, canvas, sync, object"
|
||||
<div id="no-webgl" class="alert alert-danger" style="display: none">
|
||||
This map requires a browser that supports <a href="http://get.webgl.org/">WebGL</a>.
|
||||
</div>
|
||||
<h4>DOM</h4>
|
||||
<div id="domMap" class="map"></div>
|
||||
|
||||
@@ -4,33 +4,27 @@ goog.require('ol.has');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
var map1 = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: 'dom',
|
||||
target: 'domMap',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 1
|
||||
})
|
||||
var layer = new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var map2 = new ol.Map({
|
||||
var view = new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 1
|
||||
});
|
||||
|
||||
var map1 = new ol.Map({
|
||||
target: 'canvasMap',
|
||||
layers: map1.getLayers(),
|
||||
view: map1.getView()
|
||||
layers: [layer],
|
||||
view: view
|
||||
});
|
||||
|
||||
if (ol.has.WEBGL) {
|
||||
var map3 = new ol.Map({
|
||||
renderer: 'webgl',
|
||||
var map2 = new ol.Map({
|
||||
target: 'webglMap',
|
||||
layers: map1.getLayers(),
|
||||
view: map1.getView()
|
||||
renderer: /** @type {ol.renderer.Type} */ ('webgl'),
|
||||
layers: [layer],
|
||||
view: view
|
||||
});
|
||||
} else {
|
||||
var info = document.getElementById('no-webgl');
|
||||
|
||||
@@ -29,7 +29,6 @@ var map = new ol.Map({
|
||||
})
|
||||
})
|
||||
],
|
||||
renderer: 'canvas',
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -18,7 +18,6 @@ var map = new ol.Map({
|
||||
})
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: ol.proj.transform(
|
||||
|
||||
@@ -107,7 +107,7 @@ var vector = new ol.layer.Vector({
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
renderer: common.getRendererFromQueryString('webgl'),
|
||||
renderer: /** @type {ol.renderer.Type} */ ('webgl'),
|
||||
layers: [vector],
|
||||
target: document.getElementById('map'),
|
||||
view: new ol.View({
|
||||
|
||||
@@ -11,7 +11,6 @@ var map = new ol.Map({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
collapsible: false
|
||||
|
||||
@@ -98,7 +98,6 @@ var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({source: source})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -13,7 +13,6 @@ var map = new ol.Map({
|
||||
})
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -28,7 +28,6 @@ var map4326 = new ol.Map({
|
||||
}),
|
||||
vectorLayer4326
|
||||
],
|
||||
renderer: 'canvas',
|
||||
target: 'map4326',
|
||||
view: new ol.View({
|
||||
projection: 'EPSG:4326',
|
||||
@@ -49,7 +48,6 @@ var map3857 = new ol.Map({
|
||||
}),
|
||||
vectorLayer3857
|
||||
],
|
||||
renderer: 'canvas',
|
||||
target: 'map3857',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.format.ogc.filter');
|
||||
goog.require('ol.format.filter');
|
||||
goog.require('ol.format.WFS');
|
||||
goog.require('ol.format.GeoJSON');
|
||||
goog.require('ol.layer.Tile');
|
||||
@@ -46,9 +46,9 @@ var featureRequest = new ol.format.WFS().writeGetFeature({
|
||||
featurePrefix: 'osm',
|
||||
featureTypes: ['water_areas'],
|
||||
outputFormat: 'application/json',
|
||||
filter: ol.format.ogc.filter.and(
|
||||
ol.format.ogc.filter.like('name', 'Mississippi*'),
|
||||
ol.format.ogc.filter.equalTo('waterway', 'riverbank')
|
||||
filter: ol.format.filter.and(
|
||||
ol.format.filter.like('name', 'Mississippi*'),
|
||||
ol.format.filter.equalTo('waterway', 'riverbank')
|
||||
)
|
||||
});
|
||||
|
||||
|
||||
@@ -76,7 +76,6 @@ var map = new ol.Map({
|
||||
})
|
||||
]),
|
||||
layers: layers,
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
projection: projection,
|
||||
|
||||
@@ -41,7 +41,7 @@ var layers = [
|
||||
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
|
||||
'FORMAT': 'image/jpeg'
|
||||
},
|
||||
serverType: /** @type {ol.source.wms.ServerType} */ ('mapserver')
|
||||
serverType: /** @type {ol.source.WMSServerType} */ ('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.wms.ServerType} */ ('mapserver')
|
||||
serverType: /** @type {ol.source.WMSServerType} */ ('mapserver')
|
||||
})
|
||||
})
|
||||
];
|
||||
@@ -62,7 +62,6 @@ var map = new ol.Map({
|
||||
new ol.control.ScaleLine()
|
||||
]),
|
||||
layers: layers,
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
projection: projection,
|
||||
|
||||
@@ -22,7 +22,6 @@ var layers = [
|
||||
var map = new ol.Map({
|
||||
layers: layers,
|
||||
target: 'map',
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
view: new ol.View({
|
||||
center: [-10997148, 4569099],
|
||||
zoom: 4
|
||||
|
||||
@@ -44,7 +44,6 @@ var projection = new ol.proj.Projection({
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: layers,
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [660000, 190000],
|
||||
|
||||
@@ -3,8 +3,8 @@ layout: example.html
|
||||
title: WMS Time
|
||||
shortdesc: Example of smooth tile transitions when changing the time dimension of a tiled WMS layer.
|
||||
docs: >
|
||||
Demonstrates smooth reloading of layers when changing the time dimension continously.
|
||||
tags: "wms, time, dimensions, transition"
|
||||
Demonstrates smooth reloading of layers when changing the time dimension continously. Data shown: IEM generated CONUS composite of NWS NEXRAD WSR-88D level III base reflectivity.
|
||||
tags: "wms, time, dimensions, transition, nexrad"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<div role="group" aria-label="Animation controls">
|
||||
|
||||
@@ -1,23 +1,32 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.Stamen');
|
||||
goog.require('ol.source.TileWMS');
|
||||
|
||||
var startDate = new Date(Date.parse('2012-01-01T19:00:00Z'));
|
||||
function threeHoursAgo() {
|
||||
return new Date(Math.round(Date.now() / 3600000) * 3600000 - 3600000 * 3);
|
||||
}
|
||||
|
||||
var extent = ol.proj.transformExtent([-126, 24, -66, 50], 'EPSG:4326', 'EPSG:3857');
|
||||
var startDate = threeHoursAgo();
|
||||
var frameRate = 0.5; // frames per second
|
||||
var animationId = null;
|
||||
|
||||
var layers = [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
source: new ol.source.Stamen({
|
||||
layer: 'terrain'
|
||||
})
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
extent: [-13884991, 2870341, -7455066, 6338219],
|
||||
extent: extent,
|
||||
source: new ol.source.TileWMS(/** @type {olx.source.TileWMSOptions} */ ({
|
||||
url: 'http://oos.soest.hawaii.edu/thredds/wms/hioos/model/wav/ww3/' +
|
||||
'WaveWatch_III_Global_Wave_Model_best.ncd?',
|
||||
params: {'LAYERS': 'Thgt', 'TIME': startDate.toISOString()}
|
||||
attributions: ['Iowa State University'],
|
||||
url: 'http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r-t.cgi',
|
||||
params: {'LAYERS': 'nexrad-n0r-wmst'}
|
||||
}))
|
||||
})
|
||||
];
|
||||
@@ -25,21 +34,25 @@ var map = new ol.Map({
|
||||
layers: layers,
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [-10997148, 4569099],
|
||||
center: ol.extent.getCenter(extent),
|
||||
zoom: 4
|
||||
})
|
||||
});
|
||||
|
||||
var updateInfo = function() {
|
||||
function updateInfo() {
|
||||
var el = document.getElementById('info');
|
||||
el.innerHTML = startDate.toISOString();
|
||||
};
|
||||
}
|
||||
|
||||
var setTime = function() {
|
||||
startDate.setHours(startDate.getHours() + 1);
|
||||
function setTime() {
|
||||
startDate.setMinutes(startDate.getMinutes() + 15);
|
||||
if (startDate > Date.now()) {
|
||||
startDate = threeHoursAgo();
|
||||
}
|
||||
layers[1].getSource().updateParams({'TIME': startDate.toISOString()});
|
||||
updateInfo();
|
||||
};
|
||||
}
|
||||
setTime();
|
||||
|
||||
var stop = function() {
|
||||
if (animationId !== null) {
|
||||
|
||||
@@ -8,6 +8,18 @@
|
||||
* @externs
|
||||
*/
|
||||
|
||||
|
||||
// see https://github.com/google/closure-compiler/pull/1991
|
||||
|
||||
/**
|
||||
* @param {*} arg
|
||||
* @return {boolean}
|
||||
* @nosideeffects
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView
|
||||
*/
|
||||
ArrayBuffer.isView = function(arg) {};
|
||||
|
||||
|
||||
// see https://github.com/google/closure-compiler/pull/1206
|
||||
|
||||
/**
|
||||
@@ -15,5 +27,3 @@
|
||||
* @see http://www.w3.org/TR/pointerevents/#the-touch-action-css-property
|
||||
*/
|
||||
CSSProperties.prototype.touchAction;
|
||||
|
||||
var global;
|
||||
|
||||
@@ -347,22 +347,22 @@ oli.source.RasterEvent.prototype.data;
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.source.TileEvent = function() {};
|
||||
oli.source.Tile.Event = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.Tile}
|
||||
*/
|
||||
oli.source.TileEvent.prototype.tile;
|
||||
oli.source.Tile.Event.prototype.tile;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.source.VectorEvent = function() {};
|
||||
oli.source.Vector.Event = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.Feature|undefined}
|
||||
*/
|
||||
oli.source.VectorEvent.prototype.feature;
|
||||
oli.source.Vector.Event.prototype.feature;
|
||||
|
||||
124
externs/olx.js
124
externs/olx.js
@@ -171,7 +171,7 @@ olx.interaction.InteractionOptions.prototype.handleEvent;
|
||||
* loadTilesWhileInteracting: (boolean|undefined),
|
||||
* logo: (boolean|string|olx.LogoOptions|Element|undefined),
|
||||
* overlays: (ol.Collection.<ol.Overlay>|Array.<ol.Overlay>|undefined),
|
||||
* renderer: (ol.RendererType|Array.<ol.RendererType|string>|string|undefined),
|
||||
* renderer: (ol.renderer.Type|Array.<ol.renderer.Type>|undefined),
|
||||
* target: (Element|string|undefined),
|
||||
* view: (ol.View|undefined)}}
|
||||
*/
|
||||
@@ -272,12 +272,12 @@ olx.MapOptions.prototype.overlays;
|
||||
|
||||
|
||||
/**
|
||||
* Renderer. By default, Canvas, DOM and WebGL renderers are tested for support
|
||||
* Renderer. By default, Canvas and WebGL renderers are tested for support
|
||||
* in that order, and the first supported used. Specify a
|
||||
* {@link ol.RendererType} here to use a specific renderer.
|
||||
* Note that at present the Canvas and DOM renderers fully support vector data,
|
||||
* but WebGL can only render Point geometries.
|
||||
* @type {ol.RendererType|Array.<ol.RendererType|string>|string|undefined}
|
||||
* {@link ol.renderer.Type} here to use a specific renderer.
|
||||
* Note that the Canvas renderer fully supports vector data, but WebGL can only
|
||||
* render Point geometries.
|
||||
* @type {ol.renderer.Type|Array.<ol.renderer.Type>|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.MapOptions.prototype.renderer;
|
||||
@@ -308,7 +308,7 @@ olx.MapOptions.prototype.view;
|
||||
* element: (Element|undefined),
|
||||
* offset: (Array.<number>|undefined),
|
||||
* position: (ol.Coordinate|undefined),
|
||||
* positioning: (ol.OverlayPositioning|string|undefined),
|
||||
* positioning: (ol.Overlay.Positioning|string|undefined),
|
||||
* stopEvent: (boolean|undefined),
|
||||
* insertFirst: (boolean|undefined),
|
||||
* autoPan: (boolean|undefined),
|
||||
@@ -359,7 +359,7 @@ olx.OverlayOptions.prototype.position;
|
||||
* property. Possible values are `'bottom-left'`, `'bottom-center'`,
|
||||
* `'bottom-right'`, `'center-left'`, `'center-center'`, `'center-right'`,
|
||||
* `'top-left'`, `'top-center'`, and `'top-right'`. Default is `'top-left'`.
|
||||
* @type {ol.OverlayPositioning|string|undefined}
|
||||
* @type {ol.Overlay.Positioning|string|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.OverlayOptions.prototype.positioning;
|
||||
@@ -1791,7 +1791,7 @@ olx.format.TopoJSONOptions.prototype.defaultDataProjection;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{altitudeMode: (ol.format.IGCZ|undefined)}}
|
||||
* @typedef {{altitudeMode: (ol.format.IGC.Z|undefined)}}
|
||||
*/
|
||||
olx.format.IGCOptions;
|
||||
|
||||
@@ -1799,7 +1799,7 @@ olx.format.IGCOptions;
|
||||
/**
|
||||
* Altitude mode. Possible values are `barometric`, `gps`, and `none`. Default
|
||||
* is `none`.
|
||||
* @type {ol.format.IGCZ|undefined}
|
||||
* @type {ol.format.IGC.Z|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.format.IGCOptions.prototype.altitudeMode;
|
||||
@@ -2014,7 +2014,7 @@ olx.format.WFSOptions.prototype.schemaLocation;
|
||||
* startIndex: (number|undefined),
|
||||
* count: (number|undefined),
|
||||
* bbox: (ol.Extent|undefined),
|
||||
* filter: (ol.format.ogc.filter.Filter|undefined),
|
||||
* filter: (ol.format.filter.Filter|undefined),
|
||||
* resultType: (string|undefined)}}
|
||||
*/
|
||||
olx.format.WFSWriteGetFeatureOptions;
|
||||
@@ -2121,8 +2121,8 @@ olx.format.WFSWriteGetFeatureOptions.prototype.bbox;
|
||||
|
||||
|
||||
/**
|
||||
* OGC filter condition. See {@link ol.format.ogc.filter} for more information.
|
||||
* @type {ol.format.ogc.filter.Filter|undefined}
|
||||
* Filter condition. See {@link ol.format.filter} for more information.
|
||||
* @type {ol.format.filter.Filter|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.format.WFSWriteGetFeatureOptions.prototype.filter;
|
||||
@@ -2705,6 +2705,47 @@ olx.interaction.DrawOptions.prototype.freehandCondition;
|
||||
olx.interaction.DrawOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{extent: (ol.Extent|undefined),
|
||||
* boxStyle: (ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined),
|
||||
* pointerStyle: (ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined),
|
||||
* wrapX: (boolean|undefined)}}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.ExtentOptions;
|
||||
|
||||
/**
|
||||
* Initial extent. Defaults to no inital extent
|
||||
* @type {ol.Extent|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.ExtentOptions.prototype.extent;
|
||||
|
||||
/**
|
||||
* Style for the drawn extent box.
|
||||
* Defaults to ol.style.Style.createDefaultEditing()[ol.geom.GeometryType.POLYGON]
|
||||
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.ExtentOptions.prototype.boxStyle;
|
||||
|
||||
/**
|
||||
* Style for the cursor used to draw the extent.
|
||||
* Defaults to ol.style.Style.createDefaultEditing()[ol.geom.GeometryType.POINT]
|
||||
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.ExtentOptions.prototype.pointerStyle;
|
||||
|
||||
/**
|
||||
* Wrap the drawn extent across multiple maps in the X direction?
|
||||
* Only affects visuals, not functionality. Defaults to false.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.ExtentOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{
|
||||
* features: (ol.Collection.<ol.Feature>|undefined),
|
||||
@@ -3782,7 +3823,7 @@ olx.layer.VectorOptions.prototype.visible;
|
||||
* maxResolution: (number|undefined),
|
||||
* opacity: (number|undefined),
|
||||
* renderBuffer: (number|undefined),
|
||||
* renderMode: (ol.layer.VectorTileRenderType|string|undefined),
|
||||
* renderMode: (ol.layer.VectorTile.RenderType|string|undefined),
|
||||
* renderOrder: (function(ol.Feature, ol.Feature):number|undefined),
|
||||
* source: (ol.source.VectorTile|undefined),
|
||||
* style: (ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined),
|
||||
@@ -3817,7 +3858,7 @@ olx.layer.VectorTileOptions.prototype.renderBuffer;
|
||||
* * `'vector'`: Vector tiles are rendered as vectors. Most accurate rendering
|
||||
* even during animations, but slower performance than the other options.
|
||||
* The default is `'hybrid'`.
|
||||
* @type {ol.layer.VectorTileRenderType|string|undefined}
|
||||
* @type {ol.layer.VectorTile.RenderType|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.layer.VectorTileOptions.prototype.renderMode;
|
||||
@@ -5134,7 +5175,7 @@ olx.source.RasterOptions.prototype.operationType;
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* hidpi: (boolean|undefined),
|
||||
* serverType: (ol.source.wms.ServerType|string|undefined),
|
||||
* serverType: (ol.source.WMSServerType|string|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* imageLoadFunction: (ol.ImageLoadFunctionType|undefined),
|
||||
* params: Object.<string,*>,
|
||||
@@ -5178,7 +5219,7 @@ olx.source.ImageWMSOptions.prototype.hidpi;
|
||||
/**
|
||||
* The type of the remote WMS server: `mapserver`, `geoserver` or `qgis`. Only
|
||||
* needed if `hidpi` is `true`. Default is `undefined`.
|
||||
* @type {ol.source.wms.ServerType|string|undefined}
|
||||
* @type {ol.source.WMSServerType|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageWMSOptions.prototype.serverType;
|
||||
@@ -5645,7 +5686,7 @@ olx.source.TileJSONOptions.prototype.wrapX;
|
||||
* tileGrid: (ol.tilegrid.TileGrid|undefined),
|
||||
* projection: ol.ProjectionLike,
|
||||
* reprojectionErrorThreshold: (number|undefined),
|
||||
* serverType: (ol.source.wms.ServerType|string|undefined),
|
||||
* serverType: (ol.source.WMSServerType|string|undefined),
|
||||
* tileLoadFunction: (ol.TileLoadFunctionType|undefined),
|
||||
* url: (string|undefined),
|
||||
* urls: (Array.<string>|undefined),
|
||||
@@ -5756,7 +5797,7 @@ olx.source.TileWMSOptions.prototype.reprojectionErrorThreshold;
|
||||
/**
|
||||
* The type of the remote WMS server. Currently only used when `hidpi` is
|
||||
* `true`. Default is `undefined`.
|
||||
* @type {ol.source.wms.ServerType|string|undefined}
|
||||
* @type {ol.source.WMSServerType|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileWMSOptions.prototype.serverType;
|
||||
@@ -5944,7 +5985,7 @@ olx.source.VectorOptions.prototype.wrapX;
|
||||
* tileGrid: ol.tilegrid.WMTS,
|
||||
* projection: ol.ProjectionLike,
|
||||
* reprojectionErrorThreshold: (number|undefined),
|
||||
* requestEncoding: (ol.source.WMTSRequestEncoding|string|undefined),
|
||||
* requestEncoding: (ol.source.WMTS.RequestEncoding|string|undefined),
|
||||
* layer: string,
|
||||
* style: string,
|
||||
* tilePixelRatio: (number|undefined),
|
||||
@@ -6026,7 +6067,7 @@ olx.source.WMTSOptions.prototype.reprojectionErrorThreshold;
|
||||
|
||||
/**
|
||||
* Request encoding. Default is `KVP`.
|
||||
* @type {ol.source.WMTSRequestEncoding|string|undefined}
|
||||
* @type {ol.source.WMTS.RequestEncoding|string|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.WMTSOptions.prototype.requestEncoding;
|
||||
@@ -6595,14 +6636,14 @@ olx.style.FillOptions.prototype.color;
|
||||
|
||||
/**
|
||||
* @typedef {{anchor: (Array.<number>|undefined),
|
||||
* anchorOrigin: (ol.style.IconOrigin|undefined),
|
||||
* anchorXUnits: (ol.style.IconAnchorUnits|undefined),
|
||||
* anchorYUnits: (ol.style.IconAnchorUnits|undefined),
|
||||
* anchorOrigin: (ol.style.Icon.Origin|undefined),
|
||||
* anchorXUnits: (ol.style.Icon.AnchorUnits|undefined),
|
||||
* anchorYUnits: (ol.style.Icon.AnchorUnits|undefined),
|
||||
* color: (ol.Color|string|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* img: (Image|HTMLCanvasElement|undefined),
|
||||
* offset: (Array.<number>|undefined),
|
||||
* offsetOrigin: (ol.style.IconOrigin|undefined),
|
||||
* offsetOrigin: (ol.style.Icon.Origin|undefined),
|
||||
* opacity: (number|undefined),
|
||||
* scale: (number|undefined),
|
||||
* snapToPixel: (boolean|undefined),
|
||||
@@ -6626,7 +6667,7 @@ olx.style.IconOptions.prototype.anchor;
|
||||
/**
|
||||
* Origin of the anchor: `bottom-left`, `bottom-right`, `top-left` or
|
||||
* `top-right`. Default is `top-left`.
|
||||
* @type {ol.style.IconOrigin|undefined}
|
||||
* @type {ol.style.Icon.Origin|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.style.IconOptions.prototype.anchorOrigin;
|
||||
@@ -6636,7 +6677,7 @@ olx.style.IconOptions.prototype.anchorOrigin;
|
||||
* Units in which the anchor x value is specified. A value of `'fraction'`
|
||||
* indicates the x value is a fraction of the icon. A value of `'pixels'`
|
||||
* indicates the x value in pixels. Default is `'fraction'`.
|
||||
* @type {ol.style.IconAnchorUnits|undefined}
|
||||
* @type {ol.style.Icon.AnchorUnits|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.style.IconOptions.prototype.anchorXUnits;
|
||||
@@ -6646,7 +6687,7 @@ olx.style.IconOptions.prototype.anchorXUnits;
|
||||
* Units in which the anchor y value is specified. A value of `'fraction'`
|
||||
* indicates the y value is a fraction of the icon. A value of `'pixels'`
|
||||
* indicates the y value in pixels. Default is `'fraction'`.
|
||||
* @type {ol.style.IconAnchorUnits|undefined}
|
||||
* @type {ol.style.Icon.AnchorUnits|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.style.IconOptions.prototype.anchorYUnits;
|
||||
@@ -6695,7 +6736,7 @@ olx.style.IconOptions.prototype.offset;
|
||||
/**
|
||||
* Origin of the offset: `bottom-left`, `bottom-right`, `top-left` or
|
||||
* `top-right`. Default is `top-left`.
|
||||
* @type {ol.style.IconOrigin|undefined}
|
||||
* @type {ol.style.Icon.Origin|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.style.IconOptions.prototype.offsetOrigin;
|
||||
@@ -6864,14 +6905,6 @@ olx.style.RegularShapeOptions.prototype.snapToPixel;
|
||||
olx.style.RegularShapeOptions.prototype.stroke;
|
||||
|
||||
|
||||
/**
|
||||
* Whether to rotate the text with the view. Default is `false`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.style.TextOptions.prototype.rotateWithView;
|
||||
|
||||
|
||||
/**
|
||||
* Rotation in radians (positive rotation clockwise). Default is `0`.
|
||||
* @type {number|undefined}
|
||||
@@ -6899,7 +6932,7 @@ olx.style.RegularShapeOptions.prototype.atlasManager;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{color: (ol.Color|string|undefined),
|
||||
* @typedef {{color: (ol.Color|ol.ColorLike|undefined),
|
||||
* lineCap: (string|undefined),
|
||||
* lineJoin: (string|undefined),
|
||||
* lineDash: (Array.<number>|undefined),
|
||||
@@ -6910,9 +6943,10 @@ olx.style.StrokeOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Color. See {@link ol.color} for possible formats. Default null; if null,
|
||||
* the Canvas/renderer default black will be used.
|
||||
* @type {ol.Color|string|undefined}
|
||||
* A color, gradient or pattern. See {@link ol.color}
|
||||
* and {@link ol.colorlike} for possible formats. Default null;
|
||||
* if null, the Canvas/renderer default black will be used.
|
||||
* @type {ol.Color|ol.ColorLike|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.style.StrokeOptions.prototype.color;
|
||||
@@ -7016,6 +7050,14 @@ olx.style.TextOptions.prototype.offsetY;
|
||||
olx.style.TextOptions.prototype.scale;
|
||||
|
||||
|
||||
/**
|
||||
* Whether to rotate the text with the view. Default is `false`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.style.TextOptions.prototype.rotateWithView;
|
||||
|
||||
|
||||
/**
|
||||
* Rotation in radians (positive rotation clockwise). Default is `0`.
|
||||
* @type {number|undefined}
|
||||
|
||||
18
package.json
18
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openlayers",
|
||||
"version": "3.18.1",
|
||||
"version": "3.19.0-beta.1",
|
||||
"description": "Build tools and sources for developing OpenLayers based mapping applications",
|
||||
"keywords": [
|
||||
"map",
|
||||
@@ -35,14 +35,14 @@
|
||||
"closure-util": "1.15.1",
|
||||
"derequire": "2.0.3",
|
||||
"fs-extra": "0.30.0",
|
||||
"glob": "7.0.6",
|
||||
"glob": "7.1.0",
|
||||
"handlebars": "4.0.5",
|
||||
"jsdoc": "3.4.0",
|
||||
"jsdoc": "3.4.1",
|
||||
"marked": "0.3.6",
|
||||
"metalsmith": "2.2.0",
|
||||
"metalsmith-layouts": "1.6.5",
|
||||
"nomnom": "1.8.1",
|
||||
"pbf": "2.0.1",
|
||||
"pbf": "3.0.1",
|
||||
"pixelworks": "1.1.0",
|
||||
"rbush": "2.0.1",
|
||||
"temp": "0.8.3",
|
||||
@@ -50,12 +50,12 @@
|
||||
"walk": "2.3.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"clean-css": "3.4.19",
|
||||
"coveralls": "2.11.12",
|
||||
"clean-css": "3.4.20",
|
||||
"coveralls": "2.11.14",
|
||||
"debounce": "^1.0.0",
|
||||
"eslint": "3.3.1",
|
||||
"eslint": "3.6.0",
|
||||
"eslint-config-openlayers": "5.0.0",
|
||||
"eslint-plugin-openlayers-internal": "2.1.0",
|
||||
"eslint-plugin-openlayers-internal": "2.2.0",
|
||||
"expect.js": "0.3.1",
|
||||
"gaze": "^1.0.0",
|
||||
"istanbul": "0.4.5",
|
||||
@@ -67,7 +67,7 @@
|
||||
"proj4": "2.3.15",
|
||||
"resemblejs": "2.2.1",
|
||||
"serve-files": "1.0.0",
|
||||
"sinon": "1.17.5",
|
||||
"sinon": "1.17.6",
|
||||
"slimerjs": "0.906.2"
|
||||
},
|
||||
"eslintConfig": {
|
||||
|
||||
@@ -9,8 +9,9 @@ const util = require('./util');
|
||||
* if so, require the "namespace" (ol.foo)
|
||||
* 2. check if a name looks like a class (ol.foo.Bar or ol.foo.XYZ)
|
||||
* if so, require the class (ol.foo.Bar)
|
||||
* 3. otherwise, lop off the last part of a name and require the rest
|
||||
* (e.g. ol.foo.bar would require ol.foo)
|
||||
* 3. otherwise, unless it's an external dependency (ol.ext.*), lop off the last
|
||||
* part of a name and require the rest (e.g. ol.foo.bar would require ol.foo,
|
||||
* but ol.ext.foo would require ol.ext.foo)
|
||||
*/
|
||||
|
||||
const CONST_RE = /^(ol(\.[a-z]\w*)*)\.[A-Z]+_([_A-Z])+$/;
|
||||
@@ -76,7 +77,10 @@ exports.rule = {
|
||||
}
|
||||
// otherwise, assume the object should be required
|
||||
const parts = name.split('.');
|
||||
parts.pop();
|
||||
if (parts[1] !== 'ext') {
|
||||
// unless it's an ol.ext.*
|
||||
parts.pop();
|
||||
}
|
||||
const objectName = parts.join('.');
|
||||
if (!defined[objectName]) {
|
||||
context.report(expression, `Missing goog.require('${objectName}')`);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "eslint-plugin-openlayers-internal",
|
||||
"version": "2.1.0",
|
||||
"version": "2.2.0",
|
||||
"description": "Custom ESLint rules for the OpenLayers project",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -15,7 +15,7 @@ exports.rule = {
|
||||
if (util.isRequireExpression(expression)) {
|
||||
const parent = expression.parent;
|
||||
if (parent.type !== 'ExpressionStatement') {
|
||||
return context.report(expression, 'Expected goog.require() to in an expression statement');
|
||||
return context.report(expression, 'Expected goog.require() to be in an expression statement');
|
||||
}
|
||||
|
||||
if (parent.parent.type !== 'Program') {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
goog.provide('ol.array');
|
||||
|
||||
goog.require('ol');
|
||||
|
||||
|
||||
/**
|
||||
* Performs a binary search on the provided sorted list and returns the index of the item if found. If it can't be found it'll return -1.
|
||||
@@ -36,38 +38,6 @@ ol.array.binarySearch = function(haystack, needle, opt_comparator) {
|
||||
return found ? low : ~low;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} arr Array.
|
||||
* @param {number} target Target.
|
||||
* @return {number} Index.
|
||||
*/
|
||||
ol.array.binaryFindNearest = function(arr, target) {
|
||||
var index = ol.array.binarySearch(arr, target,
|
||||
/**
|
||||
* @param {number} a A.
|
||||
* @param {number} b B.
|
||||
* @return {number} b minus a.
|
||||
*/
|
||||
function(a, b) {
|
||||
return b - a;
|
||||
});
|
||||
if (index >= 0) {
|
||||
return index;
|
||||
} else if (index == -1) {
|
||||
return 0;
|
||||
} else if (index == -arr.length - 1) {
|
||||
return arr.length - 1;
|
||||
} else {
|
||||
var left = -index - 2;
|
||||
var right = -index - 1;
|
||||
if (arr[left] - target < target - arr[right]) {
|
||||
return left;
|
||||
} else {
|
||||
return right;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Compare function for array sort that is safe for numbers.
|
||||
@@ -144,9 +114,9 @@ ol.array.linearFindNearest = function(arr, target, direction) {
|
||||
* @param {number} end End index.
|
||||
*/
|
||||
ol.array.reverseSubArray = function(arr, begin, end) {
|
||||
goog.DEBUG && console.assert(begin >= 0,
|
||||
ol.DEBUG && console.assert(begin >= 0,
|
||||
'Array begin index should be equal to or greater than 0');
|
||||
goog.DEBUG && console.assert(end < arr.length,
|
||||
ol.DEBUG && console.assert(end < arr.length,
|
||||
'Array end index should be less than the array length');
|
||||
while (begin < end) {
|
||||
var tmp = arr[begin];
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
goog.provide('ol.asserts');
|
||||
|
||||
goog.require('ol');
|
||||
goog.require('ol.AssertionError');
|
||||
|
||||
|
||||
|
||||
@@ -10,14 +10,6 @@ goog.require('ol.events.Event');
|
||||
goog.require('ol.Object');
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
ol.CollectionProperty = {
|
||||
LENGTH: 'length'
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* An expanded version of standard JS Array, adding convenience methods for
|
||||
@@ -121,7 +113,7 @@ ol.Collection.prototype.item = function(index) {
|
||||
* @api stable
|
||||
*/
|
||||
ol.Collection.prototype.getLength = function() {
|
||||
return /** @type {number} */ (this.get(ol.CollectionProperty.LENGTH));
|
||||
return /** @type {number} */ (this.get(ol.Collection.Property.LENGTH));
|
||||
};
|
||||
|
||||
|
||||
@@ -227,7 +219,15 @@ ol.Collection.prototype.setAt = function(index, elem) {
|
||||
* @private
|
||||
*/
|
||||
ol.Collection.prototype.updateLength_ = function() {
|
||||
this.set(ol.CollectionProperty.LENGTH, this.array_.length);
|
||||
this.set(ol.Collection.Property.LENGTH, this.array_.length);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
ol.Collection.Property = {
|
||||
LENGTH: 'length'
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
goog.provide('ol.color');
|
||||
|
||||
goog.require('ol');
|
||||
goog.require('ol.asserts');
|
||||
goog.require('ol.math');
|
||||
|
||||
@@ -11,7 +10,7 @@ goog.require('ol.math');
|
||||
* @type {RegExp}
|
||||
* @private
|
||||
*/
|
||||
ol.color.hexColorRe_ = /^#(?:[0-9a-f]{3}){1,2}$/i;
|
||||
ol.color.HEX_COLOR_RE_ = /^#(?:[0-9a-f]{3}){1,2}$/i;
|
||||
|
||||
|
||||
/**
|
||||
@@ -20,7 +19,7 @@ ol.color.hexColorRe_ = /^#(?:[0-9a-f]{3}){1,2}$/i;
|
||||
* @type {RegExp}
|
||||
* @private
|
||||
*/
|
||||
ol.color.rgbColorRe_ =
|
||||
ol.color.RGB_COLOR_RE_ =
|
||||
/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;
|
||||
|
||||
|
||||
@@ -30,7 +29,7 @@ ol.color.rgbColorRe_ =
|
||||
* @type {RegExp}
|
||||
* @private
|
||||
*/
|
||||
ol.color.rgbaColorRe_ =
|
||||
ol.color.RGBA_COLOR_RE_ =
|
||||
/^(?:rgba)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|1|0\.\d{0,10})\)$/i;
|
||||
|
||||
|
||||
@@ -40,7 +39,7 @@ ol.color.rgbaColorRe_ =
|
||||
* @type {RegExp}
|
||||
* @private
|
||||
*/
|
||||
ol.color.namedColorRe_ =
|
||||
ol.color.NAMED_COLOR_RE_ =
|
||||
/^([a-z]*)$/i;
|
||||
|
||||
|
||||
@@ -83,7 +82,7 @@ ol.color.fromNamed = function(color) {
|
||||
var el = document.createElement('div');
|
||||
el.style.color = color;
|
||||
document.body.appendChild(el);
|
||||
var rgb = window.getComputedStyle(el).color;
|
||||
var rgb = getComputedStyle(el).color;
|
||||
document.body.removeChild(el);
|
||||
return rgb;
|
||||
};
|
||||
@@ -154,11 +153,11 @@ ol.color.fromString = (
|
||||
ol.color.fromStringInternal_ = function(s) {
|
||||
var r, g, b, a, color, match;
|
||||
|
||||
if (ol.color.namedColorRe_.exec(s)) {
|
||||
if (ol.color.NAMED_COLOR_RE_.exec(s)) {
|
||||
s = ol.color.fromNamed(s);
|
||||
}
|
||||
|
||||
if (ol.color.hexColorRe_.exec(s)) { // hex
|
||||
if (ol.color.HEX_COLOR_RE_.exec(s)) { // hex
|
||||
var n = s.length - 1; // number of hex digits
|
||||
ol.asserts.assert(n == 3 || n == 6, 54); // Hex color should have 3 or 6 digits
|
||||
var d = n == 3 ? 1 : 2; // number of digits per channel
|
||||
@@ -172,13 +171,13 @@ ol.color.fromStringInternal_ = function(s) {
|
||||
}
|
||||
a = 1;
|
||||
color = [r, g, b, a];
|
||||
} else if ((match = ol.color.rgbaColorRe_.exec(s))) { // rgba()
|
||||
} else if ((match = ol.color.RGBA_COLOR_RE_.exec(s))) { // rgba()
|
||||
r = Number(match[1]);
|
||||
g = Number(match[2]);
|
||||
b = Number(match[3]);
|
||||
a = Number(match[4]);
|
||||
color = ol.color.normalize([r, g, b, a]);
|
||||
} else if ((match = ol.color.rgbColorRe_.exec(s))) { // rgb()
|
||||
} else if ((match = ol.color.RGB_COLOR_RE_.exec(s))) { // rgb()
|
||||
r = Number(match[1]);
|
||||
g = Number(match[2]);
|
||||
b = Number(match[3]);
|
||||
@@ -190,18 +189,6 @@ ol.color.fromStringInternal_ = function(s) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Color} color Color.
|
||||
* @return {boolean} Is valid.
|
||||
*/
|
||||
ol.color.isValid = function(color) {
|
||||
return 0 <= color[0] && color[0] < 256 &&
|
||||
0 <= color[1] && color[1] < 256 &&
|
||||
0 <= color[2] && color[2] < 256 &&
|
||||
0 <= color[3] && color[3] <= 1;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Color} color Color.
|
||||
* @param {ol.Color=} opt_color Color.
|
||||
|
||||
@@ -2,7 +2,7 @@ goog.provide('ol.control.Control');
|
||||
|
||||
goog.require('ol.events');
|
||||
goog.require('ol');
|
||||
goog.require('ol.MapEventType');
|
||||
goog.require('ol.MapEvent');
|
||||
goog.require('ol.Object');
|
||||
goog.require('ol.dom');
|
||||
|
||||
@@ -118,7 +118,7 @@ ol.control.Control.prototype.setMap = function(map) {
|
||||
target.appendChild(this.element);
|
||||
if (this.render !== ol.nullFunction) {
|
||||
this.listenerKeys.push(ol.events.listen(map,
|
||||
ol.MapEventType.POSTRENDER, this.render, this));
|
||||
ol.MapEvent.Type.POSTRENDER, this.render, this));
|
||||
}
|
||||
map.render();
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
goog.provide('ol.control.FullScreen');
|
||||
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.events.EventType');
|
||||
goog.require('ol');
|
||||
goog.require('ol.control.Control');
|
||||
goog.require('ol.dom');
|
||||
goog.require('ol.css');
|
||||
goog.require('ol.dom');
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.events.EventType');
|
||||
|
||||
|
||||
/**
|
||||
@@ -160,7 +160,7 @@ ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
|
||||
ol.control.FullScreen.prototype.setMap = function(map) {
|
||||
ol.control.Control.prototype.setMap.call(this, map);
|
||||
if (map) {
|
||||
this.listenerKeys.push(ol.events.listen(ol.global.document,
|
||||
this.listenerKeys.push(ol.events.listen(document,
|
||||
ol.control.FullScreen.getChangeType_(),
|
||||
this.handleFullScreenChange_, this)
|
||||
);
|
||||
|
||||
@@ -10,15 +10,6 @@ goog.require('ol.control.Control');
|
||||
goog.require('ol.proj');
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
ol.control.MousePositionProperty = {
|
||||
PROJECTION: 'projection',
|
||||
COORDINATE_FORMAT: 'coordinateFormat'
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* A control to show the 2D coordinates of the mouse cursor. By default, these
|
||||
@@ -49,7 +40,7 @@ ol.control.MousePosition = function(opt_options) {
|
||||
});
|
||||
|
||||
ol.events.listen(this,
|
||||
ol.Object.getChangeEventType(ol.control.MousePositionProperty.PROJECTION),
|
||||
ol.Object.getChangeEventType(ol.control.MousePosition.Property.PROJECTION),
|
||||
this.handleProjectionChanged_, this);
|
||||
|
||||
if (options.coordinateFormat) {
|
||||
@@ -131,7 +122,7 @@ ol.control.MousePosition.prototype.handleProjectionChanged_ = function() {
|
||||
*/
|
||||
ol.control.MousePosition.prototype.getCoordinateFormat = function() {
|
||||
return /** @type {ol.CoordinateFormatType|undefined} */ (
|
||||
this.get(ol.control.MousePositionProperty.COORDINATE_FORMAT));
|
||||
this.get(ol.control.MousePosition.Property.COORDINATE_FORMAT));
|
||||
};
|
||||
|
||||
|
||||
@@ -144,7 +135,7 @@ ol.control.MousePosition.prototype.getCoordinateFormat = function() {
|
||||
*/
|
||||
ol.control.MousePosition.prototype.getProjection = function() {
|
||||
return /** @type {ol.proj.Projection|undefined} */ (
|
||||
this.get(ol.control.MousePositionProperty.PROJECTION));
|
||||
this.get(ol.control.MousePosition.Property.PROJECTION));
|
||||
};
|
||||
|
||||
|
||||
@@ -195,7 +186,7 @@ ol.control.MousePosition.prototype.setMap = function(map) {
|
||||
* @api stable
|
||||
*/
|
||||
ol.control.MousePosition.prototype.setCoordinateFormat = function(format) {
|
||||
this.set(ol.control.MousePositionProperty.COORDINATE_FORMAT, format);
|
||||
this.set(ol.control.MousePosition.Property.COORDINATE_FORMAT, format);
|
||||
};
|
||||
|
||||
|
||||
@@ -207,7 +198,7 @@ ol.control.MousePosition.prototype.setCoordinateFormat = function(format) {
|
||||
* @api stable
|
||||
*/
|
||||
ol.control.MousePosition.prototype.setProjection = function(projection) {
|
||||
this.set(ol.control.MousePositionProperty.PROJECTION, projection);
|
||||
this.set(ol.control.MousePosition.Property.PROJECTION, projection);
|
||||
};
|
||||
|
||||
|
||||
@@ -244,3 +235,12 @@ ol.control.MousePosition.prototype.updateHTML_ = function(pixel) {
|
||||
this.renderedHTML_ = html;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
ol.control.MousePosition.Property = {
|
||||
PROJECTION: 'projection',
|
||||
COORDINATE_FORMAT: 'coordinateFormat'
|
||||
};
|
||||
|
||||
@@ -3,11 +3,10 @@ goog.provide('ol.control.OverviewMap');
|
||||
goog.require('ol');
|
||||
goog.require('ol.Collection');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.MapEventType');
|
||||
goog.require('ol.MapEvent');
|
||||
goog.require('ol.Object');
|
||||
goog.require('ol.ObjectEventType');
|
||||
goog.require('ol.Overlay');
|
||||
goog.require('ol.OverlayPositioning');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.control.Control');
|
||||
goog.require('ol.coordinate');
|
||||
@@ -123,7 +122,7 @@ ol.control.OverviewMap = function(opt_options) {
|
||||
*/
|
||||
this.boxOverlay_ = new ol.Overlay({
|
||||
position: [0, 0],
|
||||
positioning: ol.OverlayPositioning.BOTTOM_LEFT,
|
||||
positioning: ol.Overlay.Positioning.BOTTOM_LEFT,
|
||||
element: box
|
||||
});
|
||||
this.ovmap_.addOverlay(this.boxOverlay_);
|
||||
@@ -193,7 +192,7 @@ ol.control.OverviewMap.prototype.setMap = function(map) {
|
||||
* @private
|
||||
*/
|
||||
ol.control.OverviewMap.prototype.handleMapPropertyChange_ = function(event) {
|
||||
if (event.key === ol.MapProperty.VIEW) {
|
||||
if (event.key === ol.Map.Property.VIEW) {
|
||||
var oldView = /** @type {ol.View} */ (event.oldValue);
|
||||
if (oldView) {
|
||||
this.unbindView_(oldView);
|
||||
@@ -446,7 +445,7 @@ ol.control.OverviewMap.prototype.handleToggle_ = function() {
|
||||
if (!this.collapsed_ && !ovmap.isRendered()) {
|
||||
ovmap.updateSize();
|
||||
this.resetExtent_();
|
||||
ol.events.listenOnce(ovmap, ol.MapEventType.POSTRENDER,
|
||||
ol.events.listenOnce(ovmap, ol.MapEvent.Type.POSTRENDER,
|
||||
function(event) {
|
||||
this.updateBox_();
|
||||
},
|
||||
|
||||
@@ -12,6 +12,7 @@ goog.require('ol.events');
|
||||
goog.require('ol.events.Event');
|
||||
goog.require('ol.events.EventType');
|
||||
goog.require('ol.math');
|
||||
goog.require('ol.pointer.EventType');
|
||||
goog.require('ol.pointer.PointerEventHandler');
|
||||
|
||||
|
||||
@@ -186,7 +187,7 @@ ol.control.ZoomSlider.prototype.initSlider_ = function() {
|
||||
};
|
||||
|
||||
var thumb = container.firstElementChild;
|
||||
var computedStyle = ol.global.getComputedStyle(thumb);
|
||||
var computedStyle = getComputedStyle(thumb);
|
||||
var thumbWidth = thumb.offsetWidth +
|
||||
parseFloat(computedStyle['marginRight']) +
|
||||
parseFloat(computedStyle['marginLeft']);
|
||||
|
||||
@@ -319,28 +319,3 @@ ol.coordinate.toStringHDMS = function(coordinate, opt_fractionDigits) {
|
||||
ol.coordinate.toStringXY = function(coordinate, opt_fractionDigits) {
|
||||
return ol.coordinate.format(coordinate, '{x}, {y}', opt_fractionDigits);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Create an ol.Coordinate from an Array and take into account axis order.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* var northCoord = ol.coordinate.fromProjectedArray([1, 2], 'n');
|
||||
* // northCoord is now [2, 1]
|
||||
*
|
||||
* var eastCoord = ol.coordinate.fromProjectedArray([1, 2], 'e');
|
||||
* // eastCoord is now [1, 2]
|
||||
*
|
||||
* @param {Array} array The array with coordinates.
|
||||
* @param {string} axis the axis info.
|
||||
* @return {ol.Coordinate} The coordinate created.
|
||||
*/
|
||||
ol.coordinate.fromProjectedArray = function(array, axis) {
|
||||
var firstAxis = axis.charAt(0);
|
||||
if (firstAxis === 'n' || firstAxis === 's') {
|
||||
return [array[1], array[0]];
|
||||
} else {
|
||||
return array;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,18 +7,6 @@ goog.require('ol.has');
|
||||
goog.require('ol.math');
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
ol.DeviceOrientationProperty = {
|
||||
ALPHA: 'alpha',
|
||||
BETA: 'beta',
|
||||
GAMMA: 'gamma',
|
||||
HEADING: 'heading',
|
||||
TRACKING: 'tracking'
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* The ol.DeviceOrientation class provides access to information from
|
||||
@@ -87,7 +75,7 @@ ol.DeviceOrientation = function(opt_options) {
|
||||
this.listenerKey_ = null;
|
||||
|
||||
ol.events.listen(this,
|
||||
ol.Object.getChangeEventType(ol.DeviceOrientationProperty.TRACKING),
|
||||
ol.Object.getChangeEventType(ol.DeviceOrientation.Property.TRACKING),
|
||||
this.handleTrackingChanged_, this);
|
||||
|
||||
this.setTracking(options.tracking !== undefined ? options.tracking : false);
|
||||
@@ -113,22 +101,22 @@ ol.DeviceOrientation.prototype.orientationChange_ = function(originalEvent) {
|
||||
var event = /** @type {DeviceOrientationEvent} */ (originalEvent);
|
||||
if (event.alpha !== null) {
|
||||
var alpha = ol.math.toRadians(event.alpha);
|
||||
this.set(ol.DeviceOrientationProperty.ALPHA, alpha);
|
||||
this.set(ol.DeviceOrientation.Property.ALPHA, alpha);
|
||||
// event.absolute is undefined in iOS.
|
||||
if (typeof event.absolute === 'boolean' && event.absolute) {
|
||||
this.set(ol.DeviceOrientationProperty.HEADING, alpha);
|
||||
this.set(ol.DeviceOrientation.Property.HEADING, alpha);
|
||||
} else if (typeof event.webkitCompassHeading === 'number' &&
|
||||
event.webkitCompassAccuracy != -1) {
|
||||
var heading = ol.math.toRadians(event.webkitCompassHeading);
|
||||
this.set(ol.DeviceOrientationProperty.HEADING, heading);
|
||||
this.set(ol.DeviceOrientation.Property.HEADING, heading);
|
||||
}
|
||||
}
|
||||
if (event.beta !== null) {
|
||||
this.set(ol.DeviceOrientationProperty.BETA,
|
||||
this.set(ol.DeviceOrientation.Property.BETA,
|
||||
ol.math.toRadians(event.beta));
|
||||
}
|
||||
if (event.gamma !== null) {
|
||||
this.set(ol.DeviceOrientationProperty.GAMMA,
|
||||
this.set(ol.DeviceOrientation.Property.GAMMA,
|
||||
ol.math.toRadians(event.gamma));
|
||||
}
|
||||
this.changed();
|
||||
@@ -144,7 +132,7 @@ ol.DeviceOrientation.prototype.orientationChange_ = function(originalEvent) {
|
||||
*/
|
||||
ol.DeviceOrientation.prototype.getAlpha = function() {
|
||||
return /** @type {number|undefined} */ (
|
||||
this.get(ol.DeviceOrientationProperty.ALPHA));
|
||||
this.get(ol.DeviceOrientation.Property.ALPHA));
|
||||
};
|
||||
|
||||
|
||||
@@ -157,7 +145,7 @@ ol.DeviceOrientation.prototype.getAlpha = function() {
|
||||
*/
|
||||
ol.DeviceOrientation.prototype.getBeta = function() {
|
||||
return /** @type {number|undefined} */ (
|
||||
this.get(ol.DeviceOrientationProperty.BETA));
|
||||
this.get(ol.DeviceOrientation.Property.BETA));
|
||||
};
|
||||
|
||||
|
||||
@@ -170,7 +158,7 @@ ol.DeviceOrientation.prototype.getBeta = function() {
|
||||
*/
|
||||
ol.DeviceOrientation.prototype.getGamma = function() {
|
||||
return /** @type {number|undefined} */ (
|
||||
this.get(ol.DeviceOrientationProperty.GAMMA));
|
||||
this.get(ol.DeviceOrientation.Property.GAMMA));
|
||||
};
|
||||
|
||||
|
||||
@@ -183,7 +171,7 @@ ol.DeviceOrientation.prototype.getGamma = function() {
|
||||
*/
|
||||
ol.DeviceOrientation.prototype.getHeading = function() {
|
||||
return /** @type {number|undefined} */ (
|
||||
this.get(ol.DeviceOrientationProperty.HEADING));
|
||||
this.get(ol.DeviceOrientation.Property.HEADING));
|
||||
};
|
||||
|
||||
|
||||
@@ -195,7 +183,7 @@ ol.DeviceOrientation.prototype.getHeading = function() {
|
||||
*/
|
||||
ol.DeviceOrientation.prototype.getTracking = function() {
|
||||
return /** @type {boolean} */ (
|
||||
this.get(ol.DeviceOrientationProperty.TRACKING));
|
||||
this.get(ol.DeviceOrientation.Property.TRACKING));
|
||||
};
|
||||
|
||||
|
||||
@@ -206,7 +194,7 @@ ol.DeviceOrientation.prototype.handleTrackingChanged_ = function() {
|
||||
if (ol.has.DEVICE_ORIENTATION) {
|
||||
var tracking = this.getTracking();
|
||||
if (tracking && !this.listenerKey_) {
|
||||
this.listenerKey_ = ol.events.listen(ol.global, 'deviceorientation',
|
||||
this.listenerKey_ = ol.events.listen(window, 'deviceorientation',
|
||||
this.orientationChange_, this);
|
||||
} else if (!tracking && this.listenerKey_ !== null) {
|
||||
ol.events.unlistenByKey(this.listenerKey_);
|
||||
@@ -224,5 +212,17 @@ ol.DeviceOrientation.prototype.handleTrackingChanged_ = function() {
|
||||
* @api
|
||||
*/
|
||||
ol.DeviceOrientation.prototype.setTracking = function(tracking) {
|
||||
this.set(ol.DeviceOrientationProperty.TRACKING, tracking);
|
||||
this.set(ol.DeviceOrientation.Property.TRACKING, tracking);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
ol.DeviceOrientation.Property = {
|
||||
ALPHA: 'alpha',
|
||||
BETA: 'beta',
|
||||
GAMMA: 'gamma',
|
||||
HEADING: 'heading',
|
||||
TRACKING: 'tracking'
|
||||
};
|
||||
|
||||
154
src/ol/dom.js
154
src/ol/dom.js
@@ -1,16 +1,5 @@
|
||||
goog.provide('ol.dom');
|
||||
|
||||
goog.require('goog.userAgent');
|
||||
goog.require('ol');
|
||||
goog.require('ol.vec.Mat4');
|
||||
|
||||
|
||||
/**
|
||||
* @type {Array.<number>}
|
||||
* @private
|
||||
*/
|
||||
ol.dom.tmpMat4_ = ol.vec.Mat4.create();
|
||||
|
||||
|
||||
/**
|
||||
* Create an html canvas element and returns its 2d context.
|
||||
@@ -30,145 +19,6 @@ ol.dom.createCanvasContext2D = function(opt_width, opt_height) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Detect 2d transform.
|
||||
* Adapted from http://stackoverflow.com/q/5661671/130442
|
||||
* http://caniuse.com/#feat=transforms2d
|
||||
* @return {boolean}
|
||||
*/
|
||||
ol.dom.canUseCssTransform = (function() {
|
||||
var canUseCssTransform;
|
||||
return function() {
|
||||
if (canUseCssTransform === undefined) {
|
||||
var el = document.createElement('P'),
|
||||
has2d,
|
||||
transforms = {
|
||||
'webkitTransform': '-webkit-transform',
|
||||
'OTransform': '-o-transform',
|
||||
'msTransform': '-ms-transform',
|
||||
'MozTransform': '-moz-transform',
|
||||
'transform': 'transform'
|
||||
};
|
||||
document.body.appendChild(el);
|
||||
for (var t in transforms) {
|
||||
if (t in el.style) {
|
||||
el.style[t] = 'translate(1px,1px)';
|
||||
has2d = ol.global.getComputedStyle(el).getPropertyValue(
|
||||
transforms[t]);
|
||||
}
|
||||
}
|
||||
document.body.removeChild(el);
|
||||
|
||||
canUseCssTransform = (has2d && has2d !== 'none');
|
||||
}
|
||||
return canUseCssTransform;
|
||||
};
|
||||
}());
|
||||
|
||||
|
||||
/**
|
||||
* Detect 3d transform.
|
||||
* Adapted from http://stackoverflow.com/q/5661671/130442
|
||||
* http://caniuse.com/#feat=transforms3d
|
||||
* @return {boolean}
|
||||
*/
|
||||
ol.dom.canUseCssTransform3D = (function() {
|
||||
var canUseCssTransform3D;
|
||||
return function() {
|
||||
if (canUseCssTransform3D === undefined) {
|
||||
var el = document.createElement('P'),
|
||||
has3d,
|
||||
transforms = {
|
||||
'webkitTransform': '-webkit-transform',
|
||||
'OTransform': '-o-transform',
|
||||
'msTransform': '-ms-transform',
|
||||
'MozTransform': '-moz-transform',
|
||||
'transform': 'transform'
|
||||
};
|
||||
document.body.appendChild(el);
|
||||
for (var t in transforms) {
|
||||
if (t in el.style) {
|
||||
el.style[t] = 'translate3d(1px,1px,1px)';
|
||||
has3d = ol.global.getComputedStyle(el).getPropertyValue(
|
||||
transforms[t]);
|
||||
}
|
||||
}
|
||||
document.body.removeChild(el);
|
||||
|
||||
canUseCssTransform3D = (has3d && has3d !== 'none');
|
||||
}
|
||||
return canUseCssTransform3D;
|
||||
};
|
||||
}());
|
||||
|
||||
|
||||
/**
|
||||
* @param {Element} element Element.
|
||||
* @param {string} value Value.
|
||||
*/
|
||||
ol.dom.setTransform = function(element, value) {
|
||||
var style = element.style;
|
||||
style.WebkitTransform = value;
|
||||
style.MozTransform = value;
|
||||
style.OTransform = value;
|
||||
style.msTransform = value;
|
||||
style.transform = value;
|
||||
|
||||
// IE 9+ seems to assume transform-origin: 100% 100%; for some unknown reason
|
||||
if (goog.userAgent.IE && goog.userAgent.isVersionOrHigher('9.0')) {
|
||||
element.style.transformOrigin = '0 0';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!Element} element Element.
|
||||
* @param {ol.Transform} transform Matrix.
|
||||
* @param {number=} opt_precision Precision.
|
||||
*/
|
||||
ol.dom.transformElement2D = function(element, transform, opt_precision) {
|
||||
// using matrix() causes gaps in Chrome and Firefox on Mac OS X, so prefer
|
||||
// matrix3d()
|
||||
var i;
|
||||
if (ol.dom.canUseCssTransform3D()) {
|
||||
var value3D;
|
||||
var transform3D = ol.vec.Mat4.fromTransform(ol.dom.tmpMat4_, transform);
|
||||
if (opt_precision !== undefined) {
|
||||
/** @type {Array.<string>} */
|
||||
var strings3D = new Array(16);
|
||||
for (i = 0; i < 16; ++i) {
|
||||
strings3D[i] = transform3D[i].toFixed(opt_precision);
|
||||
}
|
||||
value3D = strings3D.join(',');
|
||||
} else {
|
||||
value3D = transform3D.join(',');
|
||||
}
|
||||
ol.dom.setTransform(element, 'matrix3d(' + value3D + ')');
|
||||
} else if (ol.dom.canUseCssTransform()) {
|
||||
/** @type {string} */
|
||||
var value2D;
|
||||
if (opt_precision !== undefined) {
|
||||
/** @type {Array.<string>} */
|
||||
var strings2D = new Array(6);
|
||||
for (i = 0; i < 6; ++i) {
|
||||
strings2D[i] = transform[i].toFixed(opt_precision);
|
||||
}
|
||||
value2D = strings2D.join(',');
|
||||
} else {
|
||||
value2D = transform.join(',');
|
||||
}
|
||||
ol.dom.setTransform(element, 'matrix(' + value2D + ')');
|
||||
} else {
|
||||
element.style.left = Math.round(transform[4]) + 'px';
|
||||
element.style.top = Math.round(transform[5]) + 'px';
|
||||
|
||||
// TODO: Add scaling here. This isn't quite as simple as multiplying
|
||||
// width/height, because that only changes the container size, not the
|
||||
// content size.
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get the current computed width for the given element including margin,
|
||||
* padding and border.
|
||||
@@ -178,7 +28,7 @@ ol.dom.transformElement2D = function(element, transform, opt_precision) {
|
||||
*/
|
||||
ol.dom.outerWidth = function(element) {
|
||||
var width = element.offsetWidth;
|
||||
var style = element.currentStyle || ol.global.getComputedStyle(element);
|
||||
var style = element.currentStyle || getComputedStyle(element);
|
||||
width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
|
||||
|
||||
return width;
|
||||
@@ -194,7 +44,7 @@ ol.dom.outerWidth = function(element) {
|
||||
*/
|
||||
ol.dom.outerHeight = function(element) {
|
||||
var height = element.offsetHeight;
|
||||
var style = element.currentStyle || ol.global.getComputedStyle(element);
|
||||
var style = element.currentStyle || getComputedStyle(element);
|
||||
height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);
|
||||
|
||||
return height;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
goog.provide('ol.events.condition');
|
||||
|
||||
goog.require('ol.MapBrowserEvent.EventType');
|
||||
goog.require('ol.asserts');
|
||||
goog.require('ol.functions');
|
||||
goog.require('ol.MapBrowserEvent.EventType');
|
||||
goog.require('ol.has');
|
||||
|
||||
|
||||
/**
|
||||
@@ -74,7 +75,7 @@ ol.events.condition.click = function(mapBrowserEvent) {
|
||||
ol.events.condition.mouseActionButton = function(mapBrowserEvent) {
|
||||
var originalEvent = mapBrowserEvent.originalEvent;
|
||||
return originalEvent.button == 0 &&
|
||||
!(goog.userAgent.WEBKIT && ol.has.MAC && originalEvent.ctrlKey);
|
||||
!(ol.has.WEBKIT && ol.has.MAC && originalEvent.ctrlKey);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ ol.events.EventTarget.prototype.removeEventListener = function(type, listener) {
|
||||
var listeners = this.listeners_[type];
|
||||
if (listeners) {
|
||||
var index = listeners.indexOf(listener);
|
||||
goog.DEBUG && console.assert(index != -1, 'listener not found');
|
||||
ol.DEBUG && console.assert(index != -1, 'listener not found');
|
||||
if (type in this.pendingRemovals_) {
|
||||
// make listener a no-op, and remove later in #dispatchEvent()
|
||||
listeners[index] = ol.nullFunction;
|
||||
|
||||
@@ -2,6 +2,7 @@ goog.provide('ol.extent');
|
||||
goog.provide('ol.extent.Corner');
|
||||
goog.provide('ol.extent.Relationship');
|
||||
|
||||
goog.require('ol');
|
||||
goog.require('ol.asserts');
|
||||
|
||||
|
||||
@@ -55,8 +56,8 @@ ol.extent.boundingExtent = function(coordinates) {
|
||||
* @return {ol.Extent} Extent.
|
||||
*/
|
||||
ol.extent.boundingExtentXYs_ = function(xs, ys, opt_extent) {
|
||||
goog.DEBUG && console.assert(xs.length > 0, 'xs length should be larger than 0');
|
||||
goog.DEBUG && console.assert(ys.length > 0, 'ys length should be larger than 0');
|
||||
ol.DEBUG && console.assert(xs.length > 0, 'xs length should be larger than 0');
|
||||
ol.DEBUG && console.assert(ys.length > 0, 'ys length should be larger than 0');
|
||||
var minX = Math.min.apply(null, xs);
|
||||
var minY = Math.min.apply(null, ys);
|
||||
var maxX = Math.max.apply(null, xs);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
goog.provide('ol.featureloader');
|
||||
|
||||
goog.require('ol');
|
||||
goog.require('ol.Tile');
|
||||
goog.require('ol.format.FormatType');
|
||||
goog.require('ol.xml');
|
||||
|
||||
@@ -144,8 +144,8 @@ ol.format.EsriJSON.convertRings_ = function(rings, layout) {
|
||||
* @return {ol.geom.Geometry} Point.
|
||||
*/
|
||||
ol.format.EsriJSON.readPointGeometry_ = function(object) {
|
||||
goog.DEBUG && console.assert(typeof object.x === 'number', 'object.x should be number');
|
||||
goog.DEBUG && console.assert(typeof object.y === 'number', 'object.y should be number');
|
||||
ol.DEBUG && console.assert(typeof object.x === 'number', 'object.x should be number');
|
||||
ol.DEBUG && console.assert(typeof object.y === 'number', 'object.y should be number');
|
||||
var point;
|
||||
if (object.m !== undefined && object.z !== undefined) {
|
||||
point = new ol.geom.Point([object.x, object.y, object.z, object.m],
|
||||
@@ -169,9 +169,9 @@ ol.format.EsriJSON.readPointGeometry_ = function(object) {
|
||||
* @return {ol.geom.Geometry} LineString.
|
||||
*/
|
||||
ol.format.EsriJSON.readLineStringGeometry_ = function(object) {
|
||||
goog.DEBUG && console.assert(Array.isArray(object.paths),
|
||||
ol.DEBUG && console.assert(Array.isArray(object.paths),
|
||||
'object.paths should be an array');
|
||||
goog.DEBUG && console.assert(object.paths.length === 1,
|
||||
ol.DEBUG && console.assert(object.paths.length === 1,
|
||||
'object.paths array length should be 1');
|
||||
var layout = ol.format.EsriJSON.getGeometryLayout_(object);
|
||||
return new ol.geom.LineString(object.paths[0], layout);
|
||||
@@ -184,9 +184,9 @@ ol.format.EsriJSON.readLineStringGeometry_ = function(object) {
|
||||
* @return {ol.geom.Geometry} MultiLineString.
|
||||
*/
|
||||
ol.format.EsriJSON.readMultiLineStringGeometry_ = function(object) {
|
||||
goog.DEBUG && console.assert(Array.isArray(object.paths),
|
||||
ol.DEBUG && console.assert(Array.isArray(object.paths),
|
||||
'object.paths should be an array');
|
||||
goog.DEBUG && console.assert(object.paths.length > 1,
|
||||
ol.DEBUG && console.assert(object.paths.length > 1,
|
||||
'object.paths array length should be more than 1');
|
||||
var layout = ol.format.EsriJSON.getGeometryLayout_(object);
|
||||
return new ol.geom.MultiLineString(object.paths, layout);
|
||||
@@ -228,7 +228,7 @@ ol.format.EsriJSON.readMultiPointGeometry_ = function(object) {
|
||||
* @return {ol.geom.Geometry} MultiPolygon.
|
||||
*/
|
||||
ol.format.EsriJSON.readMultiPolygonGeometry_ = function(object) {
|
||||
goog.DEBUG && console.assert(object.rings.length > 1,
|
||||
ol.DEBUG && console.assert(object.rings.length > 1,
|
||||
'object.rings should have length larger than 1');
|
||||
var layout = ol.format.EsriJSON.getGeometryLayout_(object);
|
||||
return new ol.geom.MultiPolygon(
|
||||
@@ -243,7 +243,7 @@ ol.format.EsriJSON.readMultiPolygonGeometry_ = function(object) {
|
||||
* @return {ol.geom.Geometry} Polygon.
|
||||
*/
|
||||
ol.format.EsriJSON.readPolygonGeometry_ = function(object) {
|
||||
goog.DEBUG && console.assert(object.rings);
|
||||
ol.DEBUG && console.assert(object.rings);
|
||||
var layout = ol.format.EsriJSON.getGeometryLayout_(object);
|
||||
return new ol.geom.Polygon(object.rings, layout);
|
||||
};
|
||||
@@ -469,7 +469,7 @@ ol.format.EsriJSON.prototype.readFeatures;
|
||||
ol.format.EsriJSON.prototype.readFeatureFromObject = function(
|
||||
object, opt_options) {
|
||||
var esriJSONFeature = /** @type {EsriJSONFeature} */ (object);
|
||||
goog.DEBUG && console.assert(esriJSONFeature.geometry ||
|
||||
ol.DEBUG && console.assert(esriJSONFeature.geometry ||
|
||||
esriJSONFeature.attributes,
|
||||
'geometry or attributes should be defined');
|
||||
var geometry = ol.format.EsriJSON.readGeometry_(esriJSONFeature.geometry,
|
||||
@@ -481,7 +481,7 @@ ol.format.EsriJSON.prototype.readFeatureFromObject = function(
|
||||
feature.setGeometry(geometry);
|
||||
if (opt_options && opt_options.idField &&
|
||||
esriJSONFeature.attributes[opt_options.idField]) {
|
||||
goog.DEBUG && console.assert(
|
||||
ol.DEBUG && console.assert(
|
||||
typeof esriJSONFeature.attributes[opt_options.idField] === 'number',
|
||||
'objectIdFieldName value should be a number');
|
||||
feature.setId(/** @type {number} */(
|
||||
|
||||
19
src/ol/format/filter/and.js
Normal file
19
src/ol/format/filter/and.js
Normal file
@@ -0,0 +1,19 @@
|
||||
goog.provide('ol.format.filter.And');
|
||||
|
||||
goog.require('ol');
|
||||
goog.require('ol.format.filter.LogicalBinary');
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a logical `<And>` operator between two filter conditions.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!ol.format.filter.Filter} conditionA First filter condition.
|
||||
* @param {!ol.format.filter.Filter} conditionB Second filter condition.
|
||||
* @extends {ol.format.filter.LogicalBinary}
|
||||
* @api
|
||||
*/
|
||||
ol.format.filter.And = function(conditionA, conditionB) {
|
||||
ol.format.filter.LogicalBinary.call(this, 'And', conditionA, conditionB);
|
||||
};
|
||||
ol.inherits(ol.format.filter.And, ol.format.filter.LogicalBinary);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user