Compare commits

...

178 Commits

Author SHA1 Message Date
Bart van den Eijnden
eb92c268ab Update package version to 3.17.1 2016-07-04 10:01:47 +02:00
Bart van den Eijnden
518212ce7d Changelog for v3.17.1 2016-07-04 10:01:10 +02:00
Andreas Hocevar
bbfc93b1d8 Merge pull request #5548 from GaborFarkas/fullscreen_event_enum
Fix CHANGETYPE in ol.control.FullScreen
2016-07-04 09:59:03 +02:00
Bart van den Eijnden
d3e15e4394 Update package version to 3.17.0 2016-07-01 19:20:18 +02:00
Bart van den Eijnden
0dbca294b2 Changelog for v3.17.0 2016-07-01 19:19:50 +02:00
Andreas Hocevar
c74d7171aa Merge pull request #5539 from probins/dom
Remove outdated comments re goog.dom
2016-07-01 15:07:59 +02:00
Tobias Sauerwein
6ebc67f1c5 Merge pull request #5543 from tsauerwein/update-rbush-2
Update rbush to 2.0.1
2016-07-01 13:13:20 +02:00
Bart van den Eijnden
72568305c0 Merge pull request #5540 from bartvde/issue-5484
Remove MapQuest source
2016-07-01 13:08:26 +02:00
tsauerwein
749660dd22 Update rbush to 2.0.1 2016-07-01 12:01:48 +02:00
Bart van den Eijnden
ed80d243fb Remove MapQuest source 2016-07-01 11:38:52 +02:00
Bart van den Eijnden
0d26c33484 Merge pull request #5538 from probins/inherits
Replace remaining goog.inherits
2016-07-01 11:30:26 +02:00
Peter Robins
1775a5aeea Remove outdated comments re goog.dom 2016-07-01 08:56:24 +00:00
Peter Robins
f196ed8102 Replace remaining goog.inherits 2016-07-01 08:45:15 +00:00
Bart van den Eijnden
c56432cf2e Merge pull request #5536 from tschaub/more-layer-extent
Update to layer-extent example
2016-07-01 09:13:47 +02:00
Tim Schaub
17e11fb84a Source shuffle 2016-06-30 15:28:33 -06:00
Tim Schaub
4154df9aa8 Remove unnecessary interaction 2016-06-30 15:22:51 -06:00
Tim Schaub
728e1dd1f2 Merge pull request #5482 from ischneider/layer-extent
Fix for regression in tile layer extent
2016-06-30 15:19:13 -06:00
Frédéric Junod
6d41e87ff5 Merge pull request #5475 from probins/enumprovide
Remove goog.provide from enums only used internally or in olx.js
2016-06-30 16:57:21 +02:00
Frédéric Junod
77e66221c1 Merge pull request #5424 from fredj/select_event
Don't dispatch select event if no feature is selected or deselected
2016-06-29 15:15:13 +02:00
Frederic Junod
b562f4d68a Don't dispatch select event if a selected feature is selected again 2016-06-29 15:03:42 +02:00
Frederic Junod
e7c2d9ab32 Don't dispatch select event if no feature is selected or deselected 2016-06-29 15:03:42 +02:00
Frédéric Junod
39de933e64 Merge pull request #5522 from SamuelBerger/master
Add 'condition' option to ol.interaction.DragPanOptions in olx.js
2016-06-29 14:52:34 +02:00
Frédéric Junod
c43740a4ad Merge pull request #5443 from fredj/max_zoom_options
Remove olx.source.WMTSOptions#maxZoom option
2016-06-29 14:52:14 +02:00
Frederic Junod
7a43a667ce Remove olx.source.TileWMSOptions#maxZoom option 2016-06-29 13:44:10 +02:00
Frederic Junod
1b662ff048 Use minZoom and maxZoom olx.source.StamenOptions 2016-06-29 13:41:49 +02:00
Frederic Junod
93a98337d8 Remove olx.source.WMTSOptions#maxZoom option
The option is not handled by `ol.source.WMTS`
2016-06-29 13:41:49 +02:00
Frédéric Junod
65c8eba59b Merge pull request #5497 from openlayers/greenkeeper-istanbul-0.4.4
Update istanbul to version 0.4.4 🚀
2016-06-28 13:32:54 +02:00
greenkeeperio-bot
059ac56fef chore(package): update istanbul to version 0.4.4
https://greenkeeper.io/
2016-06-27 07:10:41 -06:00
Frédéric Junod
64afa2eab5 Merge pull request #5523 from openlayers/greenkeeper-closure-util-1.15.0
Update closure-util to version 1.15.0 🚀
2016-06-27 15:10:26 +02:00
greenkeeperio-bot
13546d27f2 chore(package): update closure-util to version 1.15.0
https://greenkeeper.io/
2016-06-27 06:49:14 -06:00
Samuel Berger
a2326f7180 Add 'condition' option to ol.interaction.DragPanOptions in olx.js 2016-06-27 14:01:40 +02:00
Frédéric Junod
ffe0529df8 Merge pull request #5508 from tsauerwein/compiler-properties
Fix problems with ol.format.WFS in compiled mode
2016-06-27 11:59:13 +02:00
Andreas Hocevar
38f7aef6b0 Merge pull request #5512 from ahocevar/foreachtilecoord
Use forEachTileCoord name instead of forEachTileCoordInExtentAndZ
2016-06-25 21:18:58 +02:00
Bart van den Eijnden
f549f1946c Merge pull request #5513 from bartvde/view-getminmaxres
Add getters for min and max resolution of the view
2016-06-23 15:28:07 +02:00
Bart van den Eijnden
449ea370c0 Add getters for min and max resolution of the view 2016-06-23 15:00:30 +02:00
Andreas Hocevar
bc506389fc Use forEachTileCoord name instead of forEachTileCoordInExtentAndZ 2016-06-23 14:27:21 +02:00
Andreas Hocevar
5d85867fbf Merge pull request #5471 from probins/gpx
Fix GPX write of xsi ns
2016-06-23 14:24:48 +02:00
Andreas Hocevar
55edf4003f Merge pull request #5134 from nicholas-l/removeGoogDom
Remove goog.dom
2016-06-23 12:15:03 +02:00
nicholas
6b465902cd Remove goog.dom 2016-06-23 22:06:35 +12:00
Andreas Hocevar
9453984f9a Merge pull request #5511 from ahocevar/keep-last-point
Do not optimize lines away entirely
2016-06-23 11:07:04 +02:00
Andreas Hocevar
35129af7f0 Do not optimize lines away entirely 2016-06-23 10:38:10 +02:00
Andreas Hocevar
3726b25ba2 Merge pull request #5509 from ahocevar/foreachtilecoordinextentandz
Make it easier to work with tile ranges in custom source implementations
2016-06-23 09:03:08 +02:00
tsauerwein
7048de8e83 Make sure properties are not renamed 2016-06-23 08:38:06 +02:00
Frederic Junod
4b7cdffaf4 Export getZForResolution from ol.tilegrid.TileGrid 2016-06-22 20:48:49 +02:00
Andreas Hocevar
14cecb7163 Add function to iterate over tile coordinates in extent and z 2016-06-22 18:05:18 +02:00
Frédéric Junod
29c8af7559 Merge pull request #5498 from openlayers/greenkeeper-eslint-2.13.1
Update eslint to version 2.13.1 🚀
2016-06-21 12:28:40 +02:00
Frédéric Junod
b19ac3c26d Merge pull request #5495 from fredj/rm_goog.isFunction
Get rid of goog.isFunction
2016-06-21 08:37:15 +02:00
greenkeeperio-bot
f26bcf5c3e chore(package): update eslint to version 2.13.1
https://greenkeeper.io/
2016-06-21 00:36:29 -06:00
Frédéric Junod
e4168e3582 Merge pull request #5499 from openlayers/greenkeeper-glob-7.0.5
Update glob to version 7.0.5 🚀
2016-06-21 08:36:15 +02:00
greenkeeperio-bot
dd8dc8ad0f chore(package): update glob to version 7.0.5
https://greenkeeper.io/
2016-06-20 19:13:36 -06:00
Frederic Junod
b8ce70fbf0 Get rid of goog.isFunction 2016-06-20 16:09:25 +02:00
Andreas Hocevar
e916345e8c Merge pull request #5125 from nicholas-l/removeGoogStyle
Remove goog style
2016-06-20 13:04:00 +02:00
Frédéric Junod
925a272fb8 Merge pull request #5494 from probins/global
Remove goog.global
2016-06-20 12:27:33 +02:00
Peter Robins
eaa0d70289 Remove goog.global 2016-06-20 09:47:32 +00:00
Andreas Hocevar
030c0dad3d Avoid creation of unnecessary object literals 2016-06-20 21:44:15 +12:00
Nicholas L
0fef14137c Remove unneeded comments and use ol.global 2016-06-20 21:41:20 +12:00
Andreas Hocevar
04287e0fd5 Merge pull request #5492 from openlayers/greenkeeper-eslint-2.13.0
Update eslint to version 2.13.0 🚀
2016-06-20 07:55:20 +02:00
nicholas
ea1c7a6551 Remove goog.style.getPageOffset 2016-06-19 19:26:25 +12:00
nicholas
6da5a1e9f7 Remove goog.style.getContentBoxSize 2016-06-19 19:22:11 +12:00
nicholas
ec12c34edd Remove goog.style.getBorderBoxSize 2016-06-19 19:22:11 +12:00
nicholas
837c48a2e2 Remove goog.style.getMarginBox 2016-06-19 19:22:11 +12:00
nicholas
04c4b4efc1 Remove goog.style.setElementShown 2016-06-19 19:22:11 +12:00
nicholas
96a14e0515 Remove getSize 2016-06-19 19:22:11 +12:00
greenkeeperio-bot
cd4f1c109b chore(package): update eslint to version 2.13.0
https://greenkeeper.io/
2016-06-17 11:35:35 -06:00
Andreas Hocevar
609c891524 Merge pull request #5490 from openlayers/greenkeeper-glob-7.0.4
Update glob to version 7.0.4 🚀
2016-06-17 09:12:45 +02:00
greenkeeperio-bot
5442c1f587 chore(package): update glob to version 7.0.4
https://greenkeeper.io/
2016-06-16 11:38:16 -06:00
Frédéric Junod
810c655940 Merge pull request #5460 from openlayers/greenkeeper-eslint-2.12.0
Update eslint to version 2.12.0 🚀
2016-06-16 16:26:09 +02:00
Ian Schneider
9d5232d9af canvas tests for tile rendering with layer.extent 2016-06-15 21:14:37 -06:00
Ian Schneider
265068e782 example - layer-extent uses country bboxes 2016-06-15 21:13:49 -06:00
Ian Schneider
44a4fbdda2 respect layer.extent in canvas tilelayer renderer 2016-06-15 12:42:38 -06:00
Ian Schneider
6902791dc5 layer extent example changes for testing
- add draw extent tool
- rotation control
2016-06-15 12:42:32 -06:00
greenkeeperio-bot
95a3f42315 chore(package): update eslint to version 2.12.0
https://greenkeeper.io/
2016-06-15 09:54:46 -06:00
Andreas Hocevar
6fe1a58b26 Merge pull request #5479 from openlayers/greenkeeper-slimerjs-0.906.2
Update slimerjs to version 0.906.2 🚀
2016-06-15 17:54:31 +02:00
greenkeeperio-bot
466b02836b chore(package): update slimerjs to version 0.906.2
https://greenkeeper.io/
2016-06-15 09:17:14 -06:00
Peter Robins
e5cc971dc9 Remove goog.provide for enums only in olx.js 2016-06-15 09:14:13 +00:00
Peter Robins
bda673f389 Remove goog.provide from internal enums 2016-06-15 09:04:44 +00:00
Frédéric Junod
fa995cf7f3 Merge pull request #5474 from openlayers/greenkeeper-clean-css-3.4.18
Update clean-css to version 3.4.18 🚀
2016-06-15 08:51:08 +02:00
greenkeeperio-bot
1a159f3ac4 chore(package): update clean-css to version 3.4.18
https://greenkeeper.io/
2016-06-15 00:39:12 -06:00
Andreas Hocevar
6718fc982e Merge pull request #5450 from probins/typedefs
Remove sub-namespaces from all remaining typedefs
2016-06-14 17:32:10 +02:00
Andreas Hocevar
2809df86ca Merge pull request #5465 from ahocevar/fix-custom-symbol
Fix custom icon positions and rotation
2016-06-14 17:29:00 +02:00
Andreas Hocevar
1d20215bfa Make all typedefs work without provide/require 2016-06-14 15:01:20 +00:00
Peter Robins
7d210948e8 Fix GPX write of xsi ns
Also add version/creator attributes to <gpx> node.
2016-06-14 11:14:19 +00:00
Frédéric Junod
3c50d12ad9 Merge pull request #5469 from gberaudo/webgl_typo
Fix typo
2016-06-14 09:28:06 +02:00
Guillaume Beraudo
bb32b6ac55 Fix typo 2016-06-14 09:10:07 +02:00
Andreas Hocevar
103ff01456 Fix custom icon positions and rotation 2016-06-13 22:08:02 +02:00
Andreas Hocevar
d26ac55ed0 Merge pull request #5453 from ahocevar/mapbrowserpointerevent
Reference ol.MapBrowserEvent instead of ol.MapBrowserPointerEvent
2016-06-13 14:01:49 +02:00
Bart van den Eijnden
31dcb80725 Merge pull request #5208 from probins/rtewpt
Stop GPX writing rtept properties
2016-06-10 13:10:53 +02:00
Peter Robins
f3acac5259 Stop GPX writing rtept properties 2016-06-10 10:56:30 +00:00
Andreas Hocevar
06249be6bd Remove last reference to ol.MapBrowserPointerEvent from the API
This is a bit of a hack, but in fact it improves the situation for the end
user because it asserts the correct event type instead of failing silently.
2016-06-09 18:22:11 +02:00
Andreas Hocevar
400484e663 Reference ol.MapBrowserEvent instead of ol.MapBrowserPointerEvent
There is nothing exportable in ol.MapBrowserEvent in addition to what is
exportable in ol.MapBrowserEvent.
2016-06-09 18:22:11 +02:00
Frédéric Junod
ab4da04312 Merge pull request #5452 from openlayers/greenkeeper-eslint-config-openlayers-5.0.0
Update eslint-config-openlayers to version 5.0.0 🚀
2016-06-09 16:06:45 +02:00
Frederic Junod
4bf1f56405 Add missing semicolon 2016-06-09 15:39:46 +02:00
greenkeeperio-bot
08f8cd0f16 chore(package): update eslint-config-openlayers to version 5.0.0
https://greenkeeper.io/
2016-06-09 07:25:37 -06:00
Andreas Hocevar
40ead5b329 Merge pull request #5432 from bjornharrtell/rm_goog.uri
Remove use of goog.uri
2016-06-09 14:20:56 +02:00
Peter Robins
2c29512c80 Remove sub-namespaces from all remaining typedefs 2016-06-09 10:01:52 +00:00
Andreas Hocevar
09202cf95d Merge pull request #5449 from ahocevar/examples-absolute-urls
Make example data/ paths absolute for source view and JSFiddle
2016-06-09 10:10:47 +02:00
Andreas Hocevar
e39ea746a7 Make example data/ paths absolute for source view and JSFiddle 2016-06-09 08:51:34 +02:00
Andreas Hocevar
54f7bb6958 Merge pull request #5399 from probins/raster
Remove ol.raster namespace
2016-06-08 16:09:37 +02:00
Björn Harrtell
27853ea7dd Remove use of goog.uri 2016-06-08 15:14:18 +02:00
Peter Robins
395f3c0756 Remove ol.raster namespace
Now used only for 1 typedefs and 1 enum, it serves little purpose,
so the typedef is renamed in the ol namespace, and the enum moved to rastersource.js
2016-06-08 12:37:20 +00:00
Frédéric Junod
e63b4d1f48 Merge pull request #5270 from fredj/load_error
Load erroneous image in ol.Image#load and ol.ImageTile#load
2016-06-08 09:25:57 +02:00
Frédéric Junod
3935b7db24 Merge pull request #5194 from fredj/rm_goog.inherits
Get rid of goog.inherits and goog.base
2016-06-08 09:17:07 +02:00
Frederic Junod
e289bfbb7d Use ol.inherits instead of goog.inherits 2016-06-08 08:38:12 +02:00
Frederic Junod
a598737ec5 Add unit tests for ol.ImageTile 2016-06-08 08:36:58 +02:00
Frederic Junod
1f48198e95 Allow tiles in ol.ImageState.ERROR state to be loaded. 2016-06-08 08:36:58 +02:00
Andreas Hocevar
072728b083 Merge pull request #5427 from ahocevar/auto-typedef-enum-options
Document typedefs and enums used by API symbols
2016-06-07 23:58:04 +02:00
Andreas Hocevar
abec4f4ba7 Fix ol.raster.Operation type and docs 2016-06-07 08:36:44 +02:00
Frédéric Junod
edb3987054 Merge pull request #5438 from fredj/filter_inherit_object
Don't make ol.format.ogc.filter.Filter inherit from ol.Object
2016-06-06 17:20:25 +02:00
Frederic Junod
c51fc84b72 Don't make ol.format.ogc.filter.Filter inherit from ol.Object 2016-06-06 17:05:04 +02:00
Frédéric Junod
de9c338fb1 Merge pull request #5433 from openlayers/greenkeeper-clean-css-3.4.17
Update clean-css to version 3.4.17 🚀
2016-06-06 08:51:19 +02:00
Frédéric Junod
26789d91d2 Merge pull request #5434 from tsauerwein/fix-externs
Fix externs in closure compiler tutorial
2016-06-06 08:47:04 +02:00
Andreas Hocevar
aa9dbb984a Work around undetected types in {function(argType):returnType} types 2016-06-06 08:02:10 +02:00
tsauerwein
b2120b2bab Fix externs in closure tutorial 2016-06-04 10:52:17 +02:00
greenkeeperio-bot
b4b61e737f chore(package): update clean-css to version 3.4.17
https://greenkeeper.io/
2016-06-03 23:13:17 -07:00
Andreas Hocevar
0dca194525 Handle types in arrays etc. 2016-06-04 00:27:25 +02:00
Andreas Hocevar
9e980663ee Remove api annotations from typedefs in olx.js 2016-06-03 10:38:55 +02:00
Andreas Hocevar
2ec4969ac7 Remove api annotations from enums 2016-06-03 09:29:14 +02:00
Andreas Hocevar
ca07de422c Remove api annotations from typedefs 2016-06-03 09:29:04 +02:00
Andreas Hocevar
eddd006fcf Document typedefs and enums used by API symbols
It is no longer necessary to add api annotations to typedefs and enums
that are used by API symbols.
2016-06-03 09:28:53 +02:00
Marc Jansen
9e209a3362 Merge pull request #5426 from frankrowe/icon-example
Fix icon example to anchor popup to feature location
2016-06-03 07:53:09 +02:00
Frank Rowe
30482f023e fix icon example to anchor popup to feature location 2016-06-02 15:28:37 -04:00
Frédéric Junod
3d8ca68bac Merge pull request #5421 from probins/patch-1
Correct typo in config/jsdoc/api/readme.md
2016-06-02 17:03:58 +02:00
Peter Robins
3b1c76a1da Correct typo in config/jsdoc/api/readme.md 2016-06-02 15:29:41 +01:00
Frédéric Junod
578b653c40 Merge pull request #5417 from openlayers/greenkeeper-clean-css-3.4.16
Update clean-css to version 3.4.16 🚀
2016-06-02 11:52:35 +02:00
greenkeeperio-bot
da5f47999f chore(package): update clean-css to version 3.4.16
https://greenkeeper.io/
2016-06-02 03:19:55 -06:00
Frédéric Junod
d51fecd827 Merge pull request #5413 from openlayers/greenkeeper-clean-css-3.4.15
Update clean-css to version 3.4.15 🚀
2016-06-01 11:37:50 +02:00
greenkeeperio-bot
370f810f6b chore(package): update clean-css to version 3.4.15
https://greenkeeper.io/
2016-06-01 03:22:28 -06:00
Frédéric Junod
d270643ce1 Merge pull request #5410 from openlayers/greenkeeper-eslint-2.11.1
Update eslint to version 2.11.1 🚀
2016-05-31 08:46:17 +02:00
greenkeeperio-bot
1e2ea333cc chore(package): update eslint to version 2.11.1
https://greenkeeper.io/
2016-05-31 08:35:42 +02:00
Frédéric Junod
a9df88004c Merge pull request #5408 from openlayers/greenkeeper-pbf-2.0.1
Update pbf to version 2.0.1 🚀
2016-05-30 09:45:44 +02:00
greenkeeperio-bot
f477a6ccb9 chore(package): update pbf to version 2.0.1
https://greenkeeper.io/
2016-05-30 01:27:19 -06:00
Frédéric Junod
2305991ee9 Merge pull request #5404 from openlayers/greenkeeper-eslint-2.11.0
Update eslint to version 2.11.0 🚀
2016-05-30 09:27:05 +02:00
greenkeeperio-bot
3bdcdb5937 chore(package): update eslint to version 2.11.0
https://greenkeeper.io/
2016-05-27 13:24:13 -06:00
Bart van den Eijnden
bb8b43abce Merge pull request #5402 from anzhihun/master
Pass in srsName option to writeTransaction
2016-05-27 11:49:06 +02:00
Wei Lin
4877a7864c Pass in srsName option to writeTransaction
Fix #5397 :  By passing `srsName` option to `ol.format.WFS.writeTransaction`
2016-05-27 17:36:37 +08:00
Frédéric Junod
1b70931433 Merge pull request #5393 from openlayers/greenkeeper-mocha-2.5.3
Update mocha to version 2.5.3 🚀
2016-05-25 14:17:47 +02:00
greenkeeperio-bot
0acbaa20f9 chore(package): update mocha to version 2.5.3
https://greenkeeper.io/
2016-05-25 05:39:47 -06:00
Frédéric Junod
d2c8823359 Merge pull request #5394 from openlayers/greenkeeper-resemblejs-2.2.1
Update resemblejs to version 2.2.1 🚀
2016-05-25 13:39:33 +02:00
greenkeeperio-bot
2cac34e938 chore(package): update resemblejs to version 2.2.1
https://greenkeeper.io/
2016-05-25 04:25:06 -06:00
Frédéric Junod
15ede94380 Merge pull request #5390 from fredj/wmts_guess_encoding
Fix the requestEncoding automatic selection
2016-05-25 10:29:27 +02:00
Frederic Junod
bd0140f42d Fix the requestEncoding automatic selection
If the `requestEncoding` parameter was not provided, the function used `KVP`
but without checking if it was supported.
2016-05-25 09:57:49 +02:00
Frédéric Junod
f3248e9c19 Merge pull request #5392 from openlayers/greenkeeper-closure-util-1.14.0
Update closure-util to version 1.14.0 🚀
2016-05-25 09:49:47 +02:00
Frederic Junod
420374294b Remove unnecessaryCasts compiler check
Removed from the compiler, see:
https://github.com/google/closure-compiler/wiki/Releases#may-17-2016-v20160517
2016-05-25 09:38:33 +02:00
greenkeeperio-bot
271e7c5bb1 chore(package): update closure-util to version 1.14.0
https://greenkeeper.io/
2016-05-25 01:28:55 -06:00
Frédéric Junod
b434a30603 Merge pull request #5388 from openlayers/greenkeeper-mocha-2.5.2
Update mocha to version 2.5.2 🚀
2016-05-24 13:28:20 +02:00
greenkeeperio-bot
ec1d21e29a chore(package): update mocha to version 2.5.2
https://greenkeeper.io/
2016-05-24 04:16:05 -06:00
Frédéric Junod
4e1decab52 Merge pull request #5382 from twpayne/igc-date
Handle UTC midnight wrap around, fixes #5371
2016-05-24 09:08:21 +02:00
Frédéric Junod
92632f1d63 Merge pull request #5381 from openlayers/greenkeeper-mocha-2.5.1
Update mocha to version 2.5.1 🚀
2016-05-24 08:49:25 +02:00
Frédéric Junod
2063c1be71 Merge pull request #5383 from openlayers/greenkeeper-clean-css-3.4.13
Update clean-css to version 3.4.13 🚀
2016-05-24 08:49:12 +02:00
greenkeeperio-bot
77baa67e71 chore(package): update mocha to version 2.5.1
https://greenkeeper.io/
2016-05-24 08:28:18 +02:00
Andreas Hocevar
f3e6630db3 Merge v3.16.0 2016-05-23 21:01:54 +02:00
Andreas Hocevar
1038b2abea Update package version to v3.16.0 2016-05-23 20:49:32 +02:00
Andreas Hocevar
e0cada9c5d Changelog for v3.16.0 2016-05-23 20:49:05 +02:00
Tom Payne
a6a621834f Handle UTC midnight wrap around, fixes #5371 2016-05-23 20:36:01 +02:00
greenkeeperio-bot
4653a01ba4 chore(package): update clean-css to version 3.4.13
https://greenkeeper.io/
2016-05-23 04:04:44 -06:00
Frédéric Junod
7196e18479 Merge pull request #5377 from fredj/jspdf.min.js
Fix link to jspdf.min.js in export-pdf example
2016-05-23 11:23:03 +02:00
Frederic Junod
e70ce9d624 Fix link to jspdf.min.js in export-pdf example 2016-05-23 10:57:19 +02:00
Frédéric Junod
0efb3994eb Merge pull request #5372 from openlayers/greenkeeper-jquery-2.2.4
Update jquery to version 2.2.4 🚀
2016-05-23 08:36:03 +02:00
greenkeeperio-bot
d666bb4a36 chore(package): update jquery to version 2.2.4
https://greenkeeper.io/
2016-05-20 11:32:25 -06:00
Tim Schaub
50408d7c1a Merge pull request #5364 from tschaub/less-flashy
Make it so things don't flash so much when you change the tile source URL.
2016-05-19 09:26:42 -06:00
Tim Schaub
d50082b860 Upgrade note regarding tile rendering 2016-05-19 09:17:23 -06:00
Tim Schaub
ac4653ada5 Tests for source.setKey() 2016-05-19 09:09:52 -06:00
Tim Schaub
feb6fe9dce Tests for setUrl() and setUrls() 2016-05-19 09:09:52 -06:00
Tim Schaub
b2b902e22f Less weird name 2016-05-19 09:09:52 -06:00
Tim Schaub
6f5965f6a5 Demonstrate how source.setUrl() works 2016-05-19 09:09:52 -06:00
Tim Schaub
9870e8c04c Allow XYZ source construction without options 2016-05-19 09:09:52 -06:00
Tim Schaub
5542f045d5 Less special handling for WMTS tiles 2016-05-19 09:09:52 -06:00
Tim Schaub
025c063251 Less special handling for WMS tiles 2016-05-19 09:09:52 -06:00
Tim Schaub
841c8a5747 Rename source.getKeyParams() to source.getKey() 2016-05-19 09:09:52 -06:00
Tim Schaub
81d5849207 Add a settable key for all tile sources
The source's key is used as the key for all tiles in the source.  For URL tile sources, the URL is the key.
2016-05-19 09:09:52 -06:00
Andreas Hocevar
bbd1af6056 Merge pull request #5368 from probins/wfs
Move WFS typedefs to typedefs.js
2016-05-19 14:52:54 +02:00
Frédéric Junod
e3f58b3e84 Merge pull request #5369 from Turbo87/patch-2
format/igc: Remove duplicate regex exec() call
2016-05-19 14:48:08 +02:00
Tobias Bieniek
d52586d586 format/igc: Remove duplicate regex exec() call
HFDTE_RECORD_RE_.exec(line) has already been called above
2016-05-19 14:35:15 +02:00
Peter Robins
4044ae4cd0 Move WFS typedefs to typedefs.js
By renaming them so they're no longer in any subnamespaces, they no longer need to be in their own file.
2016-05-19 08:48:43 +00:00
Andreas Hocevar
be2fc808be Merge pull request #5363 from probins/camels
Convert all typedefs to CamelCase
2016-05-19 09:12:38 +02:00
Frédéric Junod
d08cca5a0c Merge pull request #5362 from openlayers/greenkeeper-vector-tile-1.2.1
Update vector-tile to version 1.2.1 🚀
2016-05-19 08:31:37 +02:00
Peter Robins
2117f2e3b1 Convert all typedefs to CamelCase 2016-05-18 19:44:45 +00:00
greenkeeperio-bot
1345d049b1 chore(package): update vector-tile to version 1.2.1
https://greenkeeper.io/
2016-05-18 12:58:43 -06:00
295 changed files with 3266 additions and 2480 deletions

View File

@@ -1,8 +1,56 @@
## Upgrade notes
### v3.17.0
#### `ol.source.MapQuest` removal
Because of changes at MapQuest (see: https://lists.openstreetmap.org/pipermail/talk/2016-June/076106.html) we had to remove the MapQuest source for now (see https://github.com/openlayers/ol3/issues/5484 for details).
#### `ol.interaction.ModifyEvent` changes
The event object previously had a `mapBrowserPointerEvent` property, which has been renamed to `mapBrowserEvent`.
#### Removal of ol.raster namespace
Users compiling their code with the library and using types in the `ol.raster` namespace should note that this has now been removed. `ol.raster.Pixel` has been deleted, and the other types have been renamed as follows, and your code may need changing if you use these:
* `ol.raster.Operation` to `ol.RasterOperation`
* `ol.raster.OperationType` to `ol.RasterOperationType`
#### All typedefs now in ol namespace
Users compiling their code with the library should note that the following typedefs have been renamed; your code may need changing if you use these:
* ol.events.ConditionType to ol.EventsConditionType
* ol.events.EventTargetLike to ol.EventTargetLike
* ol.events.Key to ol.EventsKey
* ol.events.ListenerFunctionType to ol.EventsListenerFunctionType
* ol.interaction.DragBoxEndConditionType to ol.DragBoxEndConditionType
* ol.interaction.DrawGeometryFunctionType to ol.DrawGeometryFunctionType
* ol.interaction.SegmentDataType to ol.ModifySegmentDataType
* ol.interaction.SelectFilterFunction to ol.SelectFilterFunction
* ol.interaction.SnapResultType to ol.SnapResultType
* ol.interaction.SnapSegmentDataType to ol.SnapSegmentDataType
* ol.proj.ProjectionLike to ol.ProjectionLike
* ol.style.AtlasBlock to ol.AtlasBlock
* ol.style.AtlasInfo to ol.AtlasInfo
* ol.style.AtlasManagerInfo to ol.AtlasManagerInfo
* ol.style.CircleRenderOptions to ol.CircleRenderOptions
* ol.style.ImageOptions to ol.StyleImageOptions
* ol.style.GeometryFunction to ol.StyleGeometryFunction
* ol.style.RegularShapeRenderOptions to ol.RegularShapeRenderOptions
* ol.style.StyleFunction to ol.StyleFunction
### v3.16.0
#### Rendering change for tile sources
Previously, if you called `source.setUrl()` on a tile source, all currently rendered tiles would be cleared before new tiles were loaded and rendered. This clearing of the map is undesirable if you are trying to smoothly update the tiles used by a source. This behavior has now changed, and calling `source.setUrl()` (or `source.setUrls()`) will *not* clear currently rendered tiles before loading and rendering new tiles. Instead, previously rendered tiles remain rendered until new tiles have loaded and can replace them. If you want to achieve the old behavior (render a blank map before loading new tiles), you can call `source.refresh()` or you can replace the old source with a new one (using `layer.setSource()`).
#### Move of typedefs out of code and into separate file
This change should not affect the great majority of application developers, but it's possible there are edge cases when compiling application code together with the library which cause compiler errors or warnings. In this case, please raise a GitHub issue. `goog.require`s for typedefs should not be necessary.
Users compiling their code with the library should note that the following API `@typedef`s have been renamed; your code may need changing if you use these:
* `ol.format.WFS.FeatureCollectionMetadata` to `ol.WFSFeatureCollectionMetadata`
* `ol.format.WFS.TransactionResponse` to `ol.WFSTransactionResponse`
#### Removal of `opaque` option for `ol.source.VectorTile`

148
changelog/v3.16.0.md Normal file
View File

@@ -0,0 +1,148 @@
# v3.16.0
## Summary
The v3.16.0 release includes features and fixes from 95 pull requests since the v3.15.1 release. New features and improvements include:
* Add `ol.source.ImageArcGISRest` for ArcGIS REST image layer support (#3880)
* New `finishCondition` option for `ol.interaction.Draw` to control which action should finish a geometry when drawing (#5261)
* New filter API for `ol.format.WFS#writeGetFeature` for WFS queries with OGC filters (#5252)
* New `renderMode` option for `ol.layer.VectorTile` to balance between rendering performance and rendering quality (#5177)
* More flexibility for configuring attribution logos by allowing HTML elements (#5274)
* UTFGrid updates, now supporting Mapbox API v4 (#5329)
* New `condition` option for `ol.interaction.Modify` for better reliability when combining with other interactions (#5320)
In addition to these new features, the code base has been simplified and refactored in the process of removing the dependency on Closure Library and Compiler.
## Upgrade notes
#### Rendering change for tile sources
Previously, if you called `source.setUrl()` on a tile source, all currently rendered tiles would be cleared before new tiles were loaded and rendered. This clearing of the map is undesirable if you are trying to smoothly update the tiles used by a source. This behavior has now changed, and calling `source.setUrl()` (or `source.setUrls()`) will *not* clear currently rendered tiles before loading and rendering new tiles. Instead, previously rendered tiles remain rendered until new tiles have loaded and can replace them. If you want to achieve the old behavior (render a blank map before loading new tiles), you can call `source.refresh()` or you can replace the old source with a new one (using `layer.setSource()`).
#### Move of typedefs out of code and into separate file
This change should not affect the great majority of application developers, but it's possible there are edge cases when compiling application code together with the library which cause compiler errors or warnings. In this case, please raise a GitHub issue. `goog.require`s for typedefs should not be necessary.
Users compiling their code with the library should note that the following API `@typedef`s have been renamed; your code may need changing if you use these:
* `ol.format.WFS.FeatureCollectionMetadata` to `ol.WFSFeatureCollectionMetadata`
* `ol.format.WFS.TransactionResponse` to `ol.WFSTransactionResponse`
#### Removal of `opaque` option for `ol.source.VectorTile`
This option is no longer needed, so it was removed from the API.
#### XHR loading for `ol.source.TileUTFGrid`
The `ol.source.TileUTFGrid` now uses XMLHttpRequest to load UTFGrid tiles by default. This works out of the box with the v4 Mapbox API. To work with the v3 API, you must use the new `jsonp` option on the source. See the examples below for detail.
```js
// To work with the v4 API
var v4source = new ol.source.TileUTFGrid({
url: 'https://api.tiles.mapbox.com/v4/example.json?access_token=' + YOUR_KEY_HERE
});
// To work with the v3 API
var v3source = new ol.source.TileUTFGrid({
jsonp: true, // <--- this is required for v3
url: 'http://api.tiles.mapbox.com/v3/example.json'
});
```
## Full list of changes
* [#5377](https://github.com/openlayers/ol3/pull/5377) - Fix link to jspdf.min.js in export-pdf example ([@fredj](https://github.com/fredj))
* [#5372](https://github.com/openlayers/ol3/pull/5372) - Update jquery to version 2.2.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#5364](https://github.com/openlayers/ol3/pull/5364) - Make it so things don't flash so much when you change the tile source URL. ([@tschaub](https://github.com/tschaub))
* [#5368](https://github.com/openlayers/ol3/pull/5368) - Move WFS typedefs to typedefs.js ([@probins](https://github.com/probins))
* [#5369](https://github.com/openlayers/ol3/pull/5369) - format/igc: Remove duplicate regex exec() call ([@Turbo87](https://github.com/Turbo87))
* [#5363](https://github.com/openlayers/ol3/pull/5363) - Convert all typedefs to CamelCase ([@probins](https://github.com/probins))
* [#5362](https://github.com/openlayers/ol3/pull/5362) - Update vector-tile to version 1.2.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5352](https://github.com/openlayers/ol3/pull/5352) - Add getResolutions() to ol.View ([@marlowp](https://github.com/marlowp))
* [#5359](https://github.com/openlayers/ol3/pull/5359) - Move upgrade notes to correct place ([@probins](https://github.com/probins))
* [#5343](https://github.com/openlayers/ol3/pull/5343) - Rename non-api sub-namespace typedefs ([@probins](https://github.com/probins))
* [#5361](https://github.com/openlayers/ol3/pull/5361) - Fix url to maki icons ([@fredj](https://github.com/fredj))
* [#5358](https://github.com/openlayers/ol3/pull/5358) - Handle multiple featureMember elements for different types (WFS format) ([@tsauerwein](https://github.com/tsauerwein))
* [#5355](https://github.com/openlayers/ol3/pull/5355) - Fix navigation-controls example description ([@fredj](https://github.com/fredj))
* [#5353](https://github.com/openlayers/ol3/pull/5353) - Add API definition to docs landing page ([@probins](https://github.com/probins))
* [#5356](https://github.com/openlayers/ol3/pull/5356) - Update rbush to version 1.4.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#5354](https://github.com/openlayers/ol3/pull/5354) - Update eslint to version 2.10.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#5347](https://github.com/openlayers/ol3/pull/5347) - Update eslint to version 2.10.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5344](https://github.com/openlayers/ol3/pull/5344) - Remove raster enum from test ([@probins](https://github.com/probins))
* [#5329](https://github.com/openlayers/ol3/pull/5329) - UTFGrid updates. ([@tschaub](https://github.com/tschaub))
* [#5335](https://github.com/openlayers/ol3/pull/5335) - Move typedefs to separate file ([@probins](https://github.com/probins))
* [#5332](https://github.com/openlayers/ol3/pull/5332) - Warn when viewing an outdated example, and offer a redirect to latest ([@ahocevar](https://github.com/ahocevar))
* [#5342](https://github.com/openlayers/ol3/pull/5342) - Fix incorrect source links ([@ahocevar](https://github.com/ahocevar))
* [#5339](https://github.com/openlayers/ol3/pull/5339) - Use a div instead of alert for version warning ([@ahocevar](https://github.com/ahocevar))
* [#5320](https://github.com/openlayers/ol3/pull/5320) - Add a 'condition' option to ol.interaction.Modify ([@fredj](https://github.com/fredj))
* [#5333](https://github.com/openlayers/ol3/pull/5333) - Improve code readability with better comments ([@openlayers](https://github.com/openlayers))
* [#5330](https://github.com/openlayers/ol3/pull/5330) - Fix source links, display version and warn about outdated docs ([@ahocevar](https://github.com/ahocevar))
* [#5324](https://github.com/openlayers/ol3/pull/5324) - Remove unneeded goog.provides/requires for typedefs ([@probins](https://github.com/probins))
* [#5328](https://github.com/openlayers/ol3/pull/5328) - Use Node 6 on Travis. ([@tschaub](https://github.com/tschaub))
* [#5313](https://github.com/openlayers/ol3/pull/5313) - Rastersource framestate extent ([@ahocevar](https://github.com/ahocevar))
* [#5326](https://github.com/openlayers/ol3/pull/5326) - Fix wording in tile-load-event example ([@tsauerwein](https://github.com/tsauerwein))
* [#5327](https://github.com/openlayers/ol3/pull/5327) - Update closure-util to version 1.13.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5289](https://github.com/openlayers/ol3/pull/5289) - Update fs-extra to version 0.30.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5319](https://github.com/openlayers/ol3/pull/5319) - Remove outdated fixme from framestate.js. ([@probins](https://github.com/probins))
* [#5274](https://github.com/openlayers/ol3/pull/5274) - Allow using elements in logo attribution options ([@samuellapointe](https://github.com/samuellapointe))
* [#5162](https://github.com/openlayers/ol3/pull/5162) - Improve docs/examples for loadingstrategy ([@probins](https://github.com/probins))
* [#5314](https://github.com/openlayers/ol3/pull/5314) - Update browserify to version 13.0.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5315](https://github.com/openlayers/ol3/pull/5315) - Remove unused ol.TileCoordTransformType ([@probins](https://github.com/probins))
* [#5310](https://github.com/openlayers/ol3/pull/5310) - Get raster sources working again. ([@tschaub](https://github.com/tschaub))
* [#5291](https://github.com/openlayers/ol3/pull/5291) - Allow once listeners to dispatch events of same type ([@ahocevar](https://github.com/ahocevar))
* [#5309](https://github.com/openlayers/ol3/pull/5309) - Update metalsmith-layouts to version 1.6.5 🚀 ([@openlayers](https://github.com/openlayers))
* [#5052](https://github.com/openlayers/ol3/pull/5052) - Update fs-extra to version 0.26.7 🚀 ([@openlayers](https://github.com/openlayers))
* [#5306](https://github.com/openlayers/ol3/pull/5306) - Make olx.view.FitOptions.padding optional ([@gberaudo](https://github.com/gberaudo))
* [#5302](https://github.com/openlayers/ol3/pull/5302) - Remove use of goog.partial ([@fredj](https://github.com/fredj))
* [#5304](https://github.com/openlayers/ol3/pull/5304) - Update sinon to version 1.17.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#4644](https://github.com/openlayers/ol3/pull/4644) - Remove check-requires script ([@fredj](https://github.com/fredj))
* [#5298](https://github.com/openlayers/ol3/pull/5298) - Update eslint to version 2.9.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5296](https://github.com/openlayers/ol3/pull/5296) - Document handling of KML MultiGeometries ([@probins](https://github.com/probins))
* [#5293](https://github.com/openlayers/ol3/pull/5293) - Block removePoint while dragging ([@giohappy](https://github.com/giohappy))
* [#5285](https://github.com/openlayers/ol3/pull/5285) - Add more tests for the scaleline control ([@marcjansen](https://github.com/marcjansen))
* [#5287](https://github.com/openlayers/ol3/pull/5287) - Add and fix vectortile tests ([@ahocevar](https://github.com/ahocevar))
* [#5288](https://github.com/openlayers/ol3/pull/5288) - Expose removeVertex_ as removePoint ([@giohappy](https://github.com/giohappy))
* [#5286](https://github.com/openlayers/ol3/pull/5286) - Skip unnecessary render functions ([@ahocevar](https://github.com/ahocevar))
* [#5177](https://github.com/openlayers/ol3/pull/5177) - Add render options for vector tile layers ([@ahocevar](https://github.com/ahocevar))
* [#5278](https://github.com/openlayers/ol3/pull/5278) - Fix invalid generics type instantiation ([@fredj](https://github.com/fredj))
* [#5044](https://github.com/openlayers/ol3/pull/5044) - Snap interaction now handle feature without geometry properly ([@fblackburn](https://github.com/fblackburn))
* [#5277](https://github.com/openlayers/ol3/pull/5277) - Type cleanup ([@fredj](https://github.com/fredj))
* [#5275](https://github.com/openlayers/ol3/pull/5275) - Fix feature-layer association on replaced selections ([@ahocevar](https://github.com/ahocevar))
* [#5252](https://github.com/openlayers/ol3/pull/5252) - Add filter option to ol.format.WFS#writeGetFeature ([@tsauerwein](https://github.com/tsauerwein))
* [#5264](https://github.com/openlayers/ol3/pull/5264) - Fix for close draw polygon error ([@matjos](https://github.com/matjos))
* [#5267](https://github.com/openlayers/ol3/pull/5267) - Use ol.functions instead of goog.functions ([@ahocevar](https://github.com/ahocevar))
* [#5266](https://github.com/openlayers/ol3/pull/5266) - Document ol.colorlike ([@ahocevar](https://github.com/ahocevar))
* [#5261](https://github.com/openlayers/ol3/pull/5261) - add finishCondition to ol.interaction.Draw ([@giohappy](https://github.com/giohappy))
* [#5259](https://github.com/openlayers/ol3/pull/5259) - Include squash commit merges in changelog ([@ahocevar](https://github.com/ahocevar))
* [#5257](https://github.com/openlayers/ol3/pull/5257) - Add readFeatures and readProjection as MVT experimental API ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3880](https://github.com/openlayers/ol3/pull/3880) - Add ol.source.ImageArcGISRest ([Anna Lambrechtsen](https://github.com/search?q=Anna Lambrechtsen&type=Users))
* [#5239](https://github.com/openlayers/ol3/pull/5239) - Update eslint to version 2.8.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5230](https://github.com/openlayers/ol3/pull/5230) - Reuse frame state arrays ([@fredj](https://github.com/fredj))
* [#5213](https://github.com/openlayers/ol3/pull/5213) - Remove unused ol.source.Source#setProjection function ([@fredj](https://github.com/fredj))
* [#5223](https://github.com/openlayers/ol3/pull/5223) - Create tmpSize_ before calling calculateTileRanges_ ([@fredj](https://github.com/fredj))
* [#5225](https://github.com/openlayers/ol3/pull/5225) - Remove unused ol.extent.transform2D function ([@fredj](https://github.com/fredj))
* [#5212](https://github.com/openlayers/ol3/pull/5212) - KML: fix GeometryCollection write ([@probins](https://github.com/probins))
* [#5228](https://github.com/openlayers/ol3/pull/5228) - Add 'layers' option to Translate interaction ([@adube](https://github.com/adube))
* [#5221](https://github.com/openlayers/ol3/pull/5221) - Update jquery, bootstrap and proj4js in examples ([@fredj](https://github.com/fredj))
* [#5227](https://github.com/openlayers/ol3/pull/5227) - Add a temporary ol.TileCoord in ol.renderer.canvas.TileLayer ([@fredj](https://github.com/fredj))
* [#5222](https://github.com/openlayers/ol3/pull/5222) - Remove unused private variables in ol.renderer.canvas.Map ([@fredj](https://github.com/fredj))
* [#5220](https://github.com/openlayers/ol3/pull/5220) - Externs cleanup ([@fredj](https://github.com/fredj))
* [#5224](https://github.com/openlayers/ol3/pull/5224) - Fix jsdoc tags indentation ([@fredj](https://github.com/fredj))
* [#5218](https://github.com/openlayers/ol3/pull/5218) - Add @api annotation to setConfig. ([@aisaacs](https://github.com/aisaacs))
* [#5215](https://github.com/openlayers/ol3/pull/5215) - Add an optional feature filter to getClosestFeatureToCoordinate ([@fredj](https://github.com/fredj))
* [#5132](https://github.com/openlayers/ol3/pull/5132) - Remove goog.string ([@nicholas-l](https://github.com/nicholas-l))
* [#5206](https://github.com/openlayers/ol3/pull/5206) - Minor correction of StyleFunction docs ([@probins](https://github.com/probins))
* [#4932](https://github.com/openlayers/ol3/pull/4932) - Remove undefined parameters to ol.format.WMSGetFeatureInfo#readFeatures_ ([@fredj](https://github.com/fredj))
* [#5207](https://github.com/openlayers/ol3/pull/5207) - Update clean-css to version 3.4.12 🚀 ([@openlayers](https://github.com/openlayers))
* [#5201](https://github.com/openlayers/ol3/pull/5201) - Small clarification for vector source loader docs ([@probins](https://github.com/probins))
* [#5200](https://github.com/openlayers/ol3/pull/5200) - Fix typo in rotate control for css classList ([@bartvde](https://github.com/bartvde))
* [#5178](https://github.com/openlayers/ol3/pull/5178) - Remove goog.global ([Nicholas Latham](https://github.com/search?q=Nicholas Latham&type=Users))
* [#5189](https://github.com/openlayers/ol3/pull/5189) - Add rendering tests to ensure correct circle and polygon rendering ([Andreas Hocevar](https://github.com/search?q=Andreas Hocevar&type=Users))
* [#5183](https://github.com/openlayers/ol3/pull/5183) - Update istanbul to version 0.4.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#5187](https://github.com/openlayers/ol3/pull/5187) - Remove goog.functions.and from ol.interaction.Modify ([@fredj](https://github.com/fredj))
* [#5176](https://github.com/openlayers/ol3/pull/5176) - Update jquery to version 2.2.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#5173](https://github.com/openlayers/ol3/pull/5173) - Use ol.dom.createCanvasContext2D ([@fredj](https://github.com/fredj))
* [#5171](https://github.com/openlayers/ol3/pull/5171) - Move olx.source.AttributionOption out of externs/olx.js ([@fredj](https://github.com/fredj))
* [#5170](https://github.com/openlayers/ol3/pull/5170) - Update eslint to version 2.7.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5167](https://github.com/openlayers/ol3/pull/5167) - Remove FastClick from mobile-full-screen example ([@fredj](https://github.com/fredj))
* [#5166](https://github.com/openlayers/ol3/pull/5166) - Remove jquery dependency from measure example ([@fredj](https://github.com/fredj))
* [#5164](https://github.com/openlayers/ol3/pull/5164) - Cartodb cleanup ([@fredj](https://github.com/fredj))

107
changelog/v3.17.0.md Normal file
View File

@@ -0,0 +1,107 @@
# v3.17.0
## Summary
The v3.17.0 release includes features and fixes from 60 pull requests since the v3.16.0 release. Most of the changes are bug fixes and continuing removal of the dependency on Closure Library.
## Upgrade notes
#### `ol.source.MapQuest` removal
Because of changes at MapQuest (see: https://lists.openstreetmap.org/pipermail/talk/2016-June/076106.html) we had to remove the MapQuest source for now (see https://github.com/openlayers/ol3/issues/5484 for details).
#### `ol.interaction.ModifyEvent` changes
The event object previously had a `mapBrowserPointerEvent` property, which has been renamed to `mapBrowserEvent`.
#### Removal of ol.raster namespace
Users compiling their code with the library and using types in the `ol.raster` namespace should note that this has now been removed. `ol.raster.Pixel` has been deleted, and the other types have been renamed as follows, and your code may need changing if you use these:
* `ol.raster.Operation` to `ol.RasterOperation`
* `ol.raster.OperationType` to `ol.RasterOperationType`
#### All typedefs now in ol namespace
Users compiling their code with the library should note that the following typedefs have been renamed; your code may need changing if you use these:
* ol.events.ConditionType to ol.EventsConditionType
* ol.events.EventTargetLike to ol.EventTargetLike
* ol.events.Key to ol.EventsKey
* ol.events.ListenerFunctionType to ol.EventsListenerFunctionType
* ol.interaction.DragBoxEndConditionType to ol.DragBoxEndConditionType
* ol.interaction.DrawGeometryFunctionType to ol.DrawGeometryFunctionType
* ol.interaction.SegmentDataType to ol.ModifySegmentDataType
* ol.interaction.SelectFilterFunction to ol.SelectFilterFunction
* ol.interaction.SnapResultType to ol.SnapResultType
* ol.interaction.SnapSegmentDataType to ol.SnapSegmentDataType
* ol.proj.ProjectionLike to ol.ProjectionLike
* ol.style.AtlasBlock to ol.AtlasBlock
* ol.style.AtlasInfo to ol.AtlasInfo
* ol.style.AtlasManagerInfo to ol.AtlasManagerInfo
* ol.style.CircleRenderOptions to ol.CircleRenderOptions
* ol.style.ImageOptions to ol.StyleImageOptions
* ol.style.GeometryFunction to ol.StyleGeometryFunction
* ol.style.RegularShapeRenderOptions to ol.RegularShapeRenderOptions
* ol.style.StyleFunction to ol.StyleFunction
## Full list of changes
* [#5539](https://github.com/openlayers/ol3/pull/5539) - Remove outdated comments re goog.dom ([@probins](https://github.com/probins))
* [#5543](https://github.com/openlayers/ol3/pull/5543) - Update rbush to 2.0.1 ([@tsauerwein](https://github.com/tsauerwein))
* [#5540](https://github.com/openlayers/ol3/pull/5540) - Remove MapQuest source ([@bartvde](https://github.com/bartvde))
* [#5538](https://github.com/openlayers/ol3/pull/5538) - Replace remaining goog.inherits ([@probins](https://github.com/probins))
* [#5536](https://github.com/openlayers/ol3/pull/5536) - Update to layer-extent example ([@tschaub](https://github.com/tschaub))
* [#5482](https://github.com/openlayers/ol3/pull/5482) - Fix for regression in tile layer extent ([@ischneider](https://github.com/ischneider))
* [#5475](https://github.com/openlayers/ol3/pull/5475) - Remove goog.provide from enums only used internally or in olx.js ([@probins](https://github.com/probins))
* [#5424](https://github.com/openlayers/ol3/pull/5424) - Don't dispatch select event if no feature is selected or deselected ([@fredj](https://github.com/fredj))
* [#5522](https://github.com/openlayers/ol3/pull/5522) - Add 'condition' option to ol.interaction.DragPanOptions in olx.js ([@SamuelBerger](https://github.com/SamuelBerger))
* [#5443](https://github.com/openlayers/ol3/pull/5443) - Remove olx.source.WMTSOptions#maxZoom option ([@fredj](https://github.com/fredj))
* [#5497](https://github.com/openlayers/ol3/pull/5497) - Update istanbul to version 0.4.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#5523](https://github.com/openlayers/ol3/pull/5523) - Update closure-util to version 1.15.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5508](https://github.com/openlayers/ol3/pull/5508) - Fix problems with ol.format.WFS in compiled mode ([@tsauerwein](https://github.com/tsauerwein))
* [#5512](https://github.com/openlayers/ol3/pull/5512) - Use forEachTileCoord name instead of forEachTileCoordInExtentAndZ ([@ahocevar](https://github.com/ahocevar))
* [#5513](https://github.com/openlayers/ol3/pull/5513) - Add getters for min and max resolution of the view ([@bartvde](https://github.com/bartvde))
* [#5471](https://github.com/openlayers/ol3/pull/5471) - Fix GPX write of xsi ns ([@probins](https://github.com/probins))
* [#5134](https://github.com/openlayers/ol3/pull/5134) - Remove goog.dom ([@nicholas-l](https://github.com/nicholas-l))
* [#5511](https://github.com/openlayers/ol3/pull/5511) - Do not optimize lines away entirely ([@ahocevar](https://github.com/ahocevar))
* [#5509](https://github.com/openlayers/ol3/pull/5509) - Make it easier to work with tile ranges in custom source implementations ([@ahocevar](https://github.com/ahocevar))
* [#5498](https://github.com/openlayers/ol3/pull/5498) - Update eslint to version 2.13.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5495](https://github.com/openlayers/ol3/pull/5495) - Get rid of goog.isFunction ([@fredj](https://github.com/fredj))
* [#5499](https://github.com/openlayers/ol3/pull/5499) - Update glob to version 7.0.5 🚀 ([@openlayers](https://github.com/openlayers))
* [#5125](https://github.com/openlayers/ol3/pull/5125) - Remove goog style ([@nicholas-l](https://github.com/nicholas-l))
* [#5494](https://github.com/openlayers/ol3/pull/5494) - Remove goog.global ([@probins](https://github.com/probins))
* [#5492](https://github.com/openlayers/ol3/pull/5492) - Update eslint to version 2.13.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5490](https://github.com/openlayers/ol3/pull/5490) - Update glob to version 7.0.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#5460](https://github.com/openlayers/ol3/pull/5460) - Update eslint to version 2.12.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5479](https://github.com/openlayers/ol3/pull/5479) - Update slimerjs to version 0.906.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#5474](https://github.com/openlayers/ol3/pull/5474) - Update clean-css to version 3.4.18 🚀 ([@openlayers](https://github.com/openlayers))
* [#5450](https://github.com/openlayers/ol3/pull/5450) - Remove sub-namespaces from all remaining typedefs ([@probins](https://github.com/probins))
* [#5465](https://github.com/openlayers/ol3/pull/5465) - Fix custom icon positions and rotation ([@ahocevar](https://github.com/ahocevar))
* [#5469](https://github.com/openlayers/ol3/pull/5469) - Fix typo ([@gberaudo](https://github.com/gberaudo))
* [#5453](https://github.com/openlayers/ol3/pull/5453) - Reference ol.MapBrowserEvent instead of ol.MapBrowserPointerEvent ([@ahocevar](https://github.com/ahocevar))
* [#5208](https://github.com/openlayers/ol3/pull/5208) - Stop GPX writing rtept properties ([@probins](https://github.com/probins))
* [#5452](https://github.com/openlayers/ol3/pull/5452) - Update eslint-config-openlayers to version 5.0.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5432](https://github.com/openlayers/ol3/pull/5432) - Remove use of goog.uri ([@bjornharrtell](https://github.com/bjornharrtell))
* [#5449](https://github.com/openlayers/ol3/pull/5449) - Make example data/ paths absolute for source view and JSFiddle ([@ahocevar](https://github.com/ahocevar))
* [#5399](https://github.com/openlayers/ol3/pull/5399) - Remove ol.raster namespace ([@probins](https://github.com/probins))
* [#5270](https://github.com/openlayers/ol3/pull/5270) - Load erroneous image in ol.Image#load and ol.ImageTile#load ([@fredj](https://github.com/fredj))
* [#5194](https://github.com/openlayers/ol3/pull/5194) - Get rid of goog.inherits and goog.base ([@fredj](https://github.com/fredj))
* [#5427](https://github.com/openlayers/ol3/pull/5427) - Document typedefs and enums used by API symbols ([@ahocevar](https://github.com/ahocevar))
* [#5438](https://github.com/openlayers/ol3/pull/5438) - Don't make ol.format.ogc.filter.Filter inherit from ol.Object ([@fredj](https://github.com/fredj))
* [#5433](https://github.com/openlayers/ol3/pull/5433) - Update clean-css to version 3.4.17 🚀 ([@openlayers](https://github.com/openlayers))
* [#5434](https://github.com/openlayers/ol3/pull/5434) - Fix externs in closure compiler tutorial ([@tsauerwein](https://github.com/tsauerwein))
* [#5426](https://github.com/openlayers/ol3/pull/5426) - Fix icon example to anchor popup to feature location ([@frankrowe](https://github.com/frankrowe))
* [#5421](https://github.com/openlayers/ol3/pull/5421) - Correct typo in config/jsdoc/api/readme.md ([@probins](https://github.com/probins))
* [#5417](https://github.com/openlayers/ol3/pull/5417) - Update clean-css to version 3.4.16 🚀 ([@openlayers](https://github.com/openlayers))
* [#5413](https://github.com/openlayers/ol3/pull/5413) - Update clean-css to version 3.4.15 🚀 ([@openlayers](https://github.com/openlayers))
* [#5410](https://github.com/openlayers/ol3/pull/5410) - Update eslint to version 2.11.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5408](https://github.com/openlayers/ol3/pull/5408) - Update pbf to version 2.0.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5404](https://github.com/openlayers/ol3/pull/5404) - Update eslint to version 2.11.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5402](https://github.com/openlayers/ol3/pull/5402) - Pass in srsName option to writeTransaction ([@anzhihun](https://github.com/anzhihun))
* [#5393](https://github.com/openlayers/ol3/pull/5393) - Update mocha to version 2.5.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#5394](https://github.com/openlayers/ol3/pull/5394) - Update resemblejs to version 2.2.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5390](https://github.com/openlayers/ol3/pull/5390) - Fix the requestEncoding automatic selection ([@fredj](https://github.com/fredj))
* [#5392](https://github.com/openlayers/ol3/pull/5392) - Update closure-util to version 1.14.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5388](https://github.com/openlayers/ol3/pull/5388) - Update mocha to version 2.5.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#5382](https://github.com/openlayers/ol3/pull/5382) - Handle UTC midnight wrap around, fixes #5371 ([@twpayne](https://github.com/twpayne))
* [#5381](https://github.com/openlayers/ol3/pull/5381) - Update mocha to version 2.5.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5383](https://github.com/openlayers/ol3/pull/5383) - Update clean-css to version 3.4.13 🚀 ([@openlayers](https://github.com/openlayers))

9
changelog/v3.17.1.md Normal file
View File

@@ -0,0 +1,9 @@
# v3.17.1
## Summary
The v3.17.1 release is a patch release that addresses a regression in the v3.17.0 release. See the [v3.17.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.17.0) for details on upgrading from v3.16.
## Fixes
* [#5548](https://github.com/openlayers/ol3/pull/5548) - Fix CHANGETYPE in ol.control.FullScreen ([@GaborFarkas](https://github.com/GaborFarkas))

View File

@@ -24,15 +24,12 @@
"externs/topojson.js"
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.DEBUG=false"
],
"jscomp_error": [
"*"
],
"jscomp_off": [
"unnecessaryCasts",
"useOfGoogBase",
"lintChecks",
"analyzerChecks",
"missingProvide",

View File

@@ -24,15 +24,12 @@
"externs/topojson.js"
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.DEBUG=false"
],
"jscomp_error": [
"*"
],
"jscomp_off": [
"unnecessaryCasts",
"useOfGoogBase",
"lintChecks",
"analyzerChecks"
],

View File

@@ -11,6 +11,7 @@ exports.defineTags = function(dictionary) {
canHaveType: false,
canHaveName: false,
onTagged: function(doclet, tag) {
includeTypes(doclet);
var level = tag.text || "experimental";
if (levels.indexOf(level) >= 0) {
doclet.stability = level;
@@ -25,11 +26,15 @@ exports.defineTags = function(dictionary) {
/*
* Based on @stability annotations, and assuming that items with no @stability
* annotation should not be documented, this plugin removes undocumented symbols
* Based on @api annotations, and assuming that items with no @api annotation
* should not be documented, this plugin removes undocumented symbols
* from the documentation.
*/
var api = [];
var classes = {};
var types = {};
function hasApiMembers(doclet) {
return doclet.longname.split('#')[0] == this.longname;
}
@@ -71,8 +76,30 @@ function includeAugments(doclet) {
}
}
var api = [];
var classes = {};
function extractTypes(item) {
item.type.names.forEach(function(type) {
var match = type.match(/^(.*<)?([^>]*)>?$/);
if (match) {
types[match[2]] = true;
}
});
}
function includeTypes(doclet) {
if (doclet.params && doclet.kind != 'class') {
doclet.params.forEach(extractTypes);
}
if (doclet.returns) {
doclet.returns.forEach(extractTypes);
}
if (doclet.isEnum) {
types[doclet.meta.code.name] = true;
}
if (doclet.type && doclet.meta.code.type == 'MemberExpression') {
// types in olx.js
extractTypes(doclet);
}
}
exports.handlers = {
@@ -80,6 +107,9 @@ exports.handlers = {
var doclet = e.doclet;
// Keep track of api items - needed in parseComplete to determine classes
// with api members.
if (doclet.meta.filename == 'olx.js' && doclet.kind == 'typedef') {
doclet.undocumented = false;
}
if (doclet.stability) {
api.push(doclet);
}
@@ -120,7 +150,7 @@ exports.handlers = {
// constructor from the docs.
doclet._hideConstructor = true;
includeAugments(doclet);
} else if (!doclet._hideConstructor) {
} else if (doclet.undocumented !== false && !doclet._hideConstructor && !(doclet.kind == 'typedef' && doclet.longname in types)) {
// Remove all other undocumented symbols
doclet.undocumented = true;
}

View File

@@ -89,10 +89,6 @@ exports.handlers = {
newDoclet: function(e) {
var doclet = e.doclet;
if (doclet.meta.filename == 'olx.js') {
// do nothing if not marked @api
if (!doclet.stability) {
return;
}
if (doclet.kind == 'typedef') {
lastOlxTypedef = doclet;
olxTypeNames.push(doclet.longname);

View File

@@ -24,7 +24,7 @@ The second line tells the Closure compiler the type of the argument.
The third line (`@api`) marks the method as part of the api and thus exportable. The stability can be added as value, e.g. `@api stable`. Without such an api annotation, the method will not be documented in the generated API documentation. Symbols without an api annotation will also not be exportable (unless they are explicitly exported with a `goog.exportProperty` call).
The `@api` annotation can be used in conjunciton with the `@inheritDoc` annotation to export a symbol that is documented on a parent class (where the method may be abstract). In general, `@api` annotations should never be used on abstract methods (only on their implementations).
The `@api` annotation can be used in conjunction with the `@inheritDoc` annotation to export a symbol that is documented on a parent class (where the method may be abstract). In general, `@api` annotations should never be used on abstract methods (only on their implementations).
### Events

View File

@@ -39,7 +39,7 @@ var self = this;
<?js
item.typedefs.forEach(function (v) {
?>
<li data-name="<?js= v.longname ?>" class="<?js= v.stability !== 'stable' ? 'unstable' : ''?>">
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability !== 'stable') ? 'unstable' : ''?>">
<?js= self.linkto(v.longname, v.name) ?>
</li>
<?js
@@ -56,7 +56,7 @@ var self = this;
item.methods.forEach(function (v) {
?>
<li data-name="<?js= v.longname ?>" class="<?js= v.stability !== 'stable' ? 'unstable' : ''?>">
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability !== 'stable') ? 'unstable' : ''?>">
<?js= self.linkto(v.longname, v.name) ?>
</li>
<?js
@@ -73,7 +73,7 @@ var self = this;
item.fires.forEach(function (v) {
v = self.find({longname: v})[0] || {longname: v, name: v.split(/#?event:/)[1]};
?>
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability != 'stable' ? 'unstable' : '') ?>">
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability != 'stable') ? 'unstable' : '' ?>">
<?js= self.linkto(v.longname, v.name) ?>
</li>
<?js

View File

@@ -21,7 +21,7 @@
var setter = prop.readonly ? 'no' : 'yes';
?>
<tr class="<?js= prop.stability !== 'stable' ? 'unstable' : '' ?>">
<tr class="<?js= (prop.stability && prop.stability !== 'stable') ? 'unstable' : '' ?>">
<td class="name"><code><?js= prop.name ?></code></td>
<td class="type">
<?js if (prop.type && prop.type.names) {?>

View File

@@ -2,6 +2,6 @@
var data = obj;
var self = this;
if (data.stability != 'stable') { ?>
if (data.stability && data.stability != 'stable') { ?>
<span class="stability <?js= data.stability ?>"><?js= data.stability ?></span>
<?js } ?>

View File

@@ -1,5 +1,5 @@
<section>
<header>
<?js if (children.length > 0) { ?>
<ul><?js
@@ -10,10 +10,10 @@
<?js } ?>
<h2><?js= header ?></h2>
</header>
</header>
<article>
<?js= content ?>
</article>
</section>
</section>

View File

@@ -15,15 +15,12 @@
"externs/topojson.js"
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.DEBUG=false"
],
"jscomp_error": [
"*"
],
"jscomp_off": [
"unnecessaryCasts",
"useOfGoogBase",
"lintChecks",
"analyzerChecks"
],

View File

@@ -31,7 +31,7 @@ Below you'll find a complete working example. Create a new file, copy in the co
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
})
],
view: new ol.View({
@@ -85,7 +85,7 @@ The map in the application is contained in a [`<div>` HTML element](http://en.wi
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
})
],
view: new ol.View({
@@ -95,7 +95,7 @@ The map in the application is contained in a [`<div>` HTML element](http://en.wi
});
```
With this JavaScript code, a map object is created with a MapQuest Open Aerial layer zoomed on the African East coast. Let's break this down:
With this JavaScript code, a map object is created with an OSM layer zoomed on the African East coast. Let's break this down:
The following line creates an OpenLayers `Map` object. Just by itself, this does nothing since there's no layers or interaction attached to it.
@@ -114,7 +114,7 @@ The `layers: [ ... ]` array is used to define the list of layers available in th
```js
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
})
]
```

View File

@@ -160,7 +160,9 @@ The minimum config file looks like this:
"closure_entry_point": "app",
"externs": [
"node_modules/openlayers/externs/bingmaps.js",
"node_modules/openlayers/externs/cartodb.js",
"node_modules/openlayers/externs/closure-compiler.js",
"node_modules/openlayers/externs/esrijson.js",
"node_modules/openlayers/externs/geojson.js",
"node_modules/openlayers/externs/proj4js.js",
"node_modules/openlayers/externs/tilejson.js",
@@ -210,14 +212,15 @@ Here is a version of `config.json` with more compilation checks enabled:
"closure_entry_point": "app",
"externs": [
"node_modules/openlayers/externs/bingmaps.js",
"node_modules/openlayers/externs/cartodb.js",
"node_modules/openlayers/externs/closure-compiler.js",
"node_modules/openlayers/externs/esrijson.js",
"node_modules/openlayers/externs/geojson.js",
"node_modules/openlayers/externs/proj4js.js",
"node_modules/openlayers/externs/tilejson.js",
"node_modules/openlayers/externs/topojson.js"
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.DEBUG=false",
"ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false"
@@ -230,8 +233,7 @@ Here is a version of `config.json` with more compilation checks enabled:
"*"
],
"jscomp_off": [
"unknownDefines"
"useOfGoogBase",
"unknownDefines",
"lintChecks",
"analyzerChecks"
],

View File

@@ -2,7 +2,7 @@ goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Image');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.ImageArcGISRest');
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
@@ -10,10 +10,11 @@ var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
var layers = [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
}),
new ol.layer.Image({
source: new ol.source.ImageArcGISRest({
ratio: 1,
params: {},
url: url
})

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.TileArcGISRest');
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
@@ -9,7 +9,7 @@ var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
var layers = [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
}),
new ol.layer.Tile({
extent: [-13884991, 2870341, -7455066, 6338219],

View File

@@ -5,7 +5,7 @@ goog.require('ol.geom.Point');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.Cluster');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
@@ -62,7 +62,7 @@ var clusters = new ol.layer.Vector({
});
var raster = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
});
var map = new ol.Map({

View File

@@ -22,8 +22,8 @@ var twoPi = 2 * Math.PI;
/**
* Convert an RGB pixel into an HCL pixel.
* @param {ol.raster.Pixel} pixel A pixel in RGB space.
* @return {ol.raster.Pixel} A pixel in HCL space.
* @param {Array.<number>} pixel A pixel in RGB space.
* @return {Array.<number>} A pixel in HCL space.
*/
function rgb2hcl(pixel) {
var red = rgb2xyz(pixel[0]);
@@ -57,8 +57,8 @@ function rgb2hcl(pixel) {
/**
* Convert an HCL pixel into an RGB pixel.
* @param {ol.raster.Pixel} pixel A pixel in HCL space.
* @return {ol.raster.Pixel} A pixel in RGB space.
* @param {Array.<number>} pixel A pixel in HCL space.
* @return {Array.<number>} A pixel in RGB space.
*/
function hcl2rgb(pixel) {
var h = pixel[0];

View File

@@ -3,7 +3,7 @@ goog.require('ol.View');
goog.require('ol.interaction');
goog.require('ol.interaction.DragRotateAndZoom');
goog.require('ol.layer.Tile');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
var map = new ol.Map({
@@ -12,7 +12,7 @@ var map = new ol.Map({
]),
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
})
],
renderer: common.getRendererFromQueryString(),

View File

@@ -6,7 +6,7 @@ goog.require('ol.interaction.Draw');
goog.require('ol.interaction.Modify');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
@@ -14,7 +14,7 @@ goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var raster = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
});
var map = new ol.Map({

View File

@@ -4,7 +4,7 @@ goog.require('ol.geom.Polygon');
goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
@@ -12,7 +12,7 @@ goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var raster = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
});
var source = new ol.source.Vector({wrapX: false});

View File

@@ -4,7 +4,7 @@ goog.require('ol.View');
goog.require('ol.geom.MultiPoint');
goog.require('ol.geom.Point');
goog.require('ol.layer.Tile');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
@@ -14,7 +14,7 @@ goog.require('ol.style.Style');
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
})
],
renderer: common.getRendererFromQueryString(),

View File

@@ -13,6 +13,12 @@ goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var symbol = [[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]];
var scale;
var scaleFunction = function(coordinate) {
return [coordinate[0] * scale, coordinate[1] * scale];
};
var styleCache = {};
var styleFunction = function(feature) {
// 2012_Earthquakes_Mag5.kml stores the magnitude of each earthquake in a
@@ -21,23 +27,23 @@ var styleFunction = function(feature) {
var name = feature.get('name');
var magnitude = parseFloat(name.substr(2));
var size = parseInt(10 + 40 * (magnitude - 5), 10);
scale = size / 10;
var style = styleCache[size];
if (!style) {
var canvas =
/** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
var vectorContext = ol.render.toContext(
/** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')),
{size: [size + 2, size + 2], pixelRatio: size / 10});
{size: [size, size], pixelRatio: 1});
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})
stroke: new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 2})
}));
vectorContext.drawGeometry(new ol.geom.Polygon(
[[[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]]]));
vectorContext.drawGeometry(new ol.geom.Polygon([symbol.map(scaleFunction)]));
style = new ol.style.Style({
image: new ol.style.Icon({
img: canvas,
imgSize: [canvas.width, canvas.height],
imgSize: [size, size],
rotation: 1.2
})
});

View File

@@ -6,7 +6,7 @@ docs: >
Example of exporting a map as a PDF using the <a href="https://github.com/MrRio/jsPDF" target="_blank">jsPDF</a> library.
tags: "export, pdf, openstreetmap"
resources:
- http://mrrio.github.io/jsPDF/dist/jspdf.min.js
- https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.2.61/jspdf.min.js
---
<div class="row-fluid">
<div class="span12">

View File

@@ -59,7 +59,8 @@ var element = document.getElementById('popup');
var popup = new ol.Overlay({
element: element,
positioning: 'bottom-center',
stopEvent: false
stopEvent: false,
offset: [0, -50]
});
map.addOverlay(popup);
@@ -70,7 +71,8 @@ map.on('click', function(evt) {
return feature;
});
if (feature) {
popup.setPosition(evt.coordinate);
var coordinates = feature.getGeometry().getCoordinates();
popup.setPosition(coordinates);
$(element).popover({
'placement': 'top',
'html': true,

View File

@@ -155,7 +155,7 @@ map.on('click', function(evt) {
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({

View File

@@ -5,7 +5,7 @@ goog.require('ol.layer.Image');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.ImageVector');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
@@ -15,7 +15,7 @@ goog.require('ol.style.Style');
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
}),
new ol.layer.Image({
source: new ol.source.ImageVector({

View File

@@ -7,7 +7,7 @@ goog.require('ol.format.GeoJSON');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.proj');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
@@ -39,9 +39,7 @@ var vectorLayer = new ol.layer.Vector({
});
var rasterLayer = new ol.layer.Tile({
source: new ol.source.MapQuest({
layer: 'osm'
})
source: new ol.source.OSM()
});
var map = new ol.Map({

View File

@@ -4,13 +4,12 @@ title: Limited Layer Extent
shortdesc: Restricting layer rendering to a limited extent.
docs: >
This example uses the <code>layer.setExtent()</code> method to
modify the extent of the overlay layer. Use the controls below
to limit rendering based on an extent.
modify the extent of the overlay layer. Use the controls above
to limit rendering based on an extent (approximate country bounds).
tags: "extent, tilejson"
---
<div id="map" class="map"></div>
<button type="button" class="btn btn-default" id="northwest">northwest</button>
<button type="button" class="btn btn-default" id="northeast">northeast</button>
<button type="button" class="btn btn-default" id="southeast">southeast</button>
<button type="button" class="btn btn-default" id="southwest">southwest</button>
<button type="button" class="btn btn-default" id="world">world</button>
<button type="button" class="btn btn-default" id="India">India</button>
<button type="button" class="btn btn-default" id="Argentina">Argentina</button>
<button type="button" class="btn btn-default" id="Nigeria">Nigeria</button>
<button type="button" class="btn btn-default" id="Sweden">Sweden</button>

View File

@@ -9,26 +9,25 @@ function transform(extent) {
}
var extents = {
northwest: transform([-180, 0, 0, 85]),
northeast: transform([0, 0, 180, 85]),
southeast: transform([0, -85, 180, 0]),
southwest: transform([-180, -85, 0, 0]),
world: transform([-180, -85, 180, 85])
India: transform([68.17665, 7.96553, 97.40256, 35.49401]),
Argentina: transform([-73.41544, -55.25, -53.62835, -21.83231]),
Nigeria: transform([2.6917, 4.24059, 14.57718, 13.86592]),
Sweden: transform([11.02737, 55.36174, 23.90338, 69.10625])
};
var base = new ol.layer.Tile({
source: new ol.source.TileJSON({
url: 'http://api.tiles.mapbox.com/v3/' +
'mapbox.world-black.json',
'mapbox.world-light.json',
crossOrigin: 'anonymous'
})
});
var overlay = new ol.layer.Tile({
extent: extents.northwest,
extent: extents.India,
source: new ol.source.TileJSON({
url: 'http://api.tiles.mapbox.com/v3/' +
'mapbox.world-glass.json',
'mapbox.world-black.json',
crossOrigin: 'anonymous'
})
});

View File

@@ -12,7 +12,7 @@ resources:
<div id="layertree">
<h5>Click on layer nodes below to change their properties.</h5>
<ul>
<li><span>OpenAerial layer</span>
<li><span>OSM layer</span>
<fieldset id="layer0">
<label class="checkbox" for="visible0">
<input id="visible0" class="visible" type="checkbox"/>visibility

View File

@@ -3,13 +3,13 @@ goog.require('ol.View');
goog.require('ol.layer.Group');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.TileJSON');
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
}), new ol.layer.Group({
layers: [
new ol.layer.Tile({

View File

@@ -1,9 +1,9 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
var source = new ol.source.MapQuest({layer: 'sat'});
var source = new ol.source.OSM();
var layer = new ol.layer.Tile();

View File

@@ -4,14 +4,14 @@ goog.require('ol.geom.Point');
goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Icon');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var raster = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
});
var source = new ol.source.Vector();

View File

@@ -1,14 +0,0 @@
---
layout: example.html
title: MapQuest
shortdesc: Example of a MapQuest map.Shows how to create custom controls.
docs: >
Example of a MapQuest map.
tags: "mapquest"
---
<div id="map" class="map"></div>
<select id="layer-select">
<option value="Aerial">Aerial</option>
<option value="AerialWithLabels">Aerial with labels</option>
<option value="Road" selected>Road</option>
</select>

View File

@@ -1,56 +0,0 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Group');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.MapQuest');
var layers = [
new ol.layer.Tile({
style: 'Road',
source: new ol.source.MapQuest({layer: 'osm'})
}),
new ol.layer.Tile({
style: 'Aerial',
visible: false,
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Group({
style: 'AerialWithLabels',
visible: false,
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'hyb'})
})
]
})
];
var map = new ol.Map({
layers: layers,
renderer: common.getRendererFromQueryString(),
target: 'map',
view: new ol.View({
center: ol.proj.transform(
[-73.979378, 40.702222], 'EPSG:4326', 'EPSG:3857'),
zoom: 9
})
});
var select = document.getElementById('layer-select');
function onChange() {
var style = select.value;
var i, ii;
for (i = 0, ii = layers.length; i < ii; ++i) {
layers[i].set('visible', (layers[i].get('style') == style));
}
}
select.addEventListener('change', onChange);
onChange();

View File

@@ -9,7 +9,7 @@ goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.proj');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
@@ -20,7 +20,7 @@ goog.require('ol.style.Style');
var wgs84Sphere = new ol.Sphere(6378137);
var raster = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
});
var source = new ol.source.Vector();

View File

@@ -6,14 +6,12 @@ goog.require('ol.interaction.Modify');
goog.require('ol.interaction.Select');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
var raster = new ol.layer.Tile({
source: new ol.source.MapQuest({
layer: 'sat'
})
source: new ol.source.OSM()
});
var vector = new ol.layer.Vector({

View File

@@ -4,7 +4,7 @@ title: Overlay
shortdesc: Demonstrates overlays.
docs: >
<p>The popups are created using <a href="http://getbootstrap.com/javascript/#popovers">Popovers</a> from Bootstrap.</p>
tags: "overlay, popup, bootstrap, popover, mapquest, openaerial"
tags: "overlay, popup, bootstrap, popover"
resources:
- https://code.jquery.com/jquery-2.2.3.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css

View File

@@ -4,11 +4,11 @@ goog.require('ol.View');
goog.require('ol.coordinate');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
var layer = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
});
var map = new ol.Map({

View File

@@ -6,7 +6,7 @@ docs: >
<p>
Click on the map to get a popup. The popup is composed of a few basic elements: a container, a close button, and a place for the content. To anchor the popup to the map, an <code>ol.Overlay</code> is created with the popup container. A listener is registered for the map's <code>click</code> event to display the popup, and another listener is set as the <code>click</code> handler for the close button to hide the popup.
</p>
tags: "overlay, popup, mapquest, openaerial"
tags: "overlay, popup"
---
<div id="map" class="map"></div>
<div id="popup" class="ol-popup">

View File

@@ -15,7 +15,7 @@ var bins = 10;
/**
* Calculate the Vegetation Greenness Index (VGI) from an input pixel. This
* is a rough estimate assuming that pixel values correspond to reflectance.
* @param {ol.raster.Pixel} pixel An array of [R, G, B, A] values.
* @param {Array.<number>} pixel An array of [R, G, B, A] values.
* @return {number} The VGI value for the given pixel.
*/
function vgi(pixel) {

View File

@@ -21,7 +21,7 @@ var style = new ol.style.Style({
fill: fill,
stroke: stroke
})
})
});
vectorContext.setStyle(style);
vectorContext.drawGeometry(new ol.geom.LineString([[10, 10], [90, 90]]));

View File

@@ -1,12 +1,12 @@
---
layout: example.html
title: Reprojection with EPSG.io Search
shortdesc: Demonstrates client-side raster reprojection of MapQuest OSM to arbitrary projection
shortdesc: Demonstrates client-side raster reprojection of OSM to arbitrary projection
docs: >
This example shows client-side raster reprojection capabilities from
MapQuest OSM (EPSG:3857) to arbitrary projection by searching
OSM (EPSG:3857) to arbitrary projection by searching
in <a href="http://epsg.io/">EPSG.io</a> database.
tags: "reprojection, projection, proj4js, mapquest, epsg.io"
tags: "reprojection, projection, proj4js, epsg.io"
resources:
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
---

View File

@@ -3,14 +3,14 @@ goog.require('ol.View');
goog.require('ol.extent');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.TileImage');
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'osm'})
source: new ol.source.OSM()
})
],
renderer: common.getRendererFromQueryString(),

View File

@@ -4,7 +4,7 @@ title: Image Reprojection
shortdesc: Demonstrates client-side reprojection of single image source.
docs: >
This example shows client-side reprojection of single image source.
tags: "reprojection, projection, proj4js, mapquest, image, imagestatic"
tags: "reprojection, projection, proj4js, image, imagestatic"
resources:
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
---

View File

@@ -5,7 +5,7 @@ goog.require('ol.layer.Image');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.ImageStatic');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
proj4.defs('EPSG:27700', '+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 ' +
@@ -17,7 +17,7 @@ var imageExtent = [0, 0, 700000, 1300000];
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'osm'})
source: new ol.source.OSM()
}),
new ol.layer.Image({
source: new ol.source.ImageStatic({

View File

@@ -4,7 +4,7 @@ title: Raster Reprojection
shortdesc: Demonstrates client-side raster reprojection between various projections.
docs: >
This example shows client-side raster reprojection between various projections.
tags: "reprojection, projection, proj4js, mapquest, wms, wmts, hidpi"
tags: "reprojection, projection, proj4js, osm, wms, wmts, hidpi"
resources:
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
---
@@ -13,7 +13,7 @@ resources:
<div class="col-md-3">
<label>Base map:</label>
<select id="base-layer">
<option value="mapquest">MapQuest (EPSG:3857)</option>
<option value="osm">OSM (EPSG:3857)</option>
<option value="wms4326">WMS (EPSG:4326)</option>
</select>
</div>

View File

@@ -5,7 +5,7 @@ goog.require('ol.extent');
goog.require('ol.format.WMTSCapabilities');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.TileImage');
goog.require('ol.source.TileWMS');
goog.require('ol.source.WMTS');
@@ -64,8 +64,8 @@ layers['bng'] = new ol.layer.Tile({
})
});
layers['mapquest'] = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'osm'})
layers['osm'] = new ol.layer.Tile({
source: new ol.source.OSM()
});
layers['wms4326'] = new ol.layer.Tile({
@@ -146,7 +146,7 @@ layers['states'] = new ol.layer.Tile({
var map = new ol.Map({
layers: [
layers['mapquest'],
layers['osm'],
layers['bng']
],
renderer: common.getRendererFromQueryString(),

View File

@@ -0,0 +1,12 @@
---
layout: example.html
title: Reusable Source
shortdesc: Updating a tile source by changing the URL.
docs: >
You can call <code>source.setUrl()</code> to update the URL for a tile source. Note that when you change the URL for a tile source, existing tiles will not be replaced until new tiles are loaded. If you are interested instead in clearing currently rendered tiles, you can call the <code>source.refresh()</code> method. Alternatively, you can use two separate sources if you want to remove rendered tiles and start over loading new tiles.
---
<div id="map" class="map"></div>
<button class="switcher" value="0">January</button>
<button class="switcher" value="1">January (with bathymetry)</button>
<button class="switcher" value="2">July</button>
<button class="switcher" value="3">July (with bathymetry)</button>

View File

@@ -0,0 +1,39 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.XYZ');
var urls = [
'https://{a-c}.tiles.mapbox.com/v3/mapbox.blue-marble-topo-jan/{z}/{x}/{y}.png',
'https://{a-c}.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jan/{z}/{x}/{y}.png',
'https://{a-c}.tiles.mapbox.com/v3/mapbox.blue-marble-topo-jul/{z}/{x}/{y}.png',
'https://{a-c}.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jul/{z}/{x}/{y}.png'
];
var source = new ol.source.XYZ();
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: source
})
],
view: new ol.View({
center: [0, 0],
zoom: 2
})
});
function updateUrl(index) {
source.setUrl(urls[index]);
}
var buttons = document.getElementsByClassName('switcher');
for (var i = 0, ii = buttons.length; i < ii; ++i) {
var button = buttons[i];
button.addEventListener('click', updateUrl.bind(null, Number(button.value)));
}
updateUrl(0);

View File

@@ -5,11 +5,11 @@ goog.require('ol.format.GeoJSON');
goog.require('ol.interaction.Select');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
var raster = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
});
var vector = new ol.layer.Vector({

View File

@@ -3,7 +3,7 @@ layout: example.html
title: Semi-Transparent Layer
shortdesc: Example of a map with a semi-transparent layer.
docs: >
This example will display a tiled MaxBox layer semi-transparently over a MapQuest background.
tags: "transparent, mapquest, tilejson"
This example will display a tiled MaxBox layer semi-transparently over an OSM background.
tags: "transparent, osm, tilejson"
---
<div id="map" class="map"></div>

View File

@@ -2,14 +2,14 @@ goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.TileJSON');
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
}),
new ol.layer.Tile({
source: new ol.source.TileJSON({

View File

@@ -2,13 +2,13 @@ goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.has');
goog.require('ol.layer.Tile');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
var map1 = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
})
],
renderer: 'dom',

View File

@@ -7,7 +7,7 @@ goog.require('ol.interaction.Select');
goog.require('ol.interaction.Snap');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
@@ -15,7 +15,7 @@ goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var raster = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
});
var vector = new ol.layer.Vector({

View File

@@ -7,12 +7,12 @@ goog.require('ol.interaction.Select');
goog.require('ol.interaction.Translate');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
var raster = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
});
var vector = new ol.layer.Vector({

View File

@@ -7,7 +7,7 @@ goog.require('ol.format.GeoJSON');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.proj');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
@@ -44,9 +44,7 @@ var vectorLayer = new ol.layer.Vector({
});
var rasterLayer = new ol.layer.Tile({
source: new ol.source.MapQuest({
layer: 'osm'
})
source: new ol.source.OSM()
});
var map = new ol.Map({

View File

@@ -3,7 +3,7 @@ goog.require('ol.View');
goog.require('ol.format.GeoJSON');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
@@ -172,7 +172,7 @@ var vectorPoints = new ol.layer.Vector({
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'osm'})
source: new ol.source.OSM()
}),
vectorPolygons,
vectorLines,

View File

@@ -3,7 +3,7 @@ goog.require('ol.View');
goog.require('ol.format.GeoJSON');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
@@ -45,7 +45,7 @@ var vectorLayer = new ol.layer.Vector({
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
}),
vectorLayer
],

View File

@@ -3,7 +3,7 @@ goog.require('ol.View');
goog.require('ol.extent');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.TileWMS');
goog.require('ol.tilegrid.TileGrid');
@@ -22,7 +22,7 @@ var tileGrid = new ol.tilegrid.TileGrid({
var layers = [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
}),
new ol.layer.Tile({
source: new ol.source.TileWMS({

View File

@@ -3,12 +3,12 @@ goog.require('ol.View');
goog.require('ol.layer.Image');
goog.require('ol.layer.Tile');
goog.require('ol.source.ImageWMS');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
var layers = [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
}),
new ol.layer.Image({
extent: [-13884991, 2870341, -7455066, 6338219],

View File

@@ -1,13 +1,13 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.TileWMS');
var layers = [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
}),
new ol.layer.Tile({
source: new ol.source.TileWMS({

View File

@@ -1,13 +1,13 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.TileWMS');
var layers = [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
}),
new ol.layer.Tile({
extent: [-13884991, 2870341, -7455066, 6338219],

View File

@@ -1,7 +1,7 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
goog.require('ol.source.TileWMS');
var startDate = new Date(Date.parse('2012-01-01T19:00:00Z'));
@@ -10,7 +10,7 @@ var animationId = null;
var layers = [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
source: new ol.source.OSM()
}),
new ol.layer.Tile({
extent: [-13884991, 2870341, -7455066, 6338219],

View File

@@ -30,7 +30,6 @@ fetch(capabilitiesUrl).then(function(response) {
var options = ol.source.WMTS.optionsFromCapabilities(result, {
layer: layer,
matrixSet: 'google3857',
requestEncoding: 'REST',
style: 'normal'
});
options.tilePixelRatio = tilePixelRatio;

View File

@@ -2,7 +2,7 @@ goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control.ZoomSlider');
goog.require('ol.layer.Tile');
goog.require('ol.source.MapQuest');
goog.require('ol.source.OSM');
/**
@@ -14,7 +14,7 @@ goog.require('ol.source.MapQuest');
var createMap = function(divId) {
var source, layer, map, zoomslider;
source = new ol.source.MapQuest({layer: 'sat'});
source = new ol.source.OSM();
layer = new ol.layer.Tile({
source: source
});

View File

@@ -92,9 +92,9 @@ oli.ModifyEvent.prototype.features;
/**
* @type {ol.MapBrowserPointerEvent}
* @type {ol.MapBrowserEvent}
*/
oli.ModifyEvent.prototype.mapBrowserPointerEvent;
oli.ModifyEvent.prototype.mapBrowserEvent;
/**

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "openlayers",
"version": "3.15.1",
"version": "3.17.1",
"description": "Build tools and sources for developing OpenLayers based mapping applications",
"keywords": [
"map",
@@ -32,41 +32,41 @@
"dependencies": {
"async": "1.5.2",
"browserify": "13.0.1",
"closure-util": "1.13.1",
"closure-util": "1.15.0",
"derequire": "2.0.3",
"fs-extra": "0.30.0",
"glob": "6.0.4",
"glob": "7.0.5",
"handlebars": "4.0.5",
"jsdoc": "3.4.0",
"marked": "0.3.5",
"metalsmith": "2.1.0",
"metalsmith-layouts": "1.6.5",
"nomnom": "1.8.1",
"pbf": "1.3.5",
"pbf": "2.0.1",
"pixelworks": "1.1.0",
"rbush": "1.4.3",
"rbush": "2.0.1",
"temp": "0.8.3",
"vector-tile": "1.2.0",
"vector-tile": "1.2.1",
"walk": "2.3.9"
},
"devDependencies": {
"clean-css": "3.4.12",
"clean-css": "3.4.18",
"coveralls": "2.11.9",
"debounce": "^1.0.0",
"eslint": "2.10.2",
"eslint-config-openlayers": "4.1.0",
"eslint": "2.13.1",
"eslint-config-openlayers": "5.0.0",
"expect.js": "0.3.1",
"gaze": "^1.0.0",
"istanbul": "0.4.3",
"jquery": "2.2.3",
"mocha": "2.4.5",
"istanbul": "0.4.4",
"jquery": "2.2.4",
"mocha": "2.5.3",
"mocha-phantomjs-core": "^1.3.0",
"mustache": "2.2.1",
"phantomjs-prebuilt": "2.1.7",
"proj4": "2.3.14",
"resemblejs": "2.2.0",
"resemblejs": "2.2.1",
"sinon": "1.17.4",
"slimerjs": "0.906.1"
"slimerjs": "0.906.2"
},
"eslintConfig": {
"extends": "openlayers",
@@ -86,7 +86,10 @@
}
},
"ext": [
"rbush",
{
"module": "rbush",
"browserify": true
},
{
"module": "pbf",
"browserify": true

View File

@@ -36,7 +36,7 @@ ol.array.binarySearch = function(haystack, needle, opt_comparator) {
/* Key not found. */
return found ? low : ~low;
}
};
/**
* @param {Array.<number>} arr Array.
@@ -188,11 +188,11 @@ ol.array.flatten = function(arr) {
ol.array.extend = function(arr, data) {
var i;
var extension = goog.isArrayLike(data) ? data : [data];
var length = extension.length
var length = extension.length;
for (i = 0; i < length; i++) {
arr[arr.length] = extension[i];
}
}
};
/**
@@ -208,7 +208,7 @@ ol.array.remove = function(arr, obj) {
arr.splice(i, 1);
}
return found;
}
};
/**
@@ -228,7 +228,7 @@ ol.array.find = function(arr, func) {
}
}
return null;
}
};
/**
@@ -247,7 +247,7 @@ ol.array.equals = function(arr1, arr2) {
}
}
return true;
}
};
/**
@@ -267,7 +267,7 @@ ol.array.stableSort = function(arr, compareFnc) {
for (i = 0; i < arr.length; i++) {
arr[i] = tmp[i].value;
}
}
};
/**
@@ -282,7 +282,7 @@ ol.array.findIndex = function(arr, func) {
return !func(el, idx, arr);
});
return found ? index : -1;
}
};
/**
@@ -300,4 +300,4 @@ ol.array.isSorted = function(arr, opt_func, opt_strict) {
var res = compare(arr[index - 1], currentVal);
return !(res > 0 || opt_strict && res === 0);
});
}
};

View File

@@ -44,7 +44,7 @@ ol.CollectionEventType = {
*/
ol.CollectionEvent = function(type, opt_element, opt_target) {
goog.base(this, type, opt_target);
ol.events.Event.call(this, type, opt_target);
/**
* The element that is added to or removed from the collection.
@@ -54,7 +54,7 @@ ol.CollectionEvent = function(type, opt_element, opt_target) {
this.element = opt_element;
};
goog.inherits(ol.CollectionEvent, ol.events.Event);
ol.inherits(ol.CollectionEvent, ol.events.Event);
/**
@@ -82,7 +82,7 @@ ol.CollectionProperty = {
*/
ol.Collection = function(opt_array) {
goog.base(this);
ol.Object.call(this);
/**
* @private
@@ -93,7 +93,7 @@ ol.Collection = function(opt_array) {
this.updateLength_();
};
goog.inherits(ol.Collection, ol.Object);
ol.inherits(ol.Collection, ol.Object);
/**

View File

@@ -3,9 +3,8 @@
goog.provide('ol.control.Attribution');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.style');
goog.require('ol');
goog.require('ol.dom');
goog.require('ol.Attribution');
goog.require('ol.control.Control');
goog.require('ol.css');
@@ -44,7 +43,7 @@ ol.control.Attribution = function(opt_options) {
this.logoLi_ = document.createElement('LI');
this.ulElement_.appendChild(this.logoLi_);
goog.style.setElementShown(this.logoLi_, false);
this.logoLi_.style.display = 'none';
/**
* @private
@@ -69,30 +68,37 @@ ol.control.Attribution = function(opt_options) {
var collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\u00BB';
/**
* @private
* @type {Node}
*/
this.collapseLabel_ = typeof collapseLabel === 'string' ?
goog.dom.createDom('SPAN', {}, collapseLabel) :
collapseLabel;
if (typeof collapseLabel === 'string') {
/**
* @private
* @type {Node}
*/
this.collapseLabel_ = document.createElement('span');
this.collapseLabel_.textContent = collapseLabel;
} else {
this.collapseLabel_ = collapseLabel;
}
var label = options.label !== undefined ? options.label : 'i';
/**
* @private
* @type {Node}
*/
this.label_ = typeof label === 'string' ?
goog.dom.createDom('SPAN', {}, label) :
label;
if (typeof label === 'string') {
/**
* @private
* @type {Node}
*/
this.label_ = document.createElement('span');
this.label_.textContent = label;
} else {
this.label_ = label;
}
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
this.collapseLabel_ : this.label_;
var button = goog.dom.createDom('BUTTON', {
'type': 'button',
'title': tipLabel
}, activeLabel);
var button = document.createElement('button');
button.setAttribute('type', 'button');
button.title = tipLabel;
button.appendChild(activeLabel);
ol.events.listen(button, ol.events.EventType.CLICK, this.handleClick_, this);
@@ -100,12 +106,14 @@ ol.control.Attribution = function(opt_options) {
ol.css.CLASS_CONTROL +
(this.collapsed_ && this.collapsible_ ? ' ol-collapsed' : '') +
(this.collapsible_ ? '' : ' ol-uncollapsible');
var element = goog.dom.createDom('DIV',
cssClasses, this.ulElement_, button);
var element = document.createElement('div');
element.className = cssClasses;
element.appendChild(this.ulElement_);
element.appendChild(button);
var render = options.render ? options.render : ol.control.Attribution.render;
goog.base(this, {
ol.control.Control.call(this, {
element: element,
render: render,
target: options.target
@@ -136,7 +144,7 @@ ol.control.Attribution = function(opt_options) {
this.logoElements_ = {};
};
goog.inherits(ol.control.Attribution, ol.control.Control);
ol.inherits(ol.control.Attribution, ol.control.Control);
/**
@@ -214,7 +222,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
if (!frameState) {
if (this.renderedVisible_) {
goog.style.setElementShown(this.element, false);
this.element.style.display = 'none';
this.renderedVisible_ = false;
}
return;
@@ -230,20 +238,18 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
for (attributionKey in this.attributionElements_) {
if (attributionKey in visibleAttributions) {
if (!this.attributionElementRenderedVisible_[attributionKey]) {
goog.style.setElementShown(
this.attributionElements_[attributionKey], true);
this.attributionElements_[attributionKey].style.display = '';
this.attributionElementRenderedVisible_[attributionKey] = true;
}
delete visibleAttributions[attributionKey];
} else if (attributionKey in hiddenAttributions) {
if (this.attributionElementRenderedVisible_[attributionKey]) {
goog.style.setElementShown(
this.attributionElements_[attributionKey], false);
this.attributionElements_[attributionKey].style.display = 'none';
delete this.attributionElementRenderedVisible_[attributionKey];
}
delete hiddenAttributions[attributionKey];
} else {
goog.dom.removeNode(this.attributionElements_[attributionKey]);
ol.dom.removeNode(this.attributionElements_[attributionKey]);
delete this.attributionElements_[attributionKey];
delete this.attributionElementRenderedVisible_[attributionKey];
}
@@ -260,7 +266,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
attributionElement = document.createElement('LI');
attributionElement.innerHTML =
hiddenAttributions[attributionKey].getHTML();
goog.style.setElementShown(attributionElement, false);
attributionElement.style.display = 'none';
this.ulElement_.appendChild(attributionElement);
this.attributionElements_[attributionKey] = attributionElement;
}
@@ -269,7 +275,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
!ol.object.isEmpty(this.attributionElementRenderedVisible_) ||
!ol.object.isEmpty(frameState.logos);
if (this.renderedVisible_ != renderVisible) {
goog.style.setElementShown(this.element, renderVisible);
this.element.style.display = renderVisible ? '' : 'none';
this.renderedVisible_ = renderVisible;
}
if (renderVisible &&
@@ -296,7 +302,7 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
for (logo in logoElements) {
if (!(logo in logos)) {
goog.dom.removeNode(logoElements[logo]);
ol.dom.removeNode(logoElements[logo]);
delete logoElements[logo];
}
}
@@ -314,9 +320,8 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
if (logoValue === '') {
logoElement = image;
} else {
logoElement = goog.dom.createDom('A', {
'href': logoValue
});
logoElement = document.createElement('a');
logoElement.href = logoValue;
logoElement.appendChild(image);
}
this.logoLi_.appendChild(logoElement);
@@ -324,7 +329,7 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
}
}
goog.style.setElementShown(this.logoLi_, !ol.object.isEmpty(logos));
this.logoLi_.style.display = !ol.object.isEmpty(logos) ? '' : 'none';
};
@@ -345,9 +350,9 @@ ol.control.Attribution.prototype.handleClick_ = function(event) {
ol.control.Attribution.prototype.handleToggle_ = function() {
this.element.classList.toggle('ol-collapsed');
if (this.collapsed_) {
goog.dom.replaceNode(this.collapseLabel_, this.label_);
ol.dom.replaceNode(this.collapseLabel_, this.label_);
} else {
goog.dom.replaceNode(this.label_, this.collapseLabel_);
ol.dom.replaceNode(this.label_, this.collapseLabel_);
}
this.collapsed_ = !this.collapsed_;
};

View File

@@ -1,10 +1,10 @@
goog.provide('ol.control.Control');
goog.require('goog.dom');
goog.require('ol.events');
goog.require('ol');
goog.require('ol.MapEventType');
goog.require('ol.Object');
goog.require('ol.dom');
/**
@@ -38,7 +38,7 @@ goog.require('ol.Object');
*/
ol.control.Control = function(options) {
goog.base(this);
ol.Object.call(this);
/**
* @protected
@@ -60,7 +60,7 @@ ol.control.Control = function(options) {
/**
* @protected
* @type {!Array.<ol.events.Key>}
* @type {!Array.<ol.EventsKey>}
*/
this.listenerKeys = [];
@@ -74,15 +74,15 @@ ol.control.Control = function(options) {
}
};
goog.inherits(ol.control.Control, ol.Object);
ol.inherits(ol.control.Control, ol.Object);
/**
* @inheritDoc
*/
ol.control.Control.prototype.disposeInternal = function() {
goog.dom.removeNode(this.element);
goog.base(this, 'disposeInternal');
ol.dom.removeNode(this.element);
ol.Object.prototype.disposeInternal.call(this);
};
@@ -105,7 +105,7 @@ ol.control.Control.prototype.getMap = function() {
*/
ol.control.Control.prototype.setMap = function(map) {
if (this.map_) {
goog.dom.removeNode(this.element);
ol.dom.removeNode(this.element);
}
for (var i = 0, ii = this.listenerKeys.length; i < ii; ++i) {
ol.events.unlistenByKey(this.listenerKeys[i]);
@@ -135,5 +135,7 @@ ol.control.Control.prototype.setMap = function(map) {
* @api
*/
ol.control.Control.prototype.setTarget = function(target) {
this.target_ = goog.dom.getElement(target);
this.target_ = typeof target === 'string' ?
document.getElementById(target) :
target;
};

View File

@@ -1,13 +1,11 @@
goog.provide('ol.control.FullScreen');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.fullscreen');
goog.require('goog.dom.fullscreen.EventType');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('ol');
goog.require('ol.control.Control');
goog.require('ol.dom');
goog.require('ol.css');
@@ -58,21 +56,23 @@ ol.control.FullScreen = function(opt_options) {
document.createTextNode(labelActive) : labelActive;
var tipLabel = options.tipLabel ? options.tipLabel : 'Toggle full-screen';
var button = goog.dom.createDom('BUTTON', {
'class': this.cssClassName_ + '-' + goog.dom.fullscreen.isFullScreen(),
'type': 'button',
'title': tipLabel
}, this.labelNode_);
var button = document.createElement('button');
button.className = this.cssClassName_ + '-' + ol.control.FullScreen.isFullScreen();
button.setAttribute('type', 'button');
button.title = tipLabel;
button.appendChild(this.labelNode_);
ol.events.listen(button, ol.events.EventType.CLICK,
this.handleClick_, this);
var cssClasses = this.cssClassName_ + ' ' + ol.css.CLASS_UNSELECTABLE +
' ' + ol.css.CLASS_CONTROL + ' ' +
(!goog.dom.fullscreen.isSupported() ? ol.css.CLASS_UNSUPPORTED : '');
var element = goog.dom.createDom('DIV', cssClasses, button);
(!ol.control.FullScreen.isFullScreenSupported() ? ol.css.CLASS_UNSUPPORTED : '');
var element = document.createElement('div');
element.className = cssClasses;
element.appendChild(button);
goog.base(this, {
ol.control.Control.call(this, {
element: element,
target: options.target
});
@@ -90,7 +90,7 @@ ol.control.FullScreen = function(opt_options) {
this.source_ = options.source;
};
goog.inherits(ol.control.FullScreen, ol.control.Control);
ol.inherits(ol.control.FullScreen, ol.control.Control);
/**
@@ -107,23 +107,30 @@ ol.control.FullScreen.prototype.handleClick_ = function(event) {
* @private
*/
ol.control.FullScreen.prototype.handleFullScreen_ = function() {
if (!goog.dom.fullscreen.isSupported()) {
if (!ol.control.FullScreen.isFullScreenSupported()) {
return;
}
var map = this.getMap();
if (!map) {
return;
}
if (goog.dom.fullscreen.isFullScreen()) {
goog.dom.fullscreen.exitFullScreen();
if (ol.control.FullScreen.isFullScreen()) {
ol.control.FullScreen.exitFullScreen();
} else {
var element = this.source_ ?
goog.dom.getElement(this.source_) : map.getTargetElement();
var element;
if (this.source_) {
element = typeof this.source_ === 'string' ?
document.getElementById(this.source_) :
this.source_;
} else {
element = map.getTargetElement();
}
goog.asserts.assert(element, 'element should be defined');
if (this.keys_) {
goog.dom.fullscreen.requestFullScreenWithKeys(element);
ol.control.FullScreen.requestFullScreenWithKeys(element);
} else {
goog.dom.fullscreen.requestFullScreen(element);
ol.control.FullScreen.requestFullScreen(element);
}
}
};
@@ -135,12 +142,12 @@ ol.control.FullScreen.prototype.handleFullScreen_ = function() {
ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
var button = this.element.firstElementChild;
var map = this.getMap();
if (goog.dom.fullscreen.isFullScreen()) {
if (ol.control.FullScreen.isFullScreen()) {
button.className = this.cssClassName_ + '-true';
goog.dom.replaceNode(this.labelActiveNode_, this.labelNode_);
ol.dom.replaceNode(this.labelActiveNode_, this.labelNode_);
} else {
button.className = this.cssClassName_ + '-false';
goog.dom.replaceNode(this.labelNode_, this.labelActiveNode_);
ol.dom.replaceNode(this.labelNode_, this.labelActiveNode_);
}
if (map) {
map.updateSize();
@@ -153,11 +160,102 @@ ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
* @api stable
*/
ol.control.FullScreen.prototype.setMap = function(map) {
goog.base(this, 'setMap', map);
ol.control.Control.prototype.setMap.call(this, map);
if (map) {
this.listenerKeys.push(
ol.events.listen(ol.global.document, goog.dom.fullscreen.EventType.CHANGE,
this.handleFullScreenChange_, this)
this.listenerKeys.push(ol.events.listen(ol.global.document,
ol.control.FullScreen.getChangeType_(),
this.handleFullScreenChange_, this)
);
}
};
/**
* @return {boolean} Fullscreen is supported by the current platform.
*/
ol.control.FullScreen.isFullScreenSupported = function() {
var body = document.body;
return !!(
body.webkitRequestFullscreen ||
(body.mozRequestFullScreen && document.mozFullScreenEnabled) ||
(body.msRequestFullscreen && document.msFullscreenEnabled) ||
(body.requestFullscreen && document.fullscreenEnabled)
);
};
/**
* @return {boolean} Element is currently in fullscreen.
*/
ol.control.FullScreen.isFullScreen = function() {
return !!(
document.webkitIsFullScreen || document.mozFullScreen ||
document.msFullscreenElement || document.fullscreenElement
);
};
/**
* Request to fullscreen an element.
* @param {Node} element Element to request fullscreen
*/
ol.control.FullScreen.requestFullScreen = function(element) {
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
}
};
/**
* Request to fullscreen an element with keyboard input.
* @param {Node} element Element to request fullscreen
*/
ol.control.FullScreen.requestFullScreenWithKeys = function(element) {
if (element.mozRequestFullScreenWithKeys) {
element.mozRequestFullScreenWithKeys();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
} else {
ol.control.FullScreen.requestFullScreen(element);
}
};
/**
* Exit fullscreen.
*/
ol.control.FullScreen.exitFullScreen = function() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
};
/**
* @return {string} Change type.
* @private
*/
ol.control.FullScreen.getChangeType_ = (function() {
var changeType;
return function() {
if (!changeType) {
var body = document.body;
if (body.webkitRequestFullscreen) {
changeType = 'webkitfullscreenchange';
} else if (body.mozRequestFullScreen) {
changeType = 'mozfullscreenchange';
} else if (body.msRequestFullscreen) {
changeType = 'MSFullscreenChange';
} else if (body.requestFullscreen) {
changeType = 'fullscreenchange';
}
}
return changeType;
};
})();

View File

@@ -37,12 +37,12 @@ ol.control.MousePosition = function(opt_options) {
var options = opt_options ? opt_options : {};
var element = document.createElement('DIV');
element.className = options.className !== undefined ? options.className : 'ol-mouse-position'
element.className = options.className !== undefined ? options.className : 'ol-mouse-position';
var render = options.render ?
options.render : ol.control.MousePosition.render;
goog.base(this, {
ol.control.Control.call(this, {
element: element,
render: render,
target: options.target
@@ -90,7 +90,7 @@ ol.control.MousePosition = function(opt_options) {
this.lastMouseMovePixel_ = null;
};
goog.inherits(ol.control.MousePosition, ol.control.Control);
ol.inherits(ol.control.MousePosition, ol.control.Control);
/**
@@ -174,7 +174,7 @@ ol.control.MousePosition.prototype.handleMouseOut = function(event) {
* @api stable
*/
ol.control.MousePosition.prototype.setMap = function(map) {
goog.base(this, 'setMap', map);
ol.control.Control.prototype.setMap.call(this, map);
if (map) {
var viewport = map.getViewport();
this.listenerKeys.push(

View File

@@ -1,7 +1,6 @@
goog.provide('ol.control.OverviewMap');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('ol');
@@ -17,6 +16,7 @@ goog.require('ol.ViewProperty');
goog.require('ol.control.Control');
goog.require('ol.coordinate');
goog.require('ol.css');
goog.require('ol.dom');
goog.require('ol.extent');
@@ -55,30 +55,37 @@ ol.control.OverviewMap = function(opt_options) {
var collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\u00AB';
/**
* @private
* @type {Node}
*/
this.collapseLabel_ = typeof collapseLabel === 'string' ?
goog.dom.createDom('SPAN', {}, collapseLabel) :
collapseLabel;
if (typeof collapseLabel === 'string') {
/**
* @private
* @type {Node}
*/
this.collapseLabel_ = document.createElement('span');
this.collapseLabel_.textContent = collapseLabel;
} else {
this.collapseLabel_ = collapseLabel;
}
var label = options.label !== undefined ? options.label : '\u00BB';
/**
* @private
* @type {Node}
*/
this.label_ = typeof label === 'string' ?
goog.dom.createDom('SPAN', {}, label) :
label;
if (typeof label === 'string') {
/**
* @private
* @type {Node}
*/
this.label_ = document.createElement('span');
this.label_.textContent = label;
} else {
this.label_ = label;
}
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
this.collapseLabel_ : this.label_;
var button = goog.dom.createDom('BUTTON', {
'type': 'button',
'title': tipLabel
}, activeLabel);
var button = document.createElement('button');
button.setAttribute('type', 'button');
button.title = tipLabel;
button.appendChild(activeLabel);
ol.events.listen(button, ol.events.EventType.CLICK,
this.handleClick_, this);
@@ -127,18 +134,20 @@ ol.control.OverviewMap = function(opt_options) {
ol.css.CLASS_CONTROL +
(this.collapsed_ && this.collapsible_ ? ' ol-collapsed' : '') +
(this.collapsible_ ? '' : ' ol-uncollapsible');
var element = goog.dom.createDom('DIV',
cssClasses, ovmapDiv, button);
var element = document.createElement('div');
element.className = cssClasses;
element.appendChild(ovmapDiv);
element.appendChild(button);
var render = options.render ? options.render : ol.control.OverviewMap.render;
goog.base(this, {
ol.control.Control.call(this, {
element: element,
render: render,
target: options.target
});
};
goog.inherits(ol.control.OverviewMap, ol.control.Control);
ol.inherits(ol.control.OverviewMap, ol.control.Control);
/**
@@ -156,7 +165,7 @@ ol.control.OverviewMap.prototype.setMap = function(map) {
this.unbindView_(oldView);
}
}
goog.base(this, 'setMap', map);
ol.control.Control.prototype.setMap.call(this, map);
if (map) {
this.listenerKeys.push(ol.events.listen(
@@ -445,9 +454,9 @@ ol.control.OverviewMap.prototype.handleClick_ = function(event) {
ol.control.OverviewMap.prototype.handleToggle_ = function() {
this.element.classList.toggle('ol-collapsed');
if (this.collapsed_) {
goog.dom.replaceNode(this.collapseLabel_, this.label_);
ol.dom.replaceNode(this.collapseLabel_, this.label_);
} else {
goog.dom.replaceNode(this.label_, this.collapseLabel_);
ol.dom.replaceNode(this.label_, this.collapseLabel_);
}
this.collapsed_ = !this.collapsed_;

View File

@@ -1,6 +1,5 @@
goog.provide('ol.control.Rotate');
goog.require('goog.dom');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('ol');
@@ -36,8 +35,9 @@ ol.control.Rotate = function(opt_options) {
this.label_ = null;
if (typeof label === 'string') {
this.label_ = goog.dom.createDom('SPAN',
'ol-compass', label);
this.label_ = document.createElement('span');
this.label_.className = 'ol-compass';
this.label_.textContent = label;
} else {
this.label_ = label;
this.label_.classList.add('ol-compass');
@@ -45,24 +45,26 @@ ol.control.Rotate = function(opt_options) {
var tipLabel = options.tipLabel ? options.tipLabel : 'Reset rotation';
var button = goog.dom.createDom('BUTTON', {
'class': className + '-reset',
'type' : 'button',
'title': tipLabel
}, this.label_);
var button = document.createElement('button');
button.className = className + '-reset';
button.setAttribute('type', 'button');
button.title = tipLabel;
button.appendChild(this.label_);
ol.events.listen(button, ol.events.EventType.CLICK,
ol.control.Rotate.prototype.handleClick_, this);
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
ol.css.CLASS_CONTROL;
var element = goog.dom.createDom('DIV', cssClasses, button);
var element = document.createElement('div');
element.className = cssClasses;
element.appendChild(button);
var render = options.render ? options.render : ol.control.Rotate.render;
this.callResetNorth_ = options.resetNorth ? options.resetNorth : undefined;
goog.base(this, {
ol.control.Control.call(this, {
element: element,
render: render,
target: options.target
@@ -91,7 +93,7 @@ ol.control.Rotate = function(opt_options) {
}
};
goog.inherits(ol.control.Rotate, ol.control.Control);
ol.inherits(ol.control.Rotate, ol.control.Control);
/**

View File

@@ -1,10 +1,7 @@
goog.provide('ol.control.ScaleLine');
goog.provide('ol.control.ScaleLineProperty');
goog.provide('ol.control.ScaleLineUnits');
goog.require('goog.asserts');
goog.require('ol.events');
goog.require('goog.style');
goog.require('ol');
goog.require('ol.Object');
goog.require('ol.control.Control');
@@ -25,7 +22,6 @@ ol.control.ScaleLineProperty = {
* Units for the scale line. Supported values are `'degrees'`, `'imperial'`,
* `'nautical'`, `'metric'`, `'us'`.
* @enum {string}
* @api stable
*/
ol.control.ScaleLineUnits = {
DEGREES: 'degrees',
@@ -103,7 +99,7 @@ ol.control.ScaleLine = function(opt_options) {
var render = options.render ? options.render : ol.control.ScaleLine.render;
goog.base(this, {
ol.control.Control.call(this, {
element: this.element_,
render: render,
target: options.target
@@ -117,7 +113,7 @@ ol.control.ScaleLine = function(opt_options) {
ol.control.ScaleLineUnits.METRIC);
};
goog.inherits(ol.control.ScaleLine, ol.control.Control);
ol.inherits(ol.control.ScaleLine, ol.control.Control);
/**
@@ -184,7 +180,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
if (!viewState) {
if (this.renderedVisible_) {
goog.style.setElementShown(this.element_, false);
this.element_.style.display = 'none';
this.renderedVisible_ = false;
}
return;
@@ -259,7 +255,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
Math.pow(10, Math.floor(i / 3));
width = Math.round(count / pointResolution);
if (isNaN(width)) {
goog.style.setElementShown(this.element_, false);
this.element_.style.display = 'none';
this.renderedVisible_ = false;
return;
} else if (width >= this.minWidth_) {
@@ -280,7 +276,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
}
if (!this.renderedVisible_) {
goog.style.setElementShown(this.element_, true);
this.element_.style.display = '';
this.renderedVisible_ = true;
}

View File

@@ -1,6 +1,5 @@
goog.provide('ol.control.Zoom');
goog.require('goog.dom');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('ol.animation');
@@ -36,29 +35,36 @@ ol.control.Zoom = function(opt_options) {
var zoomOutTipLabel = options.zoomOutTipLabel !== undefined ?
options.zoomOutTipLabel : 'Zoom out';
var inElement = goog.dom.createDom('BUTTON', {
'class': className + '-in',
'type' : 'button',
'title': zoomInTipLabel
}, zoomInLabel);
var inElement = document.createElement('button');
inElement.className = className + '-in';
inElement.setAttribute('type', 'button');
inElement.title = zoomInTipLabel;
inElement.appendChild(
typeof zoomInLabel === 'string' ? document.createTextNode(zoomInLabel) : zoomInLabel
);
ol.events.listen(inElement, ol.events.EventType.CLICK,
ol.control.Zoom.prototype.handleClick_.bind(this, delta));
var outElement = goog.dom.createDom('BUTTON', {
'class': className + '-out',
'type' : 'button',
'title': zoomOutTipLabel
}, zoomOutLabel);
var outElement = document.createElement('button');
outElement.className = className + '-out';
outElement.setAttribute('type', 'button');
outElement.title = zoomOutTipLabel;
outElement.appendChild(
typeof zoomOutLabel === 'string' ? document.createTextNode(zoomOutLabel) : zoomOutLabel
);
ol.events.listen(outElement, ol.events.EventType.CLICK,
ol.control.Zoom.prototype.handleClick_.bind(this, -delta));
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
ol.css.CLASS_CONTROL;
var element = goog.dom.createDom('DIV', cssClasses, inElement, outElement);
var element = document.createElement('div');
element.className = cssClasses;
element.appendChild(inElement);
element.appendChild(outElement);
goog.base(this, {
ol.control.Control.call(this, {
element: element,
target: options.target
});
@@ -70,7 +76,7 @@ ol.control.Zoom = function(opt_options) {
this.duration_ = options.duration !== undefined ? options.duration : 250;
};
goog.inherits(ol.control.Zoom, ol.control.Control);
ol.inherits(ol.control.Zoom, ol.control.Control);
/**

View File

@@ -3,8 +3,6 @@
goog.provide('ol.control.ZoomSlider');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.style');
goog.require('ol.events');
goog.require('ol.events.Event');
goog.require('ol.events.EventType');
@@ -58,7 +56,7 @@ ol.control.ZoomSlider = function(opt_options) {
this.dragging_;
/**
* @type {!Array.<ol.events.Key>}
* @type {!Array.<ol.EventsKey>}
* @private
*/
this.dragListenerKeys_ = [];
@@ -109,14 +107,12 @@ ol.control.ZoomSlider = function(opt_options) {
this.duration_ = options.duration !== undefined ? options.duration : 200;
var className = options.className !== undefined ? options.className : 'ol-zoomslider';
var thumbElement = goog.dom.createDom('BUTTON', {
'type': 'button',
'class': className + '-thumb ' + ol.css.CLASS_UNSELECTABLE
});
var containerElement = goog.dom.createDom('DIV',
[className, ol.css.CLASS_UNSELECTABLE, ol.css.CLASS_CONTROL],
thumbElement);
var thumbElement = document.createElement('button');
thumbElement.setAttribute('type', 'button');
thumbElement.className = className + '-thumb ' + ol.css.CLASS_UNSELECTABLE;
var containerElement = document.createElement('div');
containerElement.className = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' + ol.css.CLASS_CONTROL;
containerElement.appendChild(thumbElement);
/**
* @type {ol.pointer.PointerEventHandler}
* @private
@@ -137,12 +133,12 @@ ol.control.ZoomSlider = function(opt_options) {
var render = options.render ? options.render : ol.control.ZoomSlider.render;
goog.base(this, {
ol.control.Control.call(this, {
element: containerElement,
render: render
});
};
goog.inherits(ol.control.ZoomSlider, ol.control.Control);
ol.inherits(ol.control.ZoomSlider, ol.control.Control);
/**
@@ -150,7 +146,7 @@ goog.inherits(ol.control.ZoomSlider, ol.control.Control);
*/
ol.control.ZoomSlider.prototype.disposeInternal = function() {
this.dragger_.dispose();
goog.base(this, 'disposeInternal');
ol.control.Control.prototype.disposeInternal.call(this);
};
@@ -169,7 +165,7 @@ ol.control.ZoomSlider.direction = {
* @inheritDoc
*/
ol.control.ZoomSlider.prototype.setMap = function(map) {
goog.base(this, 'setMap', map);
ol.control.Control.prototype.setMap.call(this, map);
if (map) {
map.render();
}
@@ -185,15 +181,18 @@ ol.control.ZoomSlider.prototype.setMap = function(map) {
*/
ol.control.ZoomSlider.prototype.initSlider_ = function() {
var container = this.element;
var containerSize = goog.style.getSize(container);
var containerSize = {
width: container.offsetWidth, height: container.offsetHeight
};
var thumb = container.firstElementChild;
var thumbMargins = goog.style.getMarginBox(thumb);
var thumbBorderBoxSize = goog.style.getBorderBoxSize(thumb);
var thumbWidth = thumbBorderBoxSize.width +
thumbMargins.right + thumbMargins.left;
var thumbHeight = thumbBorderBoxSize.height +
thumbMargins.top + thumbMargins.bottom;
var computedStyle = ol.global.getComputedStyle(thumb);
var thumbWidth = thumb.offsetWidth +
parseFloat(computedStyle['marginRight']) +
parseFloat(computedStyle['marginLeft']);
var thumbHeight = thumb.offsetHeight +
parseFloat(computedStyle['marginTop']) +
parseFloat(computedStyle['marginBottom']);
this.thumbSize_ = [thumbWidth, thumbHeight];
if (containerSize.width > containerSize.height) {

View File

@@ -1,7 +1,6 @@
goog.provide('ol.control.ZoomToExtent');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('ol.control.Control');
@@ -33,24 +32,28 @@ ol.control.ZoomToExtent = function(opt_options) {
var label = options.label !== undefined ? options.label : 'E';
var tipLabel = options.tipLabel !== undefined ?
options.tipLabel : 'Fit to extent';
var button = goog.dom.createDom('BUTTON', {
'type': 'button',
'title': tipLabel
}, label);
var button = document.createElement('button');
button.setAttribute('type', 'button');
button.title = tipLabel;
button.appendChild(
typeof label === 'string' ? document.createTextNode(label) : label
);
ol.events.listen(button, ol.events.EventType.CLICK,
this.handleClick_, this);
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
ol.css.CLASS_CONTROL;
var element = goog.dom.createDom('DIV', cssClasses, button);
var element = document.createElement('div');
element.className = cssClasses;
element.appendChild(button);
goog.base(this, {
ol.control.Control.call(this, {
element: element,
target: options.target
});
};
goog.inherits(ol.control.ZoomToExtent, ol.control.Control);
ol.inherits(ol.control.ZoomToExtent, ol.control.Control);
/**

View File

@@ -1,5 +1,4 @@
goog.provide('ol.DeviceOrientation');
goog.provide('ol.DeviceOrientationProperty');
goog.require('ol.events');
goog.require('ol');
@@ -77,13 +76,13 @@ ol.DeviceOrientationProperty = {
*/
ol.DeviceOrientation = function(opt_options) {
goog.base(this);
ol.Object.call(this);
var options = opt_options ? opt_options : {};
/**
* @private
* @type {?ol.events.Key}
* @type {?ol.EventsKey}
*/
this.listenerKey_ = null;
@@ -94,7 +93,7 @@ ol.DeviceOrientation = function(opt_options) {
this.setTracking(options.tracking !== undefined ? options.tracking : false);
};
goog.inherits(ol.DeviceOrientation, ol.Object);
ol.inherits(ol.DeviceOrientation, ol.Object);
/**
@@ -102,7 +101,7 @@ goog.inherits(ol.DeviceOrientation, ol.Object);
*/
ol.DeviceOrientation.prototype.disposeInternal = function() {
this.setTracking(false);
goog.base(this, 'disposeInternal');
ol.Object.prototype.disposeInternal.call(this);
};

View File

@@ -213,3 +213,31 @@ ol.dom.outerHeight = function(element) {
return height;
};
/**
* @param {Node} newNode Node to replace old node
* @param {Node} oldNode The node to be replaced
*/
ol.dom.replaceNode = function(newNode, oldNode) {
var parent = oldNode.parentNode;
if (parent) {
parent.replaceChild(newNode, oldNode);
}
};
/**
* @param {Node} node The node to remove.
* @returns {Node} The node that was removed or null.
*/
ol.dom.removeNode = function(node) {
return node && node.parentNode ? node.parentNode.removeChild(node) : null;
};
/**
* @param {Node} node The node to remove the children from.
*/
ol.dom.removeChildren = function(node) {
while (node.lastChild) {
node.removeChild(node.lastChild);
}
};

View File

@@ -3,7 +3,6 @@ goog.provide('ol.events.EventType');
goog.provide('ol.events.KeyCode');
goog.require('ol.object');
goog.require('ol.events.EventTargetLike');
/**
@@ -63,8 +62,8 @@ ol.events.LISTENER_MAP_PROP_ = 'olm_' + ((Math.random() * 1e4) | 0);
/**
* @param {ol.events.Key} listenerObj Listener object.
* @return {ol.events.ListenerFunctionType} Bound listener.
* @param {ol.EventsKey} listenerObj Listener object.
* @return {ol.EventsListenerFunctionType} Bound listener.
*/
ol.events.bindListener_ = function(listenerObj) {
var boundListener = function(evt) {
@@ -74,22 +73,22 @@ ol.events.bindListener_ = function(listenerObj) {
ol.events.unlistenByKey(listenerObj);
}
return listener.call(bindTo, evt);
}
};
listenerObj.boundListener = boundListener;
return boundListener;
};
/**
* Finds the matching {@link ol.events.Key} in the given listener
* Finds the matching {@link ol.EventsKey} in the given listener
* array.
*
* @param {!Array<!ol.events.Key>} listeners Array of listeners.
* @param {!Array<!ol.EventsKey>} 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.Key|undefined} The matching listener object.
* @return {ol.EventsKey|undefined} The matching listener object.
* @private
*/
ol.events.findListener_ = function(listeners, listener, opt_this,
@@ -110,9 +109,9 @@ ol.events.findListener_ = function(listeners, listener, opt_this,
/**
* @param {ol.events.EventTargetLike} target Target.
* @param {ol.EventTargetLike} target Target.
* @param {string} type Type.
* @return {Array.<ol.events.Key>|undefined} Listeners.
* @return {Array.<ol.EventsKey>|undefined} Listeners.
*/
ol.events.getListeners = function(target, type) {
var listenerMap = target[ol.events.LISTENER_MAP_PROP_];
@@ -123,8 +122,8 @@ 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.Key>>} Map of
* @param {ol.EventTargetLike} target Target.
* @return {!Object.<string, Array.<ol.EventsKey>>} Map of
* listeners by event type.
* @private
*/
@@ -141,7 +140,7 @@ ol.events.getListenerMap_ = function(target) {
* Clean up all listener objects of the given type. All properties on the
* listener objects will be removed, and if no listeners remain in the listener
* map, it will be removed from the target.
* @param {ol.events.EventTargetLike} target Target.
* @param {ol.EventTargetLike} target Target.
* @param {string} type Type.
* @private
*/
@@ -150,7 +149,7 @@ ol.events.removeListeners_ = function(target, type) {
if (listeners) {
for (var i = 0, ii = listeners.length; i < ii; ++i) {
target.removeEventListener(type, listeners[i].boundListener);
ol.object.clear(listeners[i])
ol.object.clear(listeners[i]);
}
listeners.length = 0;
var listenerMap = target[ol.events.LISTENER_MAP_PROP_];
@@ -171,13 +170,13 @@ ol.events.removeListeners_ = function(target, type) {
* This function efficiently binds a `listener` to a `this` object, and returns
* a key for use with {@link ol.events.unlistenByKey}.
*
* @param {ol.events.EventTargetLike} target Event target.
* @param {ol.EventTargetLike} target Event target.
* @param {string} type Event type.
* @param {ol.events.ListenerFunctionType} listener Listener.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {Object=} opt_this Object referenced by the `this` keyword in the
* listener. Default is the `target`.
* @param {boolean=} opt_once If true, add the listener as one-off listener.
* @return {ol.events.Key} Unique key for the listener.
* @return {ol.EventsKey} Unique key for the listener.
*/
ol.events.listen = function(target, type, listener, opt_this, opt_once) {
var listenerMap = ol.events.getListenerMap_(target);
@@ -193,7 +192,7 @@ ol.events.listen = function(target, type, listener, opt_this, opt_once) {
listenerObj.callOnce = false;
}
} else {
listenerObj = /** @type {ol.events.Key} */ ({
listenerObj = /** @type {ol.EventsKey} */ ({
bindTo: opt_this,
callOnce: !!opt_once,
listener: listener,
@@ -221,12 +220,12 @@ ol.events.listen = function(target, type, listener, opt_this, opt_once) {
* function, the self-unregistering listener will be turned into a permanent
* listener.
*
* @param {ol.events.EventTargetLike} target Event target.
* @param {ol.EventTargetLike} target Event target.
* @param {string} type Event type.
* @param {ol.events.ListenerFunctionType} listener Listener.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {Object=} opt_this Object referenced by the `this` keyword in the
* listener. Default is the `target`.
* @return {ol.events.Key} Key for unlistenByKey.
* @return {ol.EventsKey} Key for unlistenByKey.
*/
ol.events.listenOnce = function(target, type, listener, opt_this) {
return ol.events.listen(target, type, listener, opt_this, true);
@@ -240,9 +239,9 @@ ol.events.listenOnce = function(target, type, listener, opt_this) {
* To return a listener, this function needs to be called with the exact same
* arguments that were used for a previous {@link ol.events.listen} call.
*
* @param {ol.events.EventTargetLike} target Event target.
* @param {ol.EventTargetLike} target Event target.
* @param {string} type Event type.
* @param {ol.events.ListenerFunctionType} listener Listener.
* @param {ol.EventsListenerFunctionType} listener Listener.
* @param {Object=} opt_this Object referenced by the `this` keyword in the
* listener. Default is the `target`.
*/
@@ -265,7 +264,7 @@ ol.events.unlisten = function(target, type, listener, opt_this) {
* The argument passed to this function is the key returned from
* {@link ol.events.listen} or {@link ol.events.listenOnce}.
*
* @param {ol.events.Key} key The key.
* @param {ol.EventsKey} key The key.
*/
ol.events.unlistenByKey = function(key) {
if (key && key.target) {
@@ -289,7 +288,7 @@ ol.events.unlistenByKey = function(key) {
* Unregisters all event listeners on an event target. Inspired by
* {@link https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html}
*
* @param {ol.events.EventTargetLike} target Target.
* @param {ol.EventTargetLike} target Target.
*/
ol.events.unlistenAll = function(target) {
var listenerMap = ol.events.getListenerMap_(target);

View File

@@ -202,12 +202,14 @@ ol.events.condition.targetNotEditable = function(mapBrowserEvent) {
/**
* Return `true` if the event originates from a mouse device.
*
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Map browser event.
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the event originates from a mouse device.
* @api stable
*/
ol.events.condition.mouseOnly = function(mapBrowserEvent) {
// see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
goog.asserts.assertInstanceof(mapBrowserEvent, ol.MapBrowserPointerEvent,
'Requires an ol.MapBrowserPointerEvent to work.');
return mapBrowserEvent.pointerEvent.pointerType == 'mouse';
};

View File

@@ -5,6 +5,7 @@ goog.require('ol.Disposable');
goog.require('ol.events');
goog.require('ol.events.Event');
/**
* @classdesc
* A simplified implementation of the W3C DOM Level 2 EventTarget interface.
@@ -25,7 +26,7 @@ goog.require('ol.events.Event');
*/
ol.events.EventTarget = function() {
goog.base(this);
ol.Disposable.call(this);
/**
* @private
@@ -41,17 +42,17 @@ ol.events.EventTarget = function() {
/**
* @private
* @type {!Object.<string, Array.<ol.events.ListenerFunctionType>>}
* @type {!Object.<string, Array.<ol.EventsListenerFunctionType>>}
*/
this.listeners_ = {};
};
goog.inherits(ol.events.EventTarget, ol.Disposable);
ol.inherits(ol.events.EventTarget, ol.Disposable);
/**
* @param {string} type Type.
* @param {ol.events.ListenerFunctionType} listener Listener.
* @param {ol.EventsListenerFunctionType} listener Listener.
*/
ol.events.EventTarget.prototype.addEventListener = function(type, listener) {
var listeners = this.listeners_[type];
@@ -116,7 +117,7 @@ ol.events.EventTarget.prototype.disposeInternal = function() {
* order that they will be called in.
*
* @param {string} type Type.
* @return {Array.<ol.events.ListenerFunctionType>} Listeners.
* @return {Array.<ol.EventsListenerFunctionType>} Listeners.
*/
ol.events.EventTarget.prototype.getListeners = function(type) {
return this.listeners_[type];
@@ -137,7 +138,7 @@ ol.events.EventTarget.prototype.hasListener = function(opt_type) {
/**
* @param {string} type Type.
* @param {ol.events.ListenerFunctionType} listener Listener.
* @param {ol.EventsListenerFunctionType} listener Listener.
*/
ol.events.EventTarget.prototype.removeEventListener = function(type, listener) {
var listeners = this.listeners_[type];

View File

@@ -56,7 +56,7 @@ goog.require('ol.style.Style');
*/
ol.Feature = function(opt_geometryOrProperties) {
goog.base(this);
ol.Object.call(this);
/**
* @private
@@ -86,7 +86,7 @@ ol.Feature = function(opt_geometryOrProperties) {
/**
* @private
* @type {?ol.events.Key}
* @type {?ol.EventsKey}
*/
this.geometryChangeKey_ = null;
@@ -108,7 +108,7 @@ ol.Feature = function(opt_geometryOrProperties) {
}
}
};
goog.inherits(ol.Feature, ol.Object);
ol.inherits(ol.Feature, ol.Object);
/**
@@ -294,7 +294,7 @@ ol.Feature.prototype.setGeometryName = function(name) {
ol.Feature.createStyleFunction = function(obj) {
var styleFunction;
if (goog.isFunction(obj)) {
if (typeof obj === 'function') {
styleFunction = obj;
} else {
/**

View File

@@ -31,7 +31,7 @@ ol.featureloader.loadFeaturesXhr = function(url, format, success, failure) {
function(extent, resolution, projection) {
var xhr = new XMLHttpRequest();
xhr.open('GET',
goog.isFunction(url) ? url(extent, resolution, projection) : url,
typeof url === 'function' ? url(extent, resolution, projection) : url,
true);
if (format.getType() == ol.format.FormatType.ARRAY_BUFFER) {
xhr.responseType = 'arraybuffer';

View File

@@ -33,7 +33,7 @@ ol.format.EsriJSON = function(opt_options) {
var options = opt_options ? opt_options : {};
goog.base(this);
ol.format.JSONFeature.call(this);
/**
* Name of the geometry attribute for features.
@@ -43,7 +43,7 @@ ol.format.EsriJSON = function(opt_options) {
this.geometryName_ = options.geometryName;
};
goog.inherits(ol.format.EsriJSON, ol.format.JSONFeature);
ol.inherits(ol.format.EsriJSON, ol.format.JSONFeature);
/**

View File

@@ -31,7 +31,7 @@ ol.format.GeoJSON = function(opt_options) {
var options = opt_options ? opt_options : {};
goog.base(this);
ol.format.JSONFeature.call(this);
/**
* @inheritDoc
@@ -49,7 +49,7 @@ ol.format.GeoJSON = function(opt_options) {
this.geometryName_ = options.geometryName;
};
goog.inherits(ol.format.GeoJSON, ol.format.JSONFeature);
ol.inherits(ol.format.GeoJSON, ol.format.JSONFeature);
/**

View File

@@ -1,7 +1,6 @@
goog.provide('ol.format.GML2');
goog.require('goog.asserts');
goog.require('goog.dom.NodeType');
goog.require('ol.extent');
goog.require('ol.format.GMLBase');
goog.require('ol.format.XSD');
@@ -23,7 +22,7 @@ ol.format.GML2 = function(opt_options) {
var options = /** @type {olx.format.GMLOptions} */
(opt_options ? opt_options : {});
goog.base(this, options);
ol.format.GMLBase.call(this, options);
this.FEATURE_COLLECTION_PARSERS[ol.format.GMLBase.GMLNS][
'featureMember'] =
@@ -36,7 +35,7 @@ ol.format.GML2 = function(opt_options) {
options.schemaLocation : ol.format.GML2.schemaLocation_;
};
goog.inherits(ol.format.GML2, ol.format.GMLBase);
ol.inherits(ol.format.GML2, ol.format.GMLBase);
/**
@@ -56,7 +55,7 @@ ol.format.GML2.schemaLocation_ = ol.format.GMLBase.GMLNS +
*/
ol.format.GML2.prototype.readFlatCoordinates_ = function(node, objectStack) {
var s = ol.xml.getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
var context = objectStack[0];
var context = /** @type {ol.XmlNodeStackItem} */ (objectStack[0]);
goog.asserts.assert(goog.isObject(context), 'context should be an Object');
var containerSrs = context['srsName'];
var containerDimension = node.parentNode.getAttribute('srsDimension');
@@ -102,7 +101,7 @@ ol.format.GML2.prototype.readFlatCoordinates_ = function(node, objectStack) {
* @return {ol.Extent|undefined} Envelope.
*/
ol.format.GML2.prototype.readBox_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Box', 'localName should be Box');
/** @type {Array.<number>} */
@@ -120,7 +119,7 @@ ol.format.GML2.prototype.readBox_ = function(node, objectStack) {
* @private
*/
ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'innerBoundaryIs',
'localName should be innerBoundaryIs');
@@ -145,7 +144,7 @@ ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
* @private
*/
ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'outerBoundaryIs',
'localName should be outerBoundaryIs');
@@ -166,7 +165,7 @@ ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
@@ -179,7 +178,7 @@ ol.format.GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
@@ -192,7 +191,7 @@ ol.format.GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML2.prototype.BOX_PARSERS_ = {
@@ -205,7 +204,7 @@ ol.format.GML2.prototype.BOX_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML2.prototype.GEOMETRY_PARSERS_ = {

View File

@@ -2,7 +2,6 @@ goog.provide('ol.format.GML');
goog.provide('ol.format.GML3');
goog.require('goog.asserts');
goog.require('goog.dom.NodeType');
goog.require('ol');
goog.require('ol.array');
goog.require('ol.Feature');
@@ -39,7 +38,7 @@ ol.format.GML3 = function(opt_options) {
var options = /** @type {olx.format.GMLOptions} */
(opt_options ? opt_options : {});
goog.base(this, options);
ol.format.GMLBase.call(this, options);
/**
* @private
@@ -74,7 +73,7 @@ ol.format.GML3 = function(opt_options) {
options.schemaLocation : ol.format.GML3.schemaLocation_;
};
goog.inherits(ol.format.GML3, ol.format.GMLBase);
ol.inherits(ol.format.GML3, ol.format.GMLBase);
/**
@@ -94,7 +93,7 @@ ol.format.GML3.schemaLocation_ = ol.format.GMLBase.GMLNS +
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
*/
ol.format.GML3.prototype.readMultiCurve_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'MultiCurve',
'localName should be MultiCurve');
@@ -118,7 +117,7 @@ ol.format.GML3.prototype.readMultiCurve_ = function(node, objectStack) {
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
*/
ol.format.GML3.prototype.readMultiSurface_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'MultiSurface',
'localName should be MultiSurface');
@@ -141,7 +140,7 @@ ol.format.GML3.prototype.readMultiSurface_ = function(node, objectStack) {
* @private
*/
ol.format.GML3.prototype.curveMemberParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'curveMember' ||
node.localName == 'curveMembers',
@@ -156,7 +155,7 @@ ol.format.GML3.prototype.curveMemberParser_ = function(node, objectStack) {
* @private
*/
ol.format.GML3.prototype.surfaceMemberParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'surfaceMember' ||
node.localName == 'surfaceMembers',
@@ -173,7 +172,7 @@ ol.format.GML3.prototype.surfaceMemberParser_ = function(node, objectStack) {
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
*/
ol.format.GML3.prototype.readPatch_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'patches',
'localName should be patches');
@@ -189,7 +188,7 @@ ol.format.GML3.prototype.readPatch_ = function(node, objectStack) {
* @return {Array.<number>|undefined} flat coordinates.
*/
ol.format.GML3.prototype.readSegment_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'segments',
'localName should be segments');
@@ -205,7 +204,7 @@ ol.format.GML3.prototype.readSegment_ = function(node, objectStack) {
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
*/
ol.format.GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'npde.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'PolygonPatch',
'localName should be PolygonPatch');
@@ -221,7 +220,7 @@ ol.format.GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
* @return {Array.<number>|undefined} flat coordinates.
*/
ol.format.GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LineStringSegment',
'localName should be LineStringSegment');
@@ -237,7 +236,7 @@ ol.format.GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
* @private
*/
ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'interior',
'localName should be interior');
@@ -262,7 +261,7 @@ ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) {
* @private
*/
ol.format.GML3.prototype.exteriorParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'exterior',
'localName should be exterior');
@@ -288,7 +287,7 @@ ol.format.GML3.prototype.exteriorParser_ = function(node, objectStack) {
* @return {ol.geom.Polygon|undefined} Polygon.
*/
ol.format.GML3.prototype.readSurface_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Surface',
'localName should be Surface');
@@ -320,7 +319,7 @@ ol.format.GML3.prototype.readSurface_ = function(node, objectStack) {
* @return {ol.geom.LineString|undefined} LineString.
*/
ol.format.GML3.prototype.readCurve_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Curve', 'localName should be Curve');
/** @type {Array.<number>} */
@@ -343,7 +342,7 @@ ol.format.GML3.prototype.readCurve_ = function(node, objectStack) {
* @return {ol.Extent|undefined} Envelope.
*/
ol.format.GML3.prototype.readEnvelope_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Envelope',
'localName should be Envelope');
@@ -450,7 +449,7 @@ ol.format.GML3.prototype.readFlatPosList_ = function(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
@@ -463,7 +462,7 @@ ol.format.GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
@@ -476,7 +475,7 @@ ol.format.GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML3.prototype.GEOMETRY_PARSERS_ = {
@@ -506,7 +505,7 @@ ol.format.GML3.prototype.GEOMETRY_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML3.prototype.MULTICURVE_PARSERS_ = {
@@ -521,7 +520,7 @@ ol.format.GML3.prototype.MULTICURVE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML3.prototype.MULTISURFACE_PARSERS_ = {
@@ -536,7 +535,7 @@ ol.format.GML3.prototype.MULTISURFACE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML3.prototype.CURVEMEMBER_PARSERS_ = {
@@ -550,7 +549,7 @@ ol.format.GML3.prototype.CURVEMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML3.prototype.SURFACEMEMBER_PARSERS_ = {
@@ -563,7 +562,7 @@ ol.format.GML3.prototype.SURFACEMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML3.prototype.SURFACE_PARSERS_ = {
@@ -575,7 +574,7 @@ ol.format.GML3.prototype.SURFACE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML3.prototype.CURVE_PARSERS_ = {
@@ -587,7 +586,7 @@ ol.format.GML3.prototype.CURVE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML3.prototype.ENVELOPE_PARSERS_ = {
@@ -602,7 +601,7 @@ ol.format.GML3.prototype.ENVELOPE_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML3.prototype.PATCHES_PARSERS_ = {
@@ -615,7 +614,7 @@ ol.format.GML3.prototype.PATCHES_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GML3.prototype.SEGMENTS_PARSERS_ = {
@@ -712,7 +711,7 @@ ol.format.GML3.prototype.writePoint_ = function(node, geometry, objectStack) {
/**
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.GML3.ENVELOPE_SERIALIZERS_ = {
@@ -738,7 +737,7 @@ ol.format.GML3.prototype.writeEnvelope = function(node, extent, objectStack) {
}
var keys = ['lowerCorner', 'upperCorner'];
var values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
({node: node}), ol.format.GML3.ENVELOPE_SERIALIZERS_,
ol.xml.OBJECT_PROPERTY_NODE_FACTORY,
values,
@@ -1019,7 +1018,7 @@ ol.format.GML3.prototype.writeGeometryElement = function(node, geometry, objectS
value =
ol.format.Feature.transformWithOptions(geometry, true, context);
}
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
(item), ol.format.GML3.GEOMETRY_SERIALIZERS_,
this.GEOMETRY_NODE_FACTORY_, [value],
objectStack, undefined, this);
@@ -1066,7 +1065,7 @@ ol.format.GML3.prototype.writeFeatureElement = function(node, feature, objectSta
}
var item = ol.object.assign({}, context);
item.node = node;
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
(item), context.serializers,
ol.xml.makeSimpleNodeFactory(undefined, featureNS),
values,
@@ -1091,7 +1090,7 @@ ol.format.GML3.prototype.writeFeatureMembers_ = function(node, features, objectS
this.writeFeatureElement, this);
var item = ol.object.assign({}, context);
item.node = node;
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
(item),
serializers,
ol.xml.makeSimpleNodeFactory(featureType, featureNS), features,
@@ -1100,7 +1099,7 @@ ol.format.GML3.prototype.writeFeatureMembers_ = function(node, features, objectS
/**
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.GML3.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
@@ -1114,7 +1113,7 @@ ol.format.GML3.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.GML3.POINTMEMBER_SERIALIZERS_ = {
@@ -1126,7 +1125,7 @@ ol.format.GML3.POINTMEMBER_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.GML3.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
@@ -1140,7 +1139,7 @@ ol.format.GML3.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.GML3.RING_SERIALIZERS_ = {
@@ -1152,7 +1151,7 @@ ol.format.GML3.RING_SERIALIZERS_ = {
/**
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.GML3.GEOMETRY_SERIALIZERS_ = {

View File

@@ -4,7 +4,6 @@
goog.provide('ol.format.GMLBase');
goog.require('goog.asserts');
goog.require('goog.dom.NodeType');
goog.require('ol.array');
goog.require('ol.Feature');
goog.require('ol.format.Feature');
@@ -76,9 +75,9 @@ ol.format.GMLBase = function(opt_options) {
ol.format.GMLBase.prototype.readFeaturesInternal)
};
goog.base(this);
ol.format.XMLFeature.call(this);
};
goog.inherits(ol.format.GMLBase, ol.format.XMLFeature);
ol.inherits(ol.format.GMLBase, ol.format.XMLFeature);
/**
@@ -109,7 +108,7 @@ ol.format.GMLBase.ONLY_WHITESPACE_RE_ = /^[\s\xa0]*$/;
* @return {Array.<ol.Feature> | undefined} Features.
*/
ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
var localName = node.localName;
var features = null;
@@ -263,7 +262,7 @@ ol.format.GMLBase.prototype.readFeatureElement = function(node, objectStack) {
* @return {ol.geom.Point|undefined} Point.
*/
ol.format.GMLBase.prototype.readPoint = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Point', 'localName should be Point');
var flatCoordinates =
@@ -284,7 +283,7 @@ ol.format.GMLBase.prototype.readPoint = function(node, objectStack) {
* @return {ol.geom.MultiPoint|undefined} MultiPoint.
*/
ol.format.GMLBase.prototype.readMultiPoint = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'MultiPoint',
'localName should be MultiPoint');
@@ -305,7 +304,7 @@ ol.format.GMLBase.prototype.readMultiPoint = function(node, objectStack) {
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
*/
ol.format.GMLBase.prototype.readMultiLineString = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'MultiLineString',
'localName should be MultiLineString');
@@ -328,7 +327,7 @@ ol.format.GMLBase.prototype.readMultiLineString = function(node, objectStack) {
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
*/
ol.format.GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'MultiPolygon',
'localName should be MultiPolygon');
@@ -351,7 +350,7 @@ ol.format.GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
* @private
*/
ol.format.GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'pointMember' ||
node.localName == 'pointMembers',
@@ -367,7 +366,7 @@ ol.format.GMLBase.prototype.pointMemberParser_ = function(node, objectStack) {
* @private
*/
ol.format.GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'lineStringMember' ||
node.localName == 'lineStringMembers',
@@ -383,7 +382,7 @@ ol.format.GMLBase.prototype.lineStringMemberParser_ = function(node, objectStack
* @private
*/
ol.format.GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'polygonMember' ||
node.localName == 'polygonMembers',
@@ -399,7 +398,7 @@ ol.format.GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
* @return {ol.geom.LineString|undefined} LineString.
*/
ol.format.GMLBase.prototype.readLineString = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LineString',
'localName should be LineString');
@@ -422,7 +421,7 @@ ol.format.GMLBase.prototype.readLineString = function(node, objectStack) {
* @return {Array.<number>|undefined} LinearRing flat coordinates.
*/
ol.format.GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LinearRing',
'localName should be LinearRing');
@@ -443,7 +442,7 @@ ol.format.GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
* @return {ol.geom.LinearRing|undefined} LinearRing.
*/
ol.format.GMLBase.prototype.readLinearRing = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LinearRing',
'localName should be LinearRing');
@@ -465,7 +464,7 @@ ol.format.GMLBase.prototype.readLinearRing = function(node, objectStack) {
* @return {ol.geom.Polygon|undefined} Polygon.
*/
ol.format.GMLBase.prototype.readPolygon = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Polygon',
'localName should be Polygon');
@@ -497,7 +496,7 @@ ol.format.GMLBase.prototype.readPolygon = function(node, objectStack) {
* @return {Array.<number>} Flat coordinates.
*/
ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
return ol.xml.pushParseAndPop(null,
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
@@ -507,7 +506,7 @@ ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, object
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GMLBase.prototype.MULTIPOINT_PARSERS_ = {
@@ -522,7 +521,7 @@ ol.format.GMLBase.prototype.MULTIPOINT_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
@@ -537,7 +536,7 @@ ol.format.GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
@@ -552,7 +551,7 @@ ol.format.GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GMLBase.prototype.POINTMEMBER_PARSERS_ = {
@@ -565,7 +564,7 @@ ol.format.GMLBase.prototype.POINTMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
@@ -578,7 +577,7 @@ ol.format.GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
@@ -591,7 +590,7 @@ ol.format.GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @protected
*/
ol.format.GMLBase.prototype.RING_PARSERS = {

View File

@@ -1,7 +1,6 @@
goog.provide('ol.format.GPX');
goog.require('goog.asserts');
goog.require('goog.dom.NodeType');
goog.require('ol.Feature');
goog.require('ol.array');
goog.require('ol.format.Feature');
@@ -28,7 +27,7 @@ ol.format.GPX = function(opt_options) {
var options = opt_options ? opt_options : {};
goog.base(this);
ol.format.XMLFeature.call(this);
/**
* @inheritDoc
@@ -41,7 +40,7 @@ ol.format.GPX = function(opt_options) {
*/
this.readExtensions_ = options.readExtensions;
};
goog.inherits(ol.format.GPX, ol.format.XMLFeature);
ol.inherits(ol.format.GPX, ol.format.XMLFeature);
/**
@@ -56,6 +55,15 @@ ol.format.GPX.NAMESPACE_URIS_ = [
];
/**
* @const
* @type {string}
* @private
*/
ol.format.GPX.SCHEMA_LOCATION_ = 'http://www.topografix.com/GPX/1/1 ' +
'http://www.topografix.com/GPX/1/1/gpx.xsd';
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.
* @param {Node} node Node.
@@ -64,7 +72,7 @@ ol.format.GPX.NAMESPACE_URIS_ = [
* @return {Array.<number>} Flat coordinates.
*/
ol.format.GPX.appendCoordinate_ = function(flatCoordinates, node, values) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
flatCoordinates.push(
parseFloat(node.getAttribute('lon')),
@@ -91,7 +99,7 @@ ol.format.GPX.appendCoordinate_ = function(flatCoordinates, node, values) {
* @private
*/
ol.format.GPX.parseLink_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'link', 'localName should be link');
var values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
@@ -109,7 +117,7 @@ ol.format.GPX.parseLink_ = function(node, objectStack) {
* @private
*/
ol.format.GPX.parseExtensions_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'extensions',
'localName should be extensions');
@@ -124,7 +132,7 @@ ol.format.GPX.parseExtensions_ = function(node, objectStack) {
* @private
*/
ol.format.GPX.parseRtePt_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'rtept', 'localName should be rtept');
var values = ol.xml.pushParseAndPop(
@@ -144,7 +152,7 @@ ol.format.GPX.parseRtePt_ = function(node, objectStack) {
* @private
*/
ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'trkpt', 'localName should be trkpt');
var values = ol.xml.pushParseAndPop(
@@ -164,7 +172,7 @@ ol.format.GPX.parseTrkPt_ = function(node, objectStack) {
* @private
*/
ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'trkseg',
'localName should be trkseg');
@@ -184,7 +192,7 @@ ol.format.GPX.parseTrkSeg_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Track.
*/
ol.format.GPX.readRte_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'rte', 'localName should be rte');
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
@@ -213,7 +221,7 @@ ol.format.GPX.readRte_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Track.
*/
ol.format.GPX.readTrk_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'trk', 'localName should be trk');
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
@@ -246,7 +254,7 @@ ol.format.GPX.readTrk_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Waypoint.
*/
ol.format.GPX.readWpt_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'wpt', 'localName should be wpt');
var options = /** @type {olx.format.ReadOptions} */ (objectStack[0]);
@@ -279,7 +287,7 @@ ol.format.GPX.FEATURE_READER_ = {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GPX.GPX_PARSERS_ = ol.xml.makeStructureNS(
@@ -292,7 +300,7 @@ ol.format.GPX.GPX_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GPX.LINK_PARSERS_ = ol.xml.makeStructureNS(
@@ -306,7 +314,7 @@ ol.format.GPX.LINK_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GPX.RTE_PARSERS_ = ol.xml.makeStructureNS(
@@ -326,7 +334,7 @@ ol.format.GPX.RTE_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GPX.RTEPT_PARSERS_ = ol.xml.makeStructureNS(
@@ -338,7 +346,7 @@ ol.format.GPX.RTEPT_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GPX.TRK_PARSERS_ = ol.xml.makeStructureNS(
@@ -358,7 +366,7 @@ ol.format.GPX.TRK_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GPX.TRKSEG_PARSERS_ = ol.xml.makeStructureNS(
@@ -369,7 +377,7 @@ ol.format.GPX.TRKSEG_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GPX.TRKPT_PARSERS_ = ol.xml.makeStructureNS(
@@ -381,7 +389,7 @@ ol.format.GPX.TRKPT_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.GPX.WPT_PARSERS_ = ol.xml.makeStructureNS(
@@ -432,6 +440,8 @@ ol.format.GPX.prototype.handleReadExtensions_ = function(features) {
/**
* Read the first feature from a GPX source.
* Routes (`<rte>`) are converted into LineString geometries, and tracks (`<trk>`)
* into MultiLineString. Any properties on route and track waypoints are ignored.
*
* @function
* @param {Document|Node|Object|string} source Source.
@@ -446,7 +456,7 @@ ol.format.GPX.prototype.readFeature;
* @inheritDoc
*/
ol.format.GPX.prototype.readFeatureFromNode = function(node, opt_options) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
return null;
@@ -466,6 +476,8 @@ ol.format.GPX.prototype.readFeatureFromNode = function(node, opt_options) {
/**
* Read all features from a GPX source.
* Routes (`<rte>`) are converted into LineString geometries, and tracks (`<trk>`)
* into MultiLineString. Any properties on route and track waypoints are ignored.
*
* @function
* @param {Document|Node|Object|string} source Source.
@@ -480,7 +492,7 @@ ol.format.GPX.prototype.readFeatures;
* @inheritDoc
*/
ol.format.GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.GPX.NAMESPACE_URIS_, node.namespaceURI)) {
return [];
@@ -526,7 +538,7 @@ ol.format.GPX.writeLink_ = function(node, value, objectStack) {
properties['linkText'],
properties['linkType']
];
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */ ({node: node}),
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */ ({node: node}),
ol.format.GPX.LINK_SERIALIZERS_, ol.xml.OBJECT_PROPERTY_NODE_FACTORY,
link, objectStack, ol.format.GPX.LINK_SEQUENCE_);
};
@@ -569,9 +581,11 @@ ol.format.GPX.writeWptType_ = function(node, coordinate, objectStack) {
default:
// pass
}
var orderedKeys = ol.format.GPX.WPT_TYPE_SEQUENCE_[namespaceURI];
var orderedKeys = (node.nodeName == 'rtept') ?
ol.format.GPX.RTEPT_TYPE_SEQUENCE_[namespaceURI] :
ol.format.GPX.WPT_TYPE_SEQUENCE_[namespaceURI];
var values = ol.xml.makeSequence(properties, orderedKeys);
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
({node: node, 'properties': properties}),
ol.format.GPX.WPT_TYPE_SERIALIZERS_, ol.xml.OBJECT_PROPERTY_NODE_FACTORY,
values, objectStack, orderedKeys);
@@ -615,7 +629,7 @@ ol.format.GPX.writeRte_ = function(node, feature, objectStack) {
ol.format.GPX.writeTrk_ = function(node, feature, objectStack) {
var options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
var properties = feature.getProperties();
/** @type {ol.xmlNodeStackItem} */
/** @type {ol.XmlNodeStackItem} */
var context = {node: node, 'properties': properties};
var geometry = feature.getGeometry();
if (geometry) {
@@ -641,7 +655,7 @@ ol.format.GPX.writeTrk_ = function(node, feature, objectStack) {
* @private
*/
ol.format.GPX.writeTrkSeg_ = function(node, lineString, objectStack) {
/** @type {ol.xmlNodeStackItem} */
/** @type {ol.XmlNodeStackItem} */
var context = {node: node, 'geometryLayout': lineString.getLayout(),
'properties': {}};
ol.xml.pushSerializeAndPop(context,
@@ -682,7 +696,7 @@ ol.format.GPX.LINK_SEQUENCE_ = ['text', 'type'];
/**
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.GPX.LINK_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -705,7 +719,7 @@ ol.format.GPX.RTE_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.GPX.RTE_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -723,6 +737,17 @@ ol.format.GPX.RTE_SERIALIZERS_ = ol.xml.makeStructureNS(
});
/**
* @const
* @type {Object.<string, Array.<string>>}
* @private
*/
ol.format.GPX.RTEPT_TYPE_SEQUENCE_ = ol.xml.makeStructureNS(
ol.format.GPX.NAMESPACE_URIS_, [
'ele', 'time'
]);
/**
* @const
* @type {Object.<string, Array.<string>>}
@@ -736,7 +761,7 @@ ol.format.GPX.TRK_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.GPX.TRK_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -764,7 +789,7 @@ ol.format.GPX.TRKSEG_NODE_FACTORY_ = ol.xml.makeSimpleNodeFactory('trkpt');
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.GPX.TRKSEG_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -787,7 +812,7 @@ ol.format.GPX.WPT_TYPE_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.GPX.WPT_TYPE_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -855,7 +880,7 @@ ol.format.GPX.GPX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.GPX.GPX_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -894,8 +919,15 @@ ol.format.GPX.prototype.writeFeaturesNode = function(features, opt_options) {
opt_options = this.adaptOptions(opt_options);
//FIXME Serialize metadata
var gpx = ol.xml.createElementNS('http://www.topografix.com/GPX/1/1', 'gpx');
var xmlnsUri = 'http://www.w3.org/2000/xmlns/';
var xmlSchemaInstanceUri = 'http://www.w3.org/2001/XMLSchema-instance';
ol.xml.setAttributeNS(gpx, xmlnsUri, 'xmlns:xsi', xmlSchemaInstanceUri);
ol.xml.setAttributeNS(gpx, xmlSchemaInstanceUri, 'xsi:schemaLocation',
ol.format.GPX.SCHEMA_LOCATION_);
gpx.setAttribute('version', '1.1');
gpx.setAttribute('creator', 'OpenLayers 3');
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
({node: gpx}), ol.format.GPX.GPX_SERIALIZERS_,
ol.format.GPX.GPX_NODE_FACTORY_, features, [opt_options]);
return gpx;

View File

@@ -1,5 +1,4 @@
goog.provide('ol.format.IGC');
goog.provide('ol.format.IGCZ');
goog.require('goog.asserts');
goog.require('ol.Feature');
@@ -13,7 +12,6 @@ goog.require('ol.proj');
/**
* IGC altitude/z. One of 'barometric', 'gps', 'none'.
* @enum {string}
* @api
*/
ol.format.IGCZ = {
BAROMETRIC: 'barometric',
@@ -35,7 +33,7 @@ ol.format.IGC = function(opt_options) {
var options = opt_options ? opt_options : {};
goog.base(this);
ol.format.TextFeature.call(this);
/**
* @inheritDoc
@@ -50,7 +48,7 @@ ol.format.IGC = function(opt_options) {
options.altitudeMode : ol.format.IGCZ.NONE;
};
goog.inherits(ol.format.IGC, ol.format.TextFeature);
ol.inherits(ol.format.IGC, ol.format.TextFeature);
/**
@@ -128,6 +126,7 @@ ol.format.IGC.prototype.readFeatureFromText = function(text, opt_options) {
var year = 2000;
var month = 0;
var day = 1;
var lastDateTime = -1;
var i, ii;
for (i = 0, ii = lines.length; i < ii; ++i) {
var line = lines[i];
@@ -160,7 +159,12 @@ ol.format.IGC.prototype.readFeatureFromText = function(text, opt_options) {
flatCoordinates.push(z);
}
var dateTime = Date.UTC(year, month, day, hour, minute, second);
// Detect UTC midnight wrap around.
if (dateTime < lastDateTime) {
dateTime = Date.UTC(year, month, day + 1, hour, minute, second);
}
flatCoordinates.push(dateTime / 1000);
lastDateTime = dateTime;
}
} else if (line.charAt(0) == 'H') {
m = ol.format.IGC.HFDTE_RECORD_RE_.exec(line);
@@ -172,7 +176,6 @@ ol.format.IGC.prototype.readFeatureFromText = function(text, opt_options) {
m = ol.format.IGC.H_RECORD_RE_.exec(line);
if (m) {
properties[m[1]] = m[2].trim();
m = ol.format.IGC.HFDTE_RECORD_RE_.exec(line);
}
}
}

View File

@@ -15,9 +15,9 @@ goog.require('ol.format.FormatType');
* @extends {ol.format.Feature}
*/
ol.format.JSONFeature = function() {
goog.base(this);
ol.format.Feature.call(this);
};
goog.inherits(ol.format.JSONFeature, ol.format.Feature);
ol.inherits(ol.format.JSONFeature, ol.format.Feature);
/**

View File

@@ -7,7 +7,6 @@ goog.provide('ol.format.KML');
goog.require('goog.Uri');
goog.require('goog.asserts');
goog.require('goog.dom.NodeType');
goog.require('goog.object');
goog.require('ol');
goog.require('ol.Feature');
@@ -54,7 +53,7 @@ ol.format.KML = function(opt_options) {
var options = opt_options ? opt_options : {};
goog.base(this);
ol.format.XMLFeature.call(this);
/**
* @inheritDoc
@@ -96,7 +95,7 @@ ol.format.KML = function(opt_options) {
options.showPointNames : true;
};
goog.inherits(ol.format.KML, ol.format.XMLFeature);
ol.inherits(ol.format.KML, ol.format.XMLFeature);
/**
@@ -561,7 +560,7 @@ ol.format.KML.readStyleMapValue_ = function(node, objectStack) {
* @private
*/
ol.format.KML.IconStyleParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be an ELEMENT');
goog.asserts.assert(node.localName == 'IconStyle',
'localName should be IconStyle');
@@ -662,7 +661,7 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LabelStyle',
'localName should be LabelStyle');
@@ -693,7 +692,7 @@ ol.format.KML.LabelStyleParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.LineStyleParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LineStyle',
'localName should be LineStyle');
@@ -725,7 +724,7 @@ ol.format.KML.LineStyleParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'PolyStyle',
'localName should be PolyStyle');
@@ -762,7 +761,7 @@ ol.format.KML.PolyStyleParser_ = function(node, objectStack) {
* @return {Array.<number>} LinearRing flat coordinates.
*/
ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LinearRing',
'localName should be LinearRing');
@@ -777,7 +776,7 @@ ol.format.KML.readFlatLinearRing_ = function(node, objectStack) {
* @private
*/
ol.format.KML.gxCoordParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(ol.array.includes(
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
@@ -810,7 +809,7 @@ ol.format.KML.gxCoordParser_ = function(node, objectStack) {
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
*/
ol.format.KML.readGxMultiTrack_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(ol.array.includes(
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
@@ -835,7 +834,7 @@ ol.format.KML.readGxMultiTrack_ = function(node, objectStack) {
* @return {ol.geom.LineString|undefined} LineString.
*/
ol.format.KML.readGxTrack_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(ol.array.includes(
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
@@ -872,7 +871,7 @@ ol.format.KML.readGxTrack_ = function(node, objectStack) {
* @return {Object} Icon object.
*/
ol.format.KML.readIcon_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Icon', 'localName should be Icon');
var iconObject = ol.xml.pushParseAndPop(
@@ -892,7 +891,7 @@ ol.format.KML.readIcon_ = function(node, objectStack) {
* @return {Array.<number>} Flat coordinates.
*/
ol.format.KML.readFlatCoordinatesFromNode_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
return ol.xml.pushParseAndPop(null,
ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack);
@@ -906,7 +905,7 @@ ol.format.KML.readFlatCoordinatesFromNode_ = function(node, objectStack) {
* @return {ol.geom.LineString|undefined} LineString.
*/
ol.format.KML.readLineString_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LineString',
'localName should be LineString');
@@ -933,7 +932,7 @@ ol.format.KML.readLineString_ = function(node, objectStack) {
* @return {ol.geom.Polygon|undefined} Polygon.
*/
ol.format.KML.readLinearRing_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'LinearRing',
'localName should be LinearRing');
@@ -961,7 +960,7 @@ ol.format.KML.readLinearRing_ = function(node, objectStack) {
* @return {ol.geom.Geometry} Geometry.
*/
ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'MultiGeometry',
'localName should be MultiGeometry');
@@ -1033,7 +1032,7 @@ ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
* @return {ol.geom.Point|undefined} Point.
*/
ol.format.KML.readPoint_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Point', 'localName should be Point');
var properties = ol.xml.pushParseAndPop({},
@@ -1061,7 +1060,7 @@ ol.format.KML.readPoint_ = function(node, objectStack) {
* @return {ol.geom.Polygon|undefined} Polygon.
*/
ol.format.KML.readPolygon_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Polygon',
'localName should be Polygon');
@@ -1096,7 +1095,7 @@ ol.format.KML.readPolygon_ = function(node, objectStack) {
* @return {Array.<ol.style.Style>} Style.
*/
ol.format.KML.readStyle_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Style', 'localName should be Style');
var styleObject = ol.xml.pushParseAndPop(
@@ -1172,7 +1171,7 @@ ol.format.KML.setCommonGeometryProperties_ = function(multiGeometry,
* @private
*/
ol.format.KML.DataParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Data', 'localName should be Data');
var name = node.getAttribute('name');
@@ -1196,7 +1195,7 @@ ol.format.KML.DataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'ExtendedData',
'localName should be ExtendedData');
@@ -1210,7 +1209,7 @@ ol.format.KML.ExtendedDataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.PairDataParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Pair', 'localName should be Pair');
var pairObject = ol.xml.pushParseAndPop(
@@ -1241,7 +1240,7 @@ ol.format.KML.PairDataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'StyleMap',
'localName should be StyleMap');
@@ -1268,7 +1267,7 @@ ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'SchemaData',
'localName should be SchemaData');
@@ -1282,7 +1281,7 @@ ol.format.KML.SchemaDataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'SimpleData',
'localName should be SimpleData');
@@ -1302,7 +1301,7 @@ ol.format.KML.SimpleDataParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'innerBoundaryIs',
'localName should be innerBoundaryIs');
@@ -1327,7 +1326,7 @@ ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'outerBoundaryIs',
'localName should be outerBoundaryIs');
@@ -1352,7 +1351,7 @@ ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.LinkParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Link', 'localName should be Link');
ol.xml.parseNode(ol.format.KML.LINK_PARSERS_, node, objectStack);
@@ -1365,7 +1364,7 @@ ol.format.KML.LinkParser_ = function(node, objectStack) {
* @private
*/
ol.format.KML.whenParser_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'when', 'localName should be when');
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
@@ -1401,7 +1400,7 @@ ol.format.KML.whenParser_ = function(node, objectStack) {
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.DATA_PARSERS_ = ol.xml.makeStructureNS(
@@ -1412,7 +1411,7 @@ ol.format.KML.DATA_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.EXTENDED_DATA_PARSERS_ = ol.xml.makeStructureNS(
@@ -1424,7 +1423,7 @@ ol.format.KML.EXTENDED_DATA_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_ = ol.xml.makeStructureNS(
@@ -1436,7 +1435,7 @@ ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.FLAT_LINEAR_RING_PARSERS_ = ol.xml.makeStructureNS(
@@ -1447,7 +1446,7 @@ ol.format.KML.FLAT_LINEAR_RING_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.FLAT_LINEAR_RINGS_PARSERS_ = ol.xml.makeStructureNS(
@@ -1459,7 +1458,7 @@ ol.format.KML.FLAT_LINEAR_RINGS_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.GX_TRACK_PARSERS_ = ol.xml.makeStructureNS(
@@ -1473,7 +1472,7 @@ ol.format.KML.GX_TRACK_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_ = ol.xml.makeStructureNS(
@@ -1484,7 +1483,7 @@ ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.ICON_PARSERS_ = ol.xml.makeStructureNS(
@@ -1501,7 +1500,7 @@ ol.format.KML.ICON_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.ICON_STYLE_PARSERS_ = ol.xml.makeStructureNS(
@@ -1515,7 +1514,7 @@ ol.format.KML.ICON_STYLE_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.INNER_BOUNDARY_IS_PARSERS_ = ol.xml.makeStructureNS(
@@ -1526,7 +1525,7 @@ ol.format.KML.INNER_BOUNDARY_IS_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.LABEL_STYLE_PARSERS_ = ol.xml.makeStructureNS(
@@ -1538,7 +1537,7 @@ ol.format.KML.LABEL_STYLE_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.LINE_STYLE_PARSERS_ = ol.xml.makeStructureNS(
@@ -1550,7 +1549,7 @@ ol.format.KML.LINE_STYLE_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.MULTI_GEOMETRY_PARSERS_ = ol.xml.makeStructureNS(
@@ -1565,7 +1564,7 @@ ol.format.KML.MULTI_GEOMETRY_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.GX_MULTITRACK_GEOMETRY_PARSERS_ = ol.xml.makeStructureNS(
@@ -1576,7 +1575,7 @@ ol.format.KML.GX_MULTITRACK_GEOMETRY_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.NETWORK_LINK_PARSERS_ = ol.xml.makeStructureNS(
@@ -1594,7 +1593,7 @@ ol.format.KML.NETWORK_LINK_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.LINK_PARSERS_ = ol.xml.makeStructureNS(
@@ -1605,7 +1604,7 @@ ol.format.KML.LINK_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.OUTER_BOUNDARY_IS_PARSERS_ = ol.xml.makeStructureNS(
@@ -1616,7 +1615,7 @@ ol.format.KML.OUTER_BOUNDARY_IS_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.PAIR_PARSERS_ = ol.xml.makeStructureNS(
@@ -1629,7 +1628,7 @@ ol.format.KML.PAIR_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.PLACEMARK_PARSERS_ = ol.xml.makeStructureNS(
@@ -1666,7 +1665,7 @@ ol.format.KML.PLACEMARK_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.POLY_STYLE_PARSERS_ = ol.xml.makeStructureNS(
@@ -1679,7 +1678,7 @@ ol.format.KML.POLY_STYLE_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.SCHEMA_DATA_PARSERS_ = ol.xml.makeStructureNS(
@@ -1690,7 +1689,7 @@ ol.format.KML.SCHEMA_DATA_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.STYLE_PARSERS_ = ol.xml.makeStructureNS(
@@ -1704,7 +1703,7 @@ ol.format.KML.STYLE_PARSERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlParser>>}
* @type {Object.<string, Object.<string, ol.XmlParser>>}
* @private
*/
ol.format.KML.STYLE_MAP_PARSERS_ = ol.xml.makeStructureNS(
@@ -1728,7 +1727,7 @@ ol.format.KML.prototype.getExtensions = function() {
* @return {Array.<ol.Feature>|undefined} Features.
*/
ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
var localName = node.localName;
goog.asserts.assert(localName == 'Document' || localName == 'Folder',
@@ -1759,7 +1758,7 @@ ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
* @return {ol.Feature|undefined} Feature.
*/
ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Placemark',
'localName should be Placemark');
@@ -1806,7 +1805,7 @@ ol.format.KML.prototype.readPlacemark_ = function(node, objectStack) {
* @private
*/
ol.format.KML.prototype.readSharedStyle_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'Style', 'localName should be Style');
var id = node.getAttribute('id');
@@ -1831,7 +1830,7 @@ ol.format.KML.prototype.readSharedStyle_ = function(node, objectStack) {
* @private
*/
ol.format.KML.prototype.readSharedStyleMap_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
goog.asserts.assert(node.localName == 'StyleMap',
'localName should be StyleMap');
@@ -1871,7 +1870,7 @@ ol.format.KML.prototype.readFeature;
* @inheritDoc
*/
ol.format.KML.prototype.readFeatureFromNode = function(node, opt_options) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
return null;
@@ -1906,7 +1905,7 @@ ol.format.KML.prototype.readFeatures;
* @inheritDoc
*/
ol.format.KML.prototype.readFeaturesFromNode = function(node, opt_options) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
goog.asserts.assert(node.nodeType == Node.ELEMENT_NODE,
'node.nodeType should be ELEMENT');
if (!ol.array.includes(ol.format.KML.NAMESPACE_URIS_, node.namespaceURI)) {
return [];
@@ -1974,7 +1973,7 @@ ol.format.KML.prototype.readName = function(source) {
ol.format.KML.prototype.readNameFromDocument = function(doc) {
var n;
for (n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
if (n.nodeType == Node.ELEMENT_NODE) {
var name = this.readNameFromNode(n);
if (name) {
return name;
@@ -2046,7 +2045,7 @@ ol.format.KML.prototype.readNetworkLinks = function(source) {
ol.format.KML.prototype.readNetworkLinksFromDocument = function(doc) {
var n, networkLinks = [];
for (n = doc.firstChild; n; n = n.nextSibling) {
if (n.nodeType == goog.dom.NodeType.ELEMENT) {
if (n.nodeType == Node.ELEMENT_NODE) {
ol.array.extend(networkLinks, this.readNetworkLinksFromNode(n));
}
}
@@ -2161,7 +2160,7 @@ ol.format.KML.writeCoordinatesTextNode_ = function(node, coordinates, objectStac
* @private
*/
ol.format.KML.writeDocument_ = function(node, features, objectStack) {
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
ol.xml.pushSerializeAndPop(context, ol.format.KML.DOCUMENT_SERIALIZERS_,
ol.format.KML.DOCUMENT_NODE_FACTORY_, features, objectStack, undefined,
this);
@@ -2175,7 +2174,7 @@ ol.format.KML.writeDocument_ = function(node, features, objectStack) {
* @private
*/
ol.format.KML.writeIcon_ = function(node, icon, objectStack) {
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var parentNode = objectStack[objectStack.length - 1].node;
var orderedKeys = ol.format.KML.ICON_SEQUENCE_[parentNode.namespaceURI];
var values = ol.xml.makeSequence(icon, orderedKeys);
@@ -2197,7 +2196,7 @@ ol.format.KML.writeIcon_ = function(node, icon, objectStack) {
* @private
*/
ol.format.KML.writeIconStyle_ = function(node, style, objectStack) {
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var properties = {};
var src = style.getSrc();
var size = style.getSize();
@@ -2255,7 +2254,7 @@ ol.format.KML.writeIconStyle_ = function(node, style, objectStack) {
* @private
*/
ol.format.KML.writeLabelStyle_ = function(node, style, objectStack) {
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var properties = {};
var fill = style.getFill();
if (fill) {
@@ -2281,7 +2280,7 @@ ol.format.KML.writeLabelStyle_ = function(node, style, objectStack) {
* @private
*/
ol.format.KML.writeLineStyle_ = function(node, style, objectStack) {
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var properties = {
'color': style.getColor(),
'width': style.getWidth()
@@ -2308,7 +2307,7 @@ ol.format.KML.writeMultiGeometry_ = function(node, geometry, objectStack) {
(geometry instanceof ol.geom.MultiPolygon),
'geometry should be one of: ol.geom.GeometryCollection, ' +
'ol.geom.MultiPoint, ol.geom.MultiLineString or ol.geom.MultiPolygon');
/** @type {ol.xmlNodeStackItem} */
/** @type {ol.XmlNodeStackItem} */
var context = {node: node};
var type = geometry.getType();
/** @type {Array.<ol.geom.Geometry>} */
@@ -2346,7 +2345,7 @@ ol.format.KML.writeMultiGeometry_ = function(node, geometry, objectStack) {
* @private
*/
ol.format.KML.writeBoundaryIs_ = function(node, linearRing, objectStack) {
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
ol.xml.pushSerializeAndPop(context,
ol.format.KML.BOUNDARY_IS_SERIALIZERS_,
ol.format.KML.LINEAR_RING_NODE_FACTORY_, [linearRing], objectStack);
@@ -2363,7 +2362,7 @@ ol.format.KML.writeBoundaryIs_ = function(node, linearRing, objectStack) {
* @private
*/
ol.format.KML.writePlacemark_ = function(node, feature, objectStack) {
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
// set id
if (feature.getId()) {
@@ -2421,7 +2420,7 @@ ol.format.KML.writePrimitiveGeometry_ = function(node, geometry, objectStack) {
'geometry should be one of ol.geom.Point, ol.geom.LineString ' +
'or ol.geom.LinearRing');
var flatCoordinates = geometry.getFlatCoordinates();
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
context['layout'] = geometry.getLayout();
context['stride'] = geometry.getStride();
ol.xml.pushSerializeAndPop(context,
@@ -2444,7 +2443,7 @@ ol.format.KML.writePolygon_ = function(node, polygon, objectStack) {
goog.asserts.assert(linearRings.length > 0,
'linearRings should not be empty');
var outerRing = linearRings.shift();
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
// inner rings
ol.xml.pushSerializeAndPop(context,
ol.format.KML.POLYGON_SERIALIZERS_,
@@ -2465,7 +2464,7 @@ ol.format.KML.writePolygon_ = function(node, polygon, objectStack) {
* @private
*/
ol.format.KML.writePolyStyle_ = function(node, style, objectStack) {
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
ol.xml.pushSerializeAndPop(context, ol.format.KML.POLY_STYLE_SERIALIZERS_,
ol.format.KML.COLOR_NODE_FACTORY_, [style.getColor()], objectStack);
};
@@ -2490,7 +2489,7 @@ ol.format.KML.writeScaleTextNode_ = function(node, scale) {
* @private
*/
ol.format.KML.writeStyle_ = function(node, style, objectStack) {
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
var /** @type {ol.XmlNodeStackItem} */ context = {node: node};
var properties = {};
var fillStyle = style.getFill();
var strokeStyle = style.getStroke();
@@ -2542,7 +2541,7 @@ ol.format.KML.KML_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.KML.KML_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2554,7 +2553,7 @@ ol.format.KML.KML_SERIALIZERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.KML.DOCUMENT_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2596,7 +2595,7 @@ ol.format.KML.ICON_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.KML.ICON_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2624,7 +2623,7 @@ ol.format.KML.ICON_STYLE_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.KML.ICON_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2649,7 +2648,7 @@ ol.format.KML.LABEL_STYLE_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.KML.LABEL_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2672,7 +2671,7 @@ ol.format.KML.LINE_STYLE_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.KML.LINE_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2684,7 +2683,7 @@ ol.format.KML.LINE_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.KML.BOUNDARY_IS_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2696,7 +2695,7 @@ ol.format.KML.BOUNDARY_IS_SERIALIZERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.KML.MULTI_GEOMETRY_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2725,7 +2724,7 @@ ol.format.KML.PLACEMARK_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.KML.PLACEMARK_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2755,7 +2754,7 @@ ol.format.KML.PLACEMARK_SERIALIZERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.KML.PRIMITIVE_GEOMETRY_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2767,7 +2766,7 @@ ol.format.KML.PRIMITIVE_GEOMETRY_SERIALIZERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.KML.POLYGON_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2781,7 +2780,7 @@ ol.format.KML.POLYGON_SERIALIZERS_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.KML.POLY_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2803,7 +2802,7 @@ ol.format.KML.STYLE_SEQUENCE_ = ol.xml.makeStructureNS(
/**
* @const
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
* @type {Object.<string, Object.<string, ol.XmlSerializer>>}
* @private
*/
ol.format.KML.STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
@@ -2982,7 +2981,7 @@ ol.format.KML.prototype.writeFeaturesNode = function(features, opt_options) {
ol.xml.setAttributeNS(kml, xmlSchemaInstanceUri, 'xsi:schemaLocation',
ol.format.KML.SCHEMA_LOCATION_);
var /** @type {ol.xmlNodeStackItem} */ context = {node: kml};
var /** @type {ol.XmlNodeStackItem} */ context = {node: kml};
var properties = {};
if (features.length > 1) {
properties['Document'] = features;

Some files were not shown because too many files have changed in this diff Show More