Compare commits
353 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a57c8745e | ||
|
|
84401c132f | ||
|
|
2ee1969de7 | ||
|
|
19fd3d6987 | ||
|
|
4b14c86fd1 | ||
|
|
c535cf04e2 | ||
|
|
80e984a9c3 | ||
|
|
fb4992b580 | ||
|
|
4141572725 | ||
|
|
02f4f8b1d5 | ||
|
|
0dc7313afb | ||
|
|
3ba2d71784 | ||
|
|
3416991166 | ||
|
|
106657572d | ||
|
|
c9aff61110 | ||
|
|
e222409f50 | ||
|
|
b96de85044 | ||
|
|
3f0de09dd7 | ||
|
|
13a0eb4ca7 | ||
|
|
fb6353a816 | ||
|
|
24665747b3 | ||
|
|
c2749bbdd1 | ||
|
|
4077886165 | ||
|
|
44e04be67f | ||
|
|
baf5287ad2 | ||
|
|
548e4abd35 | ||
|
|
cc9d4d8794 | ||
|
|
ee53fd772d | ||
|
|
18f3d7243d | ||
|
|
dfc1bb7592 | ||
|
|
5a00289e8e | ||
|
|
d3de8c38b5 | ||
|
|
627632ce1b | ||
|
|
c3447873b6 | ||
|
|
03d78cdd1c | ||
|
|
19b0c65e4c | ||
|
|
4d26305564 | ||
|
|
863589e5ed | ||
|
|
68fd5267c2 | ||
|
|
126e49cd39 | ||
|
|
b9073013db | ||
|
|
8f8068b88c | ||
|
|
85f11b093d | ||
|
|
4a33db370b | ||
|
|
2fd6352a57 | ||
|
|
94998c8ec7 | ||
|
|
8389c16315 | ||
|
|
cf9e24feb1 | ||
|
|
f4b4e26f19 | ||
|
|
e5012856a1 | ||
|
|
927d73d410 | ||
|
|
f29bc74b7f | ||
|
|
03038b123f | ||
|
|
bc1b9b9677 | ||
|
|
0bb3f1e228 | ||
|
|
8ef230768b | ||
|
|
64654e1e72 | ||
|
|
ae905593b3 | ||
|
|
09370952fd | ||
|
|
9425088610 | ||
|
|
94f83b53df | ||
|
|
b3796aa3a1 | ||
|
|
5276fd0580 | ||
|
|
2f67fca2a6 | ||
|
|
690152a07b | ||
|
|
feabf58740 | ||
|
|
8bf208558d | ||
|
|
d9d46bc1f7 | ||
|
|
f835364822 | ||
|
|
c0de5a6835 | ||
|
|
a18bf636f8 | ||
|
|
2159a35bb8 | ||
|
|
f9a16898a5 | ||
|
|
35ac1c4577 | ||
|
|
26ed4c33a3 | ||
|
|
3e5e271331 | ||
|
|
e752a8cea3 | ||
|
|
290f8b5c7d | ||
|
|
c9cb9b6d36 | ||
|
|
ce61fb300c | ||
|
|
92ef1724d1 | ||
|
|
fe5219eb84 | ||
|
|
e9cf0bbf6e | ||
|
|
051ed439ca | ||
|
|
e126df11e7 | ||
|
|
e742181fe9 | ||
|
|
399d8ce326 | ||
|
|
9fc2f5c19f | ||
|
|
0554c7f685 | ||
|
|
587817af94 | ||
|
|
a2a3ca84e2 | ||
|
|
1634aaa9dd | ||
|
|
f35887d6e7 | ||
|
|
14bed81994 | ||
|
|
e00149562a | ||
|
|
0f86b1df69 | ||
|
|
5001f0896e | ||
|
|
579ce6c5ad | ||
|
|
4e3d6bd556 | ||
|
|
caf3e4b062 | ||
|
|
cf6baf2cd1 | ||
|
|
e65c522cb4 | ||
|
|
1e8f0026eb | ||
|
|
bd47db8a55 | ||
|
|
d41bfde25d | ||
|
|
7990bb3bf6 | ||
|
|
c6f568f99b | ||
|
|
f380f34468 | ||
|
|
d8f7aa193c | ||
|
|
d7ad543c12 | ||
|
|
8437f95c86 | ||
|
|
01d2b84ee1 | ||
|
|
cd70f58e34 | ||
|
|
234e8c2fde | ||
|
|
22d03cb2ee | ||
|
|
309843b53d | ||
|
|
f0cca94456 | ||
|
|
a421b4fb65 | ||
|
|
ed71cf74f6 | ||
|
|
0eb7e8220d | ||
|
|
f0814628b7 | ||
|
|
ec2daf2118 | ||
|
|
ef0487c3ab | ||
|
|
42c2dd8702 | ||
|
|
42f41e1cf4 | ||
|
|
05cf57dcfc | ||
|
|
51dfe89425 | ||
|
|
1339d6b3a6 | ||
|
|
d0b2016bb6 | ||
|
|
f77c7dded2 | ||
|
|
88f8515fb6 | ||
|
|
2133d6d081 | ||
|
|
ef40f66c93 | ||
|
|
cf0c4dcf3f | ||
|
|
873e4176c6 | ||
|
|
8f0f278832 | ||
|
|
109bda60d0 | ||
|
|
3492628dc4 | ||
|
|
19cfc140a8 | ||
|
|
577e45cd97 | ||
|
|
658a2b317e | ||
|
|
9c573a5b3c | ||
|
|
908d4051cd | ||
|
|
a81150508d | ||
|
|
8f9a8e9bb1 | ||
|
|
5ba64024ab | ||
|
|
f4bb232279 | ||
|
|
242a0937a3 | ||
|
|
a857a66a98 | ||
|
|
def755f1eb | ||
|
|
6f2747cf14 | ||
|
|
0181e525ce | ||
|
|
5da0fe3300 | ||
|
|
2f079ad059 | ||
|
|
9ba4208616 | ||
|
|
4b5bb42961 | ||
|
|
24886f2710 | ||
|
|
c30ecace75 | ||
|
|
b0984070db | ||
|
|
1c57686d1f | ||
|
|
0d24be6767 | ||
|
|
074eff1efd | ||
|
|
648011c64d | ||
|
|
37899a3feb | ||
|
|
d46407f7b6 | ||
|
|
7b1e92580d | ||
|
|
88701db4c4 | ||
|
|
339c7c5c23 | ||
|
|
08b19549ce | ||
|
|
f58b7cf347 | ||
|
|
3186a411b2 | ||
|
|
10fa741476 | ||
|
|
44d0578389 | ||
|
|
0a3b7e56a9 | ||
|
|
9db16bfa94 | ||
|
|
c0b27bca8f | ||
|
|
93abfc9a03 | ||
|
|
8eb3e55aa0 | ||
|
|
a2175afcad | ||
|
|
67e511765a | ||
|
|
5b21ab8811 | ||
|
|
a3cc322593 | ||
|
|
600c139a61 | ||
|
|
6c191d0fef | ||
|
|
9365fbdb7e | ||
|
|
9cc628939a | ||
|
|
410dddaa46 | ||
|
|
7230b83cbd | ||
|
|
194c47d962 | ||
|
|
da40527077 | ||
|
|
c1263af9b1 | ||
|
|
3197972e14 | ||
|
|
5b43e8a31e | ||
|
|
df4f1c1389 | ||
|
|
74006a91fe | ||
|
|
fdee0d73de | ||
|
|
3164dc874e | ||
|
|
7c5e1b808d | ||
|
|
fb6cd4f586 | ||
|
|
166dd98b72 | ||
|
|
fedf477f29 | ||
|
|
bf30e86b84 | ||
|
|
6062128b4b | ||
|
|
cda6d678dc | ||
|
|
0dd36736c7 | ||
|
|
6e45eef2a0 | ||
|
|
a118eeded9 | ||
|
|
ef2121bb70 | ||
|
|
8a6962da9e | ||
|
|
02aee14600 | ||
|
|
4157882f2e | ||
|
|
441a7c093f | ||
|
|
cb251f1648 | ||
|
|
0b3155a47e | ||
|
|
249f3b2e47 | ||
|
|
40397aa39e | ||
|
|
47a18d41f0 | ||
|
|
9ea9b29a69 | ||
|
|
8b1ad633be | ||
|
|
7cf433eb68 | ||
|
|
091e8059c5 | ||
|
|
fd256027ec | ||
|
|
d5564a04db | ||
|
|
0377e4a322 | ||
|
|
6c74e90c5d | ||
|
|
2564bb3e58 | ||
|
|
8a279dd94b | ||
|
|
acd76a10b6 | ||
|
|
b5dc619e0e | ||
|
|
93f26a90d0 | ||
|
|
8c487d3036 | ||
|
|
951b400227 | ||
|
|
f3479a4bc4 | ||
|
|
26078e1f34 | ||
|
|
1cbb482900 | ||
|
|
a3d7a216d5 | ||
|
|
263f5bb8ab | ||
|
|
44de935ef0 | ||
|
|
8b95602211 | ||
|
|
dc2faea5eb | ||
|
|
2113c749b1 | ||
|
|
7fe1d1d68c | ||
|
|
bfb73c992e | ||
|
|
f1fee79ca4 | ||
|
|
82020bcd1f | ||
|
|
258765dc48 | ||
|
|
787e5d4dbf | ||
|
|
3793bb18ae | ||
|
|
167ee487d6 | ||
|
|
beb80ce987 | ||
|
|
0ab9dd8bd0 | ||
|
|
9ba059a159 | ||
|
|
7da7cba812 | ||
|
|
b09f7e30b2 | ||
|
|
57f7811cd0 | ||
|
|
90b4eea1cd | ||
|
|
544de3b91c | ||
|
|
811eea0d3a | ||
|
|
e210328dba | ||
|
|
1e98f1227b | ||
|
|
b87a912ecc | ||
|
|
750a01aa80 | ||
|
|
143af1e091 | ||
|
|
e1f0e8d75b | ||
|
|
2f9d4e68eb | ||
|
|
afb64ed2bf | ||
|
|
71faef3dfd | ||
|
|
09eee46822 | ||
|
|
ae4d8195c0 | ||
|
|
df4f154a93 | ||
|
|
34d8d77344 | ||
|
|
c9852250e4 | ||
|
|
1877910b7e | ||
|
|
9c594bc997 | ||
|
|
1925e39b69 | ||
|
|
0c8bec2126 | ||
|
|
8b2259bf25 | ||
|
|
8ba04ac77a | ||
|
|
f6f22b155c | ||
|
|
2cb48d3d62 | ||
|
|
e3b88b8785 | ||
|
|
efdc892219 | ||
|
|
5aa175241a | ||
|
|
bc01fdb59a | ||
|
|
66f23c1aed | ||
|
|
4cebe3d92b | ||
|
|
ad0a13ebb2 | ||
|
|
e8e5dc6332 | ||
|
|
f271fdb993 | ||
|
|
fbbbcf5cdb | ||
|
|
9fe2970fb3 | ||
|
|
fbb3ffc9e5 | ||
|
|
9819aa38f5 | ||
|
|
58d8b290af | ||
|
|
16f63a7e0c | ||
|
|
23172a3695 | ||
|
|
8553da6679 | ||
|
|
8256ff60b6 | ||
|
|
d5fb6dda49 | ||
|
|
e9a5fadacc | ||
|
|
8465875b24 | ||
|
|
41c12bcea9 | ||
|
|
cf23d0541c | ||
|
|
aaf03a8fc2 | ||
|
|
5b38eaa116 | ||
|
|
9b8ab88e41 | ||
|
|
3194d0ebd4 | ||
|
|
2a1bc70b97 | ||
|
|
2427d0e684 | ||
|
|
941f220f3d | ||
|
|
50aad8f42d | ||
|
|
24069fa7bf | ||
|
|
0e5dfec3bf | ||
|
|
7b6820a012 | ||
|
|
a172e04d5b | ||
|
|
750830b887 | ||
|
|
a51e7804b8 | ||
|
|
94debcfc3a | ||
|
|
c5d3dfd41c | ||
|
|
7491b90c30 | ||
|
|
e3f25ee71f | ||
|
|
588dd54fb6 | ||
|
|
00a0f14743 | ||
|
|
ef42267cfe | ||
|
|
0407e779f9 | ||
|
|
78d6d5ab1b | ||
|
|
fa180cfa13 | ||
|
|
d190d27534 | ||
|
|
916127d8f6 | ||
|
|
7583d8d434 | ||
|
|
b19aa01b72 | ||
|
|
148ef7afef | ||
|
|
5ad42f3b25 | ||
|
|
33bcd7194f | ||
|
|
edf2096b1b | ||
|
|
7fcf2650ee | ||
|
|
81e563b2b3 | ||
|
|
68088341d6 | ||
|
|
348f61951c | ||
|
|
48064306a1 | ||
|
|
373393dce7 | ||
|
|
bd5c85acc3 | ||
|
|
8a6afb3836 | ||
|
|
d8d7ae8e1b | ||
|
|
805b81cea7 | ||
|
|
514243a8e9 | ||
|
|
37113837d1 | ||
|
|
8395bea72d | ||
|
|
ac17a2f2a7 | ||
|
|
a365f185cc | ||
|
|
7e7d8ac4e2 | ||
|
|
345763fcd3 | ||
|
|
b46cc5a241 |
@@ -11,14 +11,6 @@ The Travis CI hook is enabled on the Github repository. This means every pull re
|
||||
is run through a full test suite to ensure it compiles and passes the tests. Failing
|
||||
pull requests will not be merged.
|
||||
|
||||
Although not mandatory, it is also recommended to set up Travis CI for your ol3 fork.
|
||||
For that go to your ol3 fork's Service Hooks page and set up the Travis hook.
|
||||
Then every time you push to your fork, the test suite will be run. This means
|
||||
errors can be caught before creating a pull request. For those making
|
||||
small or occasional contributions, this may be enough to check that your contributions
|
||||
are ok; in this case, you do not need to install the build tools on your local environment
|
||||
as described below.
|
||||
|
||||
### Development dependencies
|
||||
|
||||
The minimum requirements are:
|
||||
|
||||
@@ -1,5 +1,54 @@
|
||||
## Upgrade notes
|
||||
|
||||
### v3.15.0
|
||||
|
||||
#### Internet Explorer 9 support
|
||||
|
||||
As of this release, OpenLayers requires a `classList` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features#Element_prototype_classList.
|
||||
|
||||
#### Immediate rendering API
|
||||
|
||||
Listeners for `precompose`, `render`, and `postcompose` receive an event with a `vectorContext` property with methods for immediate vector rendering. The previous geometry drawing methods have been replaced with a single `vectorContext.drawGeometry(geometry)` method. If you were using any of the following experimental methods on the vector context, replace them with `drawGeometry`:
|
||||
|
||||
* Removed experimental geometry drawing methods: `drawPointGeometry`, `drawLineStringGeometry`, `drawPolygonGeometry`, `drawMultiPointGeometry`, `drawMultiLineStringGeometry`, `drawMultiPolygonGeometry`, and `drawCircleGeometry` (all have been replaced with `drawGeometry`).
|
||||
|
||||
In addition, the previous methods for setting style parts have been replaced with a single `vectorContext.setStyle(style)` method. If you were using any of the following experimental methods on the vector context, replace them with `setStyle`:
|
||||
|
||||
* Removed experimental style setting methods: `setFillStrokeStyle`, `setImageStyle`, `setTextStyle` (all have been replaced with `setStyle`).
|
||||
|
||||
Below is an example of how the vector context might have been used in the past:
|
||||
|
||||
```js
|
||||
// OLD WAY, NO LONGER SUPPORTED
|
||||
map.on('postcompose', function(event) {
|
||||
event.vectorContext.setFillStrokeStyle(style.getFill(), style.getStroke());
|
||||
event.vectorContext.drawPointGeometry(geometry);
|
||||
});
|
||||
```
|
||||
|
||||
Here is an example of how you could accomplish the same with the new methods:
|
||||
```js
|
||||
// NEW WAY, USE THIS INSTEAD OF THE CODE ABOVE
|
||||
map.on('postcompose', function(event) {
|
||||
event.vectorContext.setStyle(style);
|
||||
event.vectorContext.drawGeometry(geometry);
|
||||
});
|
||||
```
|
||||
|
||||
A final change to the immediate rendering API is that `vectorContext.drawFeature()` calls are now "immediate" as well. The drawing now occurs synchronously. This means that any `zIndex` in a style passed to `drawFeature()` will be ignored. To achieve `zIndex` ordering, order your calls to `drawFeature()` instead.
|
||||
|
||||
#### Removal of `ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK`
|
||||
|
||||
The `ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK` define has been removed. The size of the cache can now be defined on every tile based `ol.source`:
|
||||
```js
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM({
|
||||
cacheSize: 128
|
||||
})
|
||||
})
|
||||
```
|
||||
The default cache size is `2048`.
|
||||
|
||||
### v3.14.0
|
||||
|
||||
#### Internet Explorer 9 support
|
||||
|
||||
204
changelog/v3.15.0.md
Normal file
204
changelog/v3.15.0.md
Normal file
@@ -0,0 +1,204 @@
|
||||
# v3.15.0
|
||||
|
||||
## Summary
|
||||
|
||||
The v3.15.0 release includes features and fixes from 136 pull requests since the v3.14.2 release. New features and improvements include:
|
||||
|
||||
* Make ol.source.Cluster more flexible by adding a geometryFunction option (#4917).
|
||||
* Add new CartoDB tile source (#4926).
|
||||
* Improved rendering performance for vector layers by batching polygon fill and stroke instructions (#5149).
|
||||
* Make the tile cache size configurable (#4805).
|
||||
* Add new ol.geom.Geometry#rotate function (#4984).
|
||||
* Accept simpler forms of specifying attribution(s) for sources (#5007).
|
||||
* Support zooming out for ol.interaction.DragZoom (#5031).
|
||||
|
||||
## Upgrade notes
|
||||
|
||||
### v3.15.0
|
||||
|
||||
#### Internet Explorer 9 support
|
||||
|
||||
As of this release, OpenLayers requires a `classList` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features#Element_prototype_classList.
|
||||
|
||||
#### Immediate rendering API
|
||||
|
||||
Listeners for `precompose`, `render`, and `postcompose` receive an event with a `vectorContext` property with methods for immediate vector rendering. The previous geometry drawing methods have been replaced with a single `vectorContext.drawGeometry(geometry)` method. If you were using any of the following experimental methods on the vector context, replace them with `drawGeometry`:
|
||||
|
||||
* Removed experimental geometry drawing methods: `drawPointGeometry`, `drawLineStringGeometry`, `drawPolygonGeometry`, `drawMultiPointGeometry`, `drawMultiLineStringGeometry`, `drawMultiPolygonGeometry`, and `drawCircleGeometry` (all have been replaced with `drawGeometry`).
|
||||
|
||||
In addition, the previous methods for setting style parts have been replaced with a single `vectorContext.setStyle(style)` method. If you were using any of the following experimental methods on the vector context, replace them with `setStyle`:
|
||||
|
||||
* Removed experimental style setting methods: `setFillStrokeStyle`, `setImageStyle`, `setTextStyle` (all have been replaced with `setStyle`).
|
||||
|
||||
Below is an example of how the vector context might have been used in the past:
|
||||
|
||||
```js
|
||||
// OLD WAY, NO LONGER SUPPORTED
|
||||
map.on('postcompose', function(event) {
|
||||
event.vectorContext.setFillStrokeStyle(style.getFill(), style.getStroke());
|
||||
event.vectorContext.drawPointGeometry(geometry);
|
||||
});
|
||||
```
|
||||
|
||||
Here is an example of how you could accomplish the same with the new methods:
|
||||
```js
|
||||
// NEW WAY, USE THIS INSTEAD OF THE CODE ABOVE
|
||||
map.on('postcompose', function(event) {
|
||||
event.vectorContext.setStyle(style);
|
||||
event.vectorContext.drawGeometry(geometry);
|
||||
});
|
||||
```
|
||||
|
||||
A final change to the immediate rendering API is that `vectorContext.drawFeature()` calls are now "immediate" as well. The drawing now occurs synchronously. This means that any `zIndex` in a style passed to `drawFeature()` will be ignored. To achieve `zIndex` ordering, order your calls to `drawFeature()` instead.
|
||||
|
||||
#### Removal of `ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK`
|
||||
|
||||
The `ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK` define has been removed. The size of the cache can now be defined on every tile based `ol.source`:
|
||||
```js
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM({
|
||||
cacheSize: 128
|
||||
})
|
||||
})
|
||||
```
|
||||
The default cache size is `2048`.
|
||||
|
||||
## Full list of changes
|
||||
|
||||
* [#4775](https://github.com/openlayers/ol3/pull/4775) - Remove goog.math.modulo and goog.math.lerp ([@nicholas-l](https://github.com/nicholas-l))
|
||||
* [#5152](https://github.com/openlayers/ol3/pull/5152) - Cartodb cleanup ([@fredj](https://github.com/fredj))
|
||||
* [#4804](https://github.com/openlayers/ol3/pull/4804) - Use Array.isArray instead of goog.isArray ([@fredj](https://github.com/fredj))
|
||||
* [#5149](https://github.com/openlayers/ol3/pull/5149) - Batch polygon fill and stroke instructions ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5159](https://github.com/openlayers/ol3/pull/5159) - Update eslint to version 2.6.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5160](https://github.com/openlayers/ol3/pull/5160) - Update clean-css to version 3.4.11 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5157](https://github.com/openlayers/ol3/pull/5157) - Improve docs for measure example ([@probins](https://github.com/probins))
|
||||
* [#5155](https://github.com/openlayers/ol3/pull/5155) - Fix ol.source.Zoomify tests on firefox ([@fredj](https://github.com/fredj))
|
||||
* [#5086](https://github.com/openlayers/ol3/pull/5086) - Get rid of goog.functions ([@bjornharrtell](https://github.com/bjornharrtell))
|
||||
* [#5105](https://github.com/openlayers/ol3/pull/5105) - Support minZoom in ol.source.Stamen ([@fredj](https://github.com/fredj))
|
||||
* [#4926](https://github.com/openlayers/ol3/pull/4926) - Add CartoDB tile source. ([@aisaacs](https://github.com/aisaacs))
|
||||
* [#5151](https://github.com/openlayers/ol3/pull/5151) - Use fs-extra as fs, remove usage of graceful-fs ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#5124](https://github.com/openlayers/ol3/pull/5124) - Removed goog.dom.classlist ([@nicholas-l](https://github.com/nicholas-l))
|
||||
* [#5150](https://github.com/openlayers/ol3/pull/5150) - Use fs-extra instead of wrench ([@fredj](https://github.com/fredj))
|
||||
* [#5109](https://github.com/openlayers/ol3/pull/5109) - Add some tests for ol.source.TileUTFGrid ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#5139](https://github.com/openlayers/ol3/pull/5139) - Update closure-util to version 1.13.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5141](https://github.com/openlayers/ol3/pull/5141) - Reuse dragListenerKeys_ variable in ol.control.ZoomSlider ([@fredj](https://github.com/fredj))
|
||||
* [#5118](https://github.com/openlayers/ol3/pull/5118) - Remove goog.dom.classlist usage ([@fredj](https://github.com/fredj))
|
||||
* [#5115](https://github.com/openlayers/ol3/pull/5115) - Clarify that lineDash has no effect in IE 10 and below ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#5136](https://github.com/openlayers/ol3/pull/5136) - Update eslint to version 2.5.3 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5123](https://github.com/openlayers/ol3/pull/5123) - Update coveralls to version 2.11.9 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5131](https://github.com/openlayers/ol3/pull/5131) - Update phantomjs-prebuilt to version 2.1.7 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5122](https://github.com/openlayers/ol3/pull/5122) - Update browser support info in intro tutorial ([@probins](https://github.com/probins))
|
||||
* [#5112](https://github.com/openlayers/ol3/pull/5112) - Add decimals option to format write ([@probins](https://github.com/probins))
|
||||
* [#5120](https://github.com/openlayers/ol3/pull/5120) - Add tileJSON option to ol.source.TileUTFGrid ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5119](https://github.com/openlayers/ol3/pull/5119) - Add ol.source.Raster events on API docs page ([@drnextgis](https://github.com/drnextgis))
|
||||
* [#5116](https://github.com/openlayers/ol3/pull/5116) - Improve examples pages on mobile devices a bit ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5113](https://github.com/openlayers/ol3/pull/5113) - Memory leak in ol.control.FullScreen ([@AvatharDG](https://github.com/AvatharDG))
|
||||
* [#5111](https://github.com/openlayers/ol3/pull/5111) - Remove CSS filter in examples ([@fredj](https://github.com/fredj))
|
||||
* [#5108](https://github.com/openlayers/ol3/pull/5108) - Remove unused ol.xml.getAttributeNodeNS function ([@fredj](https://github.com/fredj))
|
||||
* [#5106](https://github.com/openlayers/ol3/pull/5106) - Get rid of goog.math.Vec2 ([@fredj](https://github.com/fredj))
|
||||
* [#5096](https://github.com/openlayers/ol3/pull/5096) - Add tests for ol.source.Zoomify ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#5102](https://github.com/openlayers/ol3/pull/5102) - Fix typo in API docs ([@openlayers](https://github.com/openlayers))
|
||||
* [#5098](https://github.com/openlayers/ol3/pull/5098) - Reintroduce log messages for relevant WebGL assertions ([@bjornharrtell](https://github.com/bjornharrtell))
|
||||
* [#5094](https://github.com/openlayers/ol3/pull/5094) - FAQ: answer question 4 ([@probins](https://github.com/probins))
|
||||
* [#5092](https://github.com/openlayers/ol3/pull/5092) - add raster.jsdoc ([@drnextgis](https://github.com/drnextgis))
|
||||
* [#5081](https://github.com/openlayers/ol3/pull/5081) - Snap to vertices or edges ([@drnextgis](https://github.com/drnextgis))
|
||||
* [#5090](https://github.com/openlayers/ol3/pull/5090) - Update custom-builds.md ([@probins](https://github.com/probins))
|
||||
* [#5089](https://github.com/openlayers/ol3/pull/5089) - Test for both transform coords should use roughlyEqual ([@probins](https://github.com/probins))
|
||||
* [#5080](https://github.com/openlayers/ol3/pull/5080) - Fix geojson write GeometryCollection ([@probins](https://github.com/probins))
|
||||
* [#5088](https://github.com/openlayers/ol3/pull/5088) - DEVELOPING.md: remove section on running Travis on fork ([@probins](https://github.com/probins))
|
||||
* [#5087](https://github.com/openlayers/ol3/pull/5087) - assertion to check that there's a DOM node for target element ([@drnextgis](https://github.com/drnextgis))
|
||||
* [#5069](https://github.com/openlayers/ol3/pull/5069) - Update jquery to version 2.2.2 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5083](https://github.com/openlayers/ol3/pull/5083) - Remove unnecessary lineTo calls in immediate polygon rendering ([@tschaub](https://github.com/tschaub))
|
||||
* [#5082](https://github.com/openlayers/ol3/pull/5082) - Get rid of goog.log. ([@bjornharrtell](https://github.com/bjornharrtell))
|
||||
* [#5079](https://github.com/openlayers/ol3/pull/5079) - Correcting a typo in the upgrade notes ([@tschaub](https://github.com/tschaub))
|
||||
* [#5076](https://github.com/openlayers/ol3/pull/5076) - Update phantomjs-prebuilt to version 2.1.6 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5077](https://github.com/openlayers/ol3/pull/5077) - Make immediate API uniformly synchronous. ([@tschaub](https://github.com/tschaub))
|
||||
* [#5072](https://github.com/openlayers/ol3/pull/5072) - Add setStyle() and drawGeometry() to the immediate rendering API. ([@tschaub](https://github.com/tschaub))
|
||||
* [#5074](https://github.com/openlayers/ol3/pull/5074) - Do not rotate map canvas after composition ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5071](https://github.com/openlayers/ol3/pull/5071) - correct way to determine freehand mode is enabled ([@drnextgis](https://github.com/drnextgis))
|
||||
* [#5066](https://github.com/openlayers/ol3/pull/5066) - Add more getters to ol.source.Vector ([@bartvde](https://github.com/bartvde))
|
||||
* [#5064](https://github.com/openlayers/ol3/pull/5064) - Fix inconsistency in geom docs ([@probins](https://github.com/probins))
|
||||
* [#5063](https://github.com/openlayers/ol3/pull/5063) - Remove inappropriate information from API docs ([@drnextgis](https://github.com/drnextgis))
|
||||
* [#5061](https://github.com/openlayers/ol3/pull/5061) - Remove redundant required option ([@drnextgis](https://github.com/drnextgis))
|
||||
* [#5058](https://github.com/openlayers/ol3/pull/5058) - Note in docs that DOM renderer can also render vectors ([@probins](https://github.com/probins))
|
||||
* [#5056](https://github.com/openlayers/ol3/pull/5056) - Note in docs that WebGL can render points ([@probins](https://github.com/probins))
|
||||
* [#5055](https://github.com/openlayers/ol3/pull/5055) - Fix cruft on kml scale output ([@probins](https://github.com/probins))
|
||||
* [#5051](https://github.com/openlayers/ol3/pull/5051) - Handle aborted tiles in ol.TileQueue ([@fredj](https://github.com/fredj))
|
||||
* [#5049](https://github.com/openlayers/ol3/pull/5049) - Supported browsers all have getComputedStyle ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#5048](https://github.com/openlayers/ol3/pull/5048) - Add tests for ol.dom methods ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#5031](https://github.com/openlayers/ol3/pull/5031) - support zooming out for ol.interaction.DragZoom ([@drnextgis](https://github.com/drnextgis))
|
||||
* [#5036](https://github.com/openlayers/ol3/pull/5036) - Use imgSize when provided ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5020](https://github.com/openlayers/ol3/pull/5020) - Update gaze to version 1.0.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5039](https://github.com/openlayers/ol3/pull/5039) - Update fs-extra to version 0.26.6 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5033](https://github.com/openlayers/ol3/pull/5033) - Document GPX geometry output types ([@probins](https://github.com/probins))
|
||||
* [#5024](https://github.com/openlayers/ol3/pull/5024) - Resize the map canvas less aggressively ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5000](https://github.com/openlayers/ol3/pull/5000) - Remove use of goog.math.Size and goog.style.setBorderBoxSize ([@fredj](https://github.com/fredj))
|
||||
* [#5027](https://github.com/openlayers/ol3/pull/5027) - Clarify default value of featureProjection on geometry write ([@probins](https://github.com/probins))
|
||||
* [#5019](https://github.com/openlayers/ol3/pull/5019) - Update eslint to version 2.4.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5016](https://github.com/openlayers/ol3/pull/5016) - Add basic tests for ol.geom.flat.center ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#5015](https://github.com/openlayers/ol3/pull/5015) - Update proj4 to version 2.3.14 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5013](https://github.com/openlayers/ol3/pull/5013) - Fix typo in test description ([@openlayers](https://github.com/openlayers))
|
||||
* [#5007](https://github.com/openlayers/ol3/pull/5007) - Accept simpler forms of specifying attribution(s) for sources. ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#5011](https://github.com/openlayers/ol3/pull/5011) - Add missing setProjection function to ol.VectorTile API ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5010](https://github.com/openlayers/ol3/pull/5010) - Add and fix API docs for ol.events.Event stack ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5009](https://github.com/openlayers/ol3/pull/5009) - Update tutorials ([@gberaudo](https://github.com/gberaudo))
|
||||
* [#5006](https://github.com/openlayers/ol3/pull/5006) - Use the maintained slimerjs package ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5003](https://github.com/openlayers/ol3/pull/5003) - Add 'function' jsdoc tag to ol.geom.Geometry#rotate ([@fredj](https://github.com/fredj))
|
||||
* [#5002](https://github.com/openlayers/ol3/pull/5002) - Update eslint-config-openlayers to version 4.1.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4999](https://github.com/openlayers/ol3/pull/4999) - Remove use of goog.dom.removeNode ([@fredj](https://github.com/fredj))
|
||||
* [#4990](https://github.com/openlayers/ol3/pull/4990) - Add new ol.source.TileJSON#getTileJSON function ([@fredj](https://github.com/fredj))
|
||||
* [#4998](https://github.com/openlayers/ol3/pull/4998) - Remove unused ol.Map#isDef function ([@fredj](https://github.com/fredj))
|
||||
* [#4995](https://github.com/openlayers/ol3/pull/4995) - Remove unused ol.color functions. ([@tschaub](https://github.com/tschaub))
|
||||
* [#4991](https://github.com/openlayers/ol3/pull/4991) - Do not remove listeners while dispatching event ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4984](https://github.com/openlayers/ol3/pull/4984) - Add new ol.geom.Geometry#rotate function ([@fredj](https://github.com/fredj))
|
||||
* [#4994](https://github.com/openlayers/ol3/pull/4994) - Add alpha default value to ol.Color array form ([@jonataswalker](https://github.com/jonataswalker))
|
||||
* [#4992](https://github.com/openlayers/ol3/pull/4992) - Allow configuration of the test reporter ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#4988](https://github.com/openlayers/ol3/pull/4988) - Update phantomjs-prebuilt to version 2.1.5 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4983](https://github.com/openlayers/ol3/pull/4983) - Update Bing Maps Portal url ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4981](https://github.com/openlayers/ol3/pull/4981) - Remove the viewport on map dispose ([@fredj](https://github.com/fredj))
|
||||
* [#4980](https://github.com/openlayers/ol3/pull/4980) - Remove unused goog.require ([@fredj](https://github.com/fredj))
|
||||
* [#4977](https://github.com/openlayers/ol3/pull/4977) - Add basic tests for ol.geom.flat.length methods ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#4973](https://github.com/openlayers/ol3/pull/4973) - Update eslint to version 2.3.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4971](https://github.com/openlayers/ol3/pull/4971) - Release v3.14.2 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4970](https://github.com/openlayers/ol3/pull/4970) - Tests for ol.Disposable. ([@tschaub](https://github.com/tschaub))
|
||||
* [#4967](https://github.com/openlayers/ol3/pull/4967) - Add missing goog.inherits for ol.render.canvas.Immediate ([@fredj](https://github.com/fredj))
|
||||
* [#4955](https://github.com/openlayers/ol3/pull/4955) - Remove IE workarounds in src/ol/xml.js ([@fredj](https://github.com/fredj))
|
||||
* [#4960](https://github.com/openlayers/ol3/pull/4960) - Simplify clipping of lower resolution regions ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4950](https://github.com/openlayers/ol3/pull/4950) - Remove use of goog.Disposable(). ([@tschaub](https://github.com/tschaub))
|
||||
* [#4963](https://github.com/openlayers/ol3/pull/4963) - Handle more XHR errors in the TileJSON source ([@tschaub](https://github.com/tschaub))
|
||||
* [#4962](https://github.com/openlayers/ol3/pull/4962) - Skip tests where features are not available ([@tschaub](https://github.com/tschaub))
|
||||
* [#4956](https://github.com/openlayers/ol3/pull/4956) - Fix Examples layout page ([@jonataswalker](https://github.com/jonataswalker))
|
||||
* [#4958](https://github.com/openlayers/ol3/pull/4958) - Stop wheel events instead of DOMMouseScroll events ([@fredj](https://github.com/fredj))
|
||||
* [#4947](https://github.com/openlayers/ol3/pull/4947) - IE support for ol.source.Raster. ([@tschaub](https://github.com/tschaub))
|
||||
* [#4944](https://github.com/openlayers/ol3/pull/4944) - Update resemblejs to version 2.2.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4942](https://github.com/openlayers/ol3/pull/4942) - Remove unused files in examples/data/ ([@fredj](https://github.com/fredj))
|
||||
* [#4805](https://github.com/openlayers/ol3/pull/4805) - Add new cacheSize option to ol.source ([@fredj](https://github.com/fredj))
|
||||
* [#4940](https://github.com/openlayers/ol3/pull/4940) - Release v3.14.1 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4939](https://github.com/openlayers/ol3/pull/4939) - Fix rendering of opaque layers with opacity != 1 ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4938](https://github.com/openlayers/ol3/pull/4938) - Get rid of goog.dom.getFirstElementChild ([@fredj](https://github.com/fredj))
|
||||
* [#4937](https://github.com/openlayers/ol3/pull/4937) - Get rid of goog.json ([@fredj](https://github.com/fredj))
|
||||
* [#4936](https://github.com/openlayers/ol3/pull/4936) - Remove jquery from getfeatureinfo-layers example ([@fredj](https://github.com/fredj))
|
||||
* [#4930](https://github.com/openlayers/ol3/pull/4930) - Use ADVANCED instead of ADVANCED_OPTIMIZATIONS ([@fredj](https://github.com/fredj))
|
||||
* [#4917](https://github.com/openlayers/ol3/pull/4917) - Make ol.source.Cluster more flexible by adding a geometryFunction option ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4918](https://github.com/openlayers/ol3/pull/4918) - Don't change the canvas size to clear it ([@fredj](https://github.com/fredj))
|
||||
* [#4923](https://github.com/openlayers/ol3/pull/4923) - Update custom-builds.md ([@xlhomme](https://github.com/xlhomme))
|
||||
* [#4929](https://github.com/openlayers/ol3/pull/4929) - Update clean-css to version 3.4.10 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4928](https://github.com/openlayers/ol3/pull/4928) - Upgrade to JSTS 1.0.2 in example ([@bjornharrtell](https://github.com/bjornharrtell))
|
||||
* [#4927](https://github.com/openlayers/ol3/pull/4927) - Upgrade JSTS in example. ([@bjornharrtell](https://github.com/bjornharrtell))
|
||||
* [#4809](https://github.com/openlayers/ol3/pull/4809) - Fix multipolygon clone. ([@fperucic](https://github.com/fperucic))
|
||||
* [#4924](https://github.com/openlayers/ol3/pull/4924) - Update coveralls to version 2.11.8 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4921](https://github.com/openlayers/ol3/pull/4921) - Unlisten before calling listener and bind to target by default ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4868](https://github.com/openlayers/ol3/pull/4868) - Allow to refresh a source and reload its data. ([@sebasbaumh](https://github.com/sebasbaumh))
|
||||
* [#4903](https://github.com/openlayers/ol3/pull/4903) - Remove use of goog.style.getRelativePosition ([@fredj](https://github.com/fredj))
|
||||
* [#4902](https://github.com/openlayers/ol3/pull/4902) - Remove use of goog.style.getClientPosition ([@fredj](https://github.com/fredj))
|
||||
* [#4916](https://github.com/openlayers/ol3/pull/4916) - Fix ol.format.GeoJSON#writeFeatureObject return type ([@fredj](https://github.com/fredj))
|
||||
* [#4909](https://github.com/openlayers/ol3/pull/4909) - Add ol.renderer.dom.VectorLayer#clearFrame ([@fredj](https://github.com/fredj))
|
||||
* [#4915](https://github.com/openlayers/ol3/pull/4915) - Use {} instead of Object ([@fredj](https://github.com/fredj))
|
||||
* [#4914](https://github.com/openlayers/ol3/pull/4914) - Export ol.proj.equivalent ([@sebasbaumh](https://github.com/sebasbaumh))
|
||||
* [#4908](https://github.com/openlayers/ol3/pull/4908) - Remove use of goog.math.Rect ([@fredj](https://github.com/fredj))
|
||||
* [#4900](https://github.com/openlayers/ol3/pull/4900) - Make ol.format.XML a @struct ([@fredj](https://github.com/fredj))
|
||||
* [#4880](https://github.com/openlayers/ol3/pull/4880) - Update closure-util to version 1.11.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4905](https://github.com/openlayers/ol3/pull/4905) - Remove use of goog.style.setPosition ([@fredj](https://github.com/fredj))
|
||||
* [#4879](https://github.com/openlayers/ol3/pull/4879) - Update metalsmith-layouts to version 1.6.4 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4901](https://github.com/openlayers/ol3/pull/4901) - Release v3.14.0 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4899](https://github.com/openlayers/ol3/pull/4899) - Use ol.format.GMLBase#srsName instead of undeclared srsName_ ([@fredj](https://github.com/fredj))
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"library_url": "https://github.com/google/closure-library/archive/5b25e65.zip"
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
],
|
||||
"externs": [
|
||||
"externs/bingmaps.js",
|
||||
"externs/cartodb.js",
|
||||
"externs/bootstrap.js",
|
||||
"externs/closure-compiler.js",
|
||||
"externs/esrijson.js",
|
||||
@@ -25,16 +26,16 @@
|
||||
],
|
||||
"define": [
|
||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||
"goog.json.USE_NATIVE_JSON=true",
|
||||
"goog.DEBUG=false"
|
||||
],
|
||||
"jscomp_error": [
|
||||
"*"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"useOfGoogBase",
|
||||
"unnecessaryCasts",
|
||||
"useOfGoogBase",
|
||||
"lintChecks",
|
||||
"analyzerChecks",
|
||||
"missingProvide",
|
||||
"unknownDefines"
|
||||
],
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"externs": [
|
||||
"externs/bingmaps.js",
|
||||
"externs/bootstrap.js",
|
||||
"externs/cartodb.js",
|
||||
"externs/closure-compiler.js",
|
||||
"externs/esrijson.js",
|
||||
"externs/example.js",
|
||||
@@ -26,16 +27,16 @@
|
||||
],
|
||||
"define": [
|
||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||
"goog.json.USE_NATIVE_JSON=true",
|
||||
"goog.DEBUG=false"
|
||||
],
|
||||
"jscomp_error": [
|
||||
"*"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"useOfGoogBase",
|
||||
"unnecessaryCasts",
|
||||
"lintChecks"
|
||||
"useOfGoogBase",
|
||||
"lintChecks",
|
||||
"analyzerChecks"
|
||||
],
|
||||
"extra_annotation_name": [
|
||||
"api", "observable"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
|
||||
{{{ extraHead.local }}}
|
||||
{{{ css.tag }}}
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame"></script>
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList"></script>
|
||||
<script src="./resources/zeroclipboard/ZeroClipboard.min.js"></script>
|
||||
<title>{{ title }}</title>
|
||||
</head>
|
||||
@@ -20,14 +20,17 @@
|
||||
<header class="navbar" role="navigation">
|
||||
<div class="container">
|
||||
<div class="display-table pull-left" id="navbar-logo-container">
|
||||
<a class="navbar-brand" href="./"><img src="./resources/logo-70x70.png"> OpenLayers 3 Examples</a>
|
||||
<a class="navbar-brand" href="./"><img src="./resources/logo-70x70.png"> OpenLayers Examples</a>
|
||||
</div>
|
||||
<ul class="nav navbar-nav pull-right">
|
||||
<li><a href="../doc">Docs</a></li>
|
||||
<li><a class="active" href="index.html">Examples</a></li>
|
||||
<li><a href="../apidoc">API</a></li>
|
||||
<li><a href="https://github.com/openlayers/ol3">Code</a></li>
|
||||
</ul>
|
||||
<!-- menu items that get hidden below 768px width -->
|
||||
<nav class='collapse navbar-collapse navbar-responsive-collapse'>
|
||||
<ul class="nav navbar-nav pull-right">
|
||||
<li><a href="../doc">Docs</a></li>
|
||||
<li><a class="active" href="index.html">Examples</a></li>
|
||||
<li><a href="../apidoc">API</a></li>
|
||||
<li><a href="https://github.com/openlayers/ol3">Code</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"compile": {
|
||||
"externs": [
|
||||
"externs/bingmaps.js",
|
||||
"externs/cartodb.js",
|
||||
"externs/closure-compiler.js",
|
||||
"externs/esrijson.js",
|
||||
"externs/geojson.js",
|
||||
@@ -15,21 +16,16 @@
|
||||
],
|
||||
"define": [
|
||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||
"goog.json.USE_NATIVE_JSON=true",
|
||||
"goog.DEBUG=false"
|
||||
],
|
||||
"jscomp_error": [
|
||||
"*"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"unnecessaryCasts",
|
||||
"useOfGoogBase",
|
||||
"lintChecks"
|
||||
],
|
||||
"hide_warnings_for": [
|
||||
"node_modules/closure-util"
|
||||
],
|
||||
"jscomp_warning": [
|
||||
"unnecessaryCasts"
|
||||
"lintChecks",
|
||||
"analyzerChecks"
|
||||
],
|
||||
"extra_annotation_name": [
|
||||
"api", "observable"
|
||||
|
||||
16
doc/faq.md
16
doc/faq.md
@@ -161,6 +161,22 @@ var swissCoord = ol.proj.transform([8.23, 46.86], 'EPSG:4326', 'EPSG:21781');
|
||||
|
||||
## Why is the order of a coordinate [lon,lat], and not [lat,lon]?
|
||||
|
||||
Because of two different and incompatible conventions. Latitude and longitude
|
||||
are normally given in that order. Maps are 2D representations/projections
|
||||
of the earth's surface, with coordinates expressed in the `x,y` grid of the
|
||||
[Cartesian system](https://en.wikipedia.org/wiki/Cartesian_coordinate_system).
|
||||
As they are by convention drawn with west on the left and north at the top,
|
||||
this means that `x` represents longitude, and `y` latitude. As stated above,
|
||||
OpenLayers is designed to handle all projections, but the default view is in
|
||||
projected Cartesian coordinates. It would make no sense to have duplicate
|
||||
functions to handle coordinates in both the Cartesian `x,y` and `lat,lon`
|
||||
systems, so the degrees of latitude and longitude should be entered as though
|
||||
they were Cartesian, in other words, they are `lon,lat`.
|
||||
|
||||
If you have difficulty remembering which way round it is, use the language code
|
||||
for English, `en`, as a mnemonic: East before North.
|
||||
|
||||
#### A practical example
|
||||
So you want to center your map on a certain place on the earth and obviously you
|
||||
need to have its coordinates for this. Let's assume you want your map centered
|
||||
on Schladming, a beautiful place in Austria. Head over to the wikipedia
|
||||
|
||||
@@ -167,8 +167,6 @@ The minimum config file looks like this:
|
||||
"node_modules/openlayers/externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||
"goog.json.USE_NATIVE_JSON=true",
|
||||
"goog.DEBUG=false",
|
||||
"ol.ENABLE_DOM=false",
|
||||
"ol.ENABLE_WEBGL=false"
|
||||
@@ -177,9 +175,6 @@ The minimum config file looks like this:
|
||||
"node_modules/openlayers/externs/olx.js",
|
||||
"node_modules/openlayers/externs/oli.js"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"unknownDefines"
|
||||
],
|
||||
"extra_annotation_name": [
|
||||
"api", "observable"
|
||||
],
|
||||
@@ -223,7 +218,6 @@ Here is a version of `config.json` with more compilation checks enabled:
|
||||
],
|
||||
"define": [
|
||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||
"goog.json.USE_NATIVE_JSON=true",
|
||||
"goog.DEBUG=false",
|
||||
"ol.ENABLE_DOM=false",
|
||||
"ol.ENABLE_WEBGL=false"
|
||||
@@ -233,41 +227,13 @@ Here is a version of `config.json` with more compilation checks enabled:
|
||||
"node_modules/openlayers/externs/oli.js"
|
||||
],
|
||||
"jscomp_error": [
|
||||
"accessControls",
|
||||
"ambiguousFunctionDecl",
|
||||
"checkEventfulObjectDisposal",
|
||||
"checkRegExp",
|
||||
"checkTypes",
|
||||
"checkVars",
|
||||
"const",
|
||||
"constantProperty",
|
||||
"deprecated",
|
||||
"duplicateMessage",
|
||||
"es3",
|
||||
"es5Strict",
|
||||
"externsValidation",
|
||||
"fileoverviewTags",
|
||||
"globalThis",
|
||||
"internetExplorerChecks",
|
||||
"invalidCasts",
|
||||
"misplacedTypeAnnotation",
|
||||
"missingGetCssName",
|
||||
"missingProperties",
|
||||
"missingProvide",
|
||||
"missingRequire",
|
||||
"missingReturn",
|
||||
"newCheckTypes",
|
||||
"nonStandardJsDocs",
|
||||
"suspiciousCode",
|
||||
"strictModuleDepCheck",
|
||||
"typeInvalidation",
|
||||
"undefinedNames",
|
||||
"undefinedVars",
|
||||
"uselessCode",
|
||||
"visibility"
|
||||
"*"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"unknownDefines"
|
||||
"useOfGoogBase",
|
||||
"lintChecks",
|
||||
"analyzerChecks"
|
||||
],
|
||||
"extra_annotation_name": [
|
||||
"api", "observable"
|
||||
|
||||
@@ -13,7 +13,7 @@ This particular tutorial explains how to create custom builds of OpenLayers 3.
|
||||
|
||||
## Requirements
|
||||
|
||||
OpenLayers 3's build tools use Node and Java, so you need to have Node and Java installed on your machine. You can run `node --version` and `java -version` to test that Node and Java are installed, respectively.
|
||||
OpenLayers 3's build tools use Node and Java, so you need to have Node and Java installed on your machine. You can run `node --version` and `java -version` to test that Node and Java are installed, respectively. See [developing guide](https://github.com/openlayers/ol3/blob/master/DEVELOPING.md) for minimum version numbers required.
|
||||
|
||||
## Download OpenLayers
|
||||
|
||||
@@ -60,17 +60,12 @@ Creating a custom build requires writing a build configuration file. The format
|
||||
"externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||
"goog.json.USE_NATIVE_JSON=true",
|
||||
"goog.DEBUG=false"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"unknownDefines"
|
||||
],
|
||||
"extra_annotation_name": [
|
||||
"api", "observable"
|
||||
],
|
||||
"compilation_level": "ADVANCED_OPTIMIZATIONS",
|
||||
"compilation_level": "ADVANCED",
|
||||
"manage_closure_dependencies": true
|
||||
}
|
||||
}
|
||||
@@ -192,16 +187,19 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openla
|
||||
{
|
||||
"exports": [
|
||||
"ol.layer.Heatmap",
|
||||
"ol.source.KML",
|
||||
"ol.source.Vector",
|
||||
"ol.format.KML",
|
||||
"ol.layer.Heatmap#getSource",
|
||||
"ol.source.KML#on",
|
||||
"ol.source.Vector#on",
|
||||
"ol.source.VectorEvent#feature",
|
||||
"ol.Feature#get",
|
||||
"ol.Feature#set",
|
||||
"ol.layer.Tile",
|
||||
"ol.source.Stamen",
|
||||
"ol.Map",
|
||||
"ol.View"
|
||||
"ol.View",
|
||||
"ol.layer.Heatmap#setRadius",
|
||||
"ol.layer.Heatmap#setBlur"
|
||||
],
|
||||
"compile": {
|
||||
"externs": [
|
||||
@@ -213,10 +211,9 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openla
|
||||
"ol.ENABLE_WEBGL=false",
|
||||
"ol.ENABLE_PROJ4JS=false",
|
||||
"ol.ENABLE_IMAGE=false",
|
||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||
"goog.DEBUG=false"
|
||||
],
|
||||
"compilation_level": "ADVANCED_OPTIMIZATIONS",
|
||||
"compilation_level": "ADVANCED",
|
||||
"manage_closure_dependencies": true
|
||||
}
|
||||
}
|
||||
@@ -226,6 +223,10 @@ The exports are given here in the order in which they occur in the `heatmaps-ear
|
||||
|
||||
As this example uses a vector layer it is necessary to remove `"ol.ENABLE_VECTOR=false"` in the `define` section of the configuration.
|
||||
|
||||
## Maintaining the code
|
||||
|
||||
If you installed OpenLayers from the Node package, you can use `npm` to upgrade to the latest version. If you cloned the Github repo, simply pulling in the latest code may not be enough, as some of the packages used, for example, the compiler, may need upgrading too. Do this by using `npm install` rather than `npm update`.
|
||||
|
||||
## Conclusion
|
||||
|
||||
This tutorial should have given you the information you need to create custom builds, i.e. builds tailored to your application. See the [tasks readme](https://github.com/openlayers/ol3/tree/master/tasks/readme.md) for more information on the build scripts and the properties you can use in the build configuration file.
|
||||
|
||||
@@ -24,7 +24,7 @@ Although Closure library functions are widely used within OL3, none of them are
|
||||
Unlike in, say, Node, where a module's exports are fixed in the source, with Closure Compiler, exports can be defined at compile time. This makes it easy to create builds that are customized to the needs of a particular site or application: a __custom build__ only exports those properties and methods needed by the site or application. As the full build is large, and will probably become larger as new features are added to the API, it's recommended that sites create a custom build for production software.
|
||||
|
||||
## Renderers and Browser Support
|
||||
The library currently includes three renderers: Canvas, DOM, and WebGL. All three support raster data from tile/image servers, but only the Canvas renderer currently supports vector data. This means that only those browsers that [support Canvas](http://caniuse.com/canvas) can handle vector data. In particular, this excludes Internet Explorer versions before 9, though there is some support for those in the DOM renderer. Clearly, the WebGL renderer can only be used on those devices and browsers supporting WebGL.
|
||||
The library currently includes three renderers: Canvas, DOM, and WebGL. All three support both raster data from tile/image servers, and vector data; WebGL however only supports Point vectors and does not support labels. Clearly only those browsers that [support Canvas](http://caniuse.com/canvas) can use the Canvas renderer. Equally, the WebGL renderer can only be used on those devices and [browsers](http://caniuse.com/webgl) that support WebGL. Internet Explorer versions before 9 are not supported at all.
|
||||
|
||||
The library is intended for use on both desktop/laptop and mobile devices.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ docs: >
|
||||
<p>When the Bing Maps tile service doesn't have tiles for a given resolution and region it returns "placeholder" tiles indicating that. Zoom the map beyond level 19 to see the "placeholder" tiles. If you want OpenLayers to display stretched tiles in place of "placeholder" tiles beyond zoom level 19 then set <code>maxZoom</code> to <code>19</code> in the options passed to <code>ol.source.BingMaps</code>.</p>
|
||||
tags: "bing, bing-maps"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<select id="layer-select">
|
||||
|
||||
26
examples/cartodb.html
Normal file
26
examples/cartodb.html
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: CartoDB source example
|
||||
shortdesc: Example of a cartodb map.
|
||||
docs: >
|
||||
A simple example with an anonymous cartodb map
|
||||
tags: "simple, openstreetmap, attribution"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<div>
|
||||
<form class="form-horizontal">
|
||||
<label>
|
||||
Show countries larger than
|
||||
<select id="country-area" class="form-control">
|
||||
<option value="0" default>0 ㎢</option>
|
||||
<option value="5000">5000 ㎢</option>
|
||||
<option value="10000">10000 ㎢</option>
|
||||
<option value="50000">50000 ㎢</option>
|
||||
<option value="100000">100000 ㎢</option>
|
||||
</select>
|
||||
</label>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
48
examples/cartodb.js
Normal file
48
examples/cartodb.js
Normal file
@@ -0,0 +1,48 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.CartoDB');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
var mapConfig = {
|
||||
'layers': [{
|
||||
'type': 'cartodb',
|
||||
'options': {
|
||||
'cartocss_version': '2.1.1',
|
||||
'cartocss': '#layer { polygon-fill: #F00; }',
|
||||
'sql': 'select * from european_countries_e where area > 0'
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
||||
var cartoDBSource = new ol.source.CartoDB({
|
||||
account: 'documentation',
|
||||
config: mapConfig
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
source: cartoDBSource
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
})
|
||||
});
|
||||
|
||||
function setArea(n) {
|
||||
mapConfig.layers[0].options.sql =
|
||||
'select * from european_countries_e where area > ' + n;
|
||||
cartoDBSource.setConfig(mapConfig);
|
||||
}
|
||||
|
||||
|
||||
document.getElementById('country-area').addEventListener('change', function() {
|
||||
setArea(this.value);
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
@@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" version="1.0.0">
|
||||
<sld:NamedLayer>
|
||||
<sld:Name>countries</sld:Name>
|
||||
<sld:UserStyle>
|
||||
<sld:Name>countries</sld:Name>
|
||||
<sld:Title>A sample style for countries</sld:Title>
|
||||
<sld:IsDefault>1</sld:IsDefault>
|
||||
<sld:Abstract>A sample style for countries</sld:Abstract>
|
||||
<sld:FeatureTypeStyle>
|
||||
<sld:Name>name</sld:Name>
|
||||
<sld:Rule>
|
||||
<sld:Name>Sample</sld:Name>
|
||||
<sld:Title>Sample</sld:Title>
|
||||
<sld:PolygonSymbolizer>
|
||||
<sld:Fill>
|
||||
<sld:CssParameter name="fill">#ff0000</sld:CssParameter>
|
||||
<sld:CssParameter name="fill-opacity">0.6</sld:CssParameter>
|
||||
</sld:Fill>
|
||||
<sld:Stroke>
|
||||
<sld:CssParameter name="stroke">#00FF00</sld:CssParameter>
|
||||
<sld:CssParameter name="stroke-opacity">0.5</sld:CssParameter>
|
||||
<sld:CssParameter name="stroke-width">4</sld:CssParameter>
|
||||
</sld:Stroke>
|
||||
</sld:PolygonSymbolizer>
|
||||
</sld:Rule>
|
||||
<sld:Rule>
|
||||
<sld:MaxScaleDenominator>20000000</sld:MaxScaleDenominator>
|
||||
<sld:TextSymbolizer>
|
||||
<sld:Label>
|
||||
<ogc:PropertyName>name</ogc:PropertyName>
|
||||
</sld:Label>
|
||||
<sld:Font>
|
||||
<sld:CssParameter name="font-family">Arial</sld:CssParameter>
|
||||
<sld:CssParameter name="font-size">10</sld:CssParameter>
|
||||
<sld:CssParameter name="font-style">Normal</sld:CssParameter>
|
||||
</sld:Font>
|
||||
</sld:TextSymbolizer>
|
||||
</sld:Rule>
|
||||
</sld:FeatureTypeStyle>
|
||||
</sld:UserStyle>
|
||||
</sld:NamedLayer>
|
||||
</sld:StyledLayerDescriptor>
|
||||
@@ -6,7 +6,7 @@ docs: >
|
||||
Example of using the drag-and-drop interaction with a ol.source.ImageVector. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. Each file is rendered to an image on the client.
|
||||
tags: "drag-and-drop-image-vector, gpx, geojson, igc, kml, topojson, vector, image"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<div id="info"> </div>
|
||||
|
||||
@@ -6,7 +6,7 @@ docs: >
|
||||
Example of using the drag-and-drop interaction. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. There is no projection transform support, so this will only work with data in EPSG:4326 and EPSG:3857.
|
||||
tags: "drag-and-drop, gpx, geojson, igc, kml, topojson"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<div id="info"> </div>
|
||||
|
||||
@@ -25,11 +25,13 @@ var map = new ol.Map({
|
||||
})
|
||||
});
|
||||
|
||||
var imageStyle = new ol.style.Circle({
|
||||
radius: 5,
|
||||
snapToPixel: false,
|
||||
fill: new ol.style.Fill({color: 'yellow'}),
|
||||
stroke: new ol.style.Stroke({color: 'red', width: 1})
|
||||
var imageStyle = new ol.style.Style({
|
||||
image: new ol.style.Circle({
|
||||
radius: 5,
|
||||
snapToPixel: false,
|
||||
fill: new ol.style.Fill({color: 'yellow'}),
|
||||
stroke: new ol.style.Stroke({color: 'red', width: 1})
|
||||
})
|
||||
});
|
||||
|
||||
var headInnerImageStyle = new ol.style.Style({
|
||||
@@ -40,10 +42,12 @@ var headInnerImageStyle = new ol.style.Style({
|
||||
})
|
||||
});
|
||||
|
||||
var headOuterImageStyle = new ol.style.Circle({
|
||||
radius: 5,
|
||||
snapToPixel: false,
|
||||
fill: new ol.style.Fill({color: 'black'})
|
||||
var headOuterImageStyle = new ol.style.Style({
|
||||
image: new ol.style.Circle({
|
||||
radius: 5,
|
||||
snapToPixel: false,
|
||||
fill: new ol.style.Fill({color: 'black'})
|
||||
})
|
||||
});
|
||||
|
||||
var n = 200;
|
||||
@@ -63,16 +67,16 @@ map.on('postcompose', function(event) {
|
||||
var y = (R + r) * Math.sin(t) + p * Math.sin((R + r) * t / r);
|
||||
coordinates.push([x, y]);
|
||||
}
|
||||
vectorContext.setImageStyle(imageStyle);
|
||||
vectorContext.drawMultiPointGeometry(
|
||||
new ol.geom.MultiPoint(coordinates), null);
|
||||
vectorContext.setStyle(imageStyle);
|
||||
vectorContext.drawGeometry(new ol.geom.MultiPoint(coordinates));
|
||||
|
||||
var headPoint = new ol.geom.Point(coordinates[coordinates.length - 1]);
|
||||
var headFeature = new ol.Feature(headPoint);
|
||||
vectorContext.drawFeature(headFeature, headInnerImageStyle);
|
||||
|
||||
vectorContext.setImageStyle(headOuterImageStyle);
|
||||
vectorContext.drawMultiPointGeometry(headPoint, null);
|
||||
vectorContext.setStyle(headOuterImageStyle);
|
||||
vectorContext.drawGeometry(headPoint);
|
||||
|
||||
vectorContext.setStyle(headInnerImageStyle);
|
||||
vectorContext.drawGeometry(headPoint);
|
||||
|
||||
map.render();
|
||||
});
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
}
|
||||
.tooltip.in {
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
.tooltip.top .tooltip-arrow {
|
||||
border-top-color: white;
|
||||
|
||||
@@ -25,13 +25,14 @@ var styleFunction = function(feature) {
|
||||
if (!style) {
|
||||
var canvas =
|
||||
/** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
|
||||
var render = ol.render.toContext(
|
||||
var vectorContext = ol.render.toContext(
|
||||
/** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')),
|
||||
{size: [size + 2, size + 2], pixelRatio: size / 10});
|
||||
render.setFillStrokeStyle(
|
||||
new ol.style.Fill({color: 'rgba(255, 153, 0, 0.4)'}),
|
||||
new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 1}));
|
||||
render.drawPolygonGeometry(new ol.geom.Polygon(
|
||||
vectorContext.setStyle(new ol.style.Style({
|
||||
fill: new ol.style.Fill({color: 'rgba(255, 153, 0, 0.4)'}),
|
||||
stroke: new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 1})
|
||||
}));
|
||||
vectorContext.drawGeometry(new ol.geom.Polygon(
|
||||
[[[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]]]));
|
||||
style = new ol.style.Style({
|
||||
image: new ol.style.Icon({
|
||||
|
||||
@@ -12,6 +12,7 @@ goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Circle');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
@@ -67,17 +68,19 @@ function flash(feature) {
|
||||
var radius = ol.easing.easeOut(elapsedRatio) * 25 + 5;
|
||||
var opacity = ol.easing.easeOut(1 - elapsedRatio);
|
||||
|
||||
var flashStyle = new ol.style.Circle({
|
||||
radius: radius,
|
||||
snapToPixel: false,
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'rgba(255, 0, 0, ' + opacity + ')',
|
||||
width: 1
|
||||
var style = new ol.style.Style({
|
||||
image: new ol.style.Circle({
|
||||
radius: radius,
|
||||
snapToPixel: false,
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'rgba(255, 0, 0, ' + opacity + ')',
|
||||
width: 0.25 + opacity
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
vectorContext.setImageStyle(flashStyle);
|
||||
vectorContext.drawPointGeometry(flashGeom, null);
|
||||
vectorContext.setStyle(style);
|
||||
vectorContext.drawGeometry(flashGeom);
|
||||
if (elapsed > duration) {
|
||||
ol.Observable.unByKey(listenerKey);
|
||||
return;
|
||||
|
||||
@@ -27,12 +27,11 @@ var map = new ol.Map({
|
||||
})
|
||||
});
|
||||
|
||||
var defaultStroke = new ol.style.Stroke({
|
||||
color: '#EAE911',
|
||||
width: 2
|
||||
});
|
||||
var defaultStyle = new ol.style.Style({
|
||||
stroke: defaultStroke
|
||||
var style = new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#EAE911',
|
||||
width: 2
|
||||
})
|
||||
});
|
||||
|
||||
var flightsSource;
|
||||
@@ -47,14 +46,13 @@ var pointsPerMs = 0.1;
|
||||
var animateFlights = function(event) {
|
||||
var vectorContext = event.vectorContext;
|
||||
var frameState = event.frameState;
|
||||
vectorContext.setFillStrokeStyle(null, defaultStroke);
|
||||
vectorContext.setStyle(style);
|
||||
|
||||
var features = flightsSource.getFeatures();
|
||||
for (var i = 0; i < features.length; i++) {
|
||||
var feature = features[i];
|
||||
if (!feature.get('finished')) {
|
||||
// only draw the lines for which the animation has not
|
||||
// finished yet
|
||||
// only draw the lines for which the animation has not finished yet
|
||||
var coords = feature.getGeometry().getCoordinates();
|
||||
var elapsedTime = frameState.time - feature.get('start');
|
||||
var elapsedPoints = elapsedTime * pointsPerMs;
|
||||
@@ -67,19 +65,17 @@ var animateFlights = function(event) {
|
||||
var currentLine = new ol.geom.LineString(coords.slice(0, maxIndex));
|
||||
|
||||
// directly draw the line with the vector context
|
||||
vectorContext.drawLineStringGeometry(currentLine, feature);
|
||||
vectorContext.drawGeometry(currentLine);
|
||||
}
|
||||
}
|
||||
// tell OL3 to continue the postcompose animation
|
||||
// tell OL3 to continue the animation
|
||||
map.render();
|
||||
};
|
||||
|
||||
flightsSource = new ol.source.Vector({
|
||||
wrapX: false,
|
||||
attributions: [new ol.Attribution({
|
||||
html: 'Flight data by ' +
|
||||
'<a href="http://openflights.org/data.html">OpenFlights</a>,'
|
||||
})],
|
||||
attributions: 'Flight data by ' +
|
||||
'<a href="http://openflights.org/data.html">OpenFlights</a>,',
|
||||
loader: function() {
|
||||
var url = 'data/openflights/flights.json';
|
||||
fetch(url).then(function(response) {
|
||||
@@ -121,7 +117,7 @@ var flightsLayer = new ol.layer.Vector({
|
||||
// if the animation is still active for a feature, do not
|
||||
// render the feature with the layer style
|
||||
if (feature.get('finished')) {
|
||||
return defaultStyle;
|
||||
return style;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ var map = new ol.Map({
|
||||
});
|
||||
|
||||
function makeFractal(depth) {
|
||||
var geometry = /** @type {ol.geom.LineString} */ (triangle.clone());
|
||||
var geometry = triangle.clone();
|
||||
var graph = coordsToGraph(geometry.getCoordinates());
|
||||
for (var i = 0; i < depth; ++i) {
|
||||
var node = graph;
|
||||
|
||||
@@ -7,6 +7,6 @@ docs: >
|
||||
<p>If there is no button on the map, your browser does not support the <a href="http://caniuse.com/#feat=fullscreen">Full Screen API</a>.</p>
|
||||
tags: "full-screen, drag, rotate, zoom, bing, bing-maps"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -7,6 +7,6 @@ docs: >
|
||||
<p>If there is no button on the map, your browser does not support the <a href="http://caniuse.com/#feat=fullscreen">Full Screen API</a>.</p>
|
||||
tags: "full-screen, bing, bing-maps"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -9,8 +9,6 @@ docs: >
|
||||
`ol.format.WMSGetFeatureInfo` format object, which allows features returned
|
||||
by a single WMS GetFeatureInfo request that asks for more than one layer
|
||||
to be read by layer name.
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
---
|
||||
<table id="info">
|
||||
<tr>
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
goog.require('ol.format.WMSGetFeatureInfo');
|
||||
|
||||
$.ajax({
|
||||
url: './data/wmsgetfeatureinfo/osm-restaurant-hotel.xml',
|
||||
success: function(response) {
|
||||
fetch('data/wmsgetfeatureinfo/osm-restaurant-hotel.xml').then(function(response) {
|
||||
return response.text();
|
||||
}).then(function(response) {
|
||||
|
||||
// this is the standard way to read the features
|
||||
var allFeatures = new ol.format.WMSGetFeatureInfo().readFeatures(response);
|
||||
$('#all').html(allFeatures.length.toString());
|
||||
// this is the standard way to read the features
|
||||
var allFeatures = new ol.format.WMSGetFeatureInfo().readFeatures(response);
|
||||
document.getElementById('all').innerText = allFeatures.length.toString();
|
||||
|
||||
// when specifying the 'layers' options, only the features of those
|
||||
// layers are returned by the format
|
||||
var hotelFeatures = new ol.format.WMSGetFeatureInfo({
|
||||
layers: ['hotel']
|
||||
}).readFeatures(response);
|
||||
$('#hotel').html(hotelFeatures.length.toString());
|
||||
// when specifying the 'layers' options, only the features of those
|
||||
// layers are returned by the format
|
||||
var hotelFeatures = new ol.format.WMSGetFeatureInfo({
|
||||
layers: ['hotel']
|
||||
}).readFeatures(response);
|
||||
document.getElementById('hotel').innerText = hotelFeatures.length.toString();
|
||||
|
||||
var restaurantFeatures = new ol.format.WMSGetFeatureInfo({
|
||||
layers: ['restaurant']
|
||||
}).readFeatures(response);
|
||||
$('#restaurant').html(restaurantFeatures.length.toString());
|
||||
var restaurantFeatures = new ol.format.WMSGetFeatureInfo({
|
||||
layers: ['restaurant']
|
||||
}).readFeatures(response);
|
||||
document.getElementById('restaurant').innerText = restaurantFeatures.length.toString();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ docs: >
|
||||
Example of using the GPX source.
|
||||
tags: "GPX"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<div id="info"> </div>
|
||||
|
||||
@@ -86,10 +86,7 @@ var map = new ol.Map({
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM({
|
||||
attributions: [
|
||||
new ol.Attribution({
|
||||
html: 'All maps © ' +
|
||||
'<a href="http://www.opencyclemap.org/">OpenCycleMap</a>'
|
||||
}),
|
||||
'All maps © <a href="http://www.opencyclemap.org/">OpenCycleMap</a>',
|
||||
ol.source.OSM.ATTRIBUTION
|
||||
],
|
||||
url: 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png'
|
||||
@@ -155,27 +152,26 @@ map.on('click', function(evt) {
|
||||
displaySnap(evt.coordinate);
|
||||
});
|
||||
|
||||
var imageStyle = new ol.style.Circle({
|
||||
radius: 5,
|
||||
fill: null,
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'rgba(255,0,0,0.9)',
|
||||
width: 1
|
||||
})
|
||||
});
|
||||
var strokeStyle = new ol.style.Stroke({
|
||||
var stroke = new ol.style.Stroke({
|
||||
color: 'rgba(255,0,0,0.9)',
|
||||
width: 1
|
||||
})
|
||||
var style = new ol.style.Style({
|
||||
stroke: stroke,
|
||||
image: new ol.style.Circle({
|
||||
radius: 5,
|
||||
fill: null,
|
||||
stroke: stroke
|
||||
})
|
||||
});
|
||||
map.on('postcompose', function(evt) {
|
||||
var vectorContext = evt.vectorContext;
|
||||
vectorContext.setStyle(style);
|
||||
if (point !== null) {
|
||||
vectorContext.setImageStyle(imageStyle);
|
||||
vectorContext.drawPointGeometry(point);
|
||||
vectorContext.drawGeometry(point);
|
||||
}
|
||||
if (line !== null) {
|
||||
vectorContext.setFillStrokeStyle(null, strokeStyle);
|
||||
vectorContext.drawLineStringGeometry(line);
|
||||
vectorContext.drawGeometry(line);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -187,8 +183,7 @@ var featureOverlay = new ol.layer.Vector({
|
||||
radius: 5,
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(255,0,0,0.9)'
|
||||
}),
|
||||
stroke: null
|
||||
})
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@ docs: >
|
||||
In this example, the <code>postcompose</code> listener applies a filter to the image data.</p>
|
||||
tags: "filter, image manipulation"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<select id="kernel" name="kernel">
|
||||
|
||||
@@ -190,12 +190,15 @@
|
||||
<span id="count"></span>
|
||||
</form>
|
||||
</div>
|
||||
<ul class="nav navbar-nav pull-right">
|
||||
<li><a href="../doc">Docs</a></li>
|
||||
<li><a class="active" href="index.html">Examples</a></li>
|
||||
<li><a href="../apidoc">API</a></li>
|
||||
<li><a href="https://github.com/openlayers/ol3">Code</a></li>
|
||||
</ul>
|
||||
<!-- menu items that get hidden below 768px width -->
|
||||
<nav class='collapse navbar-collapse navbar-responsive-collapse'>
|
||||
<ul class="nav navbar-nav pull-right">
|
||||
<li><a href="../doc">Docs</a></li>
|
||||
<li><a class="active" href="index.html">Examples</a></li>
|
||||
<li><a href="../apidoc">API</a></li>
|
||||
<li><a href="https://github.com/openlayers/ol3">Code</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ docs: >
|
||||
with OpenLayers 3.
|
||||
tags: "vector, jsts, buffer"
|
||||
resources:
|
||||
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/lib/0.17.0/javascript.util.min.js
|
||||
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/lib/0.17.0/jsts.min.js
|
||||
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/1.0.2/jsts.min.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -18,7 +18,7 @@ fetch('data/geojson/roads-seoul.geojson').then(function(response) {
|
||||
var format = new ol.format.GeoJSON();
|
||||
var features = format.readFeatures(json, {featureProjection: 'EPSG:3857'});
|
||||
|
||||
var parser = new jsts.io.olParser();
|
||||
var parser = new jsts.io.OL3Parser();
|
||||
|
||||
for (var i = 0; i < features.length; i++) {
|
||||
var feature = features[i];
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
}
|
||||
.tooltip.in {
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
.tooltip.top .tooltip-arrow {
|
||||
border-top-color: white;
|
||||
|
||||
@@ -6,7 +6,7 @@ docs: >
|
||||
This example uses the <code>ol.format.KML</code> to parse KML for rendering with a vector source.
|
||||
tags: "KML"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<div id="info"> </div>
|
||||
|
||||
@@ -10,6 +10,6 @@ docs: >
|
||||
<p>Move around the map to see the effect. Use the ↑ up and ↓ down arrow keys to adjust the spyglass size.</p>
|
||||
tags: "spy, image manipulation"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -6,7 +6,7 @@ docs: >
|
||||
Example of a Layer swipe map.
|
||||
tags: "swipe, openstreetmap"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<input id="swipe" type="range" style="width: 100%">
|
||||
|
||||
@@ -9,10 +9,7 @@ goog.require('ol.source.OSM');
|
||||
var openCycleMapLayer = new ol.layer.Tile({
|
||||
source: new ol.source.OSM({
|
||||
attributions: [
|
||||
new ol.Attribution({
|
||||
html: 'All maps © ' +
|
||||
'<a href="http://www.opencyclemap.org/">OpenCycleMap</a>'
|
||||
}),
|
||||
'All maps © <a href="http://www.opencyclemap.org/">OpenCycleMap</a>',
|
||||
ol.source.OSM.ATTRIBUTION
|
||||
],
|
||||
url: 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png'
|
||||
@@ -22,10 +19,7 @@ var openCycleMapLayer = new ol.layer.Tile({
|
||||
var openSeaMapLayer = new ol.layer.Tile({
|
||||
source: new ol.source.OSM({
|
||||
attributions: [
|
||||
new ol.Attribution({
|
||||
html: 'All maps © ' +
|
||||
'<a href="http://www.openseamap.org/">OpenSeaMap</a>'
|
||||
}),
|
||||
'All maps © <a href="http://www.openseamap.org/">OpenSeaMap</a>',
|
||||
ol.source.OSM.ATTRIBUTION
|
||||
],
|
||||
opaque: false,
|
||||
|
||||
@@ -45,11 +45,9 @@ var map = new ol.Map({
|
||||
new ol.layer.VectorTile({
|
||||
preload: Infinity,
|
||||
source: new ol.source.VectorTile({
|
||||
attributions: [new ol.Attribution({
|
||||
html: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
||||
'© <a href="http://www.openstreetmap.org/copyright">' +
|
||||
'OpenStreetMap contributors</a>'
|
||||
})],
|
||||
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
||||
'© <a href="http://www.openstreetmap.org/copyright">' +
|
||||
'OpenStreetMap contributors</a>',
|
||||
format: new ol.format.MVT(),
|
||||
tileGrid: new ol.tilegrid.TileGrid({
|
||||
extent: ol.proj.get('EPSG:3857').getExtent(),
|
||||
|
||||
@@ -17,11 +17,9 @@ var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.VectorTile({
|
||||
source: new ol.source.VectorTile({
|
||||
attributions: [new ol.Attribution({
|
||||
html: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
||||
'© <a href="http://www.openstreetmap.org/copyright">' +
|
||||
'OpenStreetMap contributors</a>'
|
||||
})],
|
||||
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
||||
'© <a href="http://www.openstreetmap.org/copyright">' +
|
||||
'OpenStreetMap contributors</a>',
|
||||
format: new ol.format.MVT(),
|
||||
tileGrid: ol.tilegrid.createXYZ({maxZoom: 22}),
|
||||
tilePixelRatio: 16,
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Measure
|
||||
shortdesc: Example of using the ol.interaction.Draw interaction for creating simple measuring application.
|
||||
shortdesc: Example of using the ol.interaction.Draw interaction to create a simple measuring application.
|
||||
docs: >
|
||||
<p><i>NOTE: If use geodesic measures is not checked, measure is done in simple way on projected plane. Earth curvature is not taken into account</i></p>
|
||||
<p><i>NOTE: By default, length and area are calculated using the projected coordinates. This is not accurate for projections like Mercator where the projected meters do not correspond to meters on the ground. To get a standarized measurement across all projections, use the geodesic measures.</i></p>
|
||||
tags: "draw, edit, measure, vector"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<form class="form-inline">
|
||||
<label>Geometry type </label>
|
||||
<label>Measurement type </label>
|
||||
<select id="type">
|
||||
<option value="length">Length</option>
|
||||
<option value="area">Area</option>
|
||||
<option value="length">Length (LineString)</option>
|
||||
<option value="area">Area (Polygon)</option>
|
||||
</select>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" id="geodesic">
|
||||
|
||||
@@ -174,7 +174,7 @@ var formatLength = function(line) {
|
||||
|
||||
|
||||
/**
|
||||
* Format length output.
|
||||
* Format area output.
|
||||
* @param {ol.geom.Polygon} polygon The polygon.
|
||||
* @return {string} Formatted area.
|
||||
*/
|
||||
@@ -243,10 +243,10 @@ function addInteraction() {
|
||||
var geom = evt.target;
|
||||
var output;
|
||||
if (geom instanceof ol.geom.Polygon) {
|
||||
output = formatArea(/** @type {ol.geom.Polygon} */ (geom));
|
||||
output = formatArea(geom);
|
||||
tooltipCoord = geom.getInteriorPoint().getCoordinates();
|
||||
} else if (geom instanceof ol.geom.LineString) {
|
||||
output = formatLength(/** @type {ol.geom.LineString} */ (geom));
|
||||
output = formatLength(geom);
|
||||
tooltipCoord = geom.getLastCoordinate();
|
||||
}
|
||||
measureTooltipElement.innerHTML = output;
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Full-Screen Mobile
|
||||
shortdesc: Example of a full screen map.
|
||||
tags: "fullscreen, geolocation, mobile"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
@@ -6,7 +6,7 @@ docs: >
|
||||
<p>The map on the top preloads low resolution tiles. The map on the bottom does not use any preloading. Try zooming out and panning to see the difference.</p>
|
||||
tags: "preload, bing"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map1" class="map"></div>
|
||||
<div id="map2" class="map"></div>
|
||||
|
||||
@@ -22,7 +22,7 @@ tags: "raster, pixel"
|
||||
resources:
|
||||
- http://d3js.org/d3.v3.min.js
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div class="rel">
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -25,7 +25,7 @@ docs: >
|
||||
</p>
|
||||
tags: "raster, region growing"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map" style="cursor: pointer"></div>
|
||||
<table class="controls">
|
||||
|
||||
@@ -59,7 +59,7 @@ function growRegion(inputs, data) {
|
||||
}
|
||||
edge = newedge;
|
||||
}
|
||||
return new ImageData(outputData, width, height);
|
||||
return {data: outputData, width: width, height: height};
|
||||
}
|
||||
|
||||
function next4Edges(edge) {
|
||||
|
||||
@@ -5,21 +5,25 @@ goog.require('ol.render');
|
||||
goog.require('ol.style.Circle');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
|
||||
var canvas = document.getElementById('canvas');
|
||||
var render = ol.render.toContext(canvas.getContext('2d'), {size: [100, 100]});
|
||||
var vectorContext = ol.render.toContext(canvas.getContext('2d'), {size: [100, 100]});
|
||||
|
||||
var fill = new ol.style.Fill({color: 'blue'});
|
||||
var stroke = new ol.style.Stroke({color: 'black'});
|
||||
render.setFillStrokeStyle(fill, stroke);
|
||||
render.setImageStyle(new ol.style.Circle({
|
||||
radius: 10,
|
||||
var style = new ol.style.Style({
|
||||
fill: fill,
|
||||
stroke: stroke
|
||||
}));
|
||||
stroke: stroke,
|
||||
image: new ol.style.Circle({
|
||||
radius: 10,
|
||||
fill: fill,
|
||||
stroke: stroke
|
||||
})
|
||||
})
|
||||
vectorContext.setStyle(style);
|
||||
|
||||
render.drawLineStringGeometry(new ol.geom.LineString([[10, 10], [90, 90]]));
|
||||
render.drawPolygonGeometry(
|
||||
new ol.geom.Polygon([[[2, 2], [98, 2], [2, 98], [2, 2]]]));
|
||||
render.drawPointGeometry(new ol.geom.Point([88, 88]));
|
||||
vectorContext.drawGeometry(new ol.geom.LineString([[10, 10], [90, 90]]));
|
||||
vectorContext.drawGeometry(new ol.geom.Polygon([[[2, 2], [98, 2], [2, 98], [2, 2]]]));
|
||||
vectorContext.drawGeometry(new ol.geom.Point([88, 88]));
|
||||
|
||||
@@ -81,12 +81,8 @@ layers['wms4326'] = new ol.layer.Tile({
|
||||
|
||||
layers['wms21781'] = new ol.layer.Tile({
|
||||
source: new ol.source.TileWMS({
|
||||
attributions: [new ol.Attribution({
|
||||
html: '© ' +
|
||||
'<a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
'en/home.html">' +
|
||||
'Pixelmap 1:1000000 / geo.admin.ch</a>'
|
||||
})],
|
||||
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
'en/home.html">Pixelmap 1:1000000 / geo.admin.ch</a>',
|
||||
crossOrigin: 'anonymous',
|
||||
params: {
|
||||
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
|
||||
@@ -120,10 +116,8 @@ layers['grandcanyon'] = new ol.layer.Tile({
|
||||
crossOrigin: '',
|
||||
tilePixelRatio: 2,
|
||||
maxZoom: 15,
|
||||
attributions: [new ol.Attribution({
|
||||
html: 'Tiles © USGS, rendered with ' +
|
||||
'<a href="http://www.maptiler.com/">MapTiler</a>'
|
||||
})]
|
||||
attributions: 'Tiles © USGS, rendered with ' +
|
||||
'<a href="http://www.maptiler.com/">MapTiler</a>'
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ function shade(inputs, data) {
|
||||
}
|
||||
}
|
||||
|
||||
return new ImageData(shadeData, width, height);
|
||||
return {data: shadeData, width: width, height: height};
|
||||
}
|
||||
|
||||
var elevation = new ol.source.XYZ({
|
||||
|
||||
@@ -21,11 +21,7 @@ var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Image({
|
||||
source: new ol.source.ImageStatic({
|
||||
attributions: [
|
||||
new ol.Attribution({
|
||||
html: '© <a href="http://xkcd.com/license.html">xkcd</a>'
|
||||
})
|
||||
],
|
||||
attributions: '© <a href="http://xkcd.com/license.html">xkcd</a>',
|
||||
url: 'http://imgs.xkcd.com/comics/online_communities.png',
|
||||
projection: projection,
|
||||
imageExtent: extent
|
||||
|
||||
@@ -96,27 +96,26 @@ map.on('click', function(evt) {
|
||||
displaySnap(evt.coordinate);
|
||||
});
|
||||
|
||||
var imageStyle = new ol.style.Circle({
|
||||
radius: 10,
|
||||
fill: null,
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'rgba(255,255,0,0.9)',
|
||||
width: 3
|
||||
})
|
||||
});
|
||||
var strokeStyle = new ol.style.Stroke({
|
||||
var stroke = new ol.style.Stroke({
|
||||
color: 'rgba(255,255,0,0.9)',
|
||||
width: 3
|
||||
});
|
||||
var style = new ol.style.Style({
|
||||
stroke: stroke,
|
||||
image: new ol.style.Circle({
|
||||
radius: 10,
|
||||
stroke: stroke
|
||||
})
|
||||
});
|
||||
|
||||
map.on('postcompose', function(evt) {
|
||||
var vectorContext = evt.vectorContext;
|
||||
vectorContext.setStyle(style);
|
||||
if (point !== null) {
|
||||
vectorContext.setImageStyle(imageStyle);
|
||||
vectorContext.drawPointGeometry(point);
|
||||
vectorContext.drawGeometry(point);
|
||||
}
|
||||
if (line !== null) {
|
||||
vectorContext.setFillStrokeStyle(null, strokeStyle);
|
||||
vectorContext.drawLineStringGeometry(line);
|
||||
vectorContext.drawGeometry(line);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -53,14 +53,10 @@ var vector = new ol.layer.Vector({
|
||||
source: vectorSource
|
||||
});
|
||||
|
||||
var attribution = new ol.Attribution({
|
||||
html: 'Tiles © <a href="http://services.arcgisonline.com/ArcGIS/' +
|
||||
'rest/services/World_Topo_Map/MapServer">ArcGIS</a>'
|
||||
});
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.XYZ({
|
||||
attributions: [attribution],
|
||||
attributions: 'Tiles © <a href="http://services.arcgisonline.com/ArcGIS/' +
|
||||
'rest/services/World_Topo_Map/MapServer">ArcGIS</a>',
|
||||
url: 'http://server.arcgisonline.com/ArcGIS/rest/services/' +
|
||||
'World_Topo_Map/MapServer/tile/{z}/{y}/{x}'
|
||||
})
|
||||
|
||||
@@ -95,15 +95,10 @@ var vector = new ol.layer.Vector({
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var attribution = new ol.Attribution({
|
||||
html: 'Tiles © <a href="http://services.arcgisonline.com/ArcGIS/' +
|
||||
'rest/services/World_Topo_Map/MapServer">ArcGIS</a>'
|
||||
});
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.XYZ({
|
||||
attributions: [attribution],
|
||||
attributions: 'Tiles © <a href="http://services.arcgisonline.com/ArcGIS/' +
|
||||
'rest/services/World_Topo_Map/MapServer">ArcGIS</a>',
|
||||
url: 'http://server.arcgisonline.com/ArcGIS/rest/services/' +
|
||||
'World_Topo_Map/MapServer/tile/{z}/{y}/{x}'
|
||||
})
|
||||
|
||||
@@ -6,6 +6,6 @@ docs: >
|
||||
OSM XML vector data is loaded dynamically from a server using a tiling strategy.
|
||||
tags: "vector, osm, xml, loading, server"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -6,6 +6,6 @@ docs: >
|
||||
This example loads new features from GeoServer WFS when the view extent changes.
|
||||
tags: "vector, WFS, bbox, loading, server"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -48,12 +48,8 @@ var layers = [
|
||||
source: new ol.source.TileWMS({
|
||||
url: 'http://wms.geo.admin.ch/',
|
||||
crossOrigin: 'anonymous',
|
||||
attributions: [new ol.Attribution({
|
||||
html: '© ' +
|
||||
'<a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
'en/home.html">' +
|
||||
'Pixelmap 1:1000000 / geo.admin.ch</a>'
|
||||
})],
|
||||
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
'en/home.html">Pixelmap 1:1000000 / geo.admin.ch</a>',
|
||||
params: {
|
||||
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
|
||||
'FORMAT': 'image/jpeg'
|
||||
@@ -66,12 +62,8 @@ var layers = [
|
||||
source: new ol.source.TileWMS({
|
||||
url: 'http://wms.geo.admin.ch/',
|
||||
crossOrigin: 'anonymous',
|
||||
attributions: [new ol.Attribution({
|
||||
html: '© ' +
|
||||
'<a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
'en/home.html">' +
|
||||
'National parks / geo.admin.ch</a>'
|
||||
})],
|
||||
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: 'mapserver'
|
||||
})
|
||||
|
||||
@@ -36,12 +36,8 @@ var layers = [
|
||||
source: new ol.source.ImageWMS({
|
||||
url: 'http://wms.geo.admin.ch/',
|
||||
crossOrigin: 'anonymous',
|
||||
attributions: [new ol.Attribution({
|
||||
html: '© ' +
|
||||
'<a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
'en/home.html">' +
|
||||
'Pixelmap 1:1000000 / geo.admin.ch</a>'
|
||||
})],
|
||||
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
'en/home.html">Pixelmap 1:1000000 / geo.admin.ch</a>',
|
||||
params: {
|
||||
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
|
||||
'FORMAT': 'image/jpeg'
|
||||
@@ -54,12 +50,8 @@ var layers = [
|
||||
source: new ol.source.ImageWMS({
|
||||
url: 'http://wms.geo.admin.ch/',
|
||||
crossOrigin: 'anonymous',
|
||||
attributions: [new ol.Attribution({
|
||||
html: '© ' +
|
||||
'<a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
'en/home.html">' +
|
||||
'National parks / geo.admin.ch</a>'
|
||||
})],
|
||||
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')
|
||||
})
|
||||
|
||||
@@ -11,12 +11,8 @@ goog.require('ol.source.TileWMS');
|
||||
var layers = [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.TileWMS({
|
||||
attributions: [new ol.Attribution({
|
||||
html: '© ' +
|
||||
'<a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
'en/home.html">' +
|
||||
'Pixelmap 1:1000000 / geo.admin.ch</a>'
|
||||
})],
|
||||
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
'en/home.html">Pixelmap 1:1000000 / geo.admin.ch</a>',
|
||||
crossOrigin: 'anonymous',
|
||||
params: {
|
||||
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
|
||||
@@ -27,12 +23,8 @@ var layers = [
|
||||
}),
|
||||
new ol.layer.Image({
|
||||
source: new ol.source.ImageWMS({
|
||||
attributions: [new ol.Attribution({
|
||||
html: '© ' +
|
||||
'<a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
'en/home.html">' +
|
||||
'National parks / geo.admin.ch</a>'
|
||||
})],
|
||||
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
'en/home.html">National parks / geo.admin.ch</a>',
|
||||
crossOrigin: 'anonymous',
|
||||
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
|
||||
serverType: 'mapserver',
|
||||
|
||||
@@ -33,13 +33,9 @@ var wmtsSource = new ol.source.WMTS({
|
||||
format: 'image/png',
|
||||
matrixSet: 'EPSG:3857',
|
||||
attributions: [
|
||||
new ol.Attribution({
|
||||
html: '<a href="http://scalgo.com">SCALGO</a>'
|
||||
}),
|
||||
new ol.Attribution({
|
||||
html: '<a href="http://www.cgiar-csi.org/data/' +
|
||||
'srtm-90m-digital-elevation-database-v4-1">CGIAR-CSI SRTM</a>'
|
||||
})
|
||||
'<a href="http://scalgo.com">SCALGO</a>',
|
||||
'<a href="http://www.cgiar-csi.org/data/' +
|
||||
'srtm-90m-digital-elevation-database-v4-1">CGIAR-CSI SRTM</a>'
|
||||
],
|
||||
tileGrid: tileGrid,
|
||||
style: 'default',
|
||||
|
||||
@@ -21,12 +21,6 @@ for (var z = 0; z < 14; ++z) {
|
||||
matrixIds[z] = z;
|
||||
}
|
||||
|
||||
var attribution = new ol.Attribution({
|
||||
html: 'Tiles © <a href="http://services.arcgisonline.com/arcgis/rest/' +
|
||||
'services/Demographics/USA_Population_Density/MapServer/">ArcGIS</a>'
|
||||
});
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
@@ -36,7 +30,8 @@ var map = new ol.Map({
|
||||
new ol.layer.Tile({
|
||||
opacity: 0.7,
|
||||
source: new ol.source.WMTS({
|
||||
attributions: [attribution],
|
||||
attributions: 'Tiles © <a href="http://services.arcgisonline.com/arcgis/rest/' +
|
||||
'services/Demographics/USA_Population_Density/MapServer/">ArcGIS</a>',
|
||||
url: 'http://services.arcgisonline.com/arcgis/rest/' +
|
||||
'services/Demographics/USA_Population_Density/MapServer/WMTS/',
|
||||
layer: '0',
|
||||
|
||||
@@ -6,7 +6,7 @@ goog.require('ol.proj');
|
||||
goog.require('ol.source.XYZ');
|
||||
|
||||
var attribution = new ol.Attribution({
|
||||
html: 'Copyright:© 2013 ESRI, i-cubed, GeoEye'
|
||||
html: 'Copyright:© 2013 ESRI, i-cubed, GeoEye'
|
||||
});
|
||||
|
||||
var projection = ol.proj.get('EPSG:4326');
|
||||
|
||||
@@ -7,7 +7,7 @@ goog.require('ol.source.XYZ');
|
||||
|
||||
|
||||
var attribution = new ol.Attribution({
|
||||
html: 'Tiles © <a href="http://services.arcgisonline.com/ArcGIS/' +
|
||||
html: 'Tiles © <a href="http://services.arcgisonline.com/ArcGIS/' +
|
||||
'rest/services/World_Topo_Map/MapServer">ArcGIS</a>'
|
||||
});
|
||||
|
||||
|
||||
@@ -6,12 +6,6 @@ goog.require('ol.proj');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.XYZ');
|
||||
|
||||
|
||||
var attribution = new ol.Attribution({
|
||||
html: 'Tiles © USGS, rendered with ' +
|
||||
'<a href="http://www.maptiler.com/">MapTiler</a>'
|
||||
});
|
||||
|
||||
var mapMinZoom = 1;
|
||||
var mapMaxZoom = 15;
|
||||
var mapExtent = [-112.261791, 35.983744, -112.113981, 36.132062];
|
||||
@@ -25,7 +19,8 @@ var map = new ol.Map({
|
||||
new ol.layer.Tile({
|
||||
extent: ol.proj.transformExtent(mapExtent, 'EPSG:4326', 'EPSG:3857'),
|
||||
source: new ol.source.XYZ({
|
||||
attributions: [attribution],
|
||||
attributions: 'Tiles © USGS, rendered with ' +
|
||||
'<a href="http://www.maptiler.com/">MapTiler</a>',
|
||||
url: 'http://tileserver.maptiler.com/grandcanyon@2x/{z}/{x}/{y}.png',
|
||||
tilePixelRatio: 2, // THIS IS IMPORTANT
|
||||
minZoom: mapMinZoom,
|
||||
|
||||
@@ -6,6 +6,6 @@ docs: >
|
||||
This map has a view that is constrained between zoom levels 9 and 13. This is done using the `minZoom` and `maxZoom` view options.
|
||||
tags: "bing, zoom, minZoom, maxZoom"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
34
externs/cartodb.js
Normal file
34
externs/cartodb.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @externs
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var CartoDBLayerInfo = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
CartoDBLayerInfo.prototype.layergroupid;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
CartoDBLayerInfo.prototype.updated_at;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
CartoDBLayerInfo.prototype.metadata;
|
||||
|
||||
|
||||
/**
|
||||
* @type {{http: string, https: string}}
|
||||
*/
|
||||
CartoDBLayerInfo.prototype.cdn_url;
|
||||
@@ -15,13 +15,3 @@
|
||||
* @see http://www.w3.org/TR/pointerevents/#the-touch-action-css-property
|
||||
*/
|
||||
CSSProperties.prototype.touchAction;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
WheelEvent.DOM_DELTA_LINE;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
WheelEvent.DOM_DELTA_PIXEL;
|
||||
|
||||
@@ -9,6 +9,33 @@
|
||||
var oli;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.events.Event = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
oli.events.Event.prototype.target;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
oli.events.Event.prototype.type;
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
oli.events.Event.prototype.preventDefault = function() {};
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
oli.events.Event.prototype.stopPropagation = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
@@ -22,7 +49,6 @@ oli.CollectionEvent = function() {};
|
||||
oli.CollectionEvent.prototype.element;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
@@ -41,7 +67,6 @@ oli.DragBoxEvent.prototype.coordinate;
|
||||
oli.DragBoxEvent.prototype.mapBrowserEvent;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
@@ -54,7 +79,6 @@ oli.DrawEvent = function() {};
|
||||
oli.DrawEvent.prototype.feature;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
@@ -73,7 +97,6 @@ oli.ModifyEvent.prototype.features;
|
||||
oli.ModifyEvent.prototype.mapBrowserPointerEvent;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
@@ -92,7 +115,6 @@ oli.ObjectEvent.prototype.key;
|
||||
oli.ObjectEvent.prototype.oldValue;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
@@ -123,7 +145,6 @@ oli.MapBrowserEvent.prototype.pixel;
|
||||
oli.MapBrowserEvent.prototype.dragging;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
@@ -166,7 +187,6 @@ oli.SelectEvent.prototype.selected;
|
||||
oli.SelectEvent.prototype.mapBrowserEvent;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
@@ -186,7 +206,6 @@ oli.control.Control = function() {};
|
||||
oli.control.Control.prototype.setMap = function(map) {};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
@@ -217,7 +236,6 @@ oli.interaction.DragAndDropEvent.prototype.projection;
|
||||
oli.interaction.DragAndDropEvent.prototype.file;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
@@ -242,7 +260,6 @@ oli.interaction.TranslateEvent.prototype.coordinate;
|
||||
oli.render;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
|
||||
418
externs/olx.js
418
externs/olx.js
@@ -159,7 +159,7 @@ olx.interaction.InteractionOptions;
|
||||
* Method called by the map to notify the interaction that a browser event was
|
||||
* dispatched to the map. The function may return `false` to prevent the
|
||||
* propagation of the event to other interactions in the map's interactions
|
||||
* chain. Required.
|
||||
* chain.
|
||||
* @type {function(ol.MapBrowserEvent):boolean}
|
||||
* @api
|
||||
*/
|
||||
@@ -281,7 +281,8 @@ olx.MapOptions.prototype.overlays;
|
||||
* Renderer. By default, Canvas, DOM 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 only the Canvas renderer supports vector data.
|
||||
* 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}
|
||||
* @api stable
|
||||
*/
|
||||
@@ -1631,7 +1632,8 @@ olx.format.ReadOptions.prototype.featureProjection;
|
||||
/**
|
||||
* @typedef {{dataProjection: ol.proj.ProjectionLike,
|
||||
* featureProjection: ol.proj.ProjectionLike,
|
||||
* rightHanded: (boolean|undefined)}}
|
||||
* rightHanded: (boolean|undefined),
|
||||
* decimals: (number|undefined)}}
|
||||
* @api
|
||||
*/
|
||||
olx.format.WriteOptions;
|
||||
@@ -1650,7 +1652,8 @@ olx.format.WriteOptions.prototype.dataProjection;
|
||||
|
||||
/**
|
||||
* Projection of the feature geometries that will be serialized by the format
|
||||
* writer.
|
||||
* writer. If not provided, geometries are assumed to be in the
|
||||
* `dataProjection` if that is set; in other words, they are not transformed.
|
||||
* @type {ol.proj.ProjectionLike}
|
||||
* @api stable
|
||||
*/
|
||||
@@ -1673,6 +1676,20 @@ olx.format.WriteOptions.prototype.featureProjection;
|
||||
olx.format.WriteOptions.prototype.rightHanded;
|
||||
|
||||
|
||||
/**
|
||||
* Maximum number of decimal places for coordinates. Coordinates are stored
|
||||
* internally as floats, but floating-point arithmetic can create coordinates
|
||||
* with a large number of decimal places, not generally wanted on output.
|
||||
* Set a number here to round coordinates. Can also be used to ensure that
|
||||
* coordinates read in can be written back out with the same number of decimals.
|
||||
* Default is no rounding.
|
||||
*
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.format.WriteOptions.prototype.decimals;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{defaultDataProjection: ol.proj.ProjectionLike,
|
||||
* geometryName: (string|undefined)}}
|
||||
@@ -2519,7 +2536,8 @@ olx.interaction.DragRotateOptions.prototype.duration;
|
||||
/**
|
||||
* @typedef {{className: (string|undefined),
|
||||
* condition: (ol.events.ConditionType|undefined),
|
||||
* duration: (number|undefined)}}
|
||||
* duration: (number|undefined),
|
||||
* out: (boolean|undefined)}}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.DragZoomOptions;
|
||||
@@ -2551,6 +2569,14 @@ olx.interaction.DragZoomOptions.prototype.condition;
|
||||
olx.interaction.DragZoomOptions.prototype.duration;
|
||||
|
||||
|
||||
/**
|
||||
* Use interaction for zooming out. Default is `false`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.DragZoomOptions.prototype.out;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{clickTolerance: (number|undefined),
|
||||
* features: (ol.Collection.<ol.Feature>|undefined),
|
||||
@@ -3087,7 +3113,9 @@ olx.interaction.SelectOptions.prototype.wrapX;
|
||||
* @typedef {{
|
||||
* features: (ol.Collection.<ol.Feature>|undefined),
|
||||
* pixelTolerance: (number|undefined),
|
||||
* source: (ol.source.Vector|undefined)
|
||||
* source: (ol.source.Vector|undefined),
|
||||
* edge: (boolean|undefined),
|
||||
* vertex: (boolean|undefined)
|
||||
* }}
|
||||
* @api
|
||||
*/
|
||||
@@ -3101,6 +3129,21 @@ olx.interaction.SnapOptions;
|
||||
*/
|
||||
olx.interaction.SnapOptions.prototype.features;
|
||||
|
||||
/**
|
||||
* Snap to edges. Default is `true`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.SnapOptions.prototype.edge;
|
||||
|
||||
|
||||
/**
|
||||
* Snap to vertices. Default is `true`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.SnapOptions.prototype.vertex;
|
||||
|
||||
|
||||
/**
|
||||
* Pixel tolerance for considering the pointer close enough to a segment or
|
||||
@@ -3904,7 +3947,15 @@ olx.source;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{culture: (string|undefined),
|
||||
* @typedef {string|Array.<string>|ol.Attribution|Array.<ol.Attribution>}
|
||||
* @api
|
||||
*/
|
||||
olx.source.AttributionOption;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{cacheSize: (number|undefined),
|
||||
* culture: (string|undefined),
|
||||
* key: string,
|
||||
* imagerySet: string,
|
||||
* maxZoom: (number|undefined),
|
||||
@@ -3916,6 +3967,14 @@ olx.source;
|
||||
olx.source.BingMapsOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Cache size. Default is `2048`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.BingMapsOptions.prototype.cacheSize;
|
||||
|
||||
|
||||
/**
|
||||
* Culture code. Default is `en-us`.
|
||||
* @type {string|undefined}
|
||||
@@ -3925,7 +3984,7 @@ olx.source.BingMapsOptions.prototype.culture;
|
||||
|
||||
|
||||
/**
|
||||
* Bing Maps API key. Get yours at http://bingmapsportal.com/.
|
||||
* Bing Maps API key. Get yours at http://www.bingmapsportal.com/.
|
||||
* @type {string}
|
||||
* @api stable
|
||||
*/
|
||||
@@ -3980,10 +4039,11 @@ olx.source.BingMapsOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* distance: (number|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* format: (ol.format.Feature|undefined),
|
||||
* geometryFunction: (undefined|function(ol.Feature):ol.geom.Point),
|
||||
* logo: (string|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* source: ol.source.Vector,
|
||||
@@ -3995,7 +4055,7 @@ olx.source.ClusterOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ClusterOptions.prototype.attributions;
|
||||
@@ -4017,6 +4077,25 @@ olx.source.ClusterOptions.prototype.distance;
|
||||
olx.source.ClusterOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Function that takes an {@link ol.Feature} as argument and returns an
|
||||
* {@link ol.geom.Point} as cluster calculation point for the feature. When a
|
||||
* feature should not be considered for clustering, the function should return
|
||||
* `null`. The default, which works when the underyling source contains point
|
||||
* features only, is
|
||||
* ```js
|
||||
* function(feature) {
|
||||
* return feature.getGeometry();
|
||||
* }
|
||||
* ```
|
||||
* See {@link ol.geom.Polygon#getInteriorPoint} for a way to get a cluster
|
||||
* calculation point for polygons.
|
||||
* @type {undefined|function(ol.Feature):ol.geom.Point}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ClusterOptions.prototype.geometryFunction;
|
||||
|
||||
|
||||
/**
|
||||
* Format.
|
||||
* @type {ol.format.Feature|undefined}
|
||||
@@ -4059,7 +4138,8 @@ olx.source.ClusterOptions.prototype.wrapX;
|
||||
|
||||
/**
|
||||
* @typedef {{preemptive: (boolean|undefined),
|
||||
* url: string}}
|
||||
* tileJSON: (TileJSON|undefined),
|
||||
* url: (string|undefined)}}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileUTFGridOptions;
|
||||
@@ -4079,14 +4159,26 @@ olx.source.TileUTFGridOptions.prototype.preemptive;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* TileJSON configuration for this source. If not provided, `url` must be
|
||||
* configured.
|
||||
* @type {TileJSON|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileUTFGridOptions.prototype.tileJSON;
|
||||
|
||||
|
||||
/**
|
||||
* TileJSON endpoint that provides the configuration for this source. Request
|
||||
* will be made through JSONP. If not provided, `tileJSON` must be configured.
|
||||
* @type {string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileUTFGridOptions.prototype.url;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* opaque: (boolean|undefined),
|
||||
@@ -4110,12 +4202,20 @@ olx.source.TileImageOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileImageOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* Cache size. Default is `2048`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileImageOptions.prototype.cacheSize;
|
||||
|
||||
|
||||
/**
|
||||
* The `crossOrigin` attribute for loaded images. Note that you must provide a
|
||||
* `crossOrigin` value if you are using the WebGL renderer or if you want to
|
||||
@@ -4249,7 +4349,8 @@ olx.source.TileImageOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* format: (ol.format.Feature|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* opaque: (boolean|undefined),
|
||||
@@ -4272,12 +4373,20 @@ olx.source.VectorTileOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.VectorTileOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* Cache size. Default is `128`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.VectorTileOptions.prototype.cacheSize;
|
||||
|
||||
|
||||
/**
|
||||
* Feature format for tiles. Used and required by the default
|
||||
* `tileLoadFunction`.
|
||||
@@ -4338,12 +4447,16 @@ olx.source.VectorTileOptions.prototype.tileGrid;
|
||||
|
||||
|
||||
/**
|
||||
* Optional function to load a tile given a URL. The default is
|
||||
* Optional function to load a tile given a URL. Could look like this:
|
||||
* ```js
|
||||
* function(tile, url) {
|
||||
* tile.setLoader(
|
||||
* ol.featureloader.tile(url, tile.getFormat()));
|
||||
* };
|
||||
* tile.setLoader(function() {
|
||||
* var data = // ... fetch data
|
||||
* var format = tile.getFormat();
|
||||
* tile.setFeatures(format.readFeatures(data));
|
||||
* tile.setProjection(format.readProjection(data));
|
||||
* };
|
||||
* });
|
||||
* ```
|
||||
* @type {ol.TileLoadFunctionType|undefined}
|
||||
* @api
|
||||
@@ -4498,7 +4611,8 @@ olx.source.ImageMapGuideOptions.prototype.params;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{layer: string,
|
||||
* @typedef {{cacheSize: (number|undefined),
|
||||
* layer: string,
|
||||
* reprojectionErrorThreshold: (number|undefined),
|
||||
* tileLoadFunction: (ol.TileLoadFunctionType|undefined),
|
||||
* url: (string|undefined)}}
|
||||
@@ -4507,6 +4621,14 @@ olx.source.ImageMapGuideOptions.prototype.params;
|
||||
olx.source.MapQuestOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Cache size. Default is `2048`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.MapQuestOptions.prototype.cacheSize;
|
||||
|
||||
|
||||
/**
|
||||
* Layer. Possible values are `osm`, `sat`, and `hyb`.
|
||||
* @type {string}
|
||||
@@ -4579,7 +4701,8 @@ olx.source.TileDebugOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* maxZoom: (number|undefined),
|
||||
* opaque: (boolean|undefined),
|
||||
@@ -4594,12 +4717,20 @@ olx.source.OSMOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.OSMOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* Cache size. Default is `2048`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.OSMOptions.prototype.cacheSize;
|
||||
|
||||
|
||||
/**
|
||||
* The `crossOrigin` attribute for loaded images. Note that you must provide a
|
||||
* `crossOrigin` value if you are using the WebGL renderer or if you want to
|
||||
@@ -4670,7 +4801,7 @@ olx.source.OSMOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* canvasFunction: ol.CanvasFunctionType,
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
@@ -4684,7 +4815,7 @@ olx.source.ImageCanvasOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageCanvasOptions.prototype.attributions;
|
||||
@@ -4749,7 +4880,7 @@ olx.source.ImageCanvasOptions.prototype.state;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* ratio: (number|undefined),
|
||||
@@ -4763,7 +4894,7 @@ olx.source.ImageVectorOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageVectorOptions.prototype.attributions;
|
||||
@@ -4881,7 +5012,7 @@ olx.source.RasterOptions.prototype.operationType;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* hidpi: (boolean|undefined),
|
||||
* serverType: (ol.source.wms.ServerType|string|undefined),
|
||||
@@ -4899,7 +5030,7 @@ olx.source.ImageWMSOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.ImageWMSOptions.prototype.attributions;
|
||||
@@ -4996,7 +5127,8 @@ olx.source.ImageWMSOptions.prototype.url;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{layer: string,
|
||||
* @typedef {{cacheSize: (number|undefined),
|
||||
* layer: string,
|
||||
* minZoom: (number|undefined),
|
||||
* maxZoom: (number|undefined),
|
||||
* opaque: (boolean|undefined),
|
||||
@@ -5008,6 +5140,13 @@ olx.source.ImageWMSOptions.prototype.url;
|
||||
olx.source.StamenOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Cache size. Default is `2048`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.StamenOptions.prototype.cacheSize;
|
||||
|
||||
/**
|
||||
* Layer.
|
||||
* @type {string}
|
||||
@@ -5071,7 +5210,7 @@ olx.source.StamenOptions.prototype.url;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* imageExtent: (ol.Extent),
|
||||
* imageLoadFunction: (ol.ImageLoadFunctionType|undefined),
|
||||
@@ -5086,7 +5225,7 @@ olx.source.ImageStaticOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.ImageStaticOptions.prototype.attributions;
|
||||
@@ -5155,7 +5294,8 @@ olx.source.ImageStaticOptions.prototype.url;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* params: (Object.<string, *>|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
@@ -5173,12 +5313,20 @@ olx.source.TileArcGISRestOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileArcGISRestOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* Cache size. Default is `2048`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileArcGISRestOptions.prototype.cacheSize;
|
||||
|
||||
|
||||
/**
|
||||
* The `crossOrigin` attribute for loaded images. Note that you must provide a
|
||||
* `crossOrigin` value if you are using the WebGL renderer or if you want to
|
||||
@@ -5282,7 +5430,8 @@ olx.source.TileArcGISRestOptions.prototype.urls;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* jsonp: (boolean|undefined),
|
||||
* reprojectionErrorThreshold: (number|undefined),
|
||||
@@ -5298,12 +5447,20 @@ olx.source.TileJSONOptions;
|
||||
* Optional attributions for the source. If provided, these will be used
|
||||
* instead of any attribution data advertised by the server. If not provided,
|
||||
* any attributions advertised by the server will be used.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.TileJSONOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* Cache size. Default is `2048`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileJSONOptions.prototype.cacheSize;
|
||||
|
||||
|
||||
/**
|
||||
* The `crossOrigin` attribute for loaded images. Note that you must provide a
|
||||
* `crossOrigin` value if you are using the WebGL renderer or if you want to
|
||||
@@ -5364,7 +5521,8 @@ olx.source.TileJSONOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* params: Object.<string,*>,
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* gutter: (number|undefined),
|
||||
@@ -5386,12 +5544,20 @@ olx.source.TileWMSOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.TileWMSOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* Cache size. Default is `2048`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileWMSOptions.prototype.cacheSize;
|
||||
|
||||
|
||||
/**
|
||||
* WMS request parameters. At least a `LAYERS` param is required. `STYLES` is
|
||||
* `''` by default. `VERSION` is `1.3.0` by default. `WIDTH`, `HEIGHT`, `BBOX`
|
||||
@@ -5534,7 +5700,7 @@ olx.source.TileWMSOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* features: (Array.<ol.Feature>|ol.Collection.<ol.Feature>|undefined),
|
||||
* format: (ol.format.Feature|undefined),
|
||||
* loader: (ol.FeatureLoader|undefined),
|
||||
@@ -5550,7 +5716,7 @@ olx.source.VectorOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.VectorOptions.prototype.attributions;
|
||||
@@ -5654,7 +5820,8 @@ olx.source.VectorOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (string|null|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* tileGrid: ol.tilegrid.WMTS,
|
||||
@@ -5683,12 +5850,20 @@ olx.source.WMTSOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.WMTSOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* Cache size. Default is `2048`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.WMTSOptions.prototype.cacheSize;
|
||||
|
||||
|
||||
/**
|
||||
* The `crossOrigin` attribute for loaded images. Note that you must provide a
|
||||
* `crossOrigin` value if you are using the WebGL renderer or if you want to
|
||||
@@ -5861,7 +6036,8 @@ olx.source.WMTSOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* opaque: (boolean|undefined),
|
||||
@@ -5884,12 +6060,20 @@ olx.source.XYZOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.XYZOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* Cache size. Default is `2048`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.XYZOptions.prototype.cacheSize;
|
||||
|
||||
|
||||
/**
|
||||
* The `crossOrigin` attribute for loaded images. Note that you must provide a
|
||||
* `crossOrigin` value if you are using the WebGL renderer or if you want to
|
||||
@@ -5944,7 +6128,7 @@ olx.source.XYZOptions.prototype.maxZoom;
|
||||
|
||||
|
||||
/**
|
||||
* Unsupported (TODO: remove this).
|
||||
* Optional min zoom level. Default is `0`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
@@ -6025,9 +6209,125 @@ olx.source.XYZOptions.prototype.urls;
|
||||
*/
|
||||
olx.source.XYZOptions.prototype.wrapX;
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* maxZoom: (number|undefined),
|
||||
* minZoom: (number|undefined),
|
||||
* wrapX: (boolean|undefined),
|
||||
* config: (Object|undefined),
|
||||
* map: (string|undefined),
|
||||
* account: string}}
|
||||
* @api
|
||||
*/
|
||||
olx.source.CartoDBOptions;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.CartoDBOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* Cache size. Default is `2048`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.CartoDBOptions.prototype.cacheSize;
|
||||
|
||||
|
||||
/**
|
||||
* The `crossOrigin` attribute for loaded images. Note that you must provide a
|
||||
* `crossOrigin` value if you are using the WebGL renderer or if you want to
|
||||
* access pixel data with the Canvas renderer. See
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image}
|
||||
* for more detail.
|
||||
* @type {null|string|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.CartoDBOptions.prototype.crossOrigin;
|
||||
|
||||
|
||||
/**
|
||||
* Logo.
|
||||
* @type {string|olx.LogoOptions|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.CartoDBOptions.prototype.logo;
|
||||
|
||||
|
||||
/**
|
||||
* Projection. Default is `EPSG:3857`.
|
||||
* @type {ol.proj.ProjectionLike}
|
||||
* @api
|
||||
*/
|
||||
olx.source.CartoDBOptions.prototype.projection;
|
||||
|
||||
|
||||
/**
|
||||
* Optional max zoom level. Default is `18`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.CartoDBOptions.prototype.maxZoom;
|
||||
|
||||
|
||||
/**
|
||||
* Minimum zoom.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.CartoDBOptions.prototype.minZoom;
|
||||
|
||||
|
||||
/**
|
||||
* Whether to wrap the world horizontally. Default is `true`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.CartoDBOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* If using anonymous maps, the CartoDB config to use. See
|
||||
* {@link http://docs.cartodb.com/cartodb-platform/maps-api/anonymous-maps/}
|
||||
* for more detail.
|
||||
* If using named maps, a key-value lookup with the template parameters.
|
||||
* See {@link http://docs.cartodb.com/cartodb-platform/maps-api/named-maps/}
|
||||
* for more detail.
|
||||
* @type {Object|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.CartoDBOptions.prototype.config;
|
||||
|
||||
|
||||
/**
|
||||
* If using named maps, this will be the name of the template to load.
|
||||
* See {@link http://docs.cartodb.com/cartodb-platform/maps-api/named-maps/}
|
||||
* for more detail.
|
||||
* @type {string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.CartoDBOptions.prototype.map;
|
||||
|
||||
|
||||
/**
|
||||
* CartoDB account name
|
||||
* @type {string}
|
||||
* @api
|
||||
*/
|
||||
olx.source.CartoDBOptions.prototype.account;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* reprojectionErrorThreshold: (number|undefined),
|
||||
@@ -6041,12 +6341,20 @@ olx.source.ZoomifyOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.ZoomifyOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* Cache size. Default is `2048`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ZoomifyOptions.prototype.cacheSize;
|
||||
|
||||
|
||||
/**
|
||||
* The `crossOrigin` attribute for loaded images. Note that you must provide a
|
||||
* `crossOrigin` value if you are using the WebGL renderer or if you want to
|
||||
@@ -6174,8 +6482,8 @@ olx.style.FillOptions;
|
||||
|
||||
|
||||
/**
|
||||
* A color, gradient or pattern. See {@link ol.color}
|
||||
* and {@link ol.colorlike} for possible formats. Default null;
|
||||
* 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
|
||||
@@ -6348,7 +6656,9 @@ olx.style.IconOptions.prototype.size;
|
||||
|
||||
|
||||
/**
|
||||
* Image size in pixel. Only required if `img` is set and `src` is not.
|
||||
* Image size in pixels. Only required if `img` is set and `src` is not, and for
|
||||
* SVG images in Internet Explorer 11. The provided `imgSize` needs to match
|
||||
* the actual size of the image.
|
||||
* @type {ol.Size|undefined}
|
||||
* @api
|
||||
*/
|
||||
@@ -6518,7 +6828,13 @@ olx.style.StrokeOptions.prototype.lineJoin;
|
||||
|
||||
|
||||
/**
|
||||
* Line dash pattern. Default is `undefined` (no dash).
|
||||
* Line dash pattern. Default is `undefined` (no dash). Please note that
|
||||
* Internet Explorer 10 and lower [do not support][mdn] the `setLineDash`
|
||||
* method on the `CanvasRenderingContext2D` and therefore this option will
|
||||
* have no visual effect in these browsers.
|
||||
*
|
||||
* [mdn]: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility
|
||||
*
|
||||
* @type {Array.<number>|undefined}
|
||||
* @api
|
||||
*/
|
||||
|
||||
33
package.json
33
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openlayers",
|
||||
"version": "3.14.2",
|
||||
"version": "3.15.0",
|
||||
"description": "Build tools and sources for developing OpenLayers based mapping applications",
|
||||
"keywords": [
|
||||
"map",
|
||||
@@ -32,48 +32,47 @@
|
||||
"dependencies": {
|
||||
"async": "1.5.2",
|
||||
"browserify": "13.0.0",
|
||||
"closure-util": "1.10.0",
|
||||
"closure-util": "1.13.0",
|
||||
"derequire": "2.0.3",
|
||||
"fs-extra": "0.26.5",
|
||||
"fs-extra": "0.26.6",
|
||||
"glob": "6.0.4",
|
||||
"graceful-fs": "4.1.3",
|
||||
"handlebars": "4.0.5",
|
||||
"jsdoc": "3.4.0",
|
||||
"marked": "0.3.5",
|
||||
"metalsmith": "2.1.0",
|
||||
"metalsmith-layouts": "1.5.4",
|
||||
"metalsmith-layouts": "1.6.4",
|
||||
"nomnom": "1.8.1",
|
||||
"pbf": "1.3.5",
|
||||
"pixelworks": "1.0.0",
|
||||
"pixelworks": "1.1.0",
|
||||
"rbush": "1.4.2",
|
||||
"temp": "0.8.3",
|
||||
"vector-tile": "1.2.0",
|
||||
"walk": "2.3.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"clean-css": "3.4.9",
|
||||
"coveralls": "2.11.6",
|
||||
"clean-css": "3.4.11",
|
||||
"coveralls": "2.11.9",
|
||||
"debounce": "^1.0.0",
|
||||
"eslint": "2.2.0",
|
||||
"eslint-config-openlayers": "4.0.0",
|
||||
"eslint": "2.6.0",
|
||||
"eslint-config-openlayers": "4.1.0",
|
||||
"expect.js": "0.3.1",
|
||||
"gaze": "^0.5.1",
|
||||
"gaze": "^1.0.0",
|
||||
"istanbul": "0.4.2",
|
||||
"jquery": "2.2.1",
|
||||
"jquery": "2.2.2",
|
||||
"mocha": "2.4.5",
|
||||
"mocha-phantomjs-core": "^1.3.0",
|
||||
"mustache": "2.2.1",
|
||||
"phantomjs-prebuilt": "2.1.4",
|
||||
"proj4": "2.3.12",
|
||||
"resemblejs": "2.1.0",
|
||||
"phantomjs-prebuilt": "2.1.7",
|
||||
"proj4": "2.3.14",
|
||||
"resemblejs": "2.2.0",
|
||||
"sinon": "1.17.3",
|
||||
"slimerjs-edge": "0.10.0-pre-3",
|
||||
"wrench": "1.5.8"
|
||||
"slimerjs": "0.906.1"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "openlayers",
|
||||
"globals": {
|
||||
"ArrayBuffer": false,
|
||||
"Float32Array": false,
|
||||
"Uint16Array": false,
|
||||
"Uint32Array": false,
|
||||
"Uint8Array": false,
|
||||
|
||||
@@ -24,6 +24,7 @@ ol.animation.bounce = function(options) {
|
||||
/**
|
||||
* @param {ol.Map} map Map.
|
||||
* @param {?olx.FrameState} frameState Frame state.
|
||||
* @return {boolean} Run this function in the next frame.
|
||||
*/
|
||||
function(map, frameState) {
|
||||
if (frameState.time < start) {
|
||||
@@ -62,6 +63,7 @@ ol.animation.pan = function(options) {
|
||||
/**
|
||||
* @param {ol.Map} map Map.
|
||||
* @param {?olx.FrameState} frameState Frame state.
|
||||
* @return {boolean} Run this function in the next frame.
|
||||
*/
|
||||
function(map, frameState) {
|
||||
if (frameState.time < start) {
|
||||
@@ -103,6 +105,7 @@ ol.animation.rotate = function(options) {
|
||||
/**
|
||||
* @param {ol.Map} map Map.
|
||||
* @param {?olx.FrameState} frameState Frame state.
|
||||
* @return {boolean} Run this function in the next frame.
|
||||
*/
|
||||
function(map, frameState) {
|
||||
if (frameState.time < start) {
|
||||
@@ -146,6 +149,7 @@ ol.animation.zoom = function(options) {
|
||||
/**
|
||||
* @param {ol.Map} map Map.
|
||||
* @param {?olx.FrameState} frameState Frame state.
|
||||
* @return {boolean} Run this function in the next frame.
|
||||
*/
|
||||
function(map, frameState) {
|
||||
if (frameState.time < start) {
|
||||
|
||||
@@ -169,7 +169,7 @@ ol.array.reverseSubArray = function(arr, begin, end) {
|
||||
*/
|
||||
ol.array.flatten = function(arr) {
|
||||
var data = arr.reduce(function(flattened, value) {
|
||||
if (goog.isArray(value)) {
|
||||
if (Array.isArray(value)) {
|
||||
return flattened.concat(ol.array.flatten(value));
|
||||
} else {
|
||||
return flattened.concat(value);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
goog.provide('ol.Attribution');
|
||||
|
||||
goog.require('goog.math');
|
||||
goog.require('ol.TileRange');
|
||||
goog.require('ol.math');
|
||||
|
||||
|
||||
/**
|
||||
@@ -80,8 +80,8 @@ ol.Attribution.prototype.intersectsAnyTileRange = function(tileRanges, tileGrid,
|
||||
if (tileRange.minX < extentTileRange.minX ||
|
||||
tileRange.maxX > extentTileRange.maxX) {
|
||||
if (testTileRange.intersects(new ol.TileRange(
|
||||
goog.math.modulo(tileRange.minX, width),
|
||||
goog.math.modulo(tileRange.maxX, width),
|
||||
ol.math.modulo(tileRange.minX, width),
|
||||
ol.math.modulo(tileRange.maxX, width),
|
||||
tileRange.minY, tileRange.maxY))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ goog.provide('ol.color');
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.color');
|
||||
goog.require('goog.color.names');
|
||||
goog.require('goog.vec.Mat4');
|
||||
goog.require('ol');
|
||||
goog.require('ol.math');
|
||||
|
||||
@@ -17,7 +16,8 @@ goog.require('ol.math');
|
||||
/**
|
||||
* A color represented as a short array [red, green, blue, alpha].
|
||||
* red, green, and blue should be integers in the range 0..255 inclusive.
|
||||
* alpha should be a float in the range 0..1 inclusive.
|
||||
* alpha should be a float in the range 0..1 inclusive. If no alpha value is
|
||||
* given then `1` will be used.
|
||||
* @typedef {Array.<number>}
|
||||
* @api
|
||||
*/
|
||||
@@ -53,48 +53,6 @@ ol.color.rgbaColorRe_ =
|
||||
/^(?: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;
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Color} dst Destination.
|
||||
* @param {ol.Color} src Source.
|
||||
* @param {ol.Color=} opt_color Color.
|
||||
* @return {ol.Color} Color.
|
||||
*/
|
||||
ol.color.blend = function(dst, src, opt_color) {
|
||||
// http://en.wikipedia.org/wiki/Alpha_compositing
|
||||
// FIXME do we need to scale by 255?
|
||||
var out = opt_color ? opt_color : [];
|
||||
var dstA = dst[3];
|
||||
var srcA = src[3];
|
||||
if (dstA == 1) {
|
||||
out[0] = (src[0] * srcA + dst[0] * (1 - srcA) + 0.5) | 0;
|
||||
out[1] = (src[1] * srcA + dst[1] * (1 - srcA) + 0.5) | 0;
|
||||
out[2] = (src[2] * srcA + dst[2] * (1 - srcA) + 0.5) | 0;
|
||||
out[3] = 1;
|
||||
} else if (srcA === 0) {
|
||||
out[0] = dst[0];
|
||||
out[1] = dst[1];
|
||||
out[2] = dst[2];
|
||||
out[3] = dstA;
|
||||
} else {
|
||||
var outA = srcA + dstA * (1 - srcA);
|
||||
if (outA === 0) {
|
||||
out[0] = 0;
|
||||
out[1] = 0;
|
||||
out[2] = 0;
|
||||
out[3] = 0;
|
||||
} else {
|
||||
out[0] = ((src[0] * srcA + dst[0] * dstA * (1 - srcA)) / outA + 0.5) | 0;
|
||||
out[1] = ((src[1] * srcA + dst[1] * dstA * (1 - srcA)) / outA + 0.5) | 0;
|
||||
out[2] = ((src[2] * srcA + dst[2] * dstA * (1 - srcA)) / outA + 0.5) | 0;
|
||||
out[3] = outA;
|
||||
}
|
||||
}
|
||||
goog.asserts.assert(ol.color.isValid(out),
|
||||
'Output color of blend should be a valid color');
|
||||
return out;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Return the color as an array. This function maintains a cache of calculated
|
||||
* arrays which means the result should not be modified.
|
||||
@@ -103,7 +61,7 @@ ol.color.blend = function(dst, src, opt_color) {
|
||||
* @api
|
||||
*/
|
||||
ol.color.asArray = function(color) {
|
||||
if (goog.isArray(color)) {
|
||||
if (Array.isArray(color)) {
|
||||
return color;
|
||||
} else {
|
||||
goog.asserts.assert(typeof color === 'string', 'Color should be a string');
|
||||
@@ -122,24 +80,12 @@ ol.color.asString = function(color) {
|
||||
if (typeof color === 'string') {
|
||||
return color;
|
||||
} else {
|
||||
goog.asserts.assert(goog.isArray(color), 'Color should be an array');
|
||||
goog.asserts.assert(Array.isArray(color), 'Color should be an array');
|
||||
return ol.color.toString(color);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Color} color1 Color1.
|
||||
* @param {ol.Color} color2 Color2.
|
||||
* @return {boolean} Equals.
|
||||
*/
|
||||
ol.color.equals = function(color1, color2) {
|
||||
return color1 === color2 || (
|
||||
color1[0] == color2[0] && color1[1] == color2[1] &&
|
||||
color1[2] == color2[2] && color1[3] == color2[3]);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} s String.
|
||||
* @return {ol.Color} Color.
|
||||
@@ -293,40 +239,6 @@ ol.color.toString = function(color) {
|
||||
if (b != (b | 0)) {
|
||||
b = (b + 0.5) | 0;
|
||||
}
|
||||
var a = color[3];
|
||||
var a = color[3] === undefined ? 1 : color[3];
|
||||
return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!ol.Color} color Color.
|
||||
* @param {goog.vec.Mat4.Number} transform Transform.
|
||||
* @param {!ol.Color=} opt_color Color.
|
||||
* @return {ol.Color} Transformed color.
|
||||
*/
|
||||
ol.color.transform = function(color, transform, opt_color) {
|
||||
var result = opt_color ? opt_color : [];
|
||||
result = goog.vec.Mat4.multVec3(transform, color, result);
|
||||
goog.asserts.assert(goog.isArray(result), 'result should be an array');
|
||||
result[3] = color[3];
|
||||
return ol.color.normalize(result, result);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Color|string} color1 Color2.
|
||||
* @param {ol.Color|string} color2 Color2.
|
||||
* @return {boolean} Equals.
|
||||
*/
|
||||
ol.color.stringOrColorEquals = function(color1, color2) {
|
||||
if (color1 === color2 || color1 == color2) {
|
||||
return true;
|
||||
}
|
||||
if (typeof color1 === 'string') {
|
||||
color1 = ol.color.fromString(color1);
|
||||
}
|
||||
if (typeof color2 === 'string') {
|
||||
color2 = ol.color.fromString(color2);
|
||||
}
|
||||
return ol.color.equals(color1, color2);
|
||||
};
|
||||
|
||||
@@ -4,7 +4,6 @@ goog.provide('ol.control.Attribution');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.dom.classlist');
|
||||
goog.require('goog.style');
|
||||
goog.require('ol');
|
||||
goog.require('ol.Attribution');
|
||||
@@ -275,9 +274,9 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
|
||||
}
|
||||
if (renderVisible &&
|
||||
ol.object.isEmpty(this.attributionElementRenderedVisible_)) {
|
||||
goog.dom.classlist.add(this.element, 'ol-logo-only');
|
||||
this.element.classList.add('ol-logo-only');
|
||||
} else {
|
||||
goog.dom.classlist.remove(this.element, 'ol-logo-only');
|
||||
this.element.classList.remove('ol-logo-only');
|
||||
}
|
||||
|
||||
this.insertLogos_(frameState);
|
||||
@@ -340,7 +339,7 @@ ol.control.Attribution.prototype.handleClick_ = function(event) {
|
||||
* @private
|
||||
*/
|
||||
ol.control.Attribution.prototype.handleToggle_ = function() {
|
||||
goog.dom.classlist.toggle(this.element, 'ol-collapsed');
|
||||
this.element.classList.toggle('ol-collapsed');
|
||||
if (this.collapsed_) {
|
||||
goog.dom.replaceNode(this.collapseLabel_, this.label_);
|
||||
} else {
|
||||
@@ -370,7 +369,7 @@ ol.control.Attribution.prototype.setCollapsible = function(collapsible) {
|
||||
return;
|
||||
}
|
||||
this.collapsible_ = collapsible;
|
||||
goog.dom.classlist.toggle(this.element, 'ol-uncollapsible');
|
||||
this.element.classList.toggle('ol-uncollapsible');
|
||||
if (!collapsible && this.collapsed_) {
|
||||
this.handleToggle_();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ goog.provide('ol.control.FullScreen');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.dom.classlist');
|
||||
goog.require('goog.dom.fullscreen');
|
||||
goog.require('goog.dom.fullscreen.EventType');
|
||||
goog.require('ol.events');
|
||||
@@ -68,10 +67,6 @@ ol.control.FullScreen = function(opt_options) {
|
||||
ol.events.listen(button, ol.events.EventType.CLICK,
|
||||
this.handleClick_, this);
|
||||
|
||||
ol.events.listen(goog.global.document,
|
||||
goog.dom.fullscreen.EventType.CHANGE,
|
||||
this.handleFullScreenChange_, this);
|
||||
|
||||
var cssClasses = this.cssClassName_ + ' ' + ol.css.CLASS_UNSELECTABLE +
|
||||
' ' + ol.css.CLASS_CONTROL + ' ' +
|
||||
(!goog.dom.fullscreen.isSupported() ? ol.css.CLASS_UNSUPPORTED : '');
|
||||
@@ -138,18 +133,31 @@ ol.control.FullScreen.prototype.handleFullScreen_ = function() {
|
||||
* @private
|
||||
*/
|
||||
ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
|
||||
var opened = this.cssClassName_ + '-true';
|
||||
var closed = this.cssClassName_ + '-false';
|
||||
var button = goog.dom.getFirstElementChild(this.element);
|
||||
var button = this.element.firstElementChild;
|
||||
var map = this.getMap();
|
||||
if (goog.dom.fullscreen.isFullScreen()) {
|
||||
goog.dom.classlist.swap(button, closed, opened);
|
||||
button.className = this.cssClassName_ + '-true';
|
||||
goog.dom.replaceNode(this.labelActiveNode_, this.labelNode_);
|
||||
} else {
|
||||
goog.dom.classlist.swap(button, opened, closed);
|
||||
button.className = this.cssClassName_ + '-false';
|
||||
goog.dom.replaceNode(this.labelNode_, this.labelActiveNode_);
|
||||
}
|
||||
if (map) {
|
||||
map.updateSize();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @api stable
|
||||
*/
|
||||
ol.control.FullScreen.prototype.setMap = function(map) {
|
||||
goog.base(this, 'setMap', map);
|
||||
if (map) {
|
||||
this.listenerKeys.push(
|
||||
ol.events.listen(goog.global.document, goog.dom.fullscreen.EventType.CHANGE,
|
||||
this.handleFullScreenChange_, this)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2,11 +2,8 @@ goog.provide('ol.control.OverviewMap');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.dom.classlist');
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.events.EventType');
|
||||
goog.require('goog.math.Size');
|
||||
goog.require('goog.style');
|
||||
goog.require('ol');
|
||||
goog.require('ol.Collection');
|
||||
goog.require('ol.Map');
|
||||
@@ -111,7 +108,9 @@ ol.control.OverviewMap = function(opt_options) {
|
||||
}, this);
|
||||
}
|
||||
|
||||
var box = goog.dom.createDom('DIV', 'ol-overviewmap-box');
|
||||
var box = document.createElement('DIV');
|
||||
box.className = 'ol-overviewmap-box';
|
||||
box.style.boxSizing = 'border-box';
|
||||
|
||||
/**
|
||||
* @type {ol.Overlay}
|
||||
@@ -282,17 +281,17 @@ ol.control.OverviewMap.prototype.validateExtent_ = function() {
|
||||
ovmap.getPixelFromCoordinate(ol.extent.getTopLeft(extent));
|
||||
var bottomRightPixel =
|
||||
ovmap.getPixelFromCoordinate(ol.extent.getBottomRight(extent));
|
||||
var boxSize = new goog.math.Size(
|
||||
Math.abs(topLeftPixel[0] - bottomRightPixel[0]),
|
||||
Math.abs(topLeftPixel[1] - bottomRightPixel[1]));
|
||||
|
||||
var boxWidth = Math.abs(topLeftPixel[0] - bottomRightPixel[0]);
|
||||
var boxHeight = Math.abs(topLeftPixel[1] - bottomRightPixel[1]);
|
||||
|
||||
var ovmapWidth = ovmapSize[0];
|
||||
var ovmapHeight = ovmapSize[1];
|
||||
|
||||
if (boxSize.width < ovmapWidth * ol.OVERVIEWMAP_MIN_RATIO ||
|
||||
boxSize.height < ovmapHeight * ol.OVERVIEWMAP_MIN_RATIO ||
|
||||
boxSize.width > ovmapWidth * ol.OVERVIEWMAP_MAX_RATIO ||
|
||||
boxSize.height > ovmapHeight * ol.OVERVIEWMAP_MAX_RATIO) {
|
||||
if (boxWidth < ovmapWidth * ol.OVERVIEWMAP_MIN_RATIO ||
|
||||
boxHeight < ovmapHeight * ol.OVERVIEWMAP_MIN_RATIO ||
|
||||
boxWidth > ovmapWidth * ol.OVERVIEWMAP_MAX_RATIO ||
|
||||
boxHeight > ovmapHeight * ol.OVERVIEWMAP_MAX_RATIO) {
|
||||
this.resetExtent_();
|
||||
} else if (!ol.extent.containsExtent(ovextent, extent)) {
|
||||
this.recenter_();
|
||||
@@ -396,10 +395,8 @@ ol.control.OverviewMap.prototype.updateBox_ = function() {
|
||||
|
||||
// set box size calculated from map extent size and overview map resolution
|
||||
if (box) {
|
||||
var boxWidth = Math.abs((bottomLeft[0] - topRight[0]) / ovresolution);
|
||||
var boxHeight = Math.abs((topRight[1] - bottomLeft[1]) / ovresolution);
|
||||
goog.style.setBorderBoxSize(box, new goog.math.Size(
|
||||
boxWidth, boxHeight));
|
||||
box.style.width = Math.abs((bottomLeft[0] - topRight[0]) / ovresolution) + 'px';
|
||||
box.style.height = Math.abs((topRight[1] - bottomLeft[1]) / ovresolution) + 'px';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -446,7 +443,7 @@ ol.control.OverviewMap.prototype.handleClick_ = function(event) {
|
||||
* @private
|
||||
*/
|
||||
ol.control.OverviewMap.prototype.handleToggle_ = function() {
|
||||
goog.dom.classlist.toggle(this.element, 'ol-collapsed');
|
||||
this.element.classList.toggle('ol-collapsed');
|
||||
if (this.collapsed_) {
|
||||
goog.dom.replaceNode(this.collapseLabel_, this.label_);
|
||||
} else {
|
||||
@@ -489,7 +486,7 @@ ol.control.OverviewMap.prototype.setCollapsible = function(collapsible) {
|
||||
return;
|
||||
}
|
||||
this.collapsible_ = collapsible;
|
||||
goog.dom.classlist.toggle(this.element, 'ol-uncollapsible');
|
||||
this.element.classList.toggle('ol-uncollapsible');
|
||||
if (!collapsible && this.collapsed_) {
|
||||
this.handleToggle_();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
goog.provide('ol.control.Rotate');
|
||||
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.dom.classlist');
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.events.EventType');
|
||||
goog.require('ol');
|
||||
@@ -41,7 +40,7 @@ ol.control.Rotate = function(opt_options) {
|
||||
'ol-compass', label);
|
||||
} else {
|
||||
this.label_ = label;
|
||||
goog.dom.classlist.add(this.label_, 'ol-compass');
|
||||
this.label_.classList.add(this.label_, 'ol-compass');
|
||||
}
|
||||
|
||||
var tipLabel = options.tipLabel ? options.tipLabel : 'Reset rotation';
|
||||
@@ -88,7 +87,7 @@ ol.control.Rotate = function(opt_options) {
|
||||
this.rotation_ = undefined;
|
||||
|
||||
if (this.autoHide_) {
|
||||
goog.dom.classlist.add(this.element, ol.css.CLASS_HIDDEN);
|
||||
this.element.classList.add(ol.css.CLASS_HIDDEN);
|
||||
}
|
||||
|
||||
};
|
||||
@@ -156,8 +155,12 @@ ol.control.Rotate.render = function(mapEvent) {
|
||||
if (rotation != this.rotation_) {
|
||||
var transform = 'rotate(' + rotation + 'rad)';
|
||||
if (this.autoHide_) {
|
||||
goog.dom.classlist.enable(
|
||||
this.element, ol.css.CLASS_HIDDEN, rotation === 0);
|
||||
var contains = this.element.classList.contains(ol.css.CLASS_HIDDEN);
|
||||
if (!contains && rotation === 0) {
|
||||
this.element.classList.add(ol.css.CLASS_HIDDEN);
|
||||
} else if (contains && rotation !== 0) {
|
||||
this.element.classList.remove(ol.css.CLASS_HIDDEN);
|
||||
}
|
||||
}
|
||||
this.label_.style.msTransform = transform;
|
||||
this.label_.style.webkitTransform = transform;
|
||||
|
||||
@@ -4,7 +4,6 @@ goog.provide('ol.control.ZoomSlider');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.math.Rect');
|
||||
goog.require('goog.style');
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.events.Event');
|
||||
@@ -55,25 +54,37 @@ ol.control.ZoomSlider = function(opt_options) {
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
* @private
|
||||
*/
|
||||
this.dragging_;
|
||||
/**
|
||||
* @type {Array.<ol.events.Key>}
|
||||
*/
|
||||
this.dragListenerKeys_;
|
||||
|
||||
/**
|
||||
* @type {goog.math.Rect}
|
||||
* @type {!Array.<ol.events.Key>}
|
||||
* @private
|
||||
*/
|
||||
this.limits_;
|
||||
this.dragListenerKeys_ = [];
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
* @private
|
||||
*/
|
||||
this.heightLimit_ = 0;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
* @private
|
||||
*/
|
||||
this.widthLimit_ = 0;
|
||||
|
||||
/**
|
||||
* @type {number|undefined}
|
||||
* @private
|
||||
*/
|
||||
this.previousX_;
|
||||
|
||||
/**
|
||||
* @type {number|undefined}
|
||||
* @private
|
||||
*/
|
||||
this.previousY_;
|
||||
|
||||
@@ -93,8 +104,8 @@ ol.control.ZoomSlider = function(opt_options) {
|
||||
this.sliderInitialized_ = false;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
* @private
|
||||
*/
|
||||
this.duration_ = options.duration !== undefined ? options.duration : 200;
|
||||
|
||||
@@ -107,14 +118,17 @@ ol.control.ZoomSlider = function(opt_options) {
|
||||
[className, ol.css.CLASS_UNSELECTABLE, ol.css.CLASS_CONTROL],
|
||||
thumbElement);
|
||||
|
||||
var dragger = new ol.pointer.PointerEventHandler(containerElement);
|
||||
this.registerDisposable(dragger);
|
||||
/**
|
||||
* @type {ol.pointer.PointerEventHandler}
|
||||
* @private
|
||||
*/
|
||||
this.dragger_ = new ol.pointer.PointerEventHandler(containerElement);
|
||||
|
||||
ol.events.listen(dragger, ol.pointer.EventType.POINTERDOWN,
|
||||
ol.events.listen(this.dragger_, ol.pointer.EventType.POINTERDOWN,
|
||||
this.handleDraggerStart_, this);
|
||||
ol.events.listen(dragger, ol.pointer.EventType.POINTERMOVE,
|
||||
ol.events.listen(this.dragger_, ol.pointer.EventType.POINTERMOVE,
|
||||
this.handleDraggerDrag_, this);
|
||||
ol.events.listen(dragger, ol.pointer.EventType.POINTERUP,
|
||||
ol.events.listen(this.dragger_, ol.pointer.EventType.POINTERUP,
|
||||
this.handleDraggerEnd_, this);
|
||||
|
||||
ol.events.listen(containerElement, ol.events.EventType.CLICK,
|
||||
@@ -132,6 +146,15 @@ ol.control.ZoomSlider = function(opt_options) {
|
||||
goog.inherits(ol.control.ZoomSlider, ol.control.Control);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.control.ZoomSlider.prototype.disposeInternal = function() {
|
||||
this.dragger_.dispose();
|
||||
goog.base(this, 'disposeInternal');
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* The enum for available directions.
|
||||
*
|
||||
@@ -165,7 +188,7 @@ ol.control.ZoomSlider.prototype.initSlider_ = function() {
|
||||
var container = this.element;
|
||||
var containerSize = goog.style.getSize(container);
|
||||
|
||||
var thumb = goog.dom.getFirstElementChild(container);
|
||||
var thumb = container.firstElementChild;
|
||||
var thumbMargins = goog.style.getMarginBox(thumb);
|
||||
var thumbBorderBoxSize = goog.style.getBorderBoxSize(thumb);
|
||||
var thumbWidth = thumbBorderBoxSize.width +
|
||||
@@ -174,18 +197,13 @@ ol.control.ZoomSlider.prototype.initSlider_ = function() {
|
||||
thumbMargins.top + thumbMargins.bottom;
|
||||
this.thumbSize_ = [thumbWidth, thumbHeight];
|
||||
|
||||
var width = containerSize.width - thumbWidth;
|
||||
var height = containerSize.height - thumbHeight;
|
||||
|
||||
var limits;
|
||||
if (containerSize.width > containerSize.height) {
|
||||
this.direction_ = ol.control.ZoomSlider.direction.HORIZONTAL;
|
||||
limits = new goog.math.Rect(0, 0, width, 0);
|
||||
this.widthLimit_ = containerSize.width - thumbWidth;
|
||||
} else {
|
||||
this.direction_ = ol.control.ZoomSlider.direction.VERTICAL;
|
||||
limits = new goog.math.Rect(0, 0, 0, height);
|
||||
this.heightLimit_ = containerSize.height - thumbHeight;
|
||||
}
|
||||
this.limits_ = limits;
|
||||
this.sliderInitialized_ = true;
|
||||
};
|
||||
|
||||
@@ -249,17 +267,17 @@ ol.control.ZoomSlider.prototype.handleDraggerStart_ = function(event) {
|
||||
this.previousY_ = event.clientY;
|
||||
this.dragging_ = true;
|
||||
|
||||
if (!this.dragListenerKeys_) {
|
||||
if (this.dragListenerKeys_.length === 0) {
|
||||
var drag = this.handleDraggerDrag_;
|
||||
var end = this.handleDraggerEnd_;
|
||||
this.dragListenerKeys_ = [
|
||||
this.dragListenerKeys_.push(
|
||||
ol.events.listen(document, ol.events.EventType.MOUSEMOVE, drag, this),
|
||||
ol.events.listen(document, ol.events.EventType.TOUCHMOVE, drag, this),
|
||||
ol.events.listen(document, ol.pointer.EventType.POINTERMOVE, drag, this),
|
||||
ol.events.listen(document, ol.events.EventType.MOUSEUP, end, this),
|
||||
ol.events.listen(document, ol.events.EventType.TOUCHEND, end, this),
|
||||
ol.events.listen(document, ol.pointer.EventType.POINTERUP, end, this)
|
||||
];
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -309,7 +327,7 @@ ol.control.ZoomSlider.prototype.handleDraggerEnd_ = function(event) {
|
||||
this.previousX_ = undefined;
|
||||
this.previousY_ = undefined;
|
||||
this.dragListenerKeys_.forEach(ol.events.unlistenByKey);
|
||||
this.dragListenerKeys_ = null;
|
||||
this.dragListenerKeys_.length = 0;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -322,14 +340,12 @@ ol.control.ZoomSlider.prototype.handleDraggerEnd_ = function(event) {
|
||||
*/
|
||||
ol.control.ZoomSlider.prototype.setThumbPosition_ = function(res) {
|
||||
var position = this.getPositionForResolution_(res);
|
||||
var thumb = goog.dom.getFirstElementChild(this.element);
|
||||
var thumb = this.element.firstElementChild;
|
||||
|
||||
if (this.direction_ == ol.control.ZoomSlider.direction.HORIZONTAL) {
|
||||
var left = this.limits_.left + this.limits_.width * position;
|
||||
goog.style.setPosition(thumb, left);
|
||||
thumb.style.left = this.widthLimit_ * position + 'px';
|
||||
} else {
|
||||
var top = this.limits_.top + this.limits_.height * position;
|
||||
goog.style.setPosition(thumb, this.limits_.left, top);
|
||||
thumb.style.top = this.heightLimit_ * position + 'px';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -345,12 +361,11 @@ ol.control.ZoomSlider.prototype.setThumbPosition_ = function(res) {
|
||||
* @private
|
||||
*/
|
||||
ol.control.ZoomSlider.prototype.getRelativePosition_ = function(x, y) {
|
||||
var draggerLimits = this.limits_;
|
||||
var amount;
|
||||
if (this.direction_ === ol.control.ZoomSlider.direction.HORIZONTAL) {
|
||||
amount = (x - draggerLimits.left) / draggerLimits.width;
|
||||
amount = x / this.widthLimit_;
|
||||
} else {
|
||||
amount = (y - draggerLimits.top) / draggerLimits.height;
|
||||
amount = y / this.heightLimit_;
|
||||
}
|
||||
return ol.math.clamp(amount, 0, 1);
|
||||
};
|
||||
|
||||
@@ -2,8 +2,8 @@ goog.provide('ol.Coordinate');
|
||||
goog.provide('ol.CoordinateFormatType');
|
||||
goog.provide('ol.coordinate');
|
||||
|
||||
goog.require('goog.math');
|
||||
goog.require('goog.string');
|
||||
goog.require('ol.math');
|
||||
|
||||
|
||||
/**
|
||||
@@ -129,7 +129,7 @@ ol.coordinate.createStringXY = function(opt_fractionDigits) {
|
||||
* @return {string} String.
|
||||
*/
|
||||
ol.coordinate.degreesToStringHDMS_ = function(degrees, hemispheres, opt_fractionDigits) {
|
||||
var normalizedDegrees = goog.math.modulo(degrees + 180, 360) - 180;
|
||||
var normalizedDegrees = ol.math.modulo(degrees + 180, 360) - 180;
|
||||
var x = Math.abs(3600 * normalizedDegrees);
|
||||
var dflPrecision = opt_fractionDigits || 0;
|
||||
return Math.floor(x / 3600) + '\u00b0 ' +
|
||||
|
||||
32
src/ol/disposable.js
Normal file
32
src/ol/disposable.js
Normal file
@@ -0,0 +1,32 @@
|
||||
goog.provide('ol.Disposable');
|
||||
|
||||
goog.require('ol');
|
||||
|
||||
/**
|
||||
* Objects that need to clean up after themselves.
|
||||
* @constructor
|
||||
*/
|
||||
ol.Disposable = function() {};
|
||||
|
||||
/**
|
||||
* The object has already been disposed.
|
||||
* @type {boolean}
|
||||
* @private
|
||||
*/
|
||||
ol.Disposable.prototype.disposed_ = false;
|
||||
|
||||
/**
|
||||
* Clean up.
|
||||
*/
|
||||
ol.Disposable.prototype.dispose = function() {
|
||||
if (!this.disposed_) {
|
||||
this.disposed_ = true;
|
||||
this.disposeInternal();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Extension point for disposable objects.
|
||||
* @protected
|
||||
*/
|
||||
ol.Disposable.prototype.disposeInternal = ol.nullFunction;
|
||||
@@ -1,10 +1,6 @@
|
||||
// FIXME add tests for browser features (Modernizr?)
|
||||
|
||||
goog.provide('ol.dom');
|
||||
goog.provide('ol.dom.BrowserFeature');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.userAgent');
|
||||
goog.require('goog.vec.Mat4');
|
||||
goog.require('ol');
|
||||
@@ -40,31 +36,29 @@ ol.dom.canUseCssTransform = (function() {
|
||||
if (canUseCssTransform === undefined) {
|
||||
goog.asserts.assert(document.body,
|
||||
'document.body should not be null');
|
||||
if (!goog.global.getComputedStyle) {
|
||||
// this browser is ancient
|
||||
canUseCssTransform = false;
|
||||
} else {
|
||||
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 = goog.global.getComputedStyle(el).getPropertyValue(
|
||||
transforms[t]);
|
||||
}
|
||||
}
|
||||
goog.dom.removeNode(el);
|
||||
goog.asserts.assert(goog.global.getComputedStyle,
|
||||
'getComputedStyle is required (unsupported browser?)');
|
||||
|
||||
canUseCssTransform = (has2d && has2d !== 'none');
|
||||
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 = goog.global.getComputedStyle(el).getPropertyValue(
|
||||
transforms[t]);
|
||||
}
|
||||
}
|
||||
document.body.removeChild(el);
|
||||
|
||||
canUseCssTransform = (has2d && has2d !== 'none');
|
||||
}
|
||||
return canUseCssTransform;
|
||||
};
|
||||
@@ -83,31 +77,29 @@ ol.dom.canUseCssTransform3D = (function() {
|
||||
if (canUseCssTransform3D === undefined) {
|
||||
goog.asserts.assert(document.body,
|
||||
'document.body should not be null');
|
||||
if (!goog.global.getComputedStyle) {
|
||||
// this browser is ancient
|
||||
canUseCssTransform3D = false;
|
||||
} else {
|
||||
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 = goog.global.getComputedStyle(el).getPropertyValue(
|
||||
transforms[t]);
|
||||
}
|
||||
}
|
||||
goog.dom.removeNode(el);
|
||||
goog.asserts.assert(goog.global.getComputedStyle,
|
||||
'getComputedStyle is required (unsupported browser?)');
|
||||
|
||||
canUseCssTransform3D = (has3d && has3d !== 'none');
|
||||
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 = goog.global.getComputedStyle(el).getPropertyValue(
|
||||
transforms[t]);
|
||||
}
|
||||
}
|
||||
document.body.removeChild(el);
|
||||
|
||||
canUseCssTransform3D = (has3d && has3d !== 'none');
|
||||
}
|
||||
return canUseCssTransform3D;
|
||||
};
|
||||
@@ -200,7 +192,7 @@ ol.dom.transformElement2D = function(element, transform, opt_precision) {
|
||||
*/
|
||||
ol.dom.outerWidth = function(element) {
|
||||
var width = element.offsetWidth;
|
||||
var style = element.currentStyle || window.getComputedStyle(element);
|
||||
var style = element.currentStyle || goog.global.getComputedStyle(element);
|
||||
width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
|
||||
|
||||
return width;
|
||||
@@ -216,7 +208,7 @@ ol.dom.outerWidth = function(element) {
|
||||
*/
|
||||
ol.dom.outerHeight = function(element) {
|
||||
var height = element.offsetHeight;
|
||||
var style = element.currentStyle || window.getComputedStyle(element);
|
||||
var style = element.currentStyle || goog.global.getComputedStyle(element);
|
||||
height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);
|
||||
|
||||
return height;
|
||||
|
||||
@@ -73,7 +73,13 @@ ol.events.EventTargetLike;
|
||||
/**
|
||||
* Key to use with {@link ol.Observable#unByKey}.
|
||||
*
|
||||
* @typedef {ol.events.ListenerObjType}
|
||||
* @typedef {{bindTo: (Object|undefined),
|
||||
* boundListener: (ol.events.ListenerFunctionType|undefined),
|
||||
* callOnce: boolean,
|
||||
* deleteIndex: (number|undefined),
|
||||
* listener: ol.events.ListenerFunctionType,
|
||||
* target: (EventTarget|ol.events.EventTarget),
|
||||
* type: string}}
|
||||
* @api
|
||||
*/
|
||||
ol.events.Key;
|
||||
@@ -90,19 +96,7 @@ ol.events.ListenerFunctionType;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{bindTo: (Object|undefined),
|
||||
* boundListener: (ol.events.ListenerFunctionType|undefined),
|
||||
* callOnce: boolean,
|
||||
* deleteIndex: (number|undefined),
|
||||
* listener: ol.events.ListenerFunctionType,
|
||||
* target: (EventTarget|ol.events.EventTarget),
|
||||
* type: string}}
|
||||
*/
|
||||
ol.events.ListenerObjType;
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.events.ListenerObjType} listenerObj Listener object.
|
||||
* @param {ol.events.Key} listenerObj Listener object.
|
||||
* @return {ol.events.ListenerFunctionType} Bound listener.
|
||||
*/
|
||||
ol.events.bindListener_ = function(listenerObj) {
|
||||
@@ -120,15 +114,15 @@ ol.events.bindListener_ = function(listenerObj) {
|
||||
|
||||
|
||||
/**
|
||||
* Finds the matching {@link ol.events.ListenerObjType} in the given listener
|
||||
* Finds the matching {@link ol.events.Key} in the given listener
|
||||
* array.
|
||||
*
|
||||
* @param {!Array<!ol.events.ListenerObjType>} listeners Array of listeners.
|
||||
* @param {!Array<!ol.events.Key>} listeners Array of listeners.
|
||||
* @param {!Function} listener The listener function.
|
||||
* @param {Object=} opt_this The `this` value inside the listener.
|
||||
* @param {boolean=} opt_setDeleteIndex Set the deleteIndex on the matching
|
||||
* listener, for {@link ol.events.unlistenByKey}.
|
||||
* @return {ol.events.ListenerObjType|undefined} The matching listener object.
|
||||
* @return {ol.events.Key|undefined} The matching listener object.
|
||||
* @private
|
||||
*/
|
||||
ol.events.findListener_ = function(listeners, listener, opt_this,
|
||||
@@ -151,7 +145,7 @@ ol.events.findListener_ = function(listeners, listener, opt_this,
|
||||
/**
|
||||
* @param {ol.events.EventTargetLike} target Target.
|
||||
* @param {string} type Type.
|
||||
* @return {Array.<ol.events.ListenerObjType>|undefined} Listeners.
|
||||
* @return {Array.<ol.events.Key>|undefined} Listeners.
|
||||
*/
|
||||
ol.events.getListeners = function(target, type) {
|
||||
var listenerMap = target[ol.events.LISTENER_MAP_PROP_];
|
||||
@@ -163,7 +157,7 @@ ol.events.getListeners = function(target, type) {
|
||||
* Get the lookup of listeners. If one does not exist on the target, it is
|
||||
* created.
|
||||
* @param {ol.events.EventTargetLike} target Target.
|
||||
* @return {!Object.<string, Array.<ol.events.ListenerObjType>>} Map of
|
||||
* @return {!Object.<string, Array.<ol.events.Key>>} Map of
|
||||
* listeners by event type.
|
||||
* @private
|
||||
*/
|
||||
@@ -232,7 +226,7 @@ ol.events.listen = function(target, type, listener, opt_this, opt_once) {
|
||||
listenerObj.callOnce = false;
|
||||
}
|
||||
} else {
|
||||
listenerObj = /** @type {ol.events.ListenerObjType} */ ({
|
||||
listenerObj = /** @type {ol.events.Key} */ ({
|
||||
bindTo: opt_this,
|
||||
callOnce: !!opt_once,
|
||||
listener: listener,
|
||||
|
||||
@@ -2,7 +2,7 @@ goog.provide('ol.events.ConditionType');
|
||||
goog.provide('ol.events.condition');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.functions');
|
||||
goog.require('ol.functions');
|
||||
goog.require('ol.MapBrowserEvent.EventType');
|
||||
goog.require('ol.MapBrowserPointerEvent');
|
||||
|
||||
@@ -59,7 +59,7 @@ ol.events.condition.altShiftKeysOnly = function(mapBrowserEvent) {
|
||||
* @function
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.condition.always = goog.functions.TRUE;
|
||||
ol.events.condition.always = ol.functions.TRUE;
|
||||
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ ol.events.condition.mouseActionButton = function(mapBrowserEvent) {
|
||||
* @function
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.condition.never = goog.functions.FALSE;
|
||||
ol.events.condition.never = ol.functions.FALSE;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,6 +12,7 @@ goog.provide('ol.events.Event');
|
||||
* {@link ol.events.EventTarget}.
|
||||
*
|
||||
* @constructor
|
||||
* @implements {oli.events.Event}
|
||||
* @param {string} type Type.
|
||||
* @param {Object=} opt_target Target.
|
||||
*/
|
||||
@@ -23,22 +24,34 @@ ol.events.Event = function(type, opt_target) {
|
||||
this.propagationStopped;
|
||||
|
||||
/**
|
||||
* The event type.
|
||||
* @type {string}
|
||||
* @api stable
|
||||
*/
|
||||
this.type = type;
|
||||
|
||||
/**
|
||||
* @type {Object|undefined}
|
||||
* The event target.
|
||||
* @type {Object}
|
||||
* @api stable
|
||||
*/
|
||||
this.target = opt_target;
|
||||
this.target = opt_target || null;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Stop event propagation
|
||||
* Stop event propagation.
|
||||
* @function
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.Event.prototype.preventDefault =
|
||||
|
||||
/**
|
||||
* Stop event propagation.
|
||||
* @function
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.Event.prototype.stopPropagation = function() {
|
||||
this.propagationStopped = true;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
goog.provide('ol.events.EventTarget');
|
||||
|
||||
goog.require('goog.Disposable');
|
||||
goog.require('goog.asserts');
|
||||
goog.require('ol.Disposable');
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.events.Event');
|
||||
|
||||
@@ -20,12 +21,18 @@ goog.require('ol.events.Event');
|
||||
* returns false.
|
||||
*
|
||||
* @constructor
|
||||
* @extends {goog.Disposable}
|
||||
* @extends {ol.Disposable}
|
||||
*/
|
||||
ol.events.EventTarget = function() {
|
||||
|
||||
goog.base(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string, number>}
|
||||
*/
|
||||
this.pendingRemovals_ = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string, Array.<ol.events.ListenerFunctionType>>}
|
||||
@@ -33,7 +40,7 @@ ol.events.EventTarget = function() {
|
||||
this.listeners_ = {};
|
||||
|
||||
};
|
||||
goog.inherits(ol.events.EventTarget, goog.Disposable);
|
||||
goog.inherits(ol.events.EventTarget, ol.Disposable);
|
||||
|
||||
|
||||
/**
|
||||
@@ -46,7 +53,7 @@ ol.events.EventTarget.prototype.addEventListener = function(type, listener) {
|
||||
listeners = this.listeners_[type] = [];
|
||||
}
|
||||
if (listeners.indexOf(listener) === -1) {
|
||||
listeners.unshift(listener);
|
||||
listeners.push(listener);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -63,13 +70,23 @@ ol.events.EventTarget.prototype.dispatchEvent = function(event) {
|
||||
var type = evt.type;
|
||||
evt.target = this;
|
||||
var listeners = this.listeners_[type];
|
||||
var propagate;
|
||||
if (listeners) {
|
||||
for (var i = listeners.length - 1; i >= 0; --i) {
|
||||
if (listeners[i].call(this, evt) === false ||
|
||||
evt.propagationStopped) {
|
||||
return false;
|
||||
if (!(type in this.pendingRemovals_)) {
|
||||
this.pendingRemovals_[type] = 0;
|
||||
}
|
||||
for (var i = 0, ii = listeners.length; i < ii; ++i) {
|
||||
if (listeners[i].call(this, evt) === false || evt.propagationStopped) {
|
||||
propagate = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var pendingRemovals = this.pendingRemovals_[type];
|
||||
delete this.pendingRemovals_[type];
|
||||
while (pendingRemovals--) {
|
||||
this.removeEventListener(type, ol.nullFunction);
|
||||
}
|
||||
return propagate;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -79,13 +96,12 @@ ol.events.EventTarget.prototype.dispatchEvent = function(event) {
|
||||
*/
|
||||
ol.events.EventTarget.prototype.disposeInternal = function() {
|
||||
ol.events.unlistenAll(this);
|
||||
goog.base(this, 'disposeInternal');
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get the listeners for a specified event type. Listeners are returned in the
|
||||
* opposite order that they will be called in.
|
||||
* order that they will be called in.
|
||||
*
|
||||
* @param {string} type Type.
|
||||
* @return {Array.<ol.events.ListenerFunctionType>} Listeners.
|
||||
@@ -115,9 +131,16 @@ ol.events.EventTarget.prototype.removeEventListener = function(type, listener) {
|
||||
var listeners = this.listeners_[type];
|
||||
if (listeners) {
|
||||
var index = listeners.indexOf(listener);
|
||||
listeners.splice(index, 1);
|
||||
if (listeners.length === 0) {
|
||||
delete this.listeners_[type];
|
||||
goog.asserts.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;
|
||||
++this.pendingRemovals_[type];
|
||||
} else {
|
||||
listeners.splice(index, 1);
|
||||
if (listeners.length === 0) {
|
||||
delete this.listeners_[type];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -314,7 +314,7 @@ ol.Feature.createStyleFunction = function(obj) {
|
||||
* @type {Array.<ol.style.Style>}
|
||||
*/
|
||||
var styles;
|
||||
if (goog.isArray(obj)) {
|
||||
if (Array.isArray(obj)) {
|
||||
styles = obj;
|
||||
} else {
|
||||
goog.asserts.assertInstanceof(obj, ol.style.Style,
|
||||
|
||||
@@ -170,7 +170,7 @@ ol.format.EsriJSON.readPointGeometry_ = function(object) {
|
||||
* @return {ol.geom.Geometry} LineString.
|
||||
*/
|
||||
ol.format.EsriJSON.readLineStringGeometry_ = function(object) {
|
||||
goog.asserts.assert(goog.isArray(object.paths),
|
||||
goog.asserts.assert(Array.isArray(object.paths),
|
||||
'object.paths should be an array');
|
||||
goog.asserts.assert(object.paths.length === 1,
|
||||
'object.paths array length should be 1');
|
||||
@@ -185,7 +185,7 @@ ol.format.EsriJSON.readLineStringGeometry_ = function(object) {
|
||||
* @return {ol.geom.Geometry} MultiLineString.
|
||||
*/
|
||||
ol.format.EsriJSON.readMultiLineStringGeometry_ = function(object) {
|
||||
goog.asserts.assert(goog.isArray(object.paths),
|
||||
goog.asserts.assert(Array.isArray(object.paths),
|
||||
'object.paths should be an array');
|
||||
goog.asserts.assert(object.paths.length > 1,
|
||||
'object.paths array length should be more than 1');
|
||||
|
||||
@@ -71,6 +71,9 @@ ol.format.Feature.prototype.adaptOptions = function(options) {
|
||||
options.dataProjection : this.defaultDataProjection,
|
||||
rightHanded: options.rightHanded
|
||||
};
|
||||
if (options.decimals) {
|
||||
updatedOptions.decimals = options.decimals;
|
||||
}
|
||||
}
|
||||
return updatedOptions;
|
||||
};
|
||||
@@ -165,21 +168,45 @@ ol.format.Feature.transformWithOptions = function(
|
||||
ol.proj.get(opt_options.featureProjection) : null;
|
||||
var dataProjection = opt_options ?
|
||||
ol.proj.get(opt_options.dataProjection) : null;
|
||||
/**
|
||||
* @type {ol.geom.Geometry|ol.Extent}
|
||||
*/
|
||||
var transformed;
|
||||
if (featureProjection && dataProjection &&
|
||||
!ol.proj.equivalent(featureProjection, dataProjection)) {
|
||||
if (geometry instanceof ol.geom.Geometry) {
|
||||
return (write ? geometry.clone() : geometry).transform(
|
||||
transformed = (write ? geometry.clone() : geometry).transform(
|
||||
write ? featureProjection : dataProjection,
|
||||
write ? dataProjection : featureProjection);
|
||||
} else {
|
||||
// FIXME this is necessary because ol.format.GML treats extents
|
||||
// as geometries
|
||||
return ol.proj.transformExtent(
|
||||
transformed = ol.proj.transformExtent(
|
||||
write ? geometry.slice() : geometry,
|
||||
write ? featureProjection : dataProjection,
|
||||
write ? dataProjection : featureProjection);
|
||||
}
|
||||
} else {
|
||||
return geometry;
|
||||
transformed = geometry;
|
||||
}
|
||||
if (write && opt_options && opt_options.decimals) {
|
||||
var power = Math.pow(10, opt_options.decimals);
|
||||
// if decimals option on write, round each coordinate appropriately
|
||||
/**
|
||||
* @param {Array.<number>} coordinates Coordinates.
|
||||
* @return {Array.<number>} Transformed coordinates.
|
||||
*/
|
||||
var transform = function(coordinates) {
|
||||
for (var i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||
coordinates[i] = Math.round(coordinates[i] * power) / power;
|
||||
}
|
||||
return coordinates;
|
||||
};
|
||||
if (Array.isArray(transformed)) {
|
||||
transform(transformed);
|
||||
} else {
|
||||
transformed.applyTransform(transform);
|
||||
}
|
||||
}
|
||||
return transformed;
|
||||
};
|
||||
|
||||
@@ -211,7 +211,9 @@ ol.format.GeoJSON.writeGeometryCollectionGeometry_ = function(
|
||||
goog.asserts.assertInstanceof(geometry, ol.geom.GeometryCollection,
|
||||
'geometry should be an ol.geom.GeometryCollection');
|
||||
var geometries = geometry.getGeometriesArray().map(function(geometry) {
|
||||
return ol.format.GeoJSON.writeGeometry_(geometry, opt_options);
|
||||
var options = ol.object.assign({}, opt_options);
|
||||
delete options.featureProjection;
|
||||
return ol.format.GeoJSON.writeGeometry_(geometry, options);
|
||||
});
|
||||
return /** @type {GeoJSONGeometryCollection} */ ({
|
||||
type: 'GeometryCollection',
|
||||
@@ -518,14 +520,13 @@ ol.format.GeoJSON.prototype.writeFeature;
|
||||
*
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||
* @return {GeoJSONObject} Object.
|
||||
* @return {GeoJSONFeature} Object.
|
||||
* @api stable
|
||||
*/
|
||||
ol.format.GeoJSON.prototype.writeFeatureObject = function(
|
||||
feature, opt_options) {
|
||||
ol.format.GeoJSON.prototype.writeFeatureObject = function(feature, opt_options) {
|
||||
opt_options = this.adaptOptions(opt_options);
|
||||
|
||||
var object = /** @type {GeoJSONObject} */ ({
|
||||
var object = /** @type {GeoJSONFeature} */ ({
|
||||
'type': 'Feature'
|
||||
});
|
||||
var id = feature.getId();
|
||||
|
||||
@@ -130,7 +130,7 @@ ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
|
||||
if (flatLinearRing) {
|
||||
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
goog.asserts.assert(goog.isArray(flatLinearRings),
|
||||
goog.asserts.assert(Array.isArray(flatLinearRings),
|
||||
'flatLinearRings should be an array');
|
||||
goog.asserts.assert(flatLinearRings.length > 0,
|
||||
'flatLinearRings should have an array length larger than 0');
|
||||
@@ -155,7 +155,7 @@ ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
|
||||
if (flatLinearRing) {
|
||||
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
goog.asserts.assert(goog.isArray(flatLinearRings),
|
||||
goog.asserts.assert(Array.isArray(flatLinearRings),
|
||||
'flatLinearRings should be an array');
|
||||
goog.asserts.assert(flatLinearRings.length > 0,
|
||||
'flatLinearRings should have an array length larger than 0');
|
||||
@@ -169,12 +169,12 @@ ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = Object({
|
||||
ol.format.GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'coordinates': ol.xml.makeReplacer(
|
||||
ol.format.GML2.prototype.readFlatCoordinates_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -182,12 +182,12 @@ ol.format.GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = Object({
|
||||
ol.format.GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'innerBoundaryIs': ol.format.GML2.prototype.innerBoundaryIsParser_,
|
||||
'outerBoundaryIs': ol.format.GML2.prototype.outerBoundaryIsParser_
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -195,12 +195,12 @@ ol.format.GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML2.prototype.BOX_PARSERS_ = Object({
|
||||
ol.format.GML2.prototype.BOX_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'coordinates': ol.xml.makeArrayPusher(
|
||||
ol.format.GML2.prototype.readFlatCoordinates_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -208,7 +208,7 @@ ol.format.GML2.prototype.BOX_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML2.prototype.GEOMETRY_PARSERS_ = Object({
|
||||
ol.format.GML2.prototype.GEOMETRY_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'Point': ol.xml.makeReplacer(ol.format.GMLBase.prototype.readPoint),
|
||||
'MultiPoint': ol.xml.makeReplacer(
|
||||
@@ -224,4 +224,4 @@ ol.format.GML2.prototype.GEOMETRY_PARSERS_ = Object({
|
||||
ol.format.GMLBase.prototype.readMultiPolygon),
|
||||
'Box': ol.xml.makeReplacer(ol.format.GML2.prototype.readBox_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -247,7 +247,7 @@ ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) {
|
||||
if (flatLinearRing) {
|
||||
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
goog.asserts.assert(goog.isArray(flatLinearRings),
|
||||
goog.asserts.assert(Array.isArray(flatLinearRings),
|
||||
'flatLinearRings should be an array');
|
||||
goog.asserts.assert(flatLinearRings.length > 0,
|
||||
'flatLinearRings should have an array length of 1 or more');
|
||||
@@ -272,7 +272,7 @@ ol.format.GML3.prototype.exteriorParser_ = function(node, objectStack) {
|
||||
if (flatLinearRing) {
|
||||
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
goog.asserts.assert(goog.isArray(flatLinearRings),
|
||||
goog.asserts.assert(Array.isArray(flatLinearRings),
|
||||
'flatLinearRings should be an array');
|
||||
goog.asserts.assert(flatLinearRings.length > 0,
|
||||
'flatLinearRings should have an array length of 1 or more');
|
||||
@@ -453,12 +453,12 @@ ol.format.GML3.prototype.readFlatPosList_ = function(node, objectStack) {
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = Object({
|
||||
ol.format.GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'pos': ol.xml.makeReplacer(ol.format.GML3.prototype.readFlatPos_),
|
||||
'posList': ol.xml.makeReplacer(ol.format.GML3.prototype.readFlatPosList_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -466,12 +466,12 @@ ol.format.GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = Object({
|
||||
ol.format.GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'interior': ol.format.GML3.prototype.interiorParser_,
|
||||
'exterior': ol.format.GML3.prototype.exteriorParser_
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -479,7 +479,7 @@ ol.format.GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.GEOMETRY_PARSERS_ = Object({
|
||||
ol.format.GML3.prototype.GEOMETRY_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'Point': ol.xml.makeReplacer(ol.format.GMLBase.prototype.readPoint),
|
||||
'MultiPoint': ol.xml.makeReplacer(
|
||||
@@ -501,7 +501,7 @@ ol.format.GML3.prototype.GEOMETRY_PARSERS_ = Object({
|
||||
ol.format.GML3.prototype.readMultiCurve_),
|
||||
'Envelope': ol.xml.makeReplacer(ol.format.GML3.prototype.readEnvelope_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -509,14 +509,14 @@ ol.format.GML3.prototype.GEOMETRY_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.MULTICURVE_PARSERS_ = Object({
|
||||
ol.format.GML3.prototype.MULTICURVE_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'curveMember': ol.xml.makeArrayPusher(
|
||||
ol.format.GML3.prototype.curveMemberParser_),
|
||||
'curveMembers': ol.xml.makeArrayPusher(
|
||||
ol.format.GML3.prototype.curveMemberParser_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -524,14 +524,14 @@ ol.format.GML3.prototype.MULTICURVE_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.MULTISURFACE_PARSERS_ = Object({
|
||||
ol.format.GML3.prototype.MULTISURFACE_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'surfaceMember': ol.xml.makeArrayPusher(
|
||||
ol.format.GML3.prototype.surfaceMemberParser_),
|
||||
'surfaceMembers': ol.xml.makeArrayPusher(
|
||||
ol.format.GML3.prototype.surfaceMemberParser_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -539,13 +539,13 @@ ol.format.GML3.prototype.MULTISURFACE_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.CURVEMEMBER_PARSERS_ = Object({
|
||||
ol.format.GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'LineString': ol.xml.makeArrayPusher(
|
||||
ol.format.GMLBase.prototype.readLineString),
|
||||
'Curve': ol.xml.makeArrayPusher(ol.format.GML3.prototype.readCurve_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -553,12 +553,12 @@ ol.format.GML3.prototype.CURVEMEMBER_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.SURFACEMEMBER_PARSERS_ = Object({
|
||||
ol.format.GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'Polygon': ol.xml.makeArrayPusher(ol.format.GMLBase.prototype.readPolygon),
|
||||
'Surface': ol.xml.makeArrayPusher(ol.format.GML3.prototype.readSurface_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -566,11 +566,11 @@ ol.format.GML3.prototype.SURFACEMEMBER_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.SURFACE_PARSERS_ = Object({
|
||||
ol.format.GML3.prototype.SURFACE_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'patches': ol.xml.makeReplacer(ol.format.GML3.prototype.readPatch_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -578,11 +578,11 @@ ol.format.GML3.prototype.SURFACE_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.CURVE_PARSERS_ = Object({
|
||||
ol.format.GML3.prototype.CURVE_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'segments': ol.xml.makeReplacer(ol.format.GML3.prototype.readSegment_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -590,14 +590,14 @@ ol.format.GML3.prototype.CURVE_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.ENVELOPE_PARSERS_ = Object({
|
||||
ol.format.GML3.prototype.ENVELOPE_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'lowerCorner': ol.xml.makeArrayPusher(
|
||||
ol.format.GML3.prototype.readFlatPosList_),
|
||||
'upperCorner': ol.xml.makeArrayPusher(
|
||||
ol.format.GML3.prototype.readFlatPosList_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -605,12 +605,12 @@ ol.format.GML3.prototype.ENVELOPE_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.PATCHES_PARSERS_ = Object({
|
||||
ol.format.GML3.prototype.PATCHES_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'PolygonPatch': ol.xml.makeReplacer(
|
||||
ol.format.GML3.prototype.readPolygonPatch_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -618,12 +618,12 @@ ol.format.GML3.prototype.PATCHES_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.SEGMENTS_PARSERS_ = Object({
|
||||
ol.format.GML3.prototype.SEGMENTS_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'LineStringSegment': ol.xml.makeReplacer(
|
||||
ol.format.GML3.prototype.readLineStringSegment_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -1006,7 +1006,7 @@ ol.format.GML3.prototype.writeGeometryElement = function(node, geometry, objectS
|
||||
var item = ol.object.assign({}, context);
|
||||
item.node = node;
|
||||
var value;
|
||||
if (goog.isArray(geometry)) {
|
||||
if (Array.isArray(geometry)) {
|
||||
if (context.dataProjection) {
|
||||
value = ol.proj.transformExtent(
|
||||
geometry, context.featureProjection, context.dataProjection);
|
||||
@@ -1233,7 +1233,7 @@ ol.format.GML3.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, o
|
||||
goog.asserts.assert(ol.xml.isNode(parentNode),
|
||||
'parentNode should be a node');
|
||||
var nodeName;
|
||||
if (!goog.isArray(value)) {
|
||||
if (!Array.isArray(value)) {
|
||||
goog.asserts.assertInstanceof(value, ol.geom.Geometry,
|
||||
'value should be an ol.geom.Geometry');
|
||||
nodeName = value.getType();
|
||||
|
||||
@@ -111,7 +111,7 @@ ol.format.GMLBase.ONLY_WHITESPACE_RE_ = /^[\s\xa0]*$/;
|
||||
ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
var localName = ol.xml.getLocalName(node);
|
||||
var localName = node.localName;
|
||||
var features;
|
||||
if (localName == 'FeatureCollection') {
|
||||
if (node.namespaceURI === 'http://www.opengis.net/wfs') {
|
||||
@@ -163,7 +163,7 @@ ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
|
||||
featureNS[defaultPrefix] = ns;
|
||||
}
|
||||
var parsersNS = {};
|
||||
var featureTypes = goog.isArray(featureType) ? featureType : [featureType];
|
||||
var featureTypes = Array.isArray(featureType) ? featureType : [featureType];
|
||||
for (var p in featureNS) {
|
||||
var parsers = {};
|
||||
for (i = 0, ii = featureTypes.length; i < ii; ++i) {
|
||||
@@ -219,7 +219,7 @@ ol.format.GMLBase.prototype.readFeatureElement = function(node, objectStack) {
|
||||
ol.xml.getAttributeNS(node, ol.format.GMLBase.GMLNS, 'id');
|
||||
var values = {}, geometryName;
|
||||
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
|
||||
var localName = ol.xml.getLocalName(n);
|
||||
var localName = n.localName;
|
||||
// Assume attribute elements have one child node and that the child
|
||||
// is a text or CDATA node (to be treated as text).
|
||||
// Otherwise assume it is a geometry node.
|
||||
@@ -503,14 +503,14 @@ ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, object
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.MULTIPOINT_PARSERS_ = Object({
|
||||
ol.format.GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'pointMember': ol.xml.makeArrayPusher(
|
||||
ol.format.GMLBase.prototype.pointMemberParser_),
|
||||
'pointMembers': ol.xml.makeArrayPusher(
|
||||
ol.format.GMLBase.prototype.pointMemberParser_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -518,14 +518,14 @@ ol.format.GMLBase.prototype.MULTIPOINT_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.MULTILINESTRING_PARSERS_ = Object({
|
||||
ol.format.GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'lineStringMember': ol.xml.makeArrayPusher(
|
||||
ol.format.GMLBase.prototype.lineStringMemberParser_),
|
||||
'lineStringMembers': ol.xml.makeArrayPusher(
|
||||
ol.format.GMLBase.prototype.lineStringMemberParser_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -533,14 +533,14 @@ ol.format.GMLBase.prototype.MULTILINESTRING_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.MULTIPOLYGON_PARSERS_ = Object({
|
||||
ol.format.GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'polygonMember': ol.xml.makeArrayPusher(
|
||||
ol.format.GMLBase.prototype.polygonMemberParser_),
|
||||
'polygonMembers': ol.xml.makeArrayPusher(
|
||||
ol.format.GMLBase.prototype.polygonMemberParser_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -548,12 +548,12 @@ ol.format.GMLBase.prototype.MULTIPOLYGON_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.POINTMEMBER_PARSERS_ = Object({
|
||||
ol.format.GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'Point': ol.xml.makeArrayPusher(
|
||||
ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -561,12 +561,12 @@ ol.format.GMLBase.prototype.POINTMEMBER_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = Object({
|
||||
ol.format.GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'LineString': ol.xml.makeArrayPusher(
|
||||
ol.format.GMLBase.prototype.readLineString)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -574,12 +574,12 @@ ol.format.GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.POLYGONMEMBER_PARSERS_ = Object({
|
||||
ol.format.GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'Polygon': ol.xml.makeArrayPusher(
|
||||
ol.format.GMLBase.prototype.readPolygon)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -587,12 +587,12 @@ ol.format.GMLBase.prototype.POLYGONMEMBER_PARSERS_ = Object({
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
ol.format.GMLBase.prototype.RING_PARSERS = Object({
|
||||
ol.format.GMLBase.prototype.RING_PARSERS = {
|
||||
'http://www.opengis.net/gml' : {
|
||||
'LinearRing': ol.xml.makeReplacer(
|
||||
ol.format.GMLBase.prototype.readFlatLinearRing_)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -636,6 +636,6 @@ ol.format.GMLBase.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.format.GMLBase.prototype.readProjectionFromNode = function(node) {
|
||||
return ol.proj.get(this.srsName_ ? this.srsName_ :
|
||||
return ol.proj.get(this.srsName ? this.srsName :
|
||||
node.firstElementChild.getAttribute('srsName'));
|
||||
};
|
||||
|
||||
@@ -868,6 +868,8 @@ ol.format.GPX.GPX_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* Encode an array of features in the GPX format.
|
||||
* LineString geometries are output as routes (`<rte>`), and MultiLineString
|
||||
* as tracks (`<trk>`).
|
||||
*
|
||||
* @function
|
||||
* @param {Array.<ol.Feature>} features Features.
|
||||
@@ -880,6 +882,8 @@ ol.format.GPX.prototype.writeFeatures;
|
||||
|
||||
/**
|
||||
* Encode an array of features in the GPX format as an XML node.
|
||||
* LineString geometries are output as routes (`<rte>`), and MultiLineString
|
||||
* as tracks (`<trk>`).
|
||||
*
|
||||
* @param {Array.<ol.Feature>} features Features.
|
||||
* @param {olx.format.WriteOptions=} opt_options Options.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
goog.provide('ol.format.JSONFeature');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.json');
|
||||
goog.require('ol.format.Feature');
|
||||
goog.require('ol.format.FormatType');
|
||||
|
||||
@@ -30,8 +29,8 @@ ol.format.JSONFeature.prototype.getObject_ = function(source) {
|
||||
if (goog.isObject(source)) {
|
||||
return source;
|
||||
} else if (typeof source === 'string') {
|
||||
var object = goog.json.parse(source);
|
||||
return object ? object : null;
|
||||
var object = JSON.parse(source);
|
||||
return object ? /** @type {Object} */ (object) : null;
|
||||
} else {
|
||||
goog.asserts.fail();
|
||||
return null;
|
||||
@@ -121,7 +120,7 @@ ol.format.JSONFeature.prototype.readProjectionFromObject = goog.abstractMethod;
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.format.JSONFeature.prototype.writeFeature = function(feature, opt_options) {
|
||||
return goog.json.serialize(this.writeFeatureObject(feature, opt_options));
|
||||
return JSON.stringify(this.writeFeatureObject(feature, opt_options));
|
||||
};
|
||||
|
||||
|
||||
@@ -136,9 +135,8 @@ ol.format.JSONFeature.prototype.writeFeatureObject = goog.abstractMethod;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.format.JSONFeature.prototype.writeFeatures = function(
|
||||
features, opt_options) {
|
||||
return goog.json.serialize(this.writeFeaturesObject(features, opt_options));
|
||||
ol.format.JSONFeature.prototype.writeFeatures = function(features, opt_options) {
|
||||
return JSON.stringify(this.writeFeaturesObject(features, opt_options));
|
||||
};
|
||||
|
||||
|
||||
@@ -153,9 +151,8 @@ ol.format.JSONFeature.prototype.writeFeaturesObject = goog.abstractMethod;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.format.JSONFeature.prototype.writeGeometry = function(
|
||||
geometry, opt_options) {
|
||||
return goog.json.serialize(this.writeGeometryObject(geometry, opt_options));
|
||||
ol.format.JSONFeature.prototype.writeGeometry = function(geometry, opt_options) {
|
||||
return JSON.stringify(this.writeGeometryObject(geometry, opt_options));
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -426,7 +426,7 @@ ol.format.KML.createFeatureStyleFunction_ = function(style, styleUrl,
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.findStyle_ = function(styleValue, defaultStyle, sharedStyles) {
|
||||
if (goog.isArray(styleValue)) {
|
||||
if (Array.isArray(styleValue)) {
|
||||
return styleValue;
|
||||
} else if (typeof styleValue === 'string') {
|
||||
// KML files in the wild occasionally forget the leading `#` on styleUrls
|
||||
@@ -1267,7 +1267,7 @@ ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
|
||||
var placemarkObject = objectStack[objectStack.length - 1];
|
||||
goog.asserts.assert(goog.isObject(placemarkObject),
|
||||
'placemarkObject should be an Object');
|
||||
if (goog.isArray(styleMapValue)) {
|
||||
if (Array.isArray(styleMapValue)) {
|
||||
placemarkObject['Style'] = styleMapValue;
|
||||
} else if (typeof styleMapValue === 'string') {
|
||||
placemarkObject['styleUrl'] = styleMapValue;
|
||||
@@ -1327,7 +1327,7 @@ ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
|
||||
if (flatLinearRing) {
|
||||
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
goog.asserts.assert(goog.isArray(flatLinearRings),
|
||||
goog.asserts.assert(Array.isArray(flatLinearRings),
|
||||
'flatLinearRings should be an array');
|
||||
goog.asserts.assert(flatLinearRings.length > 0,
|
||||
'flatLinearRings array should not be empty');
|
||||
@@ -1352,7 +1352,7 @@ ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
|
||||
if (flatLinearRing) {
|
||||
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
goog.asserts.assert(goog.isArray(flatLinearRings),
|
||||
goog.asserts.assert(Array.isArray(flatLinearRings),
|
||||
'flatLinearRings should be an array');
|
||||
goog.asserts.assert(flatLinearRings.length > 0,
|
||||
'flatLinearRings array should not be empty');
|
||||
@@ -1745,7 +1745,7 @@ ol.format.KML.prototype.getExtensions = function() {
|
||||
ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
var localName = ol.xml.getLocalName(node);
|
||||
var localName = node.localName;
|
||||
goog.asserts.assert(localName == 'Document' || localName == 'Folder',
|
||||
'localName should be Document or Folder');
|
||||
// FIXME use scope somehow
|
||||
@@ -1923,7 +1923,7 @@ ol.format.KML.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
return [];
|
||||
}
|
||||
var features;
|
||||
var localName = ol.xml.getLocalName(node);
|
||||
var localName = node.localName;
|
||||
if (localName == 'Document' || localName == 'Folder') {
|
||||
features = this.readDocumentOrFolder_(
|
||||
node, [this.getReadOptions(node, opt_options)]);
|
||||
@@ -2009,7 +2009,7 @@ ol.format.KML.prototype.readNameFromNode = function(node) {
|
||||
}
|
||||
}
|
||||
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
|
||||
var localName = ol.xml.getLocalName(n);
|
||||
var localName = n.localName;
|
||||
if (ol.array.includes(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
|
||||
(localName == 'Document' ||
|
||||
localName == 'Folder' ||
|
||||
@@ -2080,7 +2080,7 @@ ol.format.KML.prototype.readNetworkLinksFromNode = function(node) {
|
||||
}
|
||||
}
|
||||
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
|
||||
var localName = ol.xml.getLocalName(n);
|
||||
var localName = n.localName;
|
||||
if (ol.array.includes(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
|
||||
(localName == 'Document' ||
|
||||
localName == 'Folder' ||
|
||||
@@ -2386,7 +2386,7 @@ ol.format.KML.writePlacemark_ = function(node, feature, objectStack) {
|
||||
// resolution-independent here
|
||||
var styles = styleFunction.call(feature, 0);
|
||||
if (styles) {
|
||||
var style = goog.isArray(styles) ? styles[0] : styles;
|
||||
var style = Array.isArray(styles) ? styles[0] : styles;
|
||||
if (this.writeStyles_) {
|
||||
properties['Style'] = style;
|
||||
}
|
||||
@@ -2484,7 +2484,9 @@ ol.format.KML.writePolyStyle_ = function(node, style, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.writeScaleTextNode_ = function(node, scale) {
|
||||
ol.format.XSD.writeDecimalTextNode(node, scale * scale);
|
||||
// the Math is to remove any excess decimals created by float arithmetic
|
||||
ol.format.XSD.writeDecimalTextNode(node,
|
||||
Math.round(scale * scale * 1e6) / 1e6);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -664,7 +664,7 @@ ol.format.WFS.prototype.writeGetFeature = function(options) {
|
||||
bbox: options.bbox,
|
||||
propertyNames: options.propertyNames ? options.propertyNames : []
|
||||
};
|
||||
goog.asserts.assert(goog.isArray(options.featureTypes),
|
||||
goog.asserts.assert(Array.isArray(options.featureTypes),
|
||||
'options.featureTypes should be an array');
|
||||
ol.format.WFS.writeGetFeature_(node, options.featureTypes, [context]);
|
||||
return node;
|
||||
|
||||
@@ -75,7 +75,7 @@ ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = function(node, objectStack
|
||||
node.setAttribute('namespaceURI', this.featureNS_);
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
var localName = ol.xml.getLocalName(node);
|
||||
var localName = node.localName;
|
||||
/** @type {Array.<ol.Feature>} */
|
||||
var features = [];
|
||||
if (node.childNodes.length === 0) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user