Compare commits

...

353 Commits

Author SHA1 Message Date
Frederic Junod
9a57c8745e Update package version to 3.15.0 2016-04-04 10:40:12 +02:00
Frederic Junod
84401c132f Changelog for v3.15.0 2016-04-04 10:40:12 +02:00
Nicholas Latham
2ee1969de7 Remove goog.math.modulo and goog.math.lerp 2016-04-04 09:43:24 +02:00
Frédéric Junod
19fd3d6987 Merge pull request #5152 from fredj/cartodb_cleanup
Cartodb cleanup
2016-04-04 09:38:41 +02:00
Frédéric Junod
4b14c86fd1 Merge pull request #4804 from fredj/rm_goog.isArray
Use Array.isArray instead of goog.isArray
2016-04-04 09:25:41 +02:00
Andreas Hocevar
c535cf04e2 Merge pull request #5149 from ahocevar/batch-polygon-fill-stroke
Batch polygon fill and stroke instructions
2016-04-04 09:17:52 +02:00
Frederic Junod
80e984a9c3 Use Array.isArray instead of goog.isArray 2016-04-04 09:06:29 +02:00
Andreas Hocevar
fb4992b580 Merge pull request #5159 from openlayers/greenkeeper-eslint-2.6.0
Update eslint to version 2.6.0 🚀
2016-04-02 10:47:25 +02:00
Andreas Hocevar
4141572725 Merge pull request #5160 from openlayers/greenkeeper-clean-css-3.4.11
Update clean-css to version 3.4.11 🚀
2016-04-02 10:46:17 +02:00
greenkeeperio-bot
02f4f8b1d5 chore(package): update clean-css to version 3.4.11
http://greenkeeper.io/
2016-04-01 14:52:42 -06:00
greenkeeperio-bot
0dc7313afb chore(package): update eslint to version 2.6.0
http://greenkeeper.io/
2016-04-01 12:14:37 -06:00
Andreas Hocevar
3ba2d71784 Merge pull request #5157 from probins/measure
Improve docs for measure example
2016-04-01 17:49:29 +02:00
Peter Robins
3416991166 Improve docs for measure example 2016-04-01 13:39:06 +00:00
Frédéric Junod
106657572d Merge pull request #5155 from fredj/ff_zoomify_tests
Fix ol.source.Zoomify tests on firefox
2016-04-01 14:15:51 +02:00
Frederic Junod
c9aff61110 Fix ol.source.Zoomify tests on firefox 2016-04-01 13:36:43 +02:00
Frederic Junod
e222409f50 Add externs for CartoDB response 2016-04-01 10:55:38 +02:00
Frederic Junod
b96de85044 Add cacheSize option to olx.source.CartoDBOptions 2016-04-01 10:44:31 +02:00
Frederic Junod
3f0de09dd7 Fix ol.source.CartoDB goog.base params 2016-04-01 10:44:31 +02:00
Frederic Junod
13a0eb4ca7 Add jsdoc tags in ol.source.CartoDB constructor 2016-04-01 10:44:31 +02:00
Frederic Junod
fb6353a816 Fix olx.source.CartoDBOptions definition 2016-04-01 10:44:31 +02:00
Frederic Junod
24665747b3 Fix cartodb links 2016-04-01 10:44:31 +02:00
Frederic Junod
c2749bbdd1 Fix olx.source.CartoDBOptions#attributions type 2016-04-01 10:44:31 +02:00
Marc Jansen
4077886165 Merge pull request #5086 from bjornharrtell/rm_goog.functions
Get rid of goog.functions
2016-04-01 10:44:03 +02:00
Björn Harrtell
44e04be67f Get rid of goog.functions 2016-04-01 10:32:15 +02:00
Frédéric Junod
baf5287ad2 Merge pull request #5105 from fredj/stamen_minZoom
Support minZoom in ol.source.Stamen
2016-04-01 09:56:20 +02:00
Frederic Junod
548e4abd35 Support minZoom in ol.source.Stamen 2016-04-01 09:46:36 +02:00
Tim Schaub
cc9d4d8794 Merge pull request #4926 from aisaacs/cartodb
Add CartoDB tile source.
2016-03-31 17:35:54 -07:00
Andreas Hocevar
ee53fd772d Remove unnecessary duplicated polygon close points 2016-03-31 14:47:07 +02:00
Andreas Hocevar
18f3d7243d Batch polygon fill and stroke instructions 2016-03-31 13:26:42 +02:00
Marc Jansen
dfc1bb7592 Merge pull request #5151 from marcjansen/fse-fs
Use fs-extra as fs, remove usage of graceful-fs
2016-03-31 11:34:39 +02:00
Marc Jansen
5a00289e8e Remove usage of graceful-fs 2016-03-31 10:30:58 +02:00
Marc Jansen
d3de8c38b5 Use fs-extra as fs 2016-03-31 10:30:58 +02:00
Andreas Hocevar
627632ce1b Merge pull request #5124 from nicholas-l/removeDOMClassList
Removed goog.dom.classlist
2016-03-31 10:25:05 +02:00
Frédéric Junod
c3447873b6 Merge pull request #5150 from fredj/rm_wrench
Use fs-extra instead of wrench
2016-03-31 10:10:36 +02:00
Frederic Junod
03d78cdd1c Use removeSync function from fs-extra 2016-03-31 09:52:26 +02:00
Frederic Junod
19b0c65e4c Use fs-extra instead of wrench 2016-03-31 09:27:56 +02:00
nicholas
4d26305564 Add polyfill for IE 2016-03-31 19:25:42 +13:00
nicholas
863589e5ed Remove commented out code 2016-03-31 19:09:13 +13:00
nicholas
68fd5267c2 Removed goog.dom.classlist.enable 2016-03-31 19:09:13 +13:00
nicholas
126e49cd39 Removed goog.dom.classlist.contains 2016-03-31 19:09:13 +13:00
nicholas
b9073013db Remove goog.classlist.toggle 2016-03-31 19:09:13 +13:00
nicholas
8f8068b88c Removed goog.dom.classlist 2016-03-31 19:09:13 +13:00
Alessandro Isaacs
85f11b093d Use XHR 2016-03-30 15:05:43 -07:00
Alessandro Isaacs
4a33db370b Update example yml 2016-03-30 11:45:20 -07:00
Alessandro Isaacs
2fd6352a57 Use https always 2016-03-30 11:45:20 -07:00
Alessandro Isaacs
94998c8ec7 Update olx 2016-03-30 11:45:20 -07:00
Alessandro Isaacs
8389c16315 Add CartoDB tile source. 2016-03-30 11:45:20 -07:00
Marc Jansen
cf9e24feb1 Merge pull request #5109 from marcjansen/tileutfgridsource-tests
Add some tests for ol.source.TileUTFGrid
2016-03-30 17:49:39 +02:00
Marc Jansen
f4b4e26f19 Add some tests for ol.source.TileUTFGrid 2016-03-30 16:46:35 +02:00
Frédéric Junod
e5012856a1 Merge pull request #5139 from openlayers/greenkeeper-closure-util-1.13.0
Update closure-util to version 1.13.0 🚀
2016-03-30 14:53:55 +02:00
Frederic Junod
927d73d410 Add missing return jsdoc annotations 2016-03-30 09:02:12 +02:00
Frederic Junod
f29bc74b7f Ignore unnecessaryCasts errors 2016-03-30 09:02:12 +02:00
greenkeeperio-bot
03038b123f chore(package): update closure-util to version 1.13.0
http://greenkeeper.io/
2016-03-30 09:02:11 +02:00
Frédéric Junod
bc1b9b9677 Merge pull request #5141 from fredj/reuse_array
Reuse dragListenerKeys_ variable in ol.control.ZoomSlider
2016-03-30 08:55:56 +02:00
Frederic Junod
0bb3f1e228 Reuse dragListenerKeys_ variable in ol.control.ZoomSlider 2016-03-29 16:52:28 +02:00
Frédéric Junod
8ef230768b Merge pull request #5118 from fredj/rm_goog.dom.classlist
Remove goog.dom.classlist usage
2016-03-29 10:46:13 +02:00
Frederic Junod
64654e1e72 Remove goog.dom.classlist usage 2016-03-29 10:28:20 +02:00
Marc Jansen
ae905593b3 Merge pull request #5115 from marcjansen/line-dash-doc
Clarify that lineDash has no effect in IE 10 and below
2016-03-29 10:15:09 +02:00
Marc Jansen
09370952fd Clarify that lineDash has no effect in IE < 10 2016-03-29 09:58:41 +02:00
Frédéric Junod
9425088610 Merge pull request #5136 from openlayers/greenkeeper-eslint-2.5.3
Update eslint to version 2.5.3 🚀
2016-03-29 09:54:22 +02:00
greenkeeperio-bot
94f83b53df chore(package): update eslint to version 2.5.3
http://greenkeeper.io/
2016-03-29 09:22:58 +02:00
Frédéric Junod
b3796aa3a1 Merge pull request #5123 from openlayers/greenkeeper-coveralls-2.11.9
Update coveralls to version 2.11.9 🚀
2016-03-29 09:17:26 +02:00
greenkeeperio-bot
5276fd0580 chore(package): update coveralls to version 2.11.9
http://greenkeeper.io/
2016-03-29 09:06:01 +02:00
Frédéric Junod
2f67fca2a6 Merge pull request #5131 from openlayers/greenkeeper-phantomjs-prebuilt-2.1.7
Update phantomjs-prebuilt to version 2.1.7 🚀
2016-03-29 09:03:24 +02:00
greenkeeperio-bot
690152a07b chore(package): update phantomjs-prebuilt to version 2.1.7
http://greenkeeper.io/
2016-03-25 15:51:40 -06:00
Andreas Hocevar
feabf58740 Merge pull request #5122 from probins/patch-1
Update browser support info in intro tutorial
2016-03-25 19:14:18 +01:00
Peter Robins
8bf208558d Update browser support info in intro tutorial 2016-03-25 14:53:45 +00:00
Andreas Hocevar
d9d46bc1f7 Merge pull request #5112 from probins/decimals
Add decimals option to format write
2016-03-25 10:44:28 +01:00
Andreas Hocevar
f835364822 Merge pull request #5120 from ahocevar/utfgrid-config
Add tileJSON option to ol.source.TileUTFGrid
2016-03-24 23:13:19 +01:00
Andreas Hocevar
c0de5a6835 Add tileJSON option to ol.source.TileUTFGrid 2016-03-24 23:02:28 +01:00
Peter Robins
a18bf636f8 Add decimals option to format write 2016-03-24 17:14:02 +00:00
Frédéric Junod
2159a35bb8 Merge pull request #5119 from drnextgis/issue#5117
Add ol.source.Raster events on API docs page
2016-03-24 17:41:19 +01:00
drnextgis
f9a16898a5 Add ol.source.Raster events on API docs page 2016-03-24 22:25:48 +06:00
Andreas Hocevar
35ac1c4577 Merge pull request #5116 from ahocevar/responsive-examples
Improve examples pages on mobile devices a bit
2016-03-24 15:51:01 +01:00
Andreas Hocevar
26ed4c33a3 Improve examples pages on mobile devices a bit
Only show navigation when there is enough space.
2016-03-24 15:12:04 +01:00
Andreas Hocevar
3e5e271331 Merge pull request #5113 from AvatharDG/patch-1
Memory leak in ol.control.FullScreen
2016-03-24 11:09:04 +01:00
AvatharDG
e752a8cea3 Update fullscreencontrol.js 2016-03-24 09:41:01 +01:00
AvatharDG
290f8b5c7d Update fullscreencontrol.js 2016-03-24 09:39:31 +01:00
AvatharDG
c9cb9b6d36 Memory leak in ol.control.FullScreen
Register and unregister listener in setMap method.
2016-03-24 09:35:10 +01:00
Frédéric Junod
ce61fb300c Merge pull request #5111 from fredj/examples_cleanup
Remove CSS filter in examples
2016-03-23 17:18:26 +01:00
Frederic Junod
92ef1724d1 Remove CSS filter in examples
Was used to set the opacity for IE <= 8
2016-03-23 17:01:12 +01:00
Frédéric Junod
fe5219eb84 Merge pull request #5108 from fredj/rm_ol.xml.getAttributeNodeNS
Remove unused ol.xml.getAttributeNodeNS function
2016-03-23 15:39:37 +01:00
Frederic Junod
e9cf0bbf6e Remove unused ol.xml.getAttributeNodeNS function 2016-03-23 14:45:06 +01:00
Frédéric Junod
051ed439ca Merge pull request #5106 from fredj/rm_goog.math.Vec2
Get rid of goog.math.Vec2
2016-03-23 14:41:38 +01:00
Frederic Junod
e126df11e7 Remove use of goog.math.Vec2 2016-03-23 14:16:20 +01:00
Marc Jansen
e742181fe9 Merge pull request #5096 from marcjansen/zoomify-tests
Add tests for ol.source.Zoomify
2016-03-23 09:40:46 +01:00
Marc Jansen
399d8ce326 Add tests for ol.source.Zoomify 2016-03-23 09:22:17 +01:00
Marc Jansen
9fc2f5c19f Merge pull request #5102 from openlayers/jsonp-typo
Fix typo in API docs
2016-03-23 09:19:32 +01:00
Marc Jansen
0554c7f685 Fix typo in API docs 2016-03-23 09:11:10 +01:00
Andreas Hocevar
587817af94 Merge pull request #5098 from bjornharrtell/gl-log
Reintroduce log messages for relevant WebGL assertions
2016-03-22 17:54:44 +01:00
Björn Harrtell
a2a3ca84e2 Reintroduce log messages for relevant WebGL assertions 2016-03-22 16:35:46 +01:00
Andreas Hocevar
1634aaa9dd Merge pull request #5094 from probins/patch-2
FAQ: answer question 4
2016-03-22 14:53:28 +01:00
Peter Robins
f35887d6e7 FAQ: answer question 4 2016-03-22 13:17:44 +00:00
Frédéric Junod
14bed81994 Merge pull request #5092 from drnextgis/issue#5091
add raster.jsdoc
2016-03-22 09:55:35 +01:00
drnextgis
e00149562a add raster.jsdoc 2016-03-22 14:07:31 +06:00
Andreas Hocevar
0f86b1df69 Merge pull request #5081 from drnextgis/issue#3850
Snap to vertices or edges
2016-03-21 22:52:08 +01:00
Andreas Hocevar
5001f0896e Merge pull request #5090 from probins/patch-1
Update custom-builds.md
2016-03-21 17:56:18 +01:00
Andreas Hocevar
579ce6c5ad Merge pull request #5089 from probins/point
Test for both transform coords should use roughlyEqual
2016-03-21 16:53:03 +01:00
Peter Robins
4e3d6bd556 Update custom-builds.md 2016-03-21 14:37:40 +00:00
Peter Robins
caf3e4b062 Test for both transform coords should use roughlyEqual 2016-03-21 14:21:56 +00:00
Andreas Hocevar
cf6baf2cd1 Merge pull request #5080 from probins/geomcoll
Fix geojson write GeometryCollection
2016-03-21 13:28:46 +01:00
Peter Robins
e65c522cb4 Fix geojson write GeometryCollection 2016-03-21 12:11:31 +00:00
Andreas Hocevar
1e8f0026eb Merge pull request #5088 from probins/patch-1
DEVELOPING.md: remove section on running Travis on fork
2016-03-21 12:09:44 +01:00
Peter Robins
bd47db8a55 DEVELOPING.md: remove section on running Travis on fork 2016-03-21 10:32:24 +00:00
drnextgis
d41bfde25d snap to vertices or edges 2016-03-21 16:19:36 +06:00
Andreas Hocevar
7990bb3bf6 Merge pull request #5087 from drnextgis/issue#2974
assertion to check that there's a DOM node for target element
2016-03-21 11:11:59 +01:00
drnextgis
c6f568f99b assertion to check that there's a DOM node for target element 2016-03-21 16:02:13 +06:00
Frédéric Junod
f380f34468 Merge pull request #5069 from openlayers/greenkeeper-jquery-2.2.2
Update jquery to version 2.2.2 🚀
2016-03-21 08:53:49 +01:00
greenkeeperio-bot
d8f7aa193c chore(package): update jquery to version 2.2.2
http://greenkeeper.io/
2016-03-21 08:44:06 +01:00
Tim Schaub
d7ad543c12 Merge pull request #5083 from tschaub/canvas-immediate
Remove unnecessary lineTo calls in immediate polygon rendering
2016-03-20 21:50:40 -06:00
Tim Schaub
8437f95c86 Merge pull request #5082 from bjornharrtell/rm_goog.log
Get rid of goog.log.
2016-03-19 20:16:06 -06:00
Tim Schaub
01d2b84ee1 Merge pull request #5079 from tschaub/word
Correcting a typo in the upgrade notes
2016-03-19 16:55:13 -06:00
Tim Schaub
cd70f58e34 Rendering tests for vector context 2016-03-19 16:45:26 -06:00
Björn Harrtell
234e8c2fde Get rid of goog.log 2016-03-19 23:12:56 +01:00
Tim Schaub
22d03cb2ee Avoid duplicate lineTo and correctly close rings 2016-03-19 16:12:38 -06:00
Andreas Hocevar
309843b53d Merge pull request #5076 from openlayers/greenkeeper-phantomjs-prebuilt-2.1.6
Update phantomjs-prebuilt to version 2.1.6 🚀
2016-03-19 19:02:32 +01:00
Tim Schaub
f0cca94456 Correcting a typo in the upgrade notes 2016-03-18 22:41:19 -06:00
Tim Schaub
a421b4fb65 Merge pull request #5077 from tschaub/more-immediate
Make immediate API uniformly synchronous.
2016-03-18 18:00:33 -06:00
Tim Schaub
ed71cf74f6 Upgrade note on zIndex for drawFeature() styles 2016-03-18 17:52:16 -06:00
Tim Schaub
0eb7e8220d Immediate rendering for all vector contexts 2016-03-18 17:31:14 -06:00
Tim Schaub
f0814628b7 Synchronous rendering only 2016-03-18 17:26:10 -06:00
Tim Schaub
ec2daf2118 Make drawFeature() immediate 2016-03-18 17:26:10 -06:00
Tim Schaub
ef0487c3ab Merge pull request #5072 from tschaub/immediate-api
Add setStyle() and drawGeometry() to the immediate rendering API.
2016-03-18 17:18:08 -06:00
Tim Schaub
42c2dd8702 More geometry 2016-03-18 17:04:50 -06:00
Tim Schaub
42f41e1cf4 Variable named geometry 2016-03-18 17:04:50 -06:00
Tim Schaub
05cf57dcfc Remove unused arg 2016-03-18 17:04:50 -06:00
Tim Schaub
51dfe89425 Add assert message 2016-03-18 17:04:49 -06:00
Tim Schaub
1339d6b3a6 Correct to upgrade notes 2016-03-18 17:04:49 -06:00
Tim Schaub
d0b2016bb6 Add setStyle() to WebGL immediate API 2016-03-18 17:04:49 -06:00
Tim Schaub
f77c7dded2 Add drawGeometry() to WebGL immediate API 2016-03-18 17:04:49 -06:00
Tim Schaub
88f8515fb6 Shorter names for drawing methods 2016-03-18 17:04:44 -06:00
Tim Schaub
2133d6d081 Document the immediate rendering API 2016-03-18 17:03:18 -06:00
Tim Schaub
ef40f66c93 Use setStyle() and drawGeometry() in examples 2016-03-18 17:03:18 -06:00
Tim Schaub
cf0c4dcf3f Add methods to base class 2016-03-18 17:03:17 -06:00
Tim Schaub
873e4176c6 Add vectorContext.drawGeometry() method 2016-03-18 17:03:17 -06:00
Tim Schaub
8f0f278832 Add vectorContext.setStyle() method 2016-03-18 17:03:17 -06:00
Andreas Hocevar
109bda60d0 Merge pull request #5074 from ahocevar/stitch-rotated-tiles
Do not rotate map canvas after composition
2016-03-18 23:29:14 +01:00
greenkeeperio-bot
3492628dc4 chore(package): update phantomjs-prebuilt to version 2.1.6
http://greenkeeper.io/
2016-03-18 16:03:52 -06:00
Andreas Hocevar
19cfc140a8 Merge pull request #5071 from drnextgis/issue#5070
correct way to determine freehand mode is enabled
2016-03-18 23:02:32 +01:00
Andreas Hocevar
577e45cd97 Do not rotate map canvas after composition
This requires to draw tile layers to an intermediate canvas again, but
only when the view is rotated.
2016-03-18 21:53:19 +01:00
drnextgis
658a2b317e correct way to determine freehand mode is enabled 2016-03-18 11:10:27 +06:00
Bart van den Eijnden
9c573a5b3c Merge pull request #5066 from bartvde/getters
Add more getters to ol.source.Vector
2016-03-17 15:58:31 +01:00
Bart van den Eijnden
908d4051cd Add more getters to ol.source.Vector 2016-03-17 15:35:51 +01:00
Marc Jansen
a81150508d Merge pull request #5064 from probins/clonedocs
Fix inconsistency in geom docs
2016-03-17 11:45:20 +01:00
Peter Robins
8f9a8e9bb1 Fix inconsistency in geom docs 2016-03-17 10:13:30 +00:00
Andreas Hocevar
5ba64024ab Merge pull request #5063 from drnextgis/issue#5062
Remove inappropriate information from API docs
2016-03-17 09:34:07 +01:00
drnextgis
f4bb232279 remove inappropriate information from API docs 2016-03-17 12:50:52 +06:00
Marc Jansen
242a0937a3 Merge pull request #5061 from drnextgis/apidoc
Remove redundant required option
2016-03-17 07:22:01 +01:00
drnextgis
a857a66a98 remove redundant required option 2016-03-17 07:19:11 +06:00
Andreas Hocevar
def755f1eb Merge pull request #5058 from probins/patch-1
Note in docs that DOM renderer can also render vectors
2016-03-16 17:34:06 +01:00
Peter Robins
6f2747cf14 Note in docs that DOM renderer can also render vectors 2016-03-16 16:30:59 +00:00
Frédéric Junod
0181e525ce Merge pull request #5056 from probins/patch-1
Note in docs that WebGL can render points
2016-03-16 17:01:22 +01:00
Peter Robins
5da0fe3300 Note in docs that WebGL can render points 2016-03-16 15:41:57 +00:00
Andreas Hocevar
2f079ad059 Merge pull request #5055 from probins/kmlscalecruft
Fix cruft on kml scale output
2016-03-16 16:34:01 +01:00
Peter Robins
9ba4208616 Fix cruft on kml scale output 2016-03-16 15:12:23 +00:00
Frédéric Junod
4b5bb42961 Merge pull request #5051 from fredj/remove_aborted_tiles
Handle aborted tiles in ol.TileQueue
2016-03-16 14:38:59 +01:00
Frederic Junod
24886f2710 Add more ol.TileQueue tests 2016-03-16 14:21:21 +01:00
Frederic Junod
c30ecace75 Handle aborted tiles in ol.TileQueue 2016-03-16 14:21:20 +01:00
Frederic Junod
b0984070db Don't load an already loading tile 2016-03-16 14:21:20 +01:00
Marc Jansen
1c57686d1f Merge pull request #5049 from marcjansen/assume-getComputedStyle
Supported browsers all have getComputedStyle
2016-03-16 11:30:06 +01:00
Marc Jansen
0d24be6767 Supported browsers all have getComputedStyle 2016-03-16 11:16:14 +01:00
Marc Jansen
074eff1efd Merge pull request #5048 from marcjansen/dom-tests
Add tests for ol.dom methods
2016-03-16 10:59:40 +01:00
Marc Jansen
648011c64d Remove unneeded and wrong goog.provide 2016-03-16 10:48:06 +01:00
Marc Jansen
37899a3feb Add tests for ol.dom methods 2016-03-16 10:48:06 +01:00
Andreas Hocevar
d46407f7b6 Merge pull request #5031 from drnextgis/zoomout
support zooming out for ol.interaction.DragZoom
2016-03-16 10:45:09 +01:00
drnextgis
7b1e92580d zooming out option for ol.interaction.DragZoom 2016-03-16 11:47:18 +06:00
Andreas Hocevar
88701db4c4 Merge pull request #5036 from ahocevar/icon-imgsize
Use imgSize when provided
2016-03-15 18:56:27 +01:00
Andreas Hocevar
339c7c5c23 Use imgSize when provided 2016-03-15 16:17:11 +01:00
Andreas Hocevar
08b19549ce Merge pull request #5020 from openlayers/greenkeeper-gaze-1.0.0
Update gaze to version 1.0.0 🚀
2016-03-15 14:58:05 +01:00
Andreas Hocevar
f58b7cf347 Merge pull request #5039 from openlayers/greenkeeper-fs-extra-0.26.6
Update fs-extra to version 0.26.6 🚀
2016-03-15 14:39:52 +01:00
Andreas Hocevar
3186a411b2 Update closure-util to compatible version 1.12.0 2016-03-15 14:28:42 +01:00
greenkeeperio-bot
10fa741476 chore(package): update fs-extra to version 0.26.6
http://greenkeeper.io/
2016-03-15 04:46:30 -07:00
Andreas Hocevar
44d0578389 Merge pull request #5033 from probins/patch-1
Document GPX geometry output types
2016-03-15 00:18:03 +01:00
Peter Robins
0a3b7e56a9 Document GPX geometry output types 2016-03-14 16:56:23 +00:00
Andreas Hocevar
9db16bfa94 Merge pull request #5024 from ahocevar/less-aggressive-canvas-resizing
Resize the map canvas less aggressively
2016-03-14 09:41:53 +01:00
Frédéric Junod
c0b27bca8f Merge pull request #5000 from fredj/rm_goog.style.setBorderBoxSize
Remove use of goog.math.Size and goog.style.setBorderBoxSize
2016-03-14 08:53:32 +01:00
Frederic Junod
93abfc9a03 Remove use of goog.style.setBorderBoxSize 2016-03-14 08:45:18 +01:00
Frederic Junod
8eb3e55aa0 Remove use of goog.math.Size 2016-03-14 08:45:18 +01:00
Bart van den Eijnden
a2175afcad Merge pull request #5027 from probins/patch-1
Clarify default value of featureProjection on geometry write
2016-03-14 08:39:02 +01:00
Peter Robins
67e511765a Clarify default value of featureProjection on write 2016-03-13 16:30:30 +00:00
Andreas Hocevar
5b21ab8811 Merge pull request #5019 from openlayers/greenkeeper-eslint-2.4.0
Update eslint to version 2.4.0 🚀
2016-03-12 16:36:52 +01:00
Andreas Hocevar
a3cc322593 Fix indentation 2016-03-12 16:25:38 +01:00
Andreas Hocevar
600c139a61 Resize the map canvas less aggressively 2016-03-12 14:13:28 +01:00
greenkeeperio-bot
6c191d0fef chore(package): update gaze to version 1.0.0
http://greenkeeper.io/
2016-03-11 21:54:46 -07:00
greenkeeperio-bot
9365fbdb7e chore(package): update eslint to version 2.4.0
http://greenkeeper.io/
2016-03-11 15:06:34 -07:00
Marc Jansen
9cc628939a Merge pull request #5016 from marcjansen/centerflatgeom-tests
Add basic tests for ol.geom.flat.center
2016-03-11 17:22:13 +01:00
Marc Jansen
410dddaa46 Add basic tests for ol.geom.flat.center 2016-03-11 13:51:10 +01:00
Andreas Hocevar
7230b83cbd Merge pull request #5015 from openlayers/greenkeeper-proj4-2.3.14
Update proj4 to version 2.3.14 🚀
2016-03-11 11:37:20 +01:00
greenkeeperio-bot
194c47d962 chore(package): update proj4 to version 2.3.14
http://greenkeeper.io/
2016-03-11 02:45:20 -07:00
Marc Jansen
da40527077 Merge pull request #5013 from openlayers/test-typo
Fix typo in test description
2016-03-11 09:45:28 +01:00
Marc Jansen
c1263af9b1 Fix typo in test description 2016-03-11 09:25:50 +01:00
Marc Jansen
3197972e14 Merge pull request #5007 from marcjansen/plain-attr
Accept simpler forms of specifying attribution(s) for sources.
2016-03-11 09:15:03 +01:00
Marc Jansen
5b43e8a31e Use simple forms to create attributions in examples 2016-03-11 09:04:06 +01:00
Marc Jansen
df4f1c1389 Accept simpler attributions in sources 2016-03-11 09:04:06 +01:00
Andreas Hocevar
74006a91fe Merge pull request #5011 from ahocevar/vectortile-setprojection
Add missing setProjection function to ol.VectorTile API
2016-03-10 20:01:29 +01:00
Andreas Hocevar
fdee0d73de Merge pull request #5010 from ahocevar/event-docs-externs
Add and fix API docs for ol.events.Event stack
2016-03-10 19:57:57 +01:00
Andreas Hocevar
3164dc874e Add missing setProjection function to ol.VectorTile API 2016-03-10 19:50:30 +01:00
Andreas Hocevar
7c5e1b808d Add and fix API docs for ol.events.Event stack 2016-03-10 17:35:55 +01:00
Andreas Hocevar
fb6cd4f586 Merge pull request #5009 from gberaudo/update_tutorials
Update tutorials
2016-03-10 16:20:35 +01:00
Guillaume Beraudo
166dd98b72 Simplify and modernize closure tutorial
Use jscomp_error * and keep most advanced options for the last example.
2016-03-10 16:04:46 +01:00
Guillaume Beraudo
fedf477f29 Simplify custom-builds tutorial
Remove, the disturbing goog.dom.ASSUME_STANDARDS_MODE define.
Remove jscomp_off stuff.
2016-03-10 16:03:03 +01:00
Andreas Hocevar
bf30e86b84 Merge pull request #5006 from ahocevar/update-slimerjs
Use the maintained slimerjs package
2016-03-10 13:53:52 +01:00
Andreas Hocevar
6062128b4b Use the maintained slimerjs package 2016-03-10 12:25:16 +01:00
Frédéric Junod
cda6d678dc Merge pull request #5003 from fredj/jsdoc_rotate
Add 'function' jsdoc tag to ol.geom.Geometry#rotate
2016-03-10 08:39:48 +01:00
Frederic Junod
0dd36736c7 Add 'function' jsdoc tag to ol.geom.Geometry#rotate
Otherwise the function is in the 'Members' section of the API documentation.
2016-03-10 08:30:10 +01:00
Tim Schaub
6e45eef2a0 Merge pull request #5002 from openlayers/greenkeeper-eslint-config-openlayers-4.1.0
Update eslint-config-openlayers to version 4.1.0 🚀
2016-03-09 07:13:31 -07:00
greenkeeperio-bot
a118eeded9 chore(package): update eslint-config-openlayers to version 4.1.0
http://greenkeeper.io/
2016-03-09 05:44:50 -07:00
Frédéric Junod
ef2121bb70 Merge pull request #4999 from fredj/rm_goog.dom.removeNode
Remove use of goog.dom.removeNode
2016-03-09 13:16:51 +01:00
Frederic Junod
8a6962da9e Remove use of goog.dom.removeNode 2016-03-09 11:45:04 +01:00
Frédéric Junod
02aee14600 Merge pull request #4990 from fredj/getTileJSON
Add new ol.source.TileJSON#getTileJSON function
2016-03-09 11:44:35 +01:00
Frederic Junod
4157882f2e Add new ol.source.TileJSON#getTileJSON function 2016-03-09 10:55:19 +01:00
Frédéric Junod
441a7c093f Merge pull request #4998 from fredj/rm_map_isDef
Remove unused ol.Map#isDef function
2016-03-09 09:26:28 +01:00
Frederic Junod
cb251f1648 Remove unused ol.Map#isDef function 2016-03-09 08:36:36 +01:00
Tim Schaub
0b3155a47e Merge pull request #4995 from tschaub/uncolored
Remove unused ol.color functions.
2016-03-08 10:29:38 -07:00
Tim Schaub
249f3b2e47 Tests for ol.color.asString() 2016-03-08 10:05:54 -07:00
Tim Schaub
40397aa39e Tests for ol.color.asArray() 2016-03-08 10:05:54 -07:00
Tim Schaub
47a18d41f0 Remove unused ol.color.equals() 2016-03-08 10:05:53 -07:00
Tim Schaub
9ea9b29a69 Remove unused ol.color.transform() 2016-03-08 10:05:53 -07:00
Tim Schaub
8b1ad633be Remove unused ol.color.stringOrColorEquals() 2016-03-08 10:05:53 -07:00
Tim Schaub
7cf433eb68 Remove unused ol.color.blend() 2016-03-08 10:05:53 -07:00
Andreas Hocevar
091e8059c5 Merge pull request #4991 from ahocevar/soft-remove-listeners
Do not remove listeners while dispatching event
2016-03-08 17:46:03 +01:00
Frédéric Junod
fd256027ec Merge pull request #4984 from fredj/geom_rotate
Add new ol.geom.Geometry#rotate function
2016-03-08 17:17:09 +01:00
Frederic Junod
d5564a04db Add new ol.geom.Geometry#rotate function 2016-03-08 17:05:19 +01:00
Andreas Hocevar
0377e4a322 Add tests for corner cases 2016-03-08 17:04:25 +01:00
Frédéric Junod
6c74e90c5d Merge pull request #4994 from jonataswalker/array-alpha-color
Add alpha default value to ol.Color array form
2016-03-08 17:04:19 +01:00
jonataswalker
2564bb3e58 Add alpha default value to ol.Color array form 2016-03-08 12:43:42 -03:00
Andreas Hocevar
8a279dd94b Do not reset pendingRemovals if event is dispatched again 2016-03-08 15:54:51 +01:00
Andreas Hocevar
acd76a10b6 Clean up when propagation is stopped 2016-03-08 15:54:17 +01:00
Marc Jansen
b5dc619e0e Merge pull request #4992 from marcjansen/coverage-reporter
Allow configuration of the test reporter
2016-03-08 13:21:18 +01:00
Andreas Hocevar
93f26a90d0 Do not remove listeners while dispatching event 2016-03-08 13:11:22 +01:00
Marc Jansen
8c487d3036 Allow configuration of the test reporter
The reporter for the standard tests is still 'spec'; the one for the
gathering of code coverage is set to 'dot' to not clutter the output
of the logfile on travis.
2016-03-08 11:26:00 +01:00
Frédéric Junod
951b400227 Merge pull request #4988 from openlayers/greenkeeper-phantomjs-prebuilt-2.1.5
Update phantomjs-prebuilt to version 2.1.5 🚀
2016-03-08 08:35:20 +01:00
greenkeeperio-bot
f3479a4bc4 chore(package): update phantomjs-prebuilt to version 2.1.5
http://greenkeeper.io/
2016-03-07 11:31:59 -07:00
Andreas Hocevar
26078e1f34 Merge pull request #4983 from ahocevar/bing-maps-portal-url
Update Bing Maps Portal url
2016-03-07 15:33:34 +01:00
Andreas Hocevar
1cbb482900 Update Bing Maps Portal url 2016-03-07 14:52:14 +01:00
Frédéric Junod
a3d7a216d5 Merge pull request #4981 from fredj/dispose_viewport
Remove the viewport on map dispose
2016-03-07 12:10:11 +01:00
Frederic Junod
263f5bb8ab Remove the viewport on map dispose 2016-03-07 11:46:18 +01:00
Frédéric Junod
44de935ef0 Merge pull request #4980 from fredj/unused_require
Remove unused goog.require
2016-03-07 09:59:29 +01:00
Frederic Junod
8b95602211 Remove unused goog.require 2016-03-07 09:33:15 +01:00
Marc Jansen
dc2faea5eb Merge pull request #4977 from marcjansen/length-tests
Add basic tests for ol.geom.flat.length methods
2016-03-07 09:28:42 +01:00
Marc Jansen
2113c749b1 Add basic tests for ol.geom.flat.length methods 2016-03-06 15:08:40 +01:00
Andreas Hocevar
7fe1d1d68c Merge pull request #4973 from openlayers/greenkeeper-eslint-2.3.0
Update eslint to version 2.3.0 🚀
2016-03-05 07:38:29 +01:00
greenkeeperio-bot
bfb73c992e chore(package): update eslint to version 2.3.0
http://greenkeeper.io/
2016-03-04 17:57:19 -07:00
Andreas Hocevar
f1fee79ca4 Merge pull request #4971 from openlayers/release-v3.14.2
Release v3.14.2
2016-03-04 09:36:58 +01:00
Tim Schaub
82020bcd1f Merge pull request #4970 from tschaub/disposable-tests
Tests for ol.Disposable.
2016-03-03 09:35:29 -07:00
Frédéric Junod
258765dc48 Merge pull request #4967 from fredj/missing_goog.inherits
Add missing goog.inherits for ol.render.canvas.Immediate
2016-03-03 17:26:13 +01:00
Tim Schaub
787e5d4dbf Assert that map renderer is a disposable 2016-03-03 09:18:04 -07:00
Frederic Junod
3793bb18ae Add missing goog.inherits for ol.render.canvas.Immediate 2016-03-03 17:12:19 +01:00
Tim Schaub
167ee487d6 Assert that render box is a disposable 2016-03-03 09:05:08 -07:00
Tim Schaub
beb80ce987 Assert that event target is a disposable 2016-03-03 09:05:08 -07:00
Tim Schaub
0ab9dd8bd0 Tests for ol.Disposable 2016-03-03 09:05:02 -07:00
Frédéric Junod
9ba059a159 Merge pull request #4955 from fredj/ie_xml_workaround
Remove IE workarounds in src/ol/xml.js
2016-03-03 15:59:14 +01:00
Frederic Junod
7da7cba812 Don't use goog.dom.xml.createDocument
Use DOMImplementation.createDocument instead, available for IE >= 9
2016-03-03 15:46:29 +01:00
Frederic Junod
b09f7e30b2 Get rid of goog.dom.xml.serialize
Use XMLSerializer.serializeToString() function instead, available for IE >= 9
2016-03-03 15:46:29 +01:00
Frederic Junod
57f7811cd0 Remove ol.xml.isNode workaround for IE 2016-03-03 15:46:29 +01:00
Frederic Junod
90b4eea1cd Remove ol.xml.isDocument workaround for IE 2016-03-03 15:46:29 +01:00
Frederic Junod
544de3b91c Remove ol.xml.setAttributeNS workaround for IE 2016-03-03 15:46:29 +01:00
Frederic Junod
811eea0d3a Remove ol.xml.getAttributeNodeNS workaround for IE 2016-03-03 15:46:29 +01:00
Frederic Junod
e210328dba Remove ol.xml.getAttributeNS workaround for IE 2016-03-03 15:46:29 +01:00
Frederic Junod
1e98f1227b Remove ol.xml.createElementNS workaround for IE 2016-03-03 15:46:29 +01:00
Frederic Junod
b87a912ecc Remove ol.xml.getLocalName workaround for IE
This property is available for IE >= 9
2016-03-03 15:46:29 +01:00
Andreas Hocevar
750a01aa80 Merge pull request #4960 from ahocevar/clip-rendered
Simplify clipping of lower resolution regions
2016-03-03 15:44:47 +01:00
Tim Schaub
143af1e091 Merge pull request #4950 from tschaub/dispose
Remove use of goog.Disposable().
2016-03-03 07:44:39 -07:00
Tim Schaub
e1f0e8d75b No need for ol.webgl.Context to be an event target 2016-03-03 07:28:34 -07:00
Tim Schaub
2f9d4e68eb Unregister all listeners on the WebGL context's canvas 2016-03-03 07:26:45 -07:00
Tim Schaub
afb64ed2bf Make ol.webgl.Context an ol.events.EventTarget 2016-03-02 16:32:25 -07:00
Tim Schaub
71faef3dfd One fewer anonymous function 2016-03-02 15:44:07 -07:00
Tim Schaub
09eee46822 Use ol.Disposable instead of goog.Disposable 2016-03-02 15:44:07 -07:00
Tim Schaub
ae4d8195c0 Remove use of goog.dispose() 2016-03-02 15:44:06 -07:00
Tim Schaub
df4f154a93 Unused goog.dispose requires 2016-03-02 15:44:06 -07:00
Tim Schaub
34d8d77344 Merge pull request #4963 from tschaub/xhr-failures
Handle more XHR errors in the TileJSON source
2016-03-02 15:40:43 -07:00
Tim Schaub
c9852250e4 Merge pull request #4962 from tschaub/untestable
Skip tests where features are not available
2016-03-02 15:21:36 -07:00
Tim Schaub
1877910b7e Handle more XHR errors in the TileJSON source 2016-03-02 14:42:28 -07:00
Tim Schaub
9c594bc997 Use where function in MVT tests 2016-03-02 13:22:33 -07:00
Tim Schaub
1925e39b69 Allow tests to be ignored by feature 2016-03-02 13:20:37 -07:00
Andreas Hocevar
0c8bec2126 Merge pull request #4956 from jonataswalker/fix-layout-examples
Fix Examples layout page
2016-03-02 19:09:42 +01:00
jonataswalker
8b2259bf25 Fix Examples layout page 2016-03-02 14:37:19 -03:00
Andreas Hocevar
8ba04ac77a Simplify clipping of lower resolution regions 2016-03-02 15:54:06 +01:00
Frédéric Junod
f6f22b155c Merge pull request #4958 from fredj/stop_wheel_events
Stop wheel events instead of DOMMouseScroll events
2016-03-02 15:36:38 +01:00
Frederic Junod
2cb48d3d62 Stop wheel events instead of DOMMouseScroll events 2016-03-02 15:25:22 +01:00
Tim Schaub
e3b88b8785 Merge pull request #4947 from tschaub/pixelworks
IE support for ol.source.Raster.
2016-03-01 15:13:48 -07:00
Tim Schaub
efdc892219 Run ol.source.Raster tests in Phantom 2016-03-01 13:50:31 -07:00
Tim Schaub
5aa175241a No need to check for ImageData constructor in the tests 2016-03-01 13:43:55 -07:00
Tim Schaub
bc01fdb59a Return ImageData-like objects for IE support 2016-03-01 13:34:50 -07:00
Tim Schaub
66f23c1aed Upgrade to pixelworks@1.1.0 2016-03-01 13:34:50 -07:00
Andreas Hocevar
4cebe3d92b Merge pull request #4944 from openlayers/greenkeeper-resemblejs-2.2.0
Update resemblejs to version 2.2.0 🚀
2016-03-01 17:58:34 +01:00
greenkeeperio-bot
ad0a13ebb2 chore(package): update resemblejs to version 2.2.0
http://greenkeeper.io/
2016-03-01 06:46:51 -07:00
Frédéric Junod
e8e5dc6332 Merge pull request #4942 from fredj/unused_example_data
Remove unused files in examples/data/
2016-03-01 12:43:58 +01:00
Frederic Junod
f271fdb993 Remove unused files in examples/data/ 2016-03-01 12:26:06 +01:00
Frédéric Junod
fbbbcf5cdb Merge pull request #4805 from fredj/cacheSize
Add new cacheSize option to ol.source
2016-03-01 10:46:00 +01:00
Andreas Hocevar
9fe2970fb3 Merge pull request #4940 from openlayers/release-v3.14.1
Release v3.14.1
2016-03-01 10:20:50 +01:00
Andreas Hocevar
fbb3ffc9e5 Merge pull request #4939 from ahocevar/clip-opacity
Fix rendering of opaque layers with opacity != 1
2016-03-01 09:43:24 +01:00
Frederic Junod
9819aa38f5 Remove ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK 2016-03-01 09:05:12 +01:00
Frederic Junod
58d8b290af Add new cacheSize option to ol.source
Option added to:
 - olx.source.BingMapsOptions
 - olx.source.MapQuestOptions
 - olx.source.OSMOptions
 - olx.source.StamenOptions
 - olx.source.TileArcGISRestOptions
 - olx.source.TileImageOptions
 - olx.source.TileJSONOptions
 - olx.source.TileWMSOptions
 - olx.source.VectorTileOptions
 - olx.source.XYZOptions
 - olx.source.WMTSOptions
 - olx.source.ZoomifyOptions
2016-03-01 09:05:12 +01:00
Andreas Hocevar
16f63a7e0c Calculate low resolution tile clipping like current tile position 2016-02-29 21:30:57 +01:00
Andreas Hocevar
23172a3695 Use tile position coordinates for clip geometry outer ring 2016-02-29 21:28:20 +01:00
Andreas Hocevar
8553da6679 Refactor tile position calculation for readability 2016-02-29 21:23:19 +01:00
Andreas Hocevar
8256ff60b6 Consider layer opacity for lower resolution tile clipping 2016-02-29 21:13:31 +01:00
Frédéric Junod
d5fb6dda49 Merge pull request #4938 from fredj/rm_goog.dom.getFirstElementChild
Get rid of goog.dom.getFirstElementChild
2016-02-29 17:13:10 +01:00
Frederic Junod
e9a5fadacc Get rid of goog.dom.getFirstElementChild
Use [firstElementChild](https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/firstElementChild) instead.
2016-02-29 16:59:29 +01:00
Frédéric Junod
8465875b24 Merge pull request #4937 from fredj/rm_goog.json
Get rid of goog.json
2016-02-29 16:56:32 +01:00
Frédéric Junod
41c12bcea9 Merge pull request #4936 from fredj/getfeatureinfo-layers
Remove jquery from getfeatureinfo-layers example
2016-02-29 16:37:46 +01:00
Frederic Junod
cf23d0541c Get rid of goog.json
Use JSON.parse and JSON.stringify instead.
2016-02-29 16:19:32 +01:00
Frederic Junod
aaf03a8fc2 Remove jquery from getfeatureinfo-layers example 2016-02-29 15:32:28 +01:00
Frédéric Junod
5b38eaa116 Merge pull request #4930 from fredj/custom-builds.md
Use ADVANCED instead of ADVANCED_OPTIMIZATIONS
2016-02-29 10:40:19 +01:00
Andreas Hocevar
9b8ab88e41 Merge pull request #4917 from ahocevar/flexible-cluster
Make ol.source.Cluster more flexible by adding a geometryFunction option
2016-02-29 10:40:12 +01:00
Frédéric Junod
3194d0ebd4 Merge pull request #4918 from fredj/canvas_clear
Don't change the canvas size to clear it
2016-02-29 10:40:00 +01:00
Frederic Junod
2a1bc70b97 Don't change the canvas size to clear it 2016-02-29 09:23:42 +01:00
Frederic Junod
2427d0e684 Use ADVANCED instead of ADVANCED_OPTIMIZATIONS 2016-02-29 08:39:54 +01:00
Frédéric Junod
941f220f3d Merge pull request #4923 from xlhomme/patch-1
Update custom-builds.md
2016-02-29 08:37:58 +01:00
Frédéric Junod
50aad8f42d Merge pull request #4929 from openlayers/greenkeeper-clean-css-3.4.10
Update clean-css to version 3.4.10 🚀
2016-02-29 08:26:01 +01:00
greenkeeperio-bot
24069fa7bf chore(package): update clean-css to version 3.4.10
http://greenkeeper.io/
2016-02-29 00:10:03 -07:00
Tim Schaub
0e5dfec3bf Merge pull request #4928 from bjornharrtell/jsts-upgrade2
Upgrade to JSTS 1.0.2 in example
2016-02-28 21:50:13 -07:00
Björn Harrtell
7b6820a012 Upgrade to JSTS 1.0.2 in example 2016-02-28 20:31:44 +01:00
Tim Schaub
a172e04d5b Merge pull request #4927 from bjornharrtell/jsts-upgrade
Upgrade JSTS in example.
2016-02-27 09:01:47 -07:00
Tim Schaub
750830b887 Merge pull request #4809 from fperucic/multpolygon-clone
Fix multipolygon clone.
2016-02-27 09:00:17 -07:00
Fran Peručić
a51e7804b8 added a test 2016-02-27 13:03:19 +01:00
Björn Harrtell
94debcfc3a Upgrade JSTS in example 2016-02-27 09:08:17 +01:00
Andreas Hocevar
c5d3dfd41c Merge pull request #4924 from openlayers/greenkeeper-coveralls-2.11.8
Update coveralls to version 2.11.8 🚀
2016-02-26 21:24:29 +01:00
greenkeeperio-bot
7491b90c30 chore(package): update coveralls to version 2.11.8
http://greenkeeper.io/
2016-02-26 12:40:20 -07:00
xavier lhomme
e3f25ee71f Update custom-builds.md
not sure we should add 
"ol.layer.Heatmap#setRadius",
"ol.layer.Heatmap#setBlur"
but it's work.
2016-02-26 19:45:59 +01:00
Andreas Hocevar
588dd54fb6 Merge pull request #4921 from ahocevar/unlisten-earlier-and-bind-to-target
Unlisten before calling listener and bind to target by default
2016-02-25 18:04:39 +01:00
Andreas Hocevar
00a0f14743 Unlisten before calling listener and bind to target by default 2016-02-25 17:48:15 +01:00
Tim Schaub
ef42267cfe Merge pull request #4868 from sebasbaumh/refreshSource
Allow to refresh a source and reload its data.
2016-02-25 07:15:46 -07:00
Andreas Hocevar
0407e779f9 Make ol.source.Cluster more flexible by adding a geometryFunction option 2016-02-25 15:02:41 +01:00
Frédéric Junod
78d6d5ab1b Merge pull request #4903 from fredj/rm_goog.style.getRelativePosition
Remove use of goog.style.getRelativePosition
2016-02-25 14:29:34 +01:00
Frédéric Junod
fa180cfa13 Merge pull request #4902 from fredj/getBoundingClientRect
Remove use of goog.style.getClientPosition
2016-02-25 11:05:56 +01:00
Frédéric Junod
d190d27534 Merge pull request #4916 from fredj/writeFeatureObject_return
Fix ol.format.GeoJSON#writeFeatureObject return type
2016-02-25 10:22:28 +01:00
Frederic Junod
916127d8f6 Fix ol.format.GeoJSON#writeFeatureObject return type 2016-02-25 10:09:37 +01:00
Frédéric Junod
7583d8d434 Merge pull request #4909 from fredj/dom_vector_clear
Add ol.renderer.dom.VectorLayer#clearFrame
2016-02-25 10:08:14 +01:00
Frédéric Junod
b19aa01b72 Merge pull request #4915 from fredj/object
Use {} instead of Object
2016-02-25 09:51:12 +01:00
Frederic Junod
148ef7afef Use {} instead of Object
We probably have these to trick the compiler but it's not needed anymore
2016-02-25 09:15:33 +01:00
Frédéric Junod
5ad42f3b25 Merge pull request #4914 from sebasbaumh/exportEquivalent
Export ol.proj.equivalent
2016-02-25 08:55:35 +01:00
Sebastian Baumhekel
33bcd7194f Export ol.proj.equivalent
The function ol.proj.equivalent is used for comparing two projections,
but not exposed publicly. It should be accessible using a public API to
be able to compare projections in the same way as OpenLayers does.

A test for the ol.proj.equivalent function itself already exists in
https://github.com/openlayers/ol3/blob/master/test/spec/ol/proj/proj.test.js

github issue #4913
2016-02-25 08:40:56 +01:00
Frederic Junod
edf2096b1b Remove use of goog.style.getClientPosition
Use Element.getBoundingClientRect() instead.
2016-02-25 08:36:40 +01:00
Sebastian Baumhekel
7fcf2650ee Allow to refresh a source and reload its data.
Provide an API to refresh a source and reload its data in an associated
layer, as for example already loaded tiles in a ol.source.Tile source
are not refreshed. Additionally a test for the new
ol.source.Source.refresh() function is provided.

Currently internal state is not cleaned up, e.g. already loaded tiles
in a `ol.source.Tile` source are still cached and not reloaded at all.

github issue #4867 (https://github.com/openlayers/ol3/issues/4867)
2016-02-25 08:05:56 +01:00
Frederic Junod
81e563b2b3 Remove use of goog.style.getRelativePosition
Use Element.getBoundingClientRect() and Event.clientX/Event.clientY instead.
2016-02-24 17:28:46 +01:00
Frédéric Junod
68088341d6 Merge pull request #4908 from fredj/rm_goog.math.Rect
Remove use of goog.math.Rect
2016-02-24 17:15:44 +01:00
Frederic Junod
348f61951c Add ol.renderer.dom.VectorLayer#clearFrame 2016-02-24 16:13:35 +01:00
Frederic Junod
48064306a1 Remove use of goog.math.Rect 2016-02-24 14:32:58 +01:00
Frederic Junod
373393dce7 Add missing 'private' jsdoc tag 2016-02-24 14:32:57 +01:00
Frédéric Junod
bd5c85acc3 Merge pull request #4900 from fredj/ol.format.XML_struct
Make ol.format.XML a @struct
2016-02-24 14:24:39 +01:00
Frédéric Junod
8a6afb3836 Merge pull request #4880 from openlayers/greenkeeper-closure-util-1.11.0
Update closure-util to version 1.11.0 🚀
2016-02-24 14:18:01 +01:00
Frédéric Junod
d8d7ae8e1b Merge pull request #4905 from fredj/rm_goog.style.setPosition
Remove use of goog.style.setPosition
2016-02-24 14:17:36 +01:00
Frederic Junod
805b81cea7 Remove use of goog.style.setPosition
Use element.style.left and element.style.top instead
2016-02-24 12:23:10 +01:00
Frédéric Junod
514243a8e9 Merge pull request #4879 from openlayers/greenkeeper-metalsmith-layouts-1.6.4
Update metalsmith-layouts to version 1.6.4 🚀
2016-02-24 12:05:02 +01:00
Andreas Hocevar
37113837d1 Merge pull request #4901 from openlayers/release-v3.14.0
Release v3.14.0
2016-02-24 09:53:01 +01:00
Frédéric Junod
8395bea72d Merge pull request #4899 from fredj/srsName
Use ol.format.GMLBase#srsName instead of undeclared srsName_
2016-02-24 09:43:49 +01:00
Frederic Junod
ac17a2f2a7 Make ol.format.XML a @struct
And replace the undeclared `this.version` by a local variable.
2016-02-24 09:25:41 +01:00
Frederic Junod
a365f185cc Use ol.format.GMLBase#srsName instead of undeclared srsName_
The variable was changed from private to protected in 8182396
2016-02-24 09:20:22 +01:00
greenkeeperio-bot
7e7d8ac4e2 chore(package): update closure-util to version 1.11.0
- Remove closure-util.json, we're now using the same library version as closure-util
 - Disable analyzerChecks errors from closure-compiler
 - Remove WheelEvent constants from externs (fixed upstream)
 - Activate the unnecessaryCasts compiler check
2016-02-24 09:02:25 +01:00
greenkeeperio-bot
345763fcd3 chore(package): update metalsmith-layouts to version 1.6.4
http://greenkeeper.io/
2016-02-23 08:50:58 +01:00
Fran Peručić
b46cc5a241 fix multipolygon clone 2016-02-10 15:06:00 +01:00
275 changed files with 5561 additions and 2196 deletions

View File

@@ -11,14 +11,6 @@ The Travis CI hook is enabled on the Github repository. This means every pull re
is run through a full test suite to ensure it compiles and passes the tests. Failing
pull requests will not be merged.
Although not mandatory, it is also recommended to set up Travis CI for your ol3 fork.
For that go to your ol3 fork's Service Hooks page and set up the Travis hook.
Then every time you push to your fork, the test suite will be run. This means
errors can be caught before creating a pull request. For those making
small or occasional contributions, this may be enough to check that your contributions
are ok; in this case, you do not need to install the build tools on your local environment
as described below.
### Development dependencies
The minimum requirements are:

View File

@@ -1,5 +1,54 @@
## Upgrade notes
### v3.15.0
#### Internet Explorer 9 support
As of this release, OpenLayers requires a `classList` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features#Element_prototype_classList.
#### Immediate rendering API
Listeners for `precompose`, `render`, and `postcompose` receive an event with a `vectorContext` property with methods for immediate vector rendering. The previous geometry drawing methods have been replaced with a single `vectorContext.drawGeometry(geometry)` method. If you were using any of the following experimental methods on the vector context, replace them with `drawGeometry`:
* Removed experimental geometry drawing methods: `drawPointGeometry`, `drawLineStringGeometry`, `drawPolygonGeometry`, `drawMultiPointGeometry`, `drawMultiLineStringGeometry`, `drawMultiPolygonGeometry`, and `drawCircleGeometry` (all have been replaced with `drawGeometry`).
In addition, the previous methods for setting style parts have been replaced with a single `vectorContext.setStyle(style)` method. If you were using any of the following experimental methods on the vector context, replace them with `setStyle`:
* Removed experimental style setting methods: `setFillStrokeStyle`, `setImageStyle`, `setTextStyle` (all have been replaced with `setStyle`).
Below is an example of how the vector context might have been used in the past:
```js
// OLD WAY, NO LONGER SUPPORTED
map.on('postcompose', function(event) {
event.vectorContext.setFillStrokeStyle(style.getFill(), style.getStroke());
event.vectorContext.drawPointGeometry(geometry);
});
```
Here is an example of how you could accomplish the same with the new methods:
```js
// NEW WAY, USE THIS INSTEAD OF THE CODE ABOVE
map.on('postcompose', function(event) {
event.vectorContext.setStyle(style);
event.vectorContext.drawGeometry(geometry);
});
```
A final change to the immediate rendering API is that `vectorContext.drawFeature()` calls are now "immediate" as well. The drawing now occurs synchronously. This means that any `zIndex` in a style passed to `drawFeature()` will be ignored. To achieve `zIndex` ordering, order your calls to `drawFeature()` instead.
#### Removal of `ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK`
The `ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK` define has been removed. The size of the cache can now be defined on every tile based `ol.source`:
```js
new ol.layer.Tile({
source: new ol.source.OSM({
cacheSize: 128
})
})
```
The default cache size is `2048`.
### v3.14.0
#### Internet Explorer 9 support

204
changelog/v3.15.0.md Normal file
View File

@@ -0,0 +1,204 @@
# v3.15.0
## Summary
The v3.15.0 release includes features and fixes from 136 pull requests since the v3.14.2 release. New features and improvements include:
* Make ol.source.Cluster more flexible by adding a geometryFunction option (#4917).
* Add new CartoDB tile source (#4926).
* Improved rendering performance for vector layers by batching polygon fill and stroke instructions (#5149).
* Make the tile cache size configurable (#4805).
* Add new ol.geom.Geometry#rotate function (#4984).
* Accept simpler forms of specifying attribution(s) for sources (#5007).
* Support zooming out for ol.interaction.DragZoom (#5031).
## Upgrade notes
### v3.15.0
#### Internet Explorer 9 support
As of this release, OpenLayers requires a `classList` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features#Element_prototype_classList.
#### Immediate rendering API
Listeners for `precompose`, `render`, and `postcompose` receive an event with a `vectorContext` property with methods for immediate vector rendering. The previous geometry drawing methods have been replaced with a single `vectorContext.drawGeometry(geometry)` method. If you were using any of the following experimental methods on the vector context, replace them with `drawGeometry`:
* Removed experimental geometry drawing methods: `drawPointGeometry`, `drawLineStringGeometry`, `drawPolygonGeometry`, `drawMultiPointGeometry`, `drawMultiLineStringGeometry`, `drawMultiPolygonGeometry`, and `drawCircleGeometry` (all have been replaced with `drawGeometry`).
In addition, the previous methods for setting style parts have been replaced with a single `vectorContext.setStyle(style)` method. If you were using any of the following experimental methods on the vector context, replace them with `setStyle`:
* Removed experimental style setting methods: `setFillStrokeStyle`, `setImageStyle`, `setTextStyle` (all have been replaced with `setStyle`).
Below is an example of how the vector context might have been used in the past:
```js
// OLD WAY, NO LONGER SUPPORTED
map.on('postcompose', function(event) {
event.vectorContext.setFillStrokeStyle(style.getFill(), style.getStroke());
event.vectorContext.drawPointGeometry(geometry);
});
```
Here is an example of how you could accomplish the same with the new methods:
```js
// NEW WAY, USE THIS INSTEAD OF THE CODE ABOVE
map.on('postcompose', function(event) {
event.vectorContext.setStyle(style);
event.vectorContext.drawGeometry(geometry);
});
```
A final change to the immediate rendering API is that `vectorContext.drawFeature()` calls are now "immediate" as well. The drawing now occurs synchronously. This means that any `zIndex` in a style passed to `drawFeature()` will be ignored. To achieve `zIndex` ordering, order your calls to `drawFeature()` instead.
#### Removal of `ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK`
The `ol.DEFAULT_TILE_CACHE_HIGH_WATER_MARK` define has been removed. The size of the cache can now be defined on every tile based `ol.source`:
```js
new ol.layer.Tile({
source: new ol.source.OSM({
cacheSize: 128
})
})
```
The default cache size is `2048`.
## Full list of changes
* [#4775](https://github.com/openlayers/ol3/pull/4775) - Remove goog.math.modulo and goog.math.lerp ([@nicholas-l](https://github.com/nicholas-l))
* [#5152](https://github.com/openlayers/ol3/pull/5152) - Cartodb cleanup ([@fredj](https://github.com/fredj))
* [#4804](https://github.com/openlayers/ol3/pull/4804) - Use Array.isArray instead of goog.isArray ([@fredj](https://github.com/fredj))
* [#5149](https://github.com/openlayers/ol3/pull/5149) - Batch polygon fill and stroke instructions ([@ahocevar](https://github.com/ahocevar))
* [#5159](https://github.com/openlayers/ol3/pull/5159) - Update eslint to version 2.6.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5160](https://github.com/openlayers/ol3/pull/5160) - Update clean-css to version 3.4.11 🚀 ([@openlayers](https://github.com/openlayers))
* [#5157](https://github.com/openlayers/ol3/pull/5157) - Improve docs for measure example ([@probins](https://github.com/probins))
* [#5155](https://github.com/openlayers/ol3/pull/5155) - Fix ol.source.Zoomify tests on firefox ([@fredj](https://github.com/fredj))
* [#5086](https://github.com/openlayers/ol3/pull/5086) - Get rid of goog.functions ([@bjornharrtell](https://github.com/bjornharrtell))
* [#5105](https://github.com/openlayers/ol3/pull/5105) - Support minZoom in ol.source.Stamen ([@fredj](https://github.com/fredj))
* [#4926](https://github.com/openlayers/ol3/pull/4926) - Add CartoDB tile source. ([@aisaacs](https://github.com/aisaacs))
* [#5151](https://github.com/openlayers/ol3/pull/5151) - Use fs-extra as fs, remove usage of graceful-fs ([@marcjansen](https://github.com/marcjansen))
* [#5124](https://github.com/openlayers/ol3/pull/5124) - Removed goog.dom.classlist ([@nicholas-l](https://github.com/nicholas-l))
* [#5150](https://github.com/openlayers/ol3/pull/5150) - Use fs-extra instead of wrench ([@fredj](https://github.com/fredj))
* [#5109](https://github.com/openlayers/ol3/pull/5109) - Add some tests for ol.source.TileUTFGrid ([@marcjansen](https://github.com/marcjansen))
* [#5139](https://github.com/openlayers/ol3/pull/5139) - Update closure-util to version 1.13.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5141](https://github.com/openlayers/ol3/pull/5141) - Reuse dragListenerKeys_ variable in ol.control.ZoomSlider ([@fredj](https://github.com/fredj))
* [#5118](https://github.com/openlayers/ol3/pull/5118) - Remove goog.dom.classlist usage ([@fredj](https://github.com/fredj))
* [#5115](https://github.com/openlayers/ol3/pull/5115) - Clarify that lineDash has no effect in IE 10 and below ([@marcjansen](https://github.com/marcjansen))
* [#5136](https://github.com/openlayers/ol3/pull/5136) - Update eslint to version 2.5.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#5123](https://github.com/openlayers/ol3/pull/5123) - Update coveralls to version 2.11.9 🚀 ([@openlayers](https://github.com/openlayers))
* [#5131](https://github.com/openlayers/ol3/pull/5131) - Update phantomjs-prebuilt to version 2.1.7 🚀 ([@openlayers](https://github.com/openlayers))
* [#5122](https://github.com/openlayers/ol3/pull/5122) - Update browser support info in intro tutorial ([@probins](https://github.com/probins))
* [#5112](https://github.com/openlayers/ol3/pull/5112) - Add decimals option to format write ([@probins](https://github.com/probins))
* [#5120](https://github.com/openlayers/ol3/pull/5120) - Add tileJSON option to ol.source.TileUTFGrid ([@ahocevar](https://github.com/ahocevar))
* [#5119](https://github.com/openlayers/ol3/pull/5119) - Add ol.source.Raster events on API docs page ([@drnextgis](https://github.com/drnextgis))
* [#5116](https://github.com/openlayers/ol3/pull/5116) - Improve examples pages on mobile devices a bit ([@ahocevar](https://github.com/ahocevar))
* [#5113](https://github.com/openlayers/ol3/pull/5113) - Memory leak in ol.control.FullScreen ([@AvatharDG](https://github.com/AvatharDG))
* [#5111](https://github.com/openlayers/ol3/pull/5111) - Remove CSS filter in examples ([@fredj](https://github.com/fredj))
* [#5108](https://github.com/openlayers/ol3/pull/5108) - Remove unused ol.xml.getAttributeNodeNS function ([@fredj](https://github.com/fredj))
* [#5106](https://github.com/openlayers/ol3/pull/5106) - Get rid of goog.math.Vec2 ([@fredj](https://github.com/fredj))
* [#5096](https://github.com/openlayers/ol3/pull/5096) - Add tests for ol.source.Zoomify ([@marcjansen](https://github.com/marcjansen))
* [#5102](https://github.com/openlayers/ol3/pull/5102) - Fix typo in API docs ([@openlayers](https://github.com/openlayers))
* [#5098](https://github.com/openlayers/ol3/pull/5098) - Reintroduce log messages for relevant WebGL assertions ([@bjornharrtell](https://github.com/bjornharrtell))
* [#5094](https://github.com/openlayers/ol3/pull/5094) - FAQ: answer question 4 ([@probins](https://github.com/probins))
* [#5092](https://github.com/openlayers/ol3/pull/5092) - add raster.jsdoc ([@drnextgis](https://github.com/drnextgis))
* [#5081](https://github.com/openlayers/ol3/pull/5081) - Snap to vertices or edges ([@drnextgis](https://github.com/drnextgis))
* [#5090](https://github.com/openlayers/ol3/pull/5090) - Update custom-builds.md ([@probins](https://github.com/probins))
* [#5089](https://github.com/openlayers/ol3/pull/5089) - Test for both transform coords should use roughlyEqual ([@probins](https://github.com/probins))
* [#5080](https://github.com/openlayers/ol3/pull/5080) - Fix geojson write GeometryCollection ([@probins](https://github.com/probins))
* [#5088](https://github.com/openlayers/ol3/pull/5088) - DEVELOPING.md: remove section on running Travis on fork ([@probins](https://github.com/probins))
* [#5087](https://github.com/openlayers/ol3/pull/5087) - assertion to check that there's a DOM node for target element ([@drnextgis](https://github.com/drnextgis))
* [#5069](https://github.com/openlayers/ol3/pull/5069) - Update jquery to version 2.2.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#5083](https://github.com/openlayers/ol3/pull/5083) - Remove unnecessary lineTo calls in immediate polygon rendering ([@tschaub](https://github.com/tschaub))
* [#5082](https://github.com/openlayers/ol3/pull/5082) - Get rid of goog.log. ([@bjornharrtell](https://github.com/bjornharrtell))
* [#5079](https://github.com/openlayers/ol3/pull/5079) - Correcting a typo in the upgrade notes ([@tschaub](https://github.com/tschaub))
* [#5076](https://github.com/openlayers/ol3/pull/5076) - Update phantomjs-prebuilt to version 2.1.6 🚀 ([@openlayers](https://github.com/openlayers))
* [#5077](https://github.com/openlayers/ol3/pull/5077) - Make immediate API uniformly synchronous. ([@tschaub](https://github.com/tschaub))
* [#5072](https://github.com/openlayers/ol3/pull/5072) - Add setStyle() and drawGeometry() to the immediate rendering API. ([@tschaub](https://github.com/tschaub))
* [#5074](https://github.com/openlayers/ol3/pull/5074) - Do not rotate map canvas after composition ([@ahocevar](https://github.com/ahocevar))
* [#5071](https://github.com/openlayers/ol3/pull/5071) - correct way to determine freehand mode is enabled ([@drnextgis](https://github.com/drnextgis))
* [#5066](https://github.com/openlayers/ol3/pull/5066) - Add more getters to ol.source.Vector ([@bartvde](https://github.com/bartvde))
* [#5064](https://github.com/openlayers/ol3/pull/5064) - Fix inconsistency in geom docs ([@probins](https://github.com/probins))
* [#5063](https://github.com/openlayers/ol3/pull/5063) - Remove inappropriate information from API docs ([@drnextgis](https://github.com/drnextgis))
* [#5061](https://github.com/openlayers/ol3/pull/5061) - Remove redundant required option ([@drnextgis](https://github.com/drnextgis))
* [#5058](https://github.com/openlayers/ol3/pull/5058) - Note in docs that DOM renderer can also render vectors ([@probins](https://github.com/probins))
* [#5056](https://github.com/openlayers/ol3/pull/5056) - Note in docs that WebGL can render points ([@probins](https://github.com/probins))
* [#5055](https://github.com/openlayers/ol3/pull/5055) - Fix cruft on kml scale output ([@probins](https://github.com/probins))
* [#5051](https://github.com/openlayers/ol3/pull/5051) - Handle aborted tiles in ol.TileQueue ([@fredj](https://github.com/fredj))
* [#5049](https://github.com/openlayers/ol3/pull/5049) - Supported browsers all have getComputedStyle ([@marcjansen](https://github.com/marcjansen))
* [#5048](https://github.com/openlayers/ol3/pull/5048) - Add tests for ol.dom methods ([@marcjansen](https://github.com/marcjansen))
* [#5031](https://github.com/openlayers/ol3/pull/5031) - support zooming out for ol.interaction.DragZoom ([@drnextgis](https://github.com/drnextgis))
* [#5036](https://github.com/openlayers/ol3/pull/5036) - Use imgSize when provided ([@ahocevar](https://github.com/ahocevar))
* [#5020](https://github.com/openlayers/ol3/pull/5020) - Update gaze to version 1.0.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5039](https://github.com/openlayers/ol3/pull/5039) - Update fs-extra to version 0.26.6 🚀 ([@openlayers](https://github.com/openlayers))
* [#5033](https://github.com/openlayers/ol3/pull/5033) - Document GPX geometry output types ([@probins](https://github.com/probins))
* [#5024](https://github.com/openlayers/ol3/pull/5024) - Resize the map canvas less aggressively ([@ahocevar](https://github.com/ahocevar))
* [#5000](https://github.com/openlayers/ol3/pull/5000) - Remove use of goog.math.Size and goog.style.setBorderBoxSize ([@fredj](https://github.com/fredj))
* [#5027](https://github.com/openlayers/ol3/pull/5027) - Clarify default value of featureProjection on geometry write ([@probins](https://github.com/probins))
* [#5019](https://github.com/openlayers/ol3/pull/5019) - Update eslint to version 2.4.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5016](https://github.com/openlayers/ol3/pull/5016) - Add basic tests for ol.geom.flat.center ([@marcjansen](https://github.com/marcjansen))
* [#5015](https://github.com/openlayers/ol3/pull/5015) - Update proj4 to version 2.3.14 🚀 ([@openlayers](https://github.com/openlayers))
* [#5013](https://github.com/openlayers/ol3/pull/5013) - Fix typo in test description ([@openlayers](https://github.com/openlayers))
* [#5007](https://github.com/openlayers/ol3/pull/5007) - Accept simpler forms of specifying attribution(s) for sources. ([@marcjansen](https://github.com/marcjansen))
* [#5011](https://github.com/openlayers/ol3/pull/5011) - Add missing setProjection function to ol.VectorTile API ([@ahocevar](https://github.com/ahocevar))
* [#5010](https://github.com/openlayers/ol3/pull/5010) - Add and fix API docs for ol.events.Event stack ([@ahocevar](https://github.com/ahocevar))
* [#5009](https://github.com/openlayers/ol3/pull/5009) - Update tutorials ([@gberaudo](https://github.com/gberaudo))
* [#5006](https://github.com/openlayers/ol3/pull/5006) - Use the maintained slimerjs package ([@ahocevar](https://github.com/ahocevar))
* [#5003](https://github.com/openlayers/ol3/pull/5003) - Add 'function' jsdoc tag to ol.geom.Geometry#rotate ([@fredj](https://github.com/fredj))
* [#5002](https://github.com/openlayers/ol3/pull/5002) - Update eslint-config-openlayers to version 4.1.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#4999](https://github.com/openlayers/ol3/pull/4999) - Remove use of goog.dom.removeNode ([@fredj](https://github.com/fredj))
* [#4990](https://github.com/openlayers/ol3/pull/4990) - Add new ol.source.TileJSON#getTileJSON function ([@fredj](https://github.com/fredj))
* [#4998](https://github.com/openlayers/ol3/pull/4998) - Remove unused ol.Map#isDef function ([@fredj](https://github.com/fredj))
* [#4995](https://github.com/openlayers/ol3/pull/4995) - Remove unused ol.color functions. ([@tschaub](https://github.com/tschaub))
* [#4991](https://github.com/openlayers/ol3/pull/4991) - Do not remove listeners while dispatching event ([@ahocevar](https://github.com/ahocevar))
* [#4984](https://github.com/openlayers/ol3/pull/4984) - Add new ol.geom.Geometry#rotate function ([@fredj](https://github.com/fredj))
* [#4994](https://github.com/openlayers/ol3/pull/4994) - Add alpha default value to ol.Color array form ([@jonataswalker](https://github.com/jonataswalker))
* [#4992](https://github.com/openlayers/ol3/pull/4992) - Allow configuration of the test reporter ([@marcjansen](https://github.com/marcjansen))
* [#4988](https://github.com/openlayers/ol3/pull/4988) - Update phantomjs-prebuilt to version 2.1.5 🚀 ([@openlayers](https://github.com/openlayers))
* [#4983](https://github.com/openlayers/ol3/pull/4983) - Update Bing Maps Portal url ([@ahocevar](https://github.com/ahocevar))
* [#4981](https://github.com/openlayers/ol3/pull/4981) - Remove the viewport on map dispose ([@fredj](https://github.com/fredj))
* [#4980](https://github.com/openlayers/ol3/pull/4980) - Remove unused goog.require ([@fredj](https://github.com/fredj))
* [#4977](https://github.com/openlayers/ol3/pull/4977) - Add basic tests for ol.geom.flat.length methods ([@marcjansen](https://github.com/marcjansen))
* [#4973](https://github.com/openlayers/ol3/pull/4973) - Update eslint to version 2.3.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#4971](https://github.com/openlayers/ol3/pull/4971) - Release v3.14.2 ([@openlayers](https://github.com/openlayers))
* [#4970](https://github.com/openlayers/ol3/pull/4970) - Tests for ol.Disposable. ([@tschaub](https://github.com/tschaub))
* [#4967](https://github.com/openlayers/ol3/pull/4967) - Add missing goog.inherits for ol.render.canvas.Immediate ([@fredj](https://github.com/fredj))
* [#4955](https://github.com/openlayers/ol3/pull/4955) - Remove IE workarounds in src/ol/xml.js ([@fredj](https://github.com/fredj))
* [#4960](https://github.com/openlayers/ol3/pull/4960) - Simplify clipping of lower resolution regions ([@ahocevar](https://github.com/ahocevar))
* [#4950](https://github.com/openlayers/ol3/pull/4950) - Remove use of goog.Disposable(). ([@tschaub](https://github.com/tschaub))
* [#4963](https://github.com/openlayers/ol3/pull/4963) - Handle more XHR errors in the TileJSON source ([@tschaub](https://github.com/tschaub))
* [#4962](https://github.com/openlayers/ol3/pull/4962) - Skip tests where features are not available ([@tschaub](https://github.com/tschaub))
* [#4956](https://github.com/openlayers/ol3/pull/4956) - Fix Examples layout page ([@jonataswalker](https://github.com/jonataswalker))
* [#4958](https://github.com/openlayers/ol3/pull/4958) - Stop wheel events instead of DOMMouseScroll events ([@fredj](https://github.com/fredj))
* [#4947](https://github.com/openlayers/ol3/pull/4947) - IE support for ol.source.Raster. ([@tschaub](https://github.com/tschaub))
* [#4944](https://github.com/openlayers/ol3/pull/4944) - Update resemblejs to version 2.2.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#4942](https://github.com/openlayers/ol3/pull/4942) - Remove unused files in examples/data/ ([@fredj](https://github.com/fredj))
* [#4805](https://github.com/openlayers/ol3/pull/4805) - Add new cacheSize option to ol.source ([@fredj](https://github.com/fredj))
* [#4940](https://github.com/openlayers/ol3/pull/4940) - Release v3.14.1 ([@openlayers](https://github.com/openlayers))
* [#4939](https://github.com/openlayers/ol3/pull/4939) - Fix rendering of opaque layers with opacity != 1 ([@ahocevar](https://github.com/ahocevar))
* [#4938](https://github.com/openlayers/ol3/pull/4938) - Get rid of goog.dom.getFirstElementChild ([@fredj](https://github.com/fredj))
* [#4937](https://github.com/openlayers/ol3/pull/4937) - Get rid of goog.json ([@fredj](https://github.com/fredj))
* [#4936](https://github.com/openlayers/ol3/pull/4936) - Remove jquery from getfeatureinfo-layers example ([@fredj](https://github.com/fredj))
* [#4930](https://github.com/openlayers/ol3/pull/4930) - Use ADVANCED instead of ADVANCED_OPTIMIZATIONS ([@fredj](https://github.com/fredj))
* [#4917](https://github.com/openlayers/ol3/pull/4917) - Make ol.source.Cluster more flexible by adding a geometryFunction option ([@ahocevar](https://github.com/ahocevar))
* [#4918](https://github.com/openlayers/ol3/pull/4918) - Don't change the canvas size to clear it ([@fredj](https://github.com/fredj))
* [#4923](https://github.com/openlayers/ol3/pull/4923) - Update custom-builds.md ([@xlhomme](https://github.com/xlhomme))
* [#4929](https://github.com/openlayers/ol3/pull/4929) - Update clean-css to version 3.4.10 🚀 ([@openlayers](https://github.com/openlayers))
* [#4928](https://github.com/openlayers/ol3/pull/4928) - Upgrade to JSTS 1.0.2 in example ([@bjornharrtell](https://github.com/bjornharrtell))
* [#4927](https://github.com/openlayers/ol3/pull/4927) - Upgrade JSTS in example. ([@bjornharrtell](https://github.com/bjornharrtell))
* [#4809](https://github.com/openlayers/ol3/pull/4809) - Fix multipolygon clone. ([@fperucic](https://github.com/fperucic))
* [#4924](https://github.com/openlayers/ol3/pull/4924) - Update coveralls to version 2.11.8 🚀 ([@openlayers](https://github.com/openlayers))
* [#4921](https://github.com/openlayers/ol3/pull/4921) - Unlisten before calling listener and bind to target by default ([@ahocevar](https://github.com/ahocevar))
* [#4868](https://github.com/openlayers/ol3/pull/4868) - Allow to refresh a source and reload its data. ([@sebasbaumh](https://github.com/sebasbaumh))
* [#4903](https://github.com/openlayers/ol3/pull/4903) - Remove use of goog.style.getRelativePosition ([@fredj](https://github.com/fredj))
* [#4902](https://github.com/openlayers/ol3/pull/4902) - Remove use of goog.style.getClientPosition ([@fredj](https://github.com/fredj))
* [#4916](https://github.com/openlayers/ol3/pull/4916) - Fix ol.format.GeoJSON#writeFeatureObject return type ([@fredj](https://github.com/fredj))
* [#4909](https://github.com/openlayers/ol3/pull/4909) - Add ol.renderer.dom.VectorLayer#clearFrame ([@fredj](https://github.com/fredj))
* [#4915](https://github.com/openlayers/ol3/pull/4915) - Use {} instead of Object ([@fredj](https://github.com/fredj))
* [#4914](https://github.com/openlayers/ol3/pull/4914) - Export ol.proj.equivalent ([@sebasbaumh](https://github.com/sebasbaumh))
* [#4908](https://github.com/openlayers/ol3/pull/4908) - Remove use of goog.math.Rect ([@fredj](https://github.com/fredj))
* [#4900](https://github.com/openlayers/ol3/pull/4900) - Make ol.format.XML a @struct ([@fredj](https://github.com/fredj))
* [#4880](https://github.com/openlayers/ol3/pull/4880) - Update closure-util to version 1.11.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#4905](https://github.com/openlayers/ol3/pull/4905) - Remove use of goog.style.setPosition ([@fredj](https://github.com/fredj))
* [#4879](https://github.com/openlayers/ol3/pull/4879) - Update metalsmith-layouts to version 1.6.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#4901](https://github.com/openlayers/ol3/pull/4901) - Release v3.14.0 ([@openlayers](https://github.com/openlayers))
* [#4899](https://github.com/openlayers/ol3/pull/4899) - Use ol.format.GMLBase#srsName instead of undeclared srsName_ ([@fredj](https://github.com/fredj))

View File

@@ -1,3 +0,0 @@
{
"library_url": "https://github.com/google/closure-library/archive/5b25e65.zip"
}

View File

@@ -12,6 +12,7 @@
],
"externs": [
"externs/bingmaps.js",
"externs/cartodb.js",
"externs/bootstrap.js",
"externs/closure-compiler.js",
"externs/esrijson.js",
@@ -25,16 +26,16 @@
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false"
],
"jscomp_error": [
"*"
],
"jscomp_off": [
"useOfGoogBase",
"unnecessaryCasts",
"useOfGoogBase",
"lintChecks",
"analyzerChecks",
"missingProvide",
"unknownDefines"
],

View File

@@ -13,6 +13,7 @@
"externs": [
"externs/bingmaps.js",
"externs/bootstrap.js",
"externs/cartodb.js",
"externs/closure-compiler.js",
"externs/esrijson.js",
"externs/example.js",
@@ -26,16 +27,16 @@
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false"
],
"jscomp_error": [
"*"
],
"jscomp_off": [
"useOfGoogBase",
"unnecessaryCasts",
"lintChecks"
"useOfGoogBase",
"lintChecks",
"analyzerChecks"
],
"extra_annotation_name": [
"api", "observable"

View File

@@ -11,7 +11,7 @@
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
{{{ extraHead.local }}}
{{{ css.tag }}}
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList"></script>
<script src="./resources/zeroclipboard/ZeroClipboard.min.js"></script>
<title>{{ title }}</title>
</head>
@@ -20,14 +20,17 @@
<header class="navbar" role="navigation">
<div class="container">
<div class="display-table pull-left" id="navbar-logo-container">
<a class="navbar-brand" href="./"><img src="./resources/logo-70x70.png">&nbsp;OpenLayers 3 Examples</a>
<a class="navbar-brand" href="./"><img src="./resources/logo-70x70.png">&nbsp;OpenLayers Examples</a>
</div>
<ul class="nav navbar-nav pull-right">
<li><a href="../doc">Docs</a></li>
<li><a class="active" href="index.html">Examples</a></li>
<li><a href="../apidoc">API</a></li>
<li><a href="https://github.com/openlayers/ol3">Code</a></li>
</ul>
<!-- menu items that get hidden below 768px width -->
<nav class='collapse navbar-collapse navbar-responsive-collapse'>
<ul class="nav navbar-nav pull-right">
<li><a href="../doc">Docs</a></li>
<li><a class="active" href="index.html">Examples</a></li>
<li><a href="../apidoc">API</a></li>
<li><a href="https://github.com/openlayers/ol3">Code</a></li>
</ul>
</nav>
</div>
</header>

View File

@@ -4,6 +4,7 @@
"compile": {
"externs": [
"externs/bingmaps.js",
"externs/cartodb.js",
"externs/closure-compiler.js",
"externs/esrijson.js",
"externs/geojson.js",
@@ -15,21 +16,16 @@
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false"
],
"jscomp_error": [
"*"
],
"jscomp_off": [
"unnecessaryCasts",
"useOfGoogBase",
"lintChecks"
],
"hide_warnings_for": [
"node_modules/closure-util"
],
"jscomp_warning": [
"unnecessaryCasts"
"lintChecks",
"analyzerChecks"
],
"extra_annotation_name": [
"api", "observable"

View File

@@ -161,6 +161,22 @@ var swissCoord = ol.proj.transform([8.23, 46.86], 'EPSG:4326', 'EPSG:21781');
## Why is the order of a coordinate [lon,lat], and not [lat,lon]?
Because of two different and incompatible conventions. Latitude and longitude
are normally given in that order. Maps are 2D representations/projections
of the earth's surface, with coordinates expressed in the `x,y` grid of the
[Cartesian system](https://en.wikipedia.org/wiki/Cartesian_coordinate_system).
As they are by convention drawn with west on the left and north at the top,
this means that `x` represents longitude, and `y` latitude. As stated above,
OpenLayers is designed to handle all projections, but the default view is in
projected Cartesian coordinates. It would make no sense to have duplicate
functions to handle coordinates in both the Cartesian `x,y` and `lat,lon`
systems, so the degrees of latitude and longitude should be entered as though
they were Cartesian, in other words, they are `lon,lat`.
If you have difficulty remembering which way round it is, use the language code
for English, `en`, as a mnemonic: East before North.
#### A practical example
So you want to center your map on a certain place on the earth and obviously you
need to have its coordinates for this. Let's assume you want your map centered
on Schladming, a beautiful place in Austria. Head over to the wikipedia

View File

@@ -167,8 +167,6 @@ The minimum config file looks like this:
"node_modules/openlayers/externs/topojson.js"
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false",
"ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false"
@@ -177,9 +175,6 @@ The minimum config file looks like this:
"node_modules/openlayers/externs/olx.js",
"node_modules/openlayers/externs/oli.js"
],
"jscomp_off": [
"unknownDefines"
],
"extra_annotation_name": [
"api", "observable"
],
@@ -223,7 +218,6 @@ Here is a version of `config.json` with more compilation checks enabled:
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false",
"ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false"
@@ -233,41 +227,13 @@ Here is a version of `config.json` with more compilation checks enabled:
"node_modules/openlayers/externs/oli.js"
],
"jscomp_error": [
"accessControls",
"ambiguousFunctionDecl",
"checkEventfulObjectDisposal",
"checkRegExp",
"checkTypes",
"checkVars",
"const",
"constantProperty",
"deprecated",
"duplicateMessage",
"es3",
"es5Strict",
"externsValidation",
"fileoverviewTags",
"globalThis",
"internetExplorerChecks",
"invalidCasts",
"misplacedTypeAnnotation",
"missingGetCssName",
"missingProperties",
"missingProvide",
"missingRequire",
"missingReturn",
"newCheckTypes",
"nonStandardJsDocs",
"suspiciousCode",
"strictModuleDepCheck",
"typeInvalidation",
"undefinedNames",
"undefinedVars",
"uselessCode",
"visibility"
"*"
],
"jscomp_off": [
"unknownDefines"
"useOfGoogBase",
"lintChecks",
"analyzerChecks"
],
"extra_annotation_name": [
"api", "observable"

View File

@@ -13,7 +13,7 @@ This particular tutorial explains how to create custom builds of OpenLayers 3.
## Requirements
OpenLayers 3's build tools use Node and Java, so you need to have Node and Java installed on your machine. You can run `node --version` and `java -version` to test that Node and Java are installed, respectively.
OpenLayers 3's build tools use Node and Java, so you need to have Node and Java installed on your machine. You can run `node --version` and `java -version` to test that Node and Java are installed, respectively. See [developing guide](https://github.com/openlayers/ol3/blob/master/DEVELOPING.md) for minimum version numbers required.
## Download OpenLayers
@@ -60,17 +60,12 @@ Creating a custom build requires writing a build configuration file. The format
"externs/topojson.js"
],
"define": [
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false"
],
"jscomp_off": [
"unknownDefines"
],
"extra_annotation_name": [
"api", "observable"
],
"compilation_level": "ADVANCED_OPTIMIZATIONS",
"compilation_level": "ADVANCED",
"manage_closure_dependencies": true
}
}
@@ -192,16 +187,19 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openla
{
"exports": [
"ol.layer.Heatmap",
"ol.source.KML",
"ol.source.Vector",
"ol.format.KML",
"ol.layer.Heatmap#getSource",
"ol.source.KML#on",
"ol.source.Vector#on",
"ol.source.VectorEvent#feature",
"ol.Feature#get",
"ol.Feature#set",
"ol.layer.Tile",
"ol.source.Stamen",
"ol.Map",
"ol.View"
"ol.View",
"ol.layer.Heatmap#setRadius",
"ol.layer.Heatmap#setBlur"
],
"compile": {
"externs": [
@@ -213,10 +211,9 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openla
"ol.ENABLE_WEBGL=false",
"ol.ENABLE_PROJ4JS=false",
"ol.ENABLE_IMAGE=false",
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.DEBUG=false"
],
"compilation_level": "ADVANCED_OPTIMIZATIONS",
"compilation_level": "ADVANCED",
"manage_closure_dependencies": true
}
}
@@ -226,6 +223,10 @@ The exports are given here in the order in which they occur in the `heatmaps-ear
As this example uses a vector layer it is necessary to remove `"ol.ENABLE_VECTOR=false"` in the `define` section of the configuration.
## Maintaining the code
If you installed OpenLayers from the Node package, you can use `npm` to upgrade to the latest version. If you cloned the Github repo, simply pulling in the latest code may not be enough, as some of the packages used, for example, the compiler, may need upgrading too. Do this by using `npm install` rather than `npm update`.
## Conclusion
This tutorial should have given you the information you need to create custom builds, i.e. builds tailored to your application. See the [tasks readme](https://github.com/openlayers/ol3/tree/master/tasks/readme.md) for more information on the build scripts and the properties you can use in the build configuration file.

View File

@@ -24,7 +24,7 @@ Although Closure library functions are widely used within OL3, none of them are
Unlike in, say, Node, where a module's exports are fixed in the source, with Closure Compiler, exports can be defined at compile time. This makes it easy to create builds that are customized to the needs of a particular site or application: a __custom build__ only exports those properties and methods needed by the site or application. As the full build is large, and will probably become larger as new features are added to the API, it's recommended that sites create a custom build for production software.
## Renderers and Browser Support
The library currently includes three renderers: Canvas, DOM, and WebGL. All three support raster data from tile/image servers, but only the Canvas renderer currently supports vector data. This means that only those browsers that [support Canvas](http://caniuse.com/canvas) can handle vector data. In particular, this excludes Internet Explorer versions before 9, though there is some support for those in the DOM renderer. Clearly, the WebGL renderer can only be used on those devices and browsers supporting WebGL.
The library currently includes three renderers: Canvas, DOM, and WebGL. All three support both raster data from tile/image servers, and vector data; WebGL however only supports Point vectors and does not support labels. Clearly only those browsers that [support Canvas](http://caniuse.com/canvas) can use the Canvas renderer. Equally, the WebGL renderer can only be used on those devices and [browsers](http://caniuse.com/webgl) that support WebGL. Internet Explorer versions before 9 are not supported at all.
The library is intended for use on both desktop/laptop and mobile devices.

View File

@@ -6,7 +6,7 @@ docs: >
<p>When the Bing Maps tile service doesn't have tiles for a given resolution and region it returns "placeholder" tiles indicating that. Zoom the map beyond level 19 to see the "placeholder" tiles. If you want OpenLayers to display stretched tiles in place of "placeholder" tiles beyond zoom level 19 then set <code>maxZoom</code> to <code>19</code> in the options passed to <code>ol.source.BingMaps</code>.</p>
tags: "bing, bing-maps"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map"></div>
<select id="layer-select">

26
examples/cartodb.html Normal file
View File

@@ -0,0 +1,26 @@
---
layout: example.html
title: CartoDB source example
shortdesc: Example of a cartodb map.
docs: >
A simple example with an anonymous cartodb map
tags: "simple, openstreetmap, attribution"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<div>
<form class="form-horizontal">
<label>
Show countries larger than
<select id="country-area" class="form-control">
<option value="0" default>0 ㎢</option>
<option value="5000">5000 ㎢</option>
<option value="10000">10000 ㎢</option>
<option value="50000">50000 ㎢</option>
<option value="100000">100000 ㎢</option>
</select>
</label>
</form>
</div>
</div>

48
examples/cartodb.js Normal file
View File

@@ -0,0 +1,48 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.CartoDB');
goog.require('ol.source.OSM');
var mapConfig = {
'layers': [{
'type': 'cartodb',
'options': {
'cartocss_version': '2.1.1',
'cartocss': '#layer { polygon-fill: #F00; }',
'sql': 'select * from european_countries_e where area > 0'
}
}]
};
var cartoDBSource = new ol.source.CartoDB({
account: 'documentation',
config: mapConfig
});
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
new ol.layer.Tile({
source: cartoDBSource
})
],
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 2
})
});
function setArea(n) {
mapConfig.layers[0].options.sql =
'select * from european_countries_e where area > ' + n;
cartoDBSource.setConfig(mapConfig);
}
document.getElementById('country-area').addEventListener('change', function() {
setArea(this.value);
});

File diff suppressed because one or more lines are too long

View File

@@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" version="1.0.0">
<sld:NamedLayer>
<sld:Name>countries</sld:Name>
<sld:UserStyle>
<sld:Name>countries</sld:Name>
<sld:Title>A sample style for countries</sld:Title>
<sld:IsDefault>1</sld:IsDefault>
<sld:Abstract>A sample style for countries</sld:Abstract>
<sld:FeatureTypeStyle>
<sld:Name>name</sld:Name>
<sld:Rule>
<sld:Name>Sample</sld:Name>
<sld:Title>Sample</sld:Title>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:CssParameter name="fill">#ff0000</sld:CssParameter>
<sld:CssParameter name="fill-opacity">0.6</sld:CssParameter>
</sld:Fill>
<sld:Stroke>
<sld:CssParameter name="stroke">#00FF00</sld:CssParameter>
<sld:CssParameter name="stroke-opacity">0.5</sld:CssParameter>
<sld:CssParameter name="stroke-width">4</sld:CssParameter>
</sld:Stroke>
</sld:PolygonSymbolizer>
</sld:Rule>
<sld:Rule>
<sld:MaxScaleDenominator>20000000</sld:MaxScaleDenominator>
<sld:TextSymbolizer>
<sld:Label>
<ogc:PropertyName>name</ogc:PropertyName>
</sld:Label>
<sld:Font>
<sld:CssParameter name="font-family">Arial</sld:CssParameter>
<sld:CssParameter name="font-size">10</sld:CssParameter>
<sld:CssParameter name="font-style">Normal</sld:CssParameter>
</sld:Font>
</sld:TextSymbolizer>
</sld:Rule>
</sld:FeatureTypeStyle>
</sld:UserStyle>
</sld:NamedLayer>
</sld:StyledLayerDescriptor>

View File

@@ -6,7 +6,7 @@ docs: >
Example of using the drag-and-drop interaction with a ol.source.ImageVector. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. Each file is rendered to an image on the client.
tags: "drag-and-drop-image-vector, gpx, geojson, igc, kml, topojson, vector, image"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map"></div>
<div id="info">&nbsp;</div>

View File

@@ -6,7 +6,7 @@ docs: >
Example of using the drag-and-drop interaction. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. There is no projection transform support, so this will only work with data in EPSG:4326 and EPSG:3857.
tags: "drag-and-drop, gpx, geojson, igc, kml, topojson"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map"></div>
<div id="info">&nbsp;</div>

View File

@@ -25,11 +25,13 @@ var map = new ol.Map({
})
});
var imageStyle = new ol.style.Circle({
radius: 5,
snapToPixel: false,
fill: new ol.style.Fill({color: 'yellow'}),
stroke: new ol.style.Stroke({color: 'red', width: 1})
var imageStyle = new ol.style.Style({
image: new ol.style.Circle({
radius: 5,
snapToPixel: false,
fill: new ol.style.Fill({color: 'yellow'}),
stroke: new ol.style.Stroke({color: 'red', width: 1})
})
});
var headInnerImageStyle = new ol.style.Style({
@@ -40,10 +42,12 @@ var headInnerImageStyle = new ol.style.Style({
})
});
var headOuterImageStyle = new ol.style.Circle({
radius: 5,
snapToPixel: false,
fill: new ol.style.Fill({color: 'black'})
var headOuterImageStyle = new ol.style.Style({
image: new ol.style.Circle({
radius: 5,
snapToPixel: false,
fill: new ol.style.Fill({color: 'black'})
})
});
var n = 200;
@@ -63,16 +67,16 @@ map.on('postcompose', function(event) {
var y = (R + r) * Math.sin(t) + p * Math.sin((R + r) * t / r);
coordinates.push([x, y]);
}
vectorContext.setImageStyle(imageStyle);
vectorContext.drawMultiPointGeometry(
new ol.geom.MultiPoint(coordinates), null);
vectorContext.setStyle(imageStyle);
vectorContext.drawGeometry(new ol.geom.MultiPoint(coordinates));
var headPoint = new ol.geom.Point(coordinates[coordinates.length - 1]);
var headFeature = new ol.Feature(headPoint);
vectorContext.drawFeature(headFeature, headInnerImageStyle);
vectorContext.setImageStyle(headOuterImageStyle);
vectorContext.drawMultiPointGeometry(headPoint, null);
vectorContext.setStyle(headOuterImageStyle);
vectorContext.drawGeometry(headPoint);
vectorContext.setStyle(headInnerImageStyle);
vectorContext.drawGeometry(headPoint);
map.render();
});

View File

@@ -9,7 +9,6 @@
}
.tooltip.in {
opacity: 1;
filter: alpha(opacity=100);
}
.tooltip.top .tooltip-arrow {
border-top-color: white;

View File

@@ -25,13 +25,14 @@ var styleFunction = function(feature) {
if (!style) {
var canvas =
/** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
var render = ol.render.toContext(
var vectorContext = ol.render.toContext(
/** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')),
{size: [size + 2, size + 2], pixelRatio: size / 10});
render.setFillStrokeStyle(
new ol.style.Fill({color: 'rgba(255, 153, 0, 0.4)'}),
new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 1}));
render.drawPolygonGeometry(new ol.geom.Polygon(
vectorContext.setStyle(new ol.style.Style({
fill: new ol.style.Fill({color: 'rgba(255, 153, 0, 0.4)'}),
stroke: new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 1})
}));
vectorContext.drawGeometry(new ol.geom.Polygon(
[[[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]]]));
style = new ol.style.Style({
image: new ol.style.Icon({

View File

@@ -12,6 +12,7 @@ goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var map = new ol.Map({
@@ -67,17 +68,19 @@ function flash(feature) {
var radius = ol.easing.easeOut(elapsedRatio) * 25 + 5;
var opacity = ol.easing.easeOut(1 - elapsedRatio);
var flashStyle = new ol.style.Circle({
radius: radius,
snapToPixel: false,
stroke: new ol.style.Stroke({
color: 'rgba(255, 0, 0, ' + opacity + ')',
width: 1
var style = new ol.style.Style({
image: new ol.style.Circle({
radius: radius,
snapToPixel: false,
stroke: new ol.style.Stroke({
color: 'rgba(255, 0, 0, ' + opacity + ')',
width: 0.25 + opacity
})
})
});
vectorContext.setImageStyle(flashStyle);
vectorContext.drawPointGeometry(flashGeom, null);
vectorContext.setStyle(style);
vectorContext.drawGeometry(flashGeom);
if (elapsed > duration) {
ol.Observable.unByKey(listenerKey);
return;

View File

@@ -27,12 +27,11 @@ var map = new ol.Map({
})
});
var defaultStroke = new ol.style.Stroke({
color: '#EAE911',
width: 2
});
var defaultStyle = new ol.style.Style({
stroke: defaultStroke
var style = new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#EAE911',
width: 2
})
});
var flightsSource;
@@ -47,14 +46,13 @@ var pointsPerMs = 0.1;
var animateFlights = function(event) {
var vectorContext = event.vectorContext;
var frameState = event.frameState;
vectorContext.setFillStrokeStyle(null, defaultStroke);
vectorContext.setStyle(style);
var features = flightsSource.getFeatures();
for (var i = 0; i < features.length; i++) {
var feature = features[i];
if (!feature.get('finished')) {
// only draw the lines for which the animation has not
// finished yet
// only draw the lines for which the animation has not finished yet
var coords = feature.getGeometry().getCoordinates();
var elapsedTime = frameState.time - feature.get('start');
var elapsedPoints = elapsedTime * pointsPerMs;
@@ -67,19 +65,17 @@ var animateFlights = function(event) {
var currentLine = new ol.geom.LineString(coords.slice(0, maxIndex));
// directly draw the line with the vector context
vectorContext.drawLineStringGeometry(currentLine, feature);
vectorContext.drawGeometry(currentLine);
}
}
// tell OL3 to continue the postcompose animation
// tell OL3 to continue the animation
map.render();
};
flightsSource = new ol.source.Vector({
wrapX: false,
attributions: [new ol.Attribution({
html: 'Flight data by ' +
'<a href="http://openflights.org/data.html">OpenFlights</a>,'
})],
attributions: 'Flight data by ' +
'<a href="http://openflights.org/data.html">OpenFlights</a>,',
loader: function() {
var url = 'data/openflights/flights.json';
fetch(url).then(function(response) {
@@ -121,7 +117,7 @@ var flightsLayer = new ol.layer.Vector({
// if the animation is still active for a feature, do not
// render the feature with the layer style
if (feature.get('finished')) {
return defaultStyle;
return style;
} else {
return null;
}

View File

@@ -33,7 +33,7 @@ var map = new ol.Map({
});
function makeFractal(depth) {
var geometry = /** @type {ol.geom.LineString} */ (triangle.clone());
var geometry = triangle.clone();
var graph = coordsToGraph(geometry.getCoordinates());
for (var i = 0; i < depth; ++i) {
var node = graph;

View File

@@ -7,6 +7,6 @@ docs: >
<p>If there is no button on the map, your browser does not support the <a href="http://caniuse.com/#feat=fullscreen">Full Screen API</a>.</p>
tags: "full-screen, drag, rotate, zoom, bing, bing-maps"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map"></div>

View File

@@ -7,6 +7,6 @@ docs: >
<p>If there is no button on the map, your browser does not support the <a href="http://caniuse.com/#feat=fullscreen">Full Screen API</a>.</p>
tags: "full-screen, bing, bing-maps"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map"></div>

View File

@@ -9,8 +9,6 @@ docs: >
`ol.format.WMSGetFeatureInfo` format object, which allows features returned
by a single WMS GetFeatureInfo request that asks for more than one layer
to be read by layer name.
resources:
- https://code.jquery.com/jquery-1.11.2.min.js
---
<table id="info">
<tr>

View File

@@ -1,24 +1,23 @@
goog.require('ol.format.WMSGetFeatureInfo');
$.ajax({
url: './data/wmsgetfeatureinfo/osm-restaurant-hotel.xml',
success: function(response) {
fetch('data/wmsgetfeatureinfo/osm-restaurant-hotel.xml').then(function(response) {
return response.text();
}).then(function(response) {
// this is the standard way to read the features
var allFeatures = new ol.format.WMSGetFeatureInfo().readFeatures(response);
$('#all').html(allFeatures.length.toString());
// this is the standard way to read the features
var allFeatures = new ol.format.WMSGetFeatureInfo().readFeatures(response);
document.getElementById('all').innerText = allFeatures.length.toString();
// when specifying the 'layers' options, only the features of those
// layers are returned by the format
var hotelFeatures = new ol.format.WMSGetFeatureInfo({
layers: ['hotel']
}).readFeatures(response);
$('#hotel').html(hotelFeatures.length.toString());
// when specifying the 'layers' options, only the features of those
// layers are returned by the format
var hotelFeatures = new ol.format.WMSGetFeatureInfo({
layers: ['hotel']
}).readFeatures(response);
document.getElementById('hotel').innerText = hotelFeatures.length.toString();
var restaurantFeatures = new ol.format.WMSGetFeatureInfo({
layers: ['restaurant']
}).readFeatures(response);
$('#restaurant').html(restaurantFeatures.length.toString());
var restaurantFeatures = new ol.format.WMSGetFeatureInfo({
layers: ['restaurant']
}).readFeatures(response);
document.getElementById('restaurant').innerText = restaurantFeatures.length.toString();
}
});

View File

@@ -6,7 +6,7 @@ docs: >
Example of using the GPX source.
tags: "GPX"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map"></div>
<div id="info">&nbsp;</div>

View File

@@ -86,10 +86,7 @@ var map = new ol.Map({
new ol.layer.Tile({
source: new ol.source.OSM({
attributions: [
new ol.Attribution({
html: 'All maps &copy; ' +
'<a href="http://www.opencyclemap.org/">OpenCycleMap</a>'
}),
'All maps © <a href="http://www.opencyclemap.org/">OpenCycleMap</a>',
ol.source.OSM.ATTRIBUTION
],
url: 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png'
@@ -155,27 +152,26 @@ map.on('click', function(evt) {
displaySnap(evt.coordinate);
});
var imageStyle = new ol.style.Circle({
radius: 5,
fill: null,
stroke: new ol.style.Stroke({
color: 'rgba(255,0,0,0.9)',
width: 1
})
});
var strokeStyle = new ol.style.Stroke({
var stroke = new ol.style.Stroke({
color: 'rgba(255,0,0,0.9)',
width: 1
})
var style = new ol.style.Style({
stroke: stroke,
image: new ol.style.Circle({
radius: 5,
fill: null,
stroke: stroke
})
});
map.on('postcompose', function(evt) {
var vectorContext = evt.vectorContext;
vectorContext.setStyle(style);
if (point !== null) {
vectorContext.setImageStyle(imageStyle);
vectorContext.drawPointGeometry(point);
vectorContext.drawGeometry(point);
}
if (line !== null) {
vectorContext.setFillStrokeStyle(null, strokeStyle);
vectorContext.drawLineStringGeometry(line);
vectorContext.drawGeometry(line);
}
});
@@ -187,8 +183,7 @@ var featureOverlay = new ol.layer.Vector({
radius: 5,
fill: new ol.style.Fill({
color: 'rgba(255,0,0,0.9)'
}),
stroke: null
})
})
})
});

View File

@@ -8,7 +8,7 @@ docs: >
In this example, the <code>postcompose</code> listener applies a filter to the image data.</p>
tags: "filter, image manipulation"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map"></div>
<select id="kernel" name="kernel">

View File

@@ -190,12 +190,15 @@
<span id="count"></span>
</form>
</div>
<ul class="nav navbar-nav pull-right">
<li><a href="../doc">Docs</a></li>
<li><a class="active" href="index.html">Examples</a></li>
<li><a href="../apidoc">API</a></li>
<li><a href="https://github.com/openlayers/ol3">Code</a></li>
</ul>
<!-- menu items that get hidden below 768px width -->
<nav class='collapse navbar-collapse navbar-responsive-collapse'>
<ul class="nav navbar-nav pull-right">
<li><a href="../doc">Docs</a></li>
<li><a class="active" href="index.html">Examples</a></li>
<li><a href="../apidoc">API</a></li>
<li><a href="https://github.com/openlayers/ol3">Code</a></li>
</ul>
</nav>
</div>
</header>

View File

@@ -7,7 +7,6 @@ docs: >
with OpenLayers 3.
tags: "vector, jsts, buffer"
resources:
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/lib/0.17.0/javascript.util.min.js
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/lib/0.17.0/jsts.min.js
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/1.0.2/jsts.min.js
---
<div id="map" class="map"></div>

View File

@@ -18,7 +18,7 @@ fetch('data/geojson/roads-seoul.geojson').then(function(response) {
var format = new ol.format.GeoJSON();
var features = format.readFeatures(json, {featureProjection: 'EPSG:3857'});
var parser = new jsts.io.olParser();
var parser = new jsts.io.OL3Parser();
for (var i = 0; i < features.length; i++) {
var feature = features[i];

View File

@@ -9,7 +9,6 @@
}
.tooltip.in {
opacity: 1;
filter: alpha(opacity=100);
}
.tooltip.top .tooltip-arrow {
border-top-color: white;

View File

@@ -6,7 +6,7 @@ docs: >
This example uses the <code>ol.format.KML</code> to parse KML for rendering with a vector source.
tags: "KML"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map"></div>
<div id="info">&nbsp;</div>

View File

@@ -10,6 +10,6 @@ docs: >
<p>Move around the map to see the effect. Use the ↑ up and ↓ down arrow keys to adjust the spyglass size.</p>
tags: "spy, image manipulation"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map"></div>

View File

@@ -6,7 +6,7 @@ docs: >
Example of a Layer swipe map.
tags: "swipe, openstreetmap"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map"></div>
<input id="swipe" type="range" style="width: 100%">

View File

@@ -9,10 +9,7 @@ goog.require('ol.source.OSM');
var openCycleMapLayer = new ol.layer.Tile({
source: new ol.source.OSM({
attributions: [
new ol.Attribution({
html: 'All maps &copy; ' +
'<a href="http://www.opencyclemap.org/">OpenCycleMap</a>'
}),
'All maps © <a href="http://www.opencyclemap.org/">OpenCycleMap</a>',
ol.source.OSM.ATTRIBUTION
],
url: 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png'
@@ -22,10 +19,7 @@ var openCycleMapLayer = new ol.layer.Tile({
var openSeaMapLayer = new ol.layer.Tile({
source: new ol.source.OSM({
attributions: [
new ol.Attribution({
html: 'All maps &copy; ' +
'<a href="http://www.openseamap.org/">OpenSeaMap</a>'
}),
'All maps © <a href="http://www.openseamap.org/">OpenSeaMap</a>',
ol.source.OSM.ATTRIBUTION
],
opaque: false,

View File

@@ -45,11 +45,9 @@ var map = new ol.Map({
new ol.layer.VectorTile({
preload: Infinity,
source: new ol.source.VectorTile({
attributions: [new ol.Attribution({
html: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
'© <a href="http://www.openstreetmap.org/copyright">' +
'OpenStreetMap contributors</a>'
})],
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
'© <a href="http://www.openstreetmap.org/copyright">' +
'OpenStreetMap contributors</a>',
format: new ol.format.MVT(),
tileGrid: new ol.tilegrid.TileGrid({
extent: ol.proj.get('EPSG:3857').getExtent(),

View File

@@ -17,11 +17,9 @@ var map = new ol.Map({
layers: [
new ol.layer.VectorTile({
source: new ol.source.VectorTile({
attributions: [new ol.Attribution({
html: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
'© <a href="http://www.openstreetmap.org/copyright">' +
'OpenStreetMap contributors</a>'
})],
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
'© <a href="http://www.openstreetmap.org/copyright">' +
'OpenStreetMap contributors</a>',
format: new ol.format.MVT(),
tileGrid: ol.tilegrid.createXYZ({maxZoom: 22}),
tilePixelRatio: 16,

View File

@@ -1,19 +1,19 @@
---
layout: example.html
title: Measure
shortdesc: Example of using the ol.interaction.Draw interaction for creating simple measuring application.
shortdesc: Example of using the ol.interaction.Draw interaction to create a simple measuring application.
docs: >
<p><i>NOTE: If use geodesic measures is not checked, measure is done in simple way on projected plane. Earth curvature is not taken into account</i></p>
<p><i>NOTE: By default, length and area are calculated using the projected coordinates. This is not accurate for projections like Mercator where the projected meters do not correspond to meters on the ground. To get a standarized measurement across all projections, use the geodesic measures.</i></p>
tags: "draw, edit, measure, vector"
resources:
- https://code.jquery.com/jquery-1.11.2.min.js
---
<div id="map" class="map"></div>
<form class="form-inline">
<label>Geometry type &nbsp;</label>
<label>Measurement type &nbsp;</label>
<select id="type">
<option value="length">Length</option>
<option value="area">Area</option>
<option value="length">Length (LineString)</option>
<option value="area">Area (Polygon)</option>
</select>
<label class="checkbox">
<input type="checkbox" id="geodesic">

View File

@@ -174,7 +174,7 @@ var formatLength = function(line) {
/**
* Format length output.
* Format area output.
* @param {ol.geom.Polygon} polygon The polygon.
* @return {string} Formatted area.
*/
@@ -243,10 +243,10 @@ function addInteraction() {
var geom = evt.target;
var output;
if (geom instanceof ol.geom.Polygon) {
output = formatArea(/** @type {ol.geom.Polygon} */ (geom));
output = formatArea(geom);
tooltipCoord = geom.getInteriorPoint().getCoordinates();
} else if (geom instanceof ol.geom.LineString) {
output = formatLength(/** @type {ol.geom.LineString} */ (geom));
output = formatLength(geom);
tooltipCoord = geom.getLastCoordinate();
}
measureTooltipElement.innerHTML = output;

View File

@@ -4,7 +4,7 @@ title: Full-Screen Mobile
shortdesc: Example of a full screen map.
tags: "fullscreen, geolocation, mobile"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<!doctype html>
<html lang="en">

View File

@@ -6,7 +6,7 @@ docs: >
<p>The map on the top preloads low resolution tiles. The map on the bottom does not use any preloading. Try zooming out and panning to see the difference.</p>
tags: "preload, bing"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map1" class="map"></div>
<div id="map2" class="map"></div>

View File

@@ -22,7 +22,7 @@ tags: "raster, pixel"
resources:
- http://d3js.org/d3.v3.min.js
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div class="rel">
<div id="map" class="map"></div>

View File

@@ -25,7 +25,7 @@ docs: >
</p>
tags: "raster, region growing"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map" style="cursor: pointer"></div>
<table class="controls">

View File

@@ -59,7 +59,7 @@ function growRegion(inputs, data) {
}
edge = newedge;
}
return new ImageData(outputData, width, height);
return {data: outputData, width: width, height: height};
}
function next4Edges(edge) {

View File

@@ -5,21 +5,25 @@ goog.require('ol.render');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var canvas = document.getElementById('canvas');
var render = ol.render.toContext(canvas.getContext('2d'), {size: [100, 100]});
var vectorContext = ol.render.toContext(canvas.getContext('2d'), {size: [100, 100]});
var fill = new ol.style.Fill({color: 'blue'});
var stroke = new ol.style.Stroke({color: 'black'});
render.setFillStrokeStyle(fill, stroke);
render.setImageStyle(new ol.style.Circle({
radius: 10,
var style = new ol.style.Style({
fill: fill,
stroke: stroke
}));
stroke: stroke,
image: new ol.style.Circle({
radius: 10,
fill: fill,
stroke: stroke
})
})
vectorContext.setStyle(style);
render.drawLineStringGeometry(new ol.geom.LineString([[10, 10], [90, 90]]));
render.drawPolygonGeometry(
new ol.geom.Polygon([[[2, 2], [98, 2], [2, 98], [2, 2]]]));
render.drawPointGeometry(new ol.geom.Point([88, 88]));
vectorContext.drawGeometry(new ol.geom.LineString([[10, 10], [90, 90]]));
vectorContext.drawGeometry(new ol.geom.Polygon([[[2, 2], [98, 2], [2, 98], [2, 2]]]));
vectorContext.drawGeometry(new ol.geom.Point([88, 88]));

View File

@@ -81,12 +81,8 @@ layers['wms4326'] = new ol.layer.Tile({
layers['wms21781'] = new ol.layer.Tile({
source: new ol.source.TileWMS({
attributions: [new ol.Attribution({
html: '&copy; ' +
'<a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">' +
'Pixelmap 1:1000000 / geo.admin.ch</a>'
})],
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">Pixelmap 1:1000000 / geo.admin.ch</a>',
crossOrigin: 'anonymous',
params: {
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
@@ -120,10 +116,8 @@ layers['grandcanyon'] = new ol.layer.Tile({
crossOrigin: '',
tilePixelRatio: 2,
maxZoom: 15,
attributions: [new ol.Attribution({
html: 'Tiles &copy; USGS, rendered with ' +
'<a href="http://www.maptiler.com/">MapTiler</a>'
})]
attributions: 'Tiles © USGS, rendered with ' +
'<a href="http://www.maptiler.com/">MapTiler</a>'
})
});

View File

@@ -99,7 +99,7 @@ function shade(inputs, data) {
}
}
return new ImageData(shadeData, width, height);
return {data: shadeData, width: width, height: height};
}
var elevation = new ol.source.XYZ({

View File

@@ -21,11 +21,7 @@ var map = new ol.Map({
layers: [
new ol.layer.Image({
source: new ol.source.ImageStatic({
attributions: [
new ol.Attribution({
html: '&copy; <a href="http://xkcd.com/license.html">xkcd</a>'
})
],
attributions: '© <a href="http://xkcd.com/license.html">xkcd</a>',
url: 'http://imgs.xkcd.com/comics/online_communities.png',
projection: projection,
imageExtent: extent

View File

@@ -96,27 +96,26 @@ map.on('click', function(evt) {
displaySnap(evt.coordinate);
});
var imageStyle = new ol.style.Circle({
radius: 10,
fill: null,
stroke: new ol.style.Stroke({
color: 'rgba(255,255,0,0.9)',
width: 3
})
});
var strokeStyle = new ol.style.Stroke({
var stroke = new ol.style.Stroke({
color: 'rgba(255,255,0,0.9)',
width: 3
});
var style = new ol.style.Style({
stroke: stroke,
image: new ol.style.Circle({
radius: 10,
stroke: stroke
})
});
map.on('postcompose', function(evt) {
var vectorContext = evt.vectorContext;
vectorContext.setStyle(style);
if (point !== null) {
vectorContext.setImageStyle(imageStyle);
vectorContext.drawPointGeometry(point);
vectorContext.drawGeometry(point);
}
if (line !== null) {
vectorContext.setFillStrokeStyle(null, strokeStyle);
vectorContext.drawLineStringGeometry(line);
vectorContext.drawGeometry(line);
}
});

View File

@@ -53,14 +53,10 @@ var vector = new ol.layer.Vector({
source: vectorSource
});
var attribution = new ol.Attribution({
html: 'Tiles &copy; <a href="http://services.arcgisonline.com/ArcGIS/' +
'rest/services/World_Topo_Map/MapServer">ArcGIS</a>'
});
var raster = new ol.layer.Tile({
source: new ol.source.XYZ({
attributions: [attribution],
attributions: 'Tiles © <a href="http://services.arcgisonline.com/ArcGIS/' +
'rest/services/World_Topo_Map/MapServer">ArcGIS</a>',
url: 'http://server.arcgisonline.com/ArcGIS/rest/services/' +
'World_Topo_Map/MapServer/tile/{z}/{y}/{x}'
})

View File

@@ -95,15 +95,10 @@ var vector = new ol.layer.Vector({
}
});
var attribution = new ol.Attribution({
html: 'Tiles &copy; <a href="http://services.arcgisonline.com/ArcGIS/' +
'rest/services/World_Topo_Map/MapServer">ArcGIS</a>'
});
var raster = new ol.layer.Tile({
source: new ol.source.XYZ({
attributions: [attribution],
attributions: 'Tiles © <a href="http://services.arcgisonline.com/ArcGIS/' +
'rest/services/World_Topo_Map/MapServer">ArcGIS</a>',
url: 'http://server.arcgisonline.com/ArcGIS/rest/services/' +
'World_Topo_Map/MapServer/tile/{z}/{y}/{x}'
})

View File

@@ -6,6 +6,6 @@ docs: >
OSM XML vector data is loaded dynamically from a server using a tiling strategy.
tags: "vector, osm, xml, loading, server"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map"></div>

View File

@@ -6,6 +6,6 @@ docs: >
This example loads new features from GeoServer WFS when the view extent changes.
tags: "vector, WFS, bbox, loading, server"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map"></div>

View File

@@ -48,12 +48,8 @@ var layers = [
source: new ol.source.TileWMS({
url: 'http://wms.geo.admin.ch/',
crossOrigin: 'anonymous',
attributions: [new ol.Attribution({
html: '&copy; ' +
'<a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">' +
'Pixelmap 1:1000000 / geo.admin.ch</a>'
})],
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">Pixelmap 1:1000000 / geo.admin.ch</a>',
params: {
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
'FORMAT': 'image/jpeg'
@@ -66,12 +62,8 @@ var layers = [
source: new ol.source.TileWMS({
url: 'http://wms.geo.admin.ch/',
crossOrigin: 'anonymous',
attributions: [new ol.Attribution({
html: '&copy; ' +
'<a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">' +
'National parks / geo.admin.ch</a>'
})],
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">National parks / geo.admin.ch</a>',
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
serverType: 'mapserver'
})

View File

@@ -36,12 +36,8 @@ var layers = [
source: new ol.source.ImageWMS({
url: 'http://wms.geo.admin.ch/',
crossOrigin: 'anonymous',
attributions: [new ol.Attribution({
html: '&copy; ' +
'<a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">' +
'Pixelmap 1:1000000 / geo.admin.ch</a>'
})],
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">Pixelmap 1:1000000 / geo.admin.ch</a>',
params: {
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
'FORMAT': 'image/jpeg'
@@ -54,12 +50,8 @@ var layers = [
source: new ol.source.ImageWMS({
url: 'http://wms.geo.admin.ch/',
crossOrigin: 'anonymous',
attributions: [new ol.Attribution({
html: '&copy; ' +
'<a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">' +
'National parks / geo.admin.ch</a>'
})],
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">National parks / geo.admin.ch</a>',
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
serverType: /** @type {ol.source.wms.ServerType} */ ('mapserver')
})

View File

@@ -11,12 +11,8 @@ goog.require('ol.source.TileWMS');
var layers = [
new ol.layer.Tile({
source: new ol.source.TileWMS({
attributions: [new ol.Attribution({
html: '&copy; ' +
'<a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">' +
'Pixelmap 1:1000000 / geo.admin.ch</a>'
})],
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">Pixelmap 1:1000000 / geo.admin.ch</a>',
crossOrigin: 'anonymous',
params: {
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
@@ -27,12 +23,8 @@ var layers = [
}),
new ol.layer.Image({
source: new ol.source.ImageWMS({
attributions: [new ol.Attribution({
html: '&copy; ' +
'<a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">' +
'National parks / geo.admin.ch</a>'
})],
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">National parks / geo.admin.ch</a>',
crossOrigin: 'anonymous',
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
serverType: 'mapserver',

View File

@@ -33,13 +33,9 @@ var wmtsSource = new ol.source.WMTS({
format: 'image/png',
matrixSet: 'EPSG:3857',
attributions: [
new ol.Attribution({
html: '<a href="http://scalgo.com">SCALGO</a>'
}),
new ol.Attribution({
html: '<a href="http://www.cgiar-csi.org/data/' +
'srtm-90m-digital-elevation-database-v4-1">CGIAR-CSI SRTM</a>'
})
'<a href="http://scalgo.com">SCALGO</a>',
'<a href="http://www.cgiar-csi.org/data/' +
'srtm-90m-digital-elevation-database-v4-1">CGIAR-CSI SRTM</a>'
],
tileGrid: tileGrid,
style: 'default',

View File

@@ -21,12 +21,6 @@ for (var z = 0; z < 14; ++z) {
matrixIds[z] = z;
}
var attribution = new ol.Attribution({
html: 'Tiles &copy; <a href="http://services.arcgisonline.com/arcgis/rest/' +
'services/Demographics/USA_Population_Density/MapServer/">ArcGIS</a>'
});
var map = new ol.Map({
layers: [
new ol.layer.Tile({
@@ -36,7 +30,8 @@ var map = new ol.Map({
new ol.layer.Tile({
opacity: 0.7,
source: new ol.source.WMTS({
attributions: [attribution],
attributions: 'Tiles © <a href="http://services.arcgisonline.com/arcgis/rest/' +
'services/Demographics/USA_Population_Density/MapServer/">ArcGIS</a>',
url: 'http://services.arcgisonline.com/arcgis/rest/' +
'services/Demographics/USA_Population_Density/MapServer/WMTS/',
layer: '0',

View File

@@ -6,7 +6,7 @@ goog.require('ol.proj');
goog.require('ol.source.XYZ');
var attribution = new ol.Attribution({
html: 'Copyright:&copy; 2013 ESRI, i-cubed, GeoEye'
html: 'Copyright:© 2013 ESRI, i-cubed, GeoEye'
});
var projection = ol.proj.get('EPSG:4326');

View File

@@ -7,7 +7,7 @@ goog.require('ol.source.XYZ');
var attribution = new ol.Attribution({
html: 'Tiles &copy; <a href="http://services.arcgisonline.com/ArcGIS/' +
html: 'Tiles © <a href="http://services.arcgisonline.com/ArcGIS/' +
'rest/services/World_Topo_Map/MapServer">ArcGIS</a>'
});

View File

@@ -6,12 +6,6 @@ goog.require('ol.proj');
goog.require('ol.source.OSM');
goog.require('ol.source.XYZ');
var attribution = new ol.Attribution({
html: 'Tiles &copy; USGS, rendered with ' +
'<a href="http://www.maptiler.com/">MapTiler</a>'
});
var mapMinZoom = 1;
var mapMaxZoom = 15;
var mapExtent = [-112.261791, 35.983744, -112.113981, 36.132062];
@@ -25,7 +19,8 @@ var map = new ol.Map({
new ol.layer.Tile({
extent: ol.proj.transformExtent(mapExtent, 'EPSG:4326', 'EPSG:3857'),
source: new ol.source.XYZ({
attributions: [attribution],
attributions: 'Tiles © USGS, rendered with ' +
'<a href="http://www.maptiler.com/">MapTiler</a>',
url: 'http://tileserver.maptiler.com/grandcanyon@2x/{z}/{x}/{y}.png',
tilePixelRatio: 2, // THIS IS IMPORTANT
minZoom: mapMinZoom,

View File

@@ -6,6 +6,6 @@ docs: >
This map has a view that is constrained between zoom levels 9 and 13. This is done using the `minZoom` and `maxZoom` view options.
tags: "bing, zoom, minZoom, maxZoom"
cloak:
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://bingmapsportal.com/ here
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map"></div>

34
externs/cartodb.js Normal file
View File

@@ -0,0 +1,34 @@
/**
* @externs
*/
/**
* @constructor
*/
var CartoDBLayerInfo = function() {};
/**
* @type {string}
*/
CartoDBLayerInfo.prototype.layergroupid;
/**
* @type {string}
*/
CartoDBLayerInfo.prototype.updated_at;
/**
* @type {Object}
*/
CartoDBLayerInfo.prototype.metadata;
/**
* @type {{http: string, https: string}}
*/
CartoDBLayerInfo.prototype.cdn_url;

View File

@@ -15,13 +15,3 @@
* @see http://www.w3.org/TR/pointerevents/#the-touch-action-css-property
*/
CSSProperties.prototype.touchAction;
/**
* @type {number}
*/
WheelEvent.DOM_DELTA_LINE;
/**
* @type {number}
*/
WheelEvent.DOM_DELTA_PIXEL;

View File

@@ -9,6 +9,33 @@
var oli;
/**
* @interface
*/
oli.events.Event = function() {};
/**
* @type {Object}
*/
oli.events.Event.prototype.target;
/**
* @type {string}
*/
oli.events.Event.prototype.type;
/**
*/
oli.events.Event.prototype.preventDefault = function() {};
/**
*/
oli.events.Event.prototype.stopPropagation = function() {};
/**
* @interface
@@ -22,7 +49,6 @@ oli.CollectionEvent = function() {};
oli.CollectionEvent.prototype.element;
/**
* @interface
*/
@@ -41,7 +67,6 @@ oli.DragBoxEvent.prototype.coordinate;
oli.DragBoxEvent.prototype.mapBrowserEvent;
/**
* @interface
*/
@@ -54,7 +79,6 @@ oli.DrawEvent = function() {};
oli.DrawEvent.prototype.feature;
/**
* @interface
*/
@@ -73,7 +97,6 @@ oli.ModifyEvent.prototype.features;
oli.ModifyEvent.prototype.mapBrowserPointerEvent;
/**
* @interface
*/
@@ -92,7 +115,6 @@ oli.ObjectEvent.prototype.key;
oli.ObjectEvent.prototype.oldValue;
/**
* @interface
*/
@@ -123,7 +145,6 @@ oli.MapBrowserEvent.prototype.pixel;
oli.MapBrowserEvent.prototype.dragging;
/**
* @interface
*/
@@ -166,7 +187,6 @@ oli.SelectEvent.prototype.selected;
oli.SelectEvent.prototype.mapBrowserEvent;
/**
* @type {Object}
*/
@@ -186,7 +206,6 @@ oli.control.Control = function() {};
oli.control.Control.prototype.setMap = function(map) {};
/**
* @type {Object}
*/
@@ -217,7 +236,6 @@ oli.interaction.DragAndDropEvent.prototype.projection;
oli.interaction.DragAndDropEvent.prototype.file;
/**
* @interface
*/
@@ -242,7 +260,6 @@ oli.interaction.TranslateEvent.prototype.coordinate;
oli.render;
/**
* @interface
*/

View File

@@ -159,7 +159,7 @@ olx.interaction.InteractionOptions;
* Method called by the map to notify the interaction that a browser event was
* dispatched to the map. The function may return `false` to prevent the
* propagation of the event to other interactions in the map's interactions
* chain. Required.
* chain.
* @type {function(ol.MapBrowserEvent):boolean}
* @api
*/
@@ -281,7 +281,8 @@ olx.MapOptions.prototype.overlays;
* Renderer. By default, Canvas, DOM and WebGL renderers are tested for support
* in that order, and the first supported used. Specify a
* {@link ol.RendererType} here to use a specific renderer.
* Note that at present only the Canvas renderer supports vector data.
* Note that at present the Canvas and DOM renderers fully support vector data,
* but WebGL can only render Point geometries.
* @type {ol.RendererType|Array.<ol.RendererType|string>|string|undefined}
* @api stable
*/
@@ -1631,7 +1632,8 @@ olx.format.ReadOptions.prototype.featureProjection;
/**
* @typedef {{dataProjection: ol.proj.ProjectionLike,
* featureProjection: ol.proj.ProjectionLike,
* rightHanded: (boolean|undefined)}}
* rightHanded: (boolean|undefined),
* decimals: (number|undefined)}}
* @api
*/
olx.format.WriteOptions;
@@ -1650,7 +1652,8 @@ olx.format.WriteOptions.prototype.dataProjection;
/**
* Projection of the feature geometries that will be serialized by the format
* writer.
* writer. If not provided, geometries are assumed to be in the
* `dataProjection` if that is set; in other words, they are not transformed.
* @type {ol.proj.ProjectionLike}
* @api stable
*/
@@ -1673,6 +1676,20 @@ olx.format.WriteOptions.prototype.featureProjection;
olx.format.WriteOptions.prototype.rightHanded;
/**
* Maximum number of decimal places for coordinates. Coordinates are stored
* internally as floats, but floating-point arithmetic can create coordinates
* with a large number of decimal places, not generally wanted on output.
* Set a number here to round coordinates. Can also be used to ensure that
* coordinates read in can be written back out with the same number of decimals.
* Default is no rounding.
*
* @type {number|undefined}
* @api
*/
olx.format.WriteOptions.prototype.decimals;
/**
* @typedef {{defaultDataProjection: ol.proj.ProjectionLike,
* geometryName: (string|undefined)}}
@@ -2519,7 +2536,8 @@ olx.interaction.DragRotateOptions.prototype.duration;
/**
* @typedef {{className: (string|undefined),
* condition: (ol.events.ConditionType|undefined),
* duration: (number|undefined)}}
* duration: (number|undefined),
* out: (boolean|undefined)}}
* @api
*/
olx.interaction.DragZoomOptions;
@@ -2551,6 +2569,14 @@ olx.interaction.DragZoomOptions.prototype.condition;
olx.interaction.DragZoomOptions.prototype.duration;
/**
* Use interaction for zooming out. Default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.DragZoomOptions.prototype.out;
/**
* @typedef {{clickTolerance: (number|undefined),
* features: (ol.Collection.<ol.Feature>|undefined),
@@ -3087,7 +3113,9 @@ olx.interaction.SelectOptions.prototype.wrapX;
* @typedef {{
* features: (ol.Collection.<ol.Feature>|undefined),
* pixelTolerance: (number|undefined),
* source: (ol.source.Vector|undefined)
* source: (ol.source.Vector|undefined),
* edge: (boolean|undefined),
* vertex: (boolean|undefined)
* }}
* @api
*/
@@ -3101,6 +3129,21 @@ olx.interaction.SnapOptions;
*/
olx.interaction.SnapOptions.prototype.features;
/**
* Snap to edges. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.SnapOptions.prototype.edge;
/**
* Snap to vertices. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.SnapOptions.prototype.vertex;
/**
* Pixel tolerance for considering the pointer close enough to a segment or
@@ -3904,7 +3947,15 @@ olx.source;
/**
* @typedef {{culture: (string|undefined),
* @typedef {string|Array.<string>|ol.Attribution|Array.<ol.Attribution>}
* @api
*/
olx.source.AttributionOption;
/**
* @typedef {{cacheSize: (number|undefined),
* culture: (string|undefined),
* key: string,
* imagerySet: string,
* maxZoom: (number|undefined),
@@ -3916,6 +3967,14 @@ olx.source;
olx.source.BingMapsOptions;
/**
* Cache size. Default is `2048`.
* @type {number|undefined}
* @api
*/
olx.source.BingMapsOptions.prototype.cacheSize;
/**
* Culture code. Default is `en-us`.
* @type {string|undefined}
@@ -3925,7 +3984,7 @@ olx.source.BingMapsOptions.prototype.culture;
/**
* Bing Maps API key. Get yours at http://bingmapsportal.com/.
* Bing Maps API key. Get yours at http://www.bingmapsportal.com/.
* @type {string}
* @api stable
*/
@@ -3980,10 +4039,11 @@ olx.source.BingMapsOptions.prototype.wrapX;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* distance: (number|undefined),
* extent: (ol.Extent|undefined),
* format: (ol.format.Feature|undefined),
* geometryFunction: (undefined|function(ol.Feature):ol.geom.Point),
* logo: (string|undefined),
* projection: ol.proj.ProjectionLike,
* source: ol.source.Vector,
@@ -3995,7 +4055,7 @@ olx.source.ClusterOptions;
/**
* Attributions.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api
*/
olx.source.ClusterOptions.prototype.attributions;
@@ -4017,6 +4077,25 @@ olx.source.ClusterOptions.prototype.distance;
olx.source.ClusterOptions.prototype.extent;
/**
* Function that takes an {@link ol.Feature} as argument and returns an
* {@link ol.geom.Point} as cluster calculation point for the feature. When a
* feature should not be considered for clustering, the function should return
* `null`. The default, which works when the underyling source contains point
* features only, is
* ```js
* function(feature) {
* return feature.getGeometry();
* }
* ```
* See {@link ol.geom.Polygon#getInteriorPoint} for a way to get a cluster
* calculation point for polygons.
* @type {undefined|function(ol.Feature):ol.geom.Point}
* @api
*/
olx.source.ClusterOptions.prototype.geometryFunction;
/**
* Format.
* @type {ol.format.Feature|undefined}
@@ -4059,7 +4138,8 @@ olx.source.ClusterOptions.prototype.wrapX;
/**
* @typedef {{preemptive: (boolean|undefined),
* url: string}}
* tileJSON: (TileJSON|undefined),
* url: (string|undefined)}}
* @api
*/
olx.source.TileUTFGridOptions;
@@ -4079,14 +4159,26 @@ olx.source.TileUTFGridOptions.prototype.preemptive;
/**
* @type {string}
* TileJSON configuration for this source. If not provided, `url` must be
* configured.
* @type {TileJSON|undefined}
* @api
*/
olx.source.TileUTFGridOptions.prototype.tileJSON;
/**
* TileJSON endpoint that provides the configuration for this source. Request
* will be made through JSONP. If not provided, `tileJSON` must be configured.
* @type {string|undefined}
* @api
*/
olx.source.TileUTFGridOptions.prototype.url;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* cacheSize: (number|undefined),
* crossOrigin: (null|string|undefined),
* logo: (string|olx.LogoOptions|undefined),
* opaque: (boolean|undefined),
@@ -4110,12 +4202,20 @@ olx.source.TileImageOptions;
/**
* Attributions.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api
*/
olx.source.TileImageOptions.prototype.attributions;
/**
* Cache size. Default is `2048`.
* @type {number|undefined}
* @api
*/
olx.source.TileImageOptions.prototype.cacheSize;
/**
* The `crossOrigin` attribute for loaded images. Note that you must provide a
* `crossOrigin` value if you are using the WebGL renderer or if you want to
@@ -4249,7 +4349,8 @@ olx.source.TileImageOptions.prototype.wrapX;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* cacheSize: (number|undefined),
* format: (ol.format.Feature|undefined),
* logo: (string|olx.LogoOptions|undefined),
* opaque: (boolean|undefined),
@@ -4272,12 +4373,20 @@ olx.source.VectorTileOptions;
/**
* Attributions.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api
*/
olx.source.VectorTileOptions.prototype.attributions;
/**
* Cache size. Default is `128`.
* @type {number|undefined}
* @api
*/
olx.source.VectorTileOptions.prototype.cacheSize;
/**
* Feature format for tiles. Used and required by the default
* `tileLoadFunction`.
@@ -4338,12 +4447,16 @@ olx.source.VectorTileOptions.prototype.tileGrid;
/**
* Optional function to load a tile given a URL. The default is
* Optional function to load a tile given a URL. Could look like this:
* ```js
* function(tile, url) {
* tile.setLoader(
* ol.featureloader.tile(url, tile.getFormat()));
* };
* tile.setLoader(function() {
* var data = // ... fetch data
* var format = tile.getFormat();
* tile.setFeatures(format.readFeatures(data));
* tile.setProjection(format.readProjection(data));
* };
* });
* ```
* @type {ol.TileLoadFunctionType|undefined}
* @api
@@ -4498,7 +4611,8 @@ olx.source.ImageMapGuideOptions.prototype.params;
/**
* @typedef {{layer: string,
* @typedef {{cacheSize: (number|undefined),
* layer: string,
* reprojectionErrorThreshold: (number|undefined),
* tileLoadFunction: (ol.TileLoadFunctionType|undefined),
* url: (string|undefined)}}
@@ -4507,6 +4621,14 @@ olx.source.ImageMapGuideOptions.prototype.params;
olx.source.MapQuestOptions;
/**
* Cache size. Default is `2048`.
* @type {number|undefined}
* @api
*/
olx.source.MapQuestOptions.prototype.cacheSize;
/**
* Layer. Possible values are `osm`, `sat`, and `hyb`.
* @type {string}
@@ -4579,7 +4701,8 @@ olx.source.TileDebugOptions.prototype.wrapX;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* cacheSize: (number|undefined),
* crossOrigin: (null|string|undefined),
* maxZoom: (number|undefined),
* opaque: (boolean|undefined),
@@ -4594,12 +4717,20 @@ olx.source.OSMOptions;
/**
* Attributions.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api stable
*/
olx.source.OSMOptions.prototype.attributions;
/**
* Cache size. Default is `2048`.
* @type {number|undefined}
* @api
*/
olx.source.OSMOptions.prototype.cacheSize;
/**
* The `crossOrigin` attribute for loaded images. Note that you must provide a
* `crossOrigin` value if you are using the WebGL renderer or if you want to
@@ -4670,7 +4801,7 @@ olx.source.OSMOptions.prototype.wrapX;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* canvasFunction: ol.CanvasFunctionType,
* logo: (string|olx.LogoOptions|undefined),
* projection: ol.proj.ProjectionLike,
@@ -4684,7 +4815,7 @@ olx.source.ImageCanvasOptions;
/**
* Attributions.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api
*/
olx.source.ImageCanvasOptions.prototype.attributions;
@@ -4749,7 +4880,7 @@ olx.source.ImageCanvasOptions.prototype.state;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* logo: (string|olx.LogoOptions|undefined),
* projection: ol.proj.ProjectionLike,
* ratio: (number|undefined),
@@ -4763,7 +4894,7 @@ olx.source.ImageVectorOptions;
/**
* Attributions.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api
*/
olx.source.ImageVectorOptions.prototype.attributions;
@@ -4881,7 +5012,7 @@ olx.source.RasterOptions.prototype.operationType;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* crossOrigin: (null|string|undefined),
* hidpi: (boolean|undefined),
* serverType: (ol.source.wms.ServerType|string|undefined),
@@ -4899,7 +5030,7 @@ olx.source.ImageWMSOptions;
/**
* Attributions.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api stable
*/
olx.source.ImageWMSOptions.prototype.attributions;
@@ -4996,7 +5127,8 @@ olx.source.ImageWMSOptions.prototype.url;
/**
* @typedef {{layer: string,
* @typedef {{cacheSize: (number|undefined),
* layer: string,
* minZoom: (number|undefined),
* maxZoom: (number|undefined),
* opaque: (boolean|undefined),
@@ -5008,6 +5140,13 @@ olx.source.ImageWMSOptions.prototype.url;
olx.source.StamenOptions;
/**
* Cache size. Default is `2048`.
* @type {number|undefined}
* @api
*/
olx.source.StamenOptions.prototype.cacheSize;
/**
* Layer.
* @type {string}
@@ -5071,7 +5210,7 @@ olx.source.StamenOptions.prototype.url;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* crossOrigin: (null|string|undefined),
* imageExtent: (ol.Extent),
* imageLoadFunction: (ol.ImageLoadFunctionType|undefined),
@@ -5086,7 +5225,7 @@ olx.source.ImageStaticOptions;
/**
* Attributions.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api stable
*/
olx.source.ImageStaticOptions.prototype.attributions;
@@ -5155,7 +5294,8 @@ olx.source.ImageStaticOptions.prototype.url;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* cacheSize: (number|undefined),
* crossOrigin: (null|string|undefined),
* params: (Object.<string, *>|undefined),
* logo: (string|olx.LogoOptions|undefined),
@@ -5173,12 +5313,20 @@ olx.source.TileArcGISRestOptions;
/**
* Attributions.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api
*/
olx.source.TileArcGISRestOptions.prototype.attributions;
/**
* Cache size. Default is `2048`.
* @type {number|undefined}
* @api
*/
olx.source.TileArcGISRestOptions.prototype.cacheSize;
/**
* The `crossOrigin` attribute for loaded images. Note that you must provide a
* `crossOrigin` value if you are using the WebGL renderer or if you want to
@@ -5282,7 +5430,8 @@ olx.source.TileArcGISRestOptions.prototype.urls;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* cacheSize: (number|undefined),
* crossOrigin: (null|string|undefined),
* jsonp: (boolean|undefined),
* reprojectionErrorThreshold: (number|undefined),
@@ -5298,12 +5447,20 @@ olx.source.TileJSONOptions;
* Optional attributions for the source. If provided, these will be used
* instead of any attribution data advertised by the server. If not provided,
* any attributions advertised by the server will be used.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api stable
*/
olx.source.TileJSONOptions.prototype.attributions;
/**
* Cache size. Default is `2048`.
* @type {number|undefined}
* @api
*/
olx.source.TileJSONOptions.prototype.cacheSize;
/**
* The `crossOrigin` attribute for loaded images. Note that you must provide a
* `crossOrigin` value if you are using the WebGL renderer or if you want to
@@ -5364,7 +5521,8 @@ olx.source.TileJSONOptions.prototype.wrapX;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* cacheSize: (number|undefined),
* params: Object.<string,*>,
* crossOrigin: (null|string|undefined),
* gutter: (number|undefined),
@@ -5386,12 +5544,20 @@ olx.source.TileWMSOptions;
/**
* Attributions.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api stable
*/
olx.source.TileWMSOptions.prototype.attributions;
/**
* Cache size. Default is `2048`.
* @type {number|undefined}
* @api
*/
olx.source.TileWMSOptions.prototype.cacheSize;
/**
* WMS request parameters. At least a `LAYERS` param is required. `STYLES` is
* `''` by default. `VERSION` is `1.3.0` by default. `WIDTH`, `HEIGHT`, `BBOX`
@@ -5534,7 +5700,7 @@ olx.source.TileWMSOptions.prototype.wrapX;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* features: (Array.<ol.Feature>|ol.Collection.<ol.Feature>|undefined),
* format: (ol.format.Feature|undefined),
* loader: (ol.FeatureLoader|undefined),
@@ -5550,7 +5716,7 @@ olx.source.VectorOptions;
/**
* Attributions.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api stable
*/
olx.source.VectorOptions.prototype.attributions;
@@ -5654,7 +5820,8 @@ olx.source.VectorOptions.prototype.wrapX;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* cacheSize: (number|undefined),
* crossOrigin: (string|null|undefined),
* logo: (string|olx.LogoOptions|undefined),
* tileGrid: ol.tilegrid.WMTS,
@@ -5683,12 +5850,20 @@ olx.source.WMTSOptions;
/**
* Attributions.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api
*/
olx.source.WMTSOptions.prototype.attributions;
/**
* Cache size. Default is `2048`.
* @type {number|undefined}
* @api
*/
olx.source.WMTSOptions.prototype.cacheSize;
/**
* The `crossOrigin` attribute for loaded images. Note that you must provide a
* `crossOrigin` value if you are using the WebGL renderer or if you want to
@@ -5861,7 +6036,8 @@ olx.source.WMTSOptions.prototype.wrapX;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* cacheSize: (number|undefined),
* crossOrigin: (null|string|undefined),
* logo: (string|olx.LogoOptions|undefined),
* opaque: (boolean|undefined),
@@ -5884,12 +6060,20 @@ olx.source.XYZOptions;
/**
* Attributions.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api stable
*/
olx.source.XYZOptions.prototype.attributions;
/**
* Cache size. Default is `2048`.
* @type {number|undefined}
* @api
*/
olx.source.XYZOptions.prototype.cacheSize;
/**
* The `crossOrigin` attribute for loaded images. Note that you must provide a
* `crossOrigin` value if you are using the WebGL renderer or if you want to
@@ -5944,7 +6128,7 @@ olx.source.XYZOptions.prototype.maxZoom;
/**
* Unsupported (TODO: remove this).
* Optional min zoom level. Default is `0`.
* @type {number|undefined}
* @api
*/
@@ -6025,9 +6209,125 @@ olx.source.XYZOptions.prototype.urls;
*/
olx.source.XYZOptions.prototype.wrapX;
/**
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* cacheSize: (number|undefined),
* crossOrigin: (null|string|undefined),
* logo: (string|olx.LogoOptions|undefined),
* projection: ol.proj.ProjectionLike,
* maxZoom: (number|undefined),
* minZoom: (number|undefined),
* wrapX: (boolean|undefined),
* config: (Object|undefined),
* map: (string|undefined),
* account: string}}
* @api
*/
olx.source.CartoDBOptions;
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* Attributions.
* @type {olx.source.AttributionOption|undefined}
* @api stable
*/
olx.source.CartoDBOptions.prototype.attributions;
/**
* Cache size. Default is `2048`.
* @type {number|undefined}
* @api
*/
olx.source.CartoDBOptions.prototype.cacheSize;
/**
* The `crossOrigin` attribute for loaded images. Note that you must provide a
* `crossOrigin` value if you are using the WebGL renderer or if you want to
* access pixel data with the Canvas renderer. See
* {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image}
* for more detail.
* @type {null|string|undefined}
* @api stable
*/
olx.source.CartoDBOptions.prototype.crossOrigin;
/**
* Logo.
* @type {string|olx.LogoOptions|undefined}
* @api stable
*/
olx.source.CartoDBOptions.prototype.logo;
/**
* Projection. Default is `EPSG:3857`.
* @type {ol.proj.ProjectionLike}
* @api
*/
olx.source.CartoDBOptions.prototype.projection;
/**
* Optional max zoom level. Default is `18`.
* @type {number|undefined}
* @api
*/
olx.source.CartoDBOptions.prototype.maxZoom;
/**
* Minimum zoom.
* @type {number|undefined}
* @api
*/
olx.source.CartoDBOptions.prototype.minZoom;
/**
* Whether to wrap the world horizontally. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.source.CartoDBOptions.prototype.wrapX;
/**
* If using anonymous maps, the CartoDB config to use. See
* {@link http://docs.cartodb.com/cartodb-platform/maps-api/anonymous-maps/}
* for more detail.
* If using named maps, a key-value lookup with the template parameters.
* See {@link http://docs.cartodb.com/cartodb-platform/maps-api/named-maps/}
* for more detail.
* @type {Object|undefined}
* @api
*/
olx.source.CartoDBOptions.prototype.config;
/**
* If using named maps, this will be the name of the template to load.
* See {@link http://docs.cartodb.com/cartodb-platform/maps-api/named-maps/}
* for more detail.
* @type {string|undefined}
* @api
*/
olx.source.CartoDBOptions.prototype.map;
/**
* CartoDB account name
* @type {string}
* @api
*/
olx.source.CartoDBOptions.prototype.account;
/**
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
* cacheSize: (number|undefined),
* crossOrigin: (null|string|undefined),
* logo: (string|olx.LogoOptions|undefined),
* reprojectionErrorThreshold: (number|undefined),
@@ -6041,12 +6341,20 @@ olx.source.ZoomifyOptions;
/**
* Attributions.
* @type {Array.<ol.Attribution>|undefined}
* @type {olx.source.AttributionOption|undefined}
* @api stable
*/
olx.source.ZoomifyOptions.prototype.attributions;
/**
* Cache size. Default is `2048`.
* @type {number|undefined}
* @api
*/
olx.source.ZoomifyOptions.prototype.cacheSize;
/**
* The `crossOrigin` attribute for loaded images. Note that you must provide a
* `crossOrigin` value if you are using the WebGL renderer or if you want to
@@ -6174,8 +6482,8 @@ olx.style.FillOptions;
/**
* A color, gradient or pattern. See {@link ol.color}
* and {@link ol.colorlike} for possible formats. Default null;
* A color, gradient or pattern. See {@link ol.color}
* and {@link ol.colorlike} for possible formats. Default null;
* if null, the Canvas/renderer default black will be used.
* @type {ol.Color|ol.ColorLike|undefined}
* @api
@@ -6348,7 +6656,9 @@ olx.style.IconOptions.prototype.size;
/**
* Image size in pixel. Only required if `img` is set and `src` is not.
* Image size in pixels. Only required if `img` is set and `src` is not, and for
* SVG images in Internet Explorer 11. The provided `imgSize` needs to match
* the actual size of the image.
* @type {ol.Size|undefined}
* @api
*/
@@ -6518,7 +6828,13 @@ olx.style.StrokeOptions.prototype.lineJoin;
/**
* Line dash pattern. Default is `undefined` (no dash).
* Line dash pattern. Default is `undefined` (no dash). Please note that
* Internet Explorer 10 and lower [do not support][mdn] the `setLineDash`
* method on the `CanvasRenderingContext2D` and therefore this option will
* have no visual effect in these browsers.
*
* [mdn]: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility
*
* @type {Array.<number>|undefined}
* @api
*/

View File

@@ -1,6 +1,6 @@
{
"name": "openlayers",
"version": "3.14.2",
"version": "3.15.0",
"description": "Build tools and sources for developing OpenLayers based mapping applications",
"keywords": [
"map",
@@ -32,48 +32,47 @@
"dependencies": {
"async": "1.5.2",
"browserify": "13.0.0",
"closure-util": "1.10.0",
"closure-util": "1.13.0",
"derequire": "2.0.3",
"fs-extra": "0.26.5",
"fs-extra": "0.26.6",
"glob": "6.0.4",
"graceful-fs": "4.1.3",
"handlebars": "4.0.5",
"jsdoc": "3.4.0",
"marked": "0.3.5",
"metalsmith": "2.1.0",
"metalsmith-layouts": "1.5.4",
"metalsmith-layouts": "1.6.4",
"nomnom": "1.8.1",
"pbf": "1.3.5",
"pixelworks": "1.0.0",
"pixelworks": "1.1.0",
"rbush": "1.4.2",
"temp": "0.8.3",
"vector-tile": "1.2.0",
"walk": "2.3.9"
},
"devDependencies": {
"clean-css": "3.4.9",
"coveralls": "2.11.6",
"clean-css": "3.4.11",
"coveralls": "2.11.9",
"debounce": "^1.0.0",
"eslint": "2.2.0",
"eslint-config-openlayers": "4.0.0",
"eslint": "2.6.0",
"eslint-config-openlayers": "4.1.0",
"expect.js": "0.3.1",
"gaze": "^0.5.1",
"gaze": "^1.0.0",
"istanbul": "0.4.2",
"jquery": "2.2.1",
"jquery": "2.2.2",
"mocha": "2.4.5",
"mocha-phantomjs-core": "^1.3.0",
"mustache": "2.2.1",
"phantomjs-prebuilt": "2.1.4",
"proj4": "2.3.12",
"resemblejs": "2.1.0",
"phantomjs-prebuilt": "2.1.7",
"proj4": "2.3.14",
"resemblejs": "2.2.0",
"sinon": "1.17.3",
"slimerjs-edge": "0.10.0-pre-3",
"wrench": "1.5.8"
"slimerjs": "0.906.1"
},
"eslintConfig": {
"extends": "openlayers",
"globals": {
"ArrayBuffer": false,
"Float32Array": false,
"Uint16Array": false,
"Uint32Array": false,
"Uint8Array": false,

View File

@@ -24,6 +24,7 @@ ol.animation.bounce = function(options) {
/**
* @param {ol.Map} map Map.
* @param {?olx.FrameState} frameState Frame state.
* @return {boolean} Run this function in the next frame.
*/
function(map, frameState) {
if (frameState.time < start) {
@@ -62,6 +63,7 @@ ol.animation.pan = function(options) {
/**
* @param {ol.Map} map Map.
* @param {?olx.FrameState} frameState Frame state.
* @return {boolean} Run this function in the next frame.
*/
function(map, frameState) {
if (frameState.time < start) {
@@ -103,6 +105,7 @@ ol.animation.rotate = function(options) {
/**
* @param {ol.Map} map Map.
* @param {?olx.FrameState} frameState Frame state.
* @return {boolean} Run this function in the next frame.
*/
function(map, frameState) {
if (frameState.time < start) {
@@ -146,6 +149,7 @@ ol.animation.zoom = function(options) {
/**
* @param {ol.Map} map Map.
* @param {?olx.FrameState} frameState Frame state.
* @return {boolean} Run this function in the next frame.
*/
function(map, frameState) {
if (frameState.time < start) {

View File

@@ -169,7 +169,7 @@ ol.array.reverseSubArray = function(arr, begin, end) {
*/
ol.array.flatten = function(arr) {
var data = arr.reduce(function(flattened, value) {
if (goog.isArray(value)) {
if (Array.isArray(value)) {
return flattened.concat(ol.array.flatten(value));
} else {
return flattened.concat(value);

View File

@@ -1,7 +1,7 @@
goog.provide('ol.Attribution');
goog.require('goog.math');
goog.require('ol.TileRange');
goog.require('ol.math');
/**
@@ -80,8 +80,8 @@ ol.Attribution.prototype.intersectsAnyTileRange = function(tileRanges, tileGrid,
if (tileRange.minX < extentTileRange.minX ||
tileRange.maxX > extentTileRange.maxX) {
if (testTileRange.intersects(new ol.TileRange(
goog.math.modulo(tileRange.minX, width),
goog.math.modulo(tileRange.maxX, width),
ol.math.modulo(tileRange.minX, width),
ol.math.modulo(tileRange.maxX, width),
tileRange.minY, tileRange.maxY))) {
return true;
}

View File

@@ -9,7 +9,6 @@ goog.provide('ol.color');
goog.require('goog.asserts');
goog.require('goog.color');
goog.require('goog.color.names');
goog.require('goog.vec.Mat4');
goog.require('ol');
goog.require('ol.math');
@@ -17,7 +16,8 @@ goog.require('ol.math');
/**
* A color represented as a short array [red, green, blue, alpha].
* red, green, and blue should be integers in the range 0..255 inclusive.
* alpha should be a float in the range 0..1 inclusive.
* alpha should be a float in the range 0..1 inclusive. If no alpha value is
* given then `1` will be used.
* @typedef {Array.<number>}
* @api
*/
@@ -53,48 +53,6 @@ ol.color.rgbaColorRe_ =
/^(?:rgba)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|1|0\.\d{0,10})\)$/i;
/**
* @param {ol.Color} dst Destination.
* @param {ol.Color} src Source.
* @param {ol.Color=} opt_color Color.
* @return {ol.Color} Color.
*/
ol.color.blend = function(dst, src, opt_color) {
// http://en.wikipedia.org/wiki/Alpha_compositing
// FIXME do we need to scale by 255?
var out = opt_color ? opt_color : [];
var dstA = dst[3];
var srcA = src[3];
if (dstA == 1) {
out[0] = (src[0] * srcA + dst[0] * (1 - srcA) + 0.5) | 0;
out[1] = (src[1] * srcA + dst[1] * (1 - srcA) + 0.5) | 0;
out[2] = (src[2] * srcA + dst[2] * (1 - srcA) + 0.5) | 0;
out[3] = 1;
} else if (srcA === 0) {
out[0] = dst[0];
out[1] = dst[1];
out[2] = dst[2];
out[3] = dstA;
} else {
var outA = srcA + dstA * (1 - srcA);
if (outA === 0) {
out[0] = 0;
out[1] = 0;
out[2] = 0;
out[3] = 0;
} else {
out[0] = ((src[0] * srcA + dst[0] * dstA * (1 - srcA)) / outA + 0.5) | 0;
out[1] = ((src[1] * srcA + dst[1] * dstA * (1 - srcA)) / outA + 0.5) | 0;
out[2] = ((src[2] * srcA + dst[2] * dstA * (1 - srcA)) / outA + 0.5) | 0;
out[3] = outA;
}
}
goog.asserts.assert(ol.color.isValid(out),
'Output color of blend should be a valid color');
return out;
};
/**
* Return the color as an array. This function maintains a cache of calculated
* arrays which means the result should not be modified.
@@ -103,7 +61,7 @@ ol.color.blend = function(dst, src, opt_color) {
* @api
*/
ol.color.asArray = function(color) {
if (goog.isArray(color)) {
if (Array.isArray(color)) {
return color;
} else {
goog.asserts.assert(typeof color === 'string', 'Color should be a string');
@@ -122,24 +80,12 @@ ol.color.asString = function(color) {
if (typeof color === 'string') {
return color;
} else {
goog.asserts.assert(goog.isArray(color), 'Color should be an array');
goog.asserts.assert(Array.isArray(color), 'Color should be an array');
return ol.color.toString(color);
}
};
/**
* @param {ol.Color} color1 Color1.
* @param {ol.Color} color2 Color2.
* @return {boolean} Equals.
*/
ol.color.equals = function(color1, color2) {
return color1 === color2 || (
color1[0] == color2[0] && color1[1] == color2[1] &&
color1[2] == color2[2] && color1[3] == color2[3]);
};
/**
* @param {string} s String.
* @return {ol.Color} Color.
@@ -293,40 +239,6 @@ ol.color.toString = function(color) {
if (b != (b | 0)) {
b = (b + 0.5) | 0;
}
var a = color[3];
var a = color[3] === undefined ? 1 : color[3];
return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';
};
/**
* @param {!ol.Color} color Color.
* @param {goog.vec.Mat4.Number} transform Transform.
* @param {!ol.Color=} opt_color Color.
* @return {ol.Color} Transformed color.
*/
ol.color.transform = function(color, transform, opt_color) {
var result = opt_color ? opt_color : [];
result = goog.vec.Mat4.multVec3(transform, color, result);
goog.asserts.assert(goog.isArray(result), 'result should be an array');
result[3] = color[3];
return ol.color.normalize(result, result);
};
/**
* @param {ol.Color|string} color1 Color2.
* @param {ol.Color|string} color2 Color2.
* @return {boolean} Equals.
*/
ol.color.stringOrColorEquals = function(color1, color2) {
if (color1 === color2 || color1 == color2) {
return true;
}
if (typeof color1 === 'string') {
color1 = ol.color.fromString(color1);
}
if (typeof color2 === 'string') {
color2 = ol.color.fromString(color2);
}
return ol.color.equals(color1, color2);
};

View File

@@ -4,7 +4,6 @@ goog.provide('ol.control.Attribution');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.classlist');
goog.require('goog.style');
goog.require('ol');
goog.require('ol.Attribution');
@@ -275,9 +274,9 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
}
if (renderVisible &&
ol.object.isEmpty(this.attributionElementRenderedVisible_)) {
goog.dom.classlist.add(this.element, 'ol-logo-only');
this.element.classList.add('ol-logo-only');
} else {
goog.dom.classlist.remove(this.element, 'ol-logo-only');
this.element.classList.remove('ol-logo-only');
}
this.insertLogos_(frameState);
@@ -340,7 +339,7 @@ ol.control.Attribution.prototype.handleClick_ = function(event) {
* @private
*/
ol.control.Attribution.prototype.handleToggle_ = function() {
goog.dom.classlist.toggle(this.element, 'ol-collapsed');
this.element.classList.toggle('ol-collapsed');
if (this.collapsed_) {
goog.dom.replaceNode(this.collapseLabel_, this.label_);
} else {
@@ -370,7 +369,7 @@ ol.control.Attribution.prototype.setCollapsible = function(collapsible) {
return;
}
this.collapsible_ = collapsible;
goog.dom.classlist.toggle(this.element, 'ol-uncollapsible');
this.element.classList.toggle('ol-uncollapsible');
if (!collapsible && this.collapsed_) {
this.handleToggle_();
}

View File

@@ -2,7 +2,6 @@ goog.provide('ol.control.FullScreen');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.classlist');
goog.require('goog.dom.fullscreen');
goog.require('goog.dom.fullscreen.EventType');
goog.require('ol.events');
@@ -68,10 +67,6 @@ ol.control.FullScreen = function(opt_options) {
ol.events.listen(button, ol.events.EventType.CLICK,
this.handleClick_, this);
ol.events.listen(goog.global.document,
goog.dom.fullscreen.EventType.CHANGE,
this.handleFullScreenChange_, this);
var cssClasses = this.cssClassName_ + ' ' + ol.css.CLASS_UNSELECTABLE +
' ' + ol.css.CLASS_CONTROL + ' ' +
(!goog.dom.fullscreen.isSupported() ? ol.css.CLASS_UNSUPPORTED : '');
@@ -138,18 +133,31 @@ ol.control.FullScreen.prototype.handleFullScreen_ = function() {
* @private
*/
ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
var opened = this.cssClassName_ + '-true';
var closed = this.cssClassName_ + '-false';
var button = goog.dom.getFirstElementChild(this.element);
var button = this.element.firstElementChild;
var map = this.getMap();
if (goog.dom.fullscreen.isFullScreen()) {
goog.dom.classlist.swap(button, closed, opened);
button.className = this.cssClassName_ + '-true';
goog.dom.replaceNode(this.labelActiveNode_, this.labelNode_);
} else {
goog.dom.classlist.swap(button, opened, closed);
button.className = this.cssClassName_ + '-false';
goog.dom.replaceNode(this.labelNode_, this.labelActiveNode_);
}
if (map) {
map.updateSize();
}
};
/**
* @inheritDoc
* @api stable
*/
ol.control.FullScreen.prototype.setMap = function(map) {
goog.base(this, 'setMap', map);
if (map) {
this.listenerKeys.push(
ol.events.listen(goog.global.document, goog.dom.fullscreen.EventType.CHANGE,
this.handleFullScreenChange_, this)
);
}
};

View File

@@ -2,11 +2,8 @@ goog.provide('ol.control.OverviewMap');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.classlist');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('goog.math.Size');
goog.require('goog.style');
goog.require('ol');
goog.require('ol.Collection');
goog.require('ol.Map');
@@ -111,7 +108,9 @@ ol.control.OverviewMap = function(opt_options) {
}, this);
}
var box = goog.dom.createDom('DIV', 'ol-overviewmap-box');
var box = document.createElement('DIV');
box.className = 'ol-overviewmap-box';
box.style.boxSizing = 'border-box';
/**
* @type {ol.Overlay}
@@ -282,17 +281,17 @@ ol.control.OverviewMap.prototype.validateExtent_ = function() {
ovmap.getPixelFromCoordinate(ol.extent.getTopLeft(extent));
var bottomRightPixel =
ovmap.getPixelFromCoordinate(ol.extent.getBottomRight(extent));
var boxSize = new goog.math.Size(
Math.abs(topLeftPixel[0] - bottomRightPixel[0]),
Math.abs(topLeftPixel[1] - bottomRightPixel[1]));
var boxWidth = Math.abs(topLeftPixel[0] - bottomRightPixel[0]);
var boxHeight = Math.abs(topLeftPixel[1] - bottomRightPixel[1]);
var ovmapWidth = ovmapSize[0];
var ovmapHeight = ovmapSize[1];
if (boxSize.width < ovmapWidth * ol.OVERVIEWMAP_MIN_RATIO ||
boxSize.height < ovmapHeight * ol.OVERVIEWMAP_MIN_RATIO ||
boxSize.width > ovmapWidth * ol.OVERVIEWMAP_MAX_RATIO ||
boxSize.height > ovmapHeight * ol.OVERVIEWMAP_MAX_RATIO) {
if (boxWidth < ovmapWidth * ol.OVERVIEWMAP_MIN_RATIO ||
boxHeight < ovmapHeight * ol.OVERVIEWMAP_MIN_RATIO ||
boxWidth > ovmapWidth * ol.OVERVIEWMAP_MAX_RATIO ||
boxHeight > ovmapHeight * ol.OVERVIEWMAP_MAX_RATIO) {
this.resetExtent_();
} else if (!ol.extent.containsExtent(ovextent, extent)) {
this.recenter_();
@@ -396,10 +395,8 @@ ol.control.OverviewMap.prototype.updateBox_ = function() {
// set box size calculated from map extent size and overview map resolution
if (box) {
var boxWidth = Math.abs((bottomLeft[0] - topRight[0]) / ovresolution);
var boxHeight = Math.abs((topRight[1] - bottomLeft[1]) / ovresolution);
goog.style.setBorderBoxSize(box, new goog.math.Size(
boxWidth, boxHeight));
box.style.width = Math.abs((bottomLeft[0] - topRight[0]) / ovresolution) + 'px';
box.style.height = Math.abs((topRight[1] - bottomLeft[1]) / ovresolution) + 'px';
}
};
@@ -446,7 +443,7 @@ ol.control.OverviewMap.prototype.handleClick_ = function(event) {
* @private
*/
ol.control.OverviewMap.prototype.handleToggle_ = function() {
goog.dom.classlist.toggle(this.element, 'ol-collapsed');
this.element.classList.toggle('ol-collapsed');
if (this.collapsed_) {
goog.dom.replaceNode(this.collapseLabel_, this.label_);
} else {
@@ -489,7 +486,7 @@ ol.control.OverviewMap.prototype.setCollapsible = function(collapsible) {
return;
}
this.collapsible_ = collapsible;
goog.dom.classlist.toggle(this.element, 'ol-uncollapsible');
this.element.classList.toggle('ol-uncollapsible');
if (!collapsible && this.collapsed_) {
this.handleToggle_();
}

View File

@@ -1,7 +1,6 @@
goog.provide('ol.control.Rotate');
goog.require('goog.dom');
goog.require('goog.dom.classlist');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('ol');
@@ -41,7 +40,7 @@ ol.control.Rotate = function(opt_options) {
'ol-compass', label);
} else {
this.label_ = label;
goog.dom.classlist.add(this.label_, 'ol-compass');
this.label_.classList.add(this.label_, 'ol-compass');
}
var tipLabel = options.tipLabel ? options.tipLabel : 'Reset rotation';
@@ -88,7 +87,7 @@ ol.control.Rotate = function(opt_options) {
this.rotation_ = undefined;
if (this.autoHide_) {
goog.dom.classlist.add(this.element, ol.css.CLASS_HIDDEN);
this.element.classList.add(ol.css.CLASS_HIDDEN);
}
};
@@ -156,8 +155,12 @@ ol.control.Rotate.render = function(mapEvent) {
if (rotation != this.rotation_) {
var transform = 'rotate(' + rotation + 'rad)';
if (this.autoHide_) {
goog.dom.classlist.enable(
this.element, ol.css.CLASS_HIDDEN, rotation === 0);
var contains = this.element.classList.contains(ol.css.CLASS_HIDDEN);
if (!contains && rotation === 0) {
this.element.classList.add(ol.css.CLASS_HIDDEN);
} else if (contains && rotation !== 0) {
this.element.classList.remove(ol.css.CLASS_HIDDEN);
}
}
this.label_.style.msTransform = transform;
this.label_.style.webkitTransform = transform;

View File

@@ -4,7 +4,6 @@ goog.provide('ol.control.ZoomSlider');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.math.Rect');
goog.require('goog.style');
goog.require('ol.events');
goog.require('ol.events.Event');
@@ -55,25 +54,37 @@ ol.control.ZoomSlider = function(opt_options) {
/**
* @type {boolean}
* @private
*/
this.dragging_;
/**
* @type {Array.<ol.events.Key>}
*/
this.dragListenerKeys_;
/**
* @type {goog.math.Rect}
* @type {!Array.<ol.events.Key>}
* @private
*/
this.limits_;
this.dragListenerKeys_ = [];
/**
* @type {number}
* @private
*/
this.heightLimit_ = 0;
/**
* @type {number}
* @private
*/
this.widthLimit_ = 0;
/**
* @type {number|undefined}
* @private
*/
this.previousX_;
/**
* @type {number|undefined}
* @private
*/
this.previousY_;
@@ -93,8 +104,8 @@ ol.control.ZoomSlider = function(opt_options) {
this.sliderInitialized_ = false;
/**
* @private
* @type {number}
* @private
*/
this.duration_ = options.duration !== undefined ? options.duration : 200;
@@ -107,14 +118,17 @@ ol.control.ZoomSlider = function(opt_options) {
[className, ol.css.CLASS_UNSELECTABLE, ol.css.CLASS_CONTROL],
thumbElement);
var dragger = new ol.pointer.PointerEventHandler(containerElement);
this.registerDisposable(dragger);
/**
* @type {ol.pointer.PointerEventHandler}
* @private
*/
this.dragger_ = new ol.pointer.PointerEventHandler(containerElement);
ol.events.listen(dragger, ol.pointer.EventType.POINTERDOWN,
ol.events.listen(this.dragger_, ol.pointer.EventType.POINTERDOWN,
this.handleDraggerStart_, this);
ol.events.listen(dragger, ol.pointer.EventType.POINTERMOVE,
ol.events.listen(this.dragger_, ol.pointer.EventType.POINTERMOVE,
this.handleDraggerDrag_, this);
ol.events.listen(dragger, ol.pointer.EventType.POINTERUP,
ol.events.listen(this.dragger_, ol.pointer.EventType.POINTERUP,
this.handleDraggerEnd_, this);
ol.events.listen(containerElement, ol.events.EventType.CLICK,
@@ -132,6 +146,15 @@ ol.control.ZoomSlider = function(opt_options) {
goog.inherits(ol.control.ZoomSlider, ol.control.Control);
/**
* @inheritDoc
*/
ol.control.ZoomSlider.prototype.disposeInternal = function() {
this.dragger_.dispose();
goog.base(this, 'disposeInternal');
};
/**
* The enum for available directions.
*
@@ -165,7 +188,7 @@ ol.control.ZoomSlider.prototype.initSlider_ = function() {
var container = this.element;
var containerSize = goog.style.getSize(container);
var thumb = goog.dom.getFirstElementChild(container);
var thumb = container.firstElementChild;
var thumbMargins = goog.style.getMarginBox(thumb);
var thumbBorderBoxSize = goog.style.getBorderBoxSize(thumb);
var thumbWidth = thumbBorderBoxSize.width +
@@ -174,18 +197,13 @@ ol.control.ZoomSlider.prototype.initSlider_ = function() {
thumbMargins.top + thumbMargins.bottom;
this.thumbSize_ = [thumbWidth, thumbHeight];
var width = containerSize.width - thumbWidth;
var height = containerSize.height - thumbHeight;
var limits;
if (containerSize.width > containerSize.height) {
this.direction_ = ol.control.ZoomSlider.direction.HORIZONTAL;
limits = new goog.math.Rect(0, 0, width, 0);
this.widthLimit_ = containerSize.width - thumbWidth;
} else {
this.direction_ = ol.control.ZoomSlider.direction.VERTICAL;
limits = new goog.math.Rect(0, 0, 0, height);
this.heightLimit_ = containerSize.height - thumbHeight;
}
this.limits_ = limits;
this.sliderInitialized_ = true;
};
@@ -249,17 +267,17 @@ ol.control.ZoomSlider.prototype.handleDraggerStart_ = function(event) {
this.previousY_ = event.clientY;
this.dragging_ = true;
if (!this.dragListenerKeys_) {
if (this.dragListenerKeys_.length === 0) {
var drag = this.handleDraggerDrag_;
var end = this.handleDraggerEnd_;
this.dragListenerKeys_ = [
this.dragListenerKeys_.push(
ol.events.listen(document, ol.events.EventType.MOUSEMOVE, drag, this),
ol.events.listen(document, ol.events.EventType.TOUCHMOVE, drag, this),
ol.events.listen(document, ol.pointer.EventType.POINTERMOVE, drag, this),
ol.events.listen(document, ol.events.EventType.MOUSEUP, end, this),
ol.events.listen(document, ol.events.EventType.TOUCHEND, end, this),
ol.events.listen(document, ol.pointer.EventType.POINTERUP, end, this)
];
);
}
}
};
@@ -309,7 +327,7 @@ ol.control.ZoomSlider.prototype.handleDraggerEnd_ = function(event) {
this.previousX_ = undefined;
this.previousY_ = undefined;
this.dragListenerKeys_.forEach(ol.events.unlistenByKey);
this.dragListenerKeys_ = null;
this.dragListenerKeys_.length = 0;
}
};
@@ -322,14 +340,12 @@ ol.control.ZoomSlider.prototype.handleDraggerEnd_ = function(event) {
*/
ol.control.ZoomSlider.prototype.setThumbPosition_ = function(res) {
var position = this.getPositionForResolution_(res);
var thumb = goog.dom.getFirstElementChild(this.element);
var thumb = this.element.firstElementChild;
if (this.direction_ == ol.control.ZoomSlider.direction.HORIZONTAL) {
var left = this.limits_.left + this.limits_.width * position;
goog.style.setPosition(thumb, left);
thumb.style.left = this.widthLimit_ * position + 'px';
} else {
var top = this.limits_.top + this.limits_.height * position;
goog.style.setPosition(thumb, this.limits_.left, top);
thumb.style.top = this.heightLimit_ * position + 'px';
}
};
@@ -345,12 +361,11 @@ ol.control.ZoomSlider.prototype.setThumbPosition_ = function(res) {
* @private
*/
ol.control.ZoomSlider.prototype.getRelativePosition_ = function(x, y) {
var draggerLimits = this.limits_;
var amount;
if (this.direction_ === ol.control.ZoomSlider.direction.HORIZONTAL) {
amount = (x - draggerLimits.left) / draggerLimits.width;
amount = x / this.widthLimit_;
} else {
amount = (y - draggerLimits.top) / draggerLimits.height;
amount = y / this.heightLimit_;
}
return ol.math.clamp(amount, 0, 1);
};

View File

@@ -2,8 +2,8 @@ goog.provide('ol.Coordinate');
goog.provide('ol.CoordinateFormatType');
goog.provide('ol.coordinate');
goog.require('goog.math');
goog.require('goog.string');
goog.require('ol.math');
/**
@@ -129,7 +129,7 @@ ol.coordinate.createStringXY = function(opt_fractionDigits) {
* @return {string} String.
*/
ol.coordinate.degreesToStringHDMS_ = function(degrees, hemispheres, opt_fractionDigits) {
var normalizedDegrees = goog.math.modulo(degrees + 180, 360) - 180;
var normalizedDegrees = ol.math.modulo(degrees + 180, 360) - 180;
var x = Math.abs(3600 * normalizedDegrees);
var dflPrecision = opt_fractionDigits || 0;
return Math.floor(x / 3600) + '\u00b0 ' +

32
src/ol/disposable.js Normal file
View File

@@ -0,0 +1,32 @@
goog.provide('ol.Disposable');
goog.require('ol');
/**
* Objects that need to clean up after themselves.
* @constructor
*/
ol.Disposable = function() {};
/**
* The object has already been disposed.
* @type {boolean}
* @private
*/
ol.Disposable.prototype.disposed_ = false;
/**
* Clean up.
*/
ol.Disposable.prototype.dispose = function() {
if (!this.disposed_) {
this.disposed_ = true;
this.disposeInternal();
}
};
/**
* Extension point for disposable objects.
* @protected
*/
ol.Disposable.prototype.disposeInternal = ol.nullFunction;

View File

@@ -1,10 +1,6 @@
// FIXME add tests for browser features (Modernizr?)
goog.provide('ol.dom');
goog.provide('ol.dom.BrowserFeature');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.userAgent');
goog.require('goog.vec.Mat4');
goog.require('ol');
@@ -40,31 +36,29 @@ ol.dom.canUseCssTransform = (function() {
if (canUseCssTransform === undefined) {
goog.asserts.assert(document.body,
'document.body should not be null');
if (!goog.global.getComputedStyle) {
// this browser is ancient
canUseCssTransform = false;
} else {
var el = document.createElement('P'),
has2d,
transforms = {
'webkitTransform': '-webkit-transform',
'OTransform': '-o-transform',
'msTransform': '-ms-transform',
'MozTransform': '-moz-transform',
'transform': 'transform'
};
document.body.appendChild(el);
for (var t in transforms) {
if (t in el.style) {
el.style[t] = 'translate(1px,1px)';
has2d = goog.global.getComputedStyle(el).getPropertyValue(
transforms[t]);
}
}
goog.dom.removeNode(el);
goog.asserts.assert(goog.global.getComputedStyle,
'getComputedStyle is required (unsupported browser?)');
canUseCssTransform = (has2d && has2d !== 'none');
var el = document.createElement('P'),
has2d,
transforms = {
'webkitTransform': '-webkit-transform',
'OTransform': '-o-transform',
'msTransform': '-ms-transform',
'MozTransform': '-moz-transform',
'transform': 'transform'
};
document.body.appendChild(el);
for (var t in transforms) {
if (t in el.style) {
el.style[t] = 'translate(1px,1px)';
has2d = goog.global.getComputedStyle(el).getPropertyValue(
transforms[t]);
}
}
document.body.removeChild(el);
canUseCssTransform = (has2d && has2d !== 'none');
}
return canUseCssTransform;
};
@@ -83,31 +77,29 @@ ol.dom.canUseCssTransform3D = (function() {
if (canUseCssTransform3D === undefined) {
goog.asserts.assert(document.body,
'document.body should not be null');
if (!goog.global.getComputedStyle) {
// this browser is ancient
canUseCssTransform3D = false;
} else {
var el = document.createElement('P'),
has3d,
transforms = {
'webkitTransform': '-webkit-transform',
'OTransform': '-o-transform',
'msTransform': '-ms-transform',
'MozTransform': '-moz-transform',
'transform': 'transform'
};
document.body.appendChild(el);
for (var t in transforms) {
if (t in el.style) {
el.style[t] = 'translate3d(1px,1px,1px)';
has3d = goog.global.getComputedStyle(el).getPropertyValue(
transforms[t]);
}
}
goog.dom.removeNode(el);
goog.asserts.assert(goog.global.getComputedStyle,
'getComputedStyle is required (unsupported browser?)');
canUseCssTransform3D = (has3d && has3d !== 'none');
var el = document.createElement('P'),
has3d,
transforms = {
'webkitTransform': '-webkit-transform',
'OTransform': '-o-transform',
'msTransform': '-ms-transform',
'MozTransform': '-moz-transform',
'transform': 'transform'
};
document.body.appendChild(el);
for (var t in transforms) {
if (t in el.style) {
el.style[t] = 'translate3d(1px,1px,1px)';
has3d = goog.global.getComputedStyle(el).getPropertyValue(
transforms[t]);
}
}
document.body.removeChild(el);
canUseCssTransform3D = (has3d && has3d !== 'none');
}
return canUseCssTransform3D;
};
@@ -200,7 +192,7 @@ ol.dom.transformElement2D = function(element, transform, opt_precision) {
*/
ol.dom.outerWidth = function(element) {
var width = element.offsetWidth;
var style = element.currentStyle || window.getComputedStyle(element);
var style = element.currentStyle || goog.global.getComputedStyle(element);
width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
return width;
@@ -216,7 +208,7 @@ ol.dom.outerWidth = function(element) {
*/
ol.dom.outerHeight = function(element) {
var height = element.offsetHeight;
var style = element.currentStyle || window.getComputedStyle(element);
var style = element.currentStyle || goog.global.getComputedStyle(element);
height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);
return height;

View File

@@ -73,7 +73,13 @@ ol.events.EventTargetLike;
/**
* Key to use with {@link ol.Observable#unByKey}.
*
* @typedef {ol.events.ListenerObjType}
* @typedef {{bindTo: (Object|undefined),
* boundListener: (ol.events.ListenerFunctionType|undefined),
* callOnce: boolean,
* deleteIndex: (number|undefined),
* listener: ol.events.ListenerFunctionType,
* target: (EventTarget|ol.events.EventTarget),
* type: string}}
* @api
*/
ol.events.Key;
@@ -90,19 +96,7 @@ ol.events.ListenerFunctionType;
/**
* @typedef {{bindTo: (Object|undefined),
* boundListener: (ol.events.ListenerFunctionType|undefined),
* callOnce: boolean,
* deleteIndex: (number|undefined),
* listener: ol.events.ListenerFunctionType,
* target: (EventTarget|ol.events.EventTarget),
* type: string}}
*/
ol.events.ListenerObjType;
/**
* @param {ol.events.ListenerObjType} listenerObj Listener object.
* @param {ol.events.Key} listenerObj Listener object.
* @return {ol.events.ListenerFunctionType} Bound listener.
*/
ol.events.bindListener_ = function(listenerObj) {
@@ -120,15 +114,15 @@ ol.events.bindListener_ = function(listenerObj) {
/**
* Finds the matching {@link ol.events.ListenerObjType} in the given listener
* Finds the matching {@link ol.events.Key} in the given listener
* array.
*
* @param {!Array<!ol.events.ListenerObjType>} listeners Array of listeners.
* @param {!Array<!ol.events.Key>} listeners Array of listeners.
* @param {!Function} listener The listener function.
* @param {Object=} opt_this The `this` value inside the listener.
* @param {boolean=} opt_setDeleteIndex Set the deleteIndex on the matching
* listener, for {@link ol.events.unlistenByKey}.
* @return {ol.events.ListenerObjType|undefined} The matching listener object.
* @return {ol.events.Key|undefined} The matching listener object.
* @private
*/
ol.events.findListener_ = function(listeners, listener, opt_this,
@@ -151,7 +145,7 @@ ol.events.findListener_ = function(listeners, listener, opt_this,
/**
* @param {ol.events.EventTargetLike} target Target.
* @param {string} type Type.
* @return {Array.<ol.events.ListenerObjType>|undefined} Listeners.
* @return {Array.<ol.events.Key>|undefined} Listeners.
*/
ol.events.getListeners = function(target, type) {
var listenerMap = target[ol.events.LISTENER_MAP_PROP_];
@@ -163,7 +157,7 @@ ol.events.getListeners = function(target, type) {
* Get the lookup of listeners. If one does not exist on the target, it is
* created.
* @param {ol.events.EventTargetLike} target Target.
* @return {!Object.<string, Array.<ol.events.ListenerObjType>>} Map of
* @return {!Object.<string, Array.<ol.events.Key>>} Map of
* listeners by event type.
* @private
*/
@@ -232,7 +226,7 @@ ol.events.listen = function(target, type, listener, opt_this, opt_once) {
listenerObj.callOnce = false;
}
} else {
listenerObj = /** @type {ol.events.ListenerObjType} */ ({
listenerObj = /** @type {ol.events.Key} */ ({
bindTo: opt_this,
callOnce: !!opt_once,
listener: listener,

View File

@@ -2,7 +2,7 @@ goog.provide('ol.events.ConditionType');
goog.provide('ol.events.condition');
goog.require('goog.asserts');
goog.require('goog.functions');
goog.require('ol.functions');
goog.require('ol.MapBrowserEvent.EventType');
goog.require('ol.MapBrowserPointerEvent');
@@ -59,7 +59,7 @@ ol.events.condition.altShiftKeysOnly = function(mapBrowserEvent) {
* @function
* @api stable
*/
ol.events.condition.always = goog.functions.TRUE;
ol.events.condition.always = ol.functions.TRUE;
/**
@@ -98,7 +98,7 @@ ol.events.condition.mouseActionButton = function(mapBrowserEvent) {
* @function
* @api stable
*/
ol.events.condition.never = goog.functions.FALSE;
ol.events.condition.never = ol.functions.FALSE;
/**

View File

@@ -12,6 +12,7 @@ goog.provide('ol.events.Event');
* {@link ol.events.EventTarget}.
*
* @constructor
* @implements {oli.events.Event}
* @param {string} type Type.
* @param {Object=} opt_target Target.
*/
@@ -23,22 +24,34 @@ ol.events.Event = function(type, opt_target) {
this.propagationStopped;
/**
* The event type.
* @type {string}
* @api stable
*/
this.type = type;
/**
* @type {Object|undefined}
* The event target.
* @type {Object}
* @api stable
*/
this.target = opt_target;
this.target = opt_target || null;
};
/**
* Stop event propagation
* Stop event propagation.
* @function
* @api stable
*/
ol.events.Event.prototype.preventDefault =
/**
* Stop event propagation.
* @function
* @api stable
*/
ol.events.Event.prototype.stopPropagation = function() {
this.propagationStopped = true;
};

View File

@@ -1,6 +1,7 @@
goog.provide('ol.events.EventTarget');
goog.require('goog.Disposable');
goog.require('goog.asserts');
goog.require('ol.Disposable');
goog.require('ol.events');
goog.require('ol.events.Event');
@@ -20,12 +21,18 @@ goog.require('ol.events.Event');
* returns false.
*
* @constructor
* @extends {goog.Disposable}
* @extends {ol.Disposable}
*/
ol.events.EventTarget = function() {
goog.base(this);
/**
* @private
* @type {!Object.<string, number>}
*/
this.pendingRemovals_ = {};
/**
* @private
* @type {!Object.<string, Array.<ol.events.ListenerFunctionType>>}
@@ -33,7 +40,7 @@ ol.events.EventTarget = function() {
this.listeners_ = {};
};
goog.inherits(ol.events.EventTarget, goog.Disposable);
goog.inherits(ol.events.EventTarget, ol.Disposable);
/**
@@ -46,7 +53,7 @@ ol.events.EventTarget.prototype.addEventListener = function(type, listener) {
listeners = this.listeners_[type] = [];
}
if (listeners.indexOf(listener) === -1) {
listeners.unshift(listener);
listeners.push(listener);
}
};
@@ -63,13 +70,23 @@ ol.events.EventTarget.prototype.dispatchEvent = function(event) {
var type = evt.type;
evt.target = this;
var listeners = this.listeners_[type];
var propagate;
if (listeners) {
for (var i = listeners.length - 1; i >= 0; --i) {
if (listeners[i].call(this, evt) === false ||
evt.propagationStopped) {
return false;
if (!(type in this.pendingRemovals_)) {
this.pendingRemovals_[type] = 0;
}
for (var i = 0, ii = listeners.length; i < ii; ++i) {
if (listeners[i].call(this, evt) === false || evt.propagationStopped) {
propagate = false;
break;
}
}
var pendingRemovals = this.pendingRemovals_[type];
delete this.pendingRemovals_[type];
while (pendingRemovals--) {
this.removeEventListener(type, ol.nullFunction);
}
return propagate;
}
};
@@ -79,13 +96,12 @@ ol.events.EventTarget.prototype.dispatchEvent = function(event) {
*/
ol.events.EventTarget.prototype.disposeInternal = function() {
ol.events.unlistenAll(this);
goog.base(this, 'disposeInternal');
};
/**
* Get the listeners for a specified event type. Listeners are returned in the
* opposite order that they will be called in.
* order that they will be called in.
*
* @param {string} type Type.
* @return {Array.<ol.events.ListenerFunctionType>} Listeners.
@@ -115,9 +131,16 @@ ol.events.EventTarget.prototype.removeEventListener = function(type, listener) {
var listeners = this.listeners_[type];
if (listeners) {
var index = listeners.indexOf(listener);
listeners.splice(index, 1);
if (listeners.length === 0) {
delete this.listeners_[type];
goog.asserts.assert(index != -1, 'listener not found');
if (type in this.pendingRemovals_) {
// make listener a no-op, and remove later in #dispatchEvent()
listeners[index] = ol.nullFunction;
++this.pendingRemovals_[type];
} else {
listeners.splice(index, 1);
if (listeners.length === 0) {
delete this.listeners_[type];
}
}
}
};

View File

@@ -314,7 +314,7 @@ ol.Feature.createStyleFunction = function(obj) {
* @type {Array.<ol.style.Style>}
*/
var styles;
if (goog.isArray(obj)) {
if (Array.isArray(obj)) {
styles = obj;
} else {
goog.asserts.assertInstanceof(obj, ol.style.Style,

View File

@@ -170,7 +170,7 @@ ol.format.EsriJSON.readPointGeometry_ = function(object) {
* @return {ol.geom.Geometry} LineString.
*/
ol.format.EsriJSON.readLineStringGeometry_ = function(object) {
goog.asserts.assert(goog.isArray(object.paths),
goog.asserts.assert(Array.isArray(object.paths),
'object.paths should be an array');
goog.asserts.assert(object.paths.length === 1,
'object.paths array length should be 1');
@@ -185,7 +185,7 @@ ol.format.EsriJSON.readLineStringGeometry_ = function(object) {
* @return {ol.geom.Geometry} MultiLineString.
*/
ol.format.EsriJSON.readMultiLineStringGeometry_ = function(object) {
goog.asserts.assert(goog.isArray(object.paths),
goog.asserts.assert(Array.isArray(object.paths),
'object.paths should be an array');
goog.asserts.assert(object.paths.length > 1,
'object.paths array length should be more than 1');

View File

@@ -71,6 +71,9 @@ ol.format.Feature.prototype.adaptOptions = function(options) {
options.dataProjection : this.defaultDataProjection,
rightHanded: options.rightHanded
};
if (options.decimals) {
updatedOptions.decimals = options.decimals;
}
}
return updatedOptions;
};
@@ -165,21 +168,45 @@ ol.format.Feature.transformWithOptions = function(
ol.proj.get(opt_options.featureProjection) : null;
var dataProjection = opt_options ?
ol.proj.get(opt_options.dataProjection) : null;
/**
* @type {ol.geom.Geometry|ol.Extent}
*/
var transformed;
if (featureProjection && dataProjection &&
!ol.proj.equivalent(featureProjection, dataProjection)) {
if (geometry instanceof ol.geom.Geometry) {
return (write ? geometry.clone() : geometry).transform(
transformed = (write ? geometry.clone() : geometry).transform(
write ? featureProjection : dataProjection,
write ? dataProjection : featureProjection);
} else {
// FIXME this is necessary because ol.format.GML treats extents
// as geometries
return ol.proj.transformExtent(
transformed = ol.proj.transformExtent(
write ? geometry.slice() : geometry,
write ? featureProjection : dataProjection,
write ? dataProjection : featureProjection);
}
} else {
return geometry;
transformed = geometry;
}
if (write && opt_options && opt_options.decimals) {
var power = Math.pow(10, opt_options.decimals);
// if decimals option on write, round each coordinate appropriately
/**
* @param {Array.<number>} coordinates Coordinates.
* @return {Array.<number>} Transformed coordinates.
*/
var transform = function(coordinates) {
for (var i = 0, ii = coordinates.length; i < ii; ++i) {
coordinates[i] = Math.round(coordinates[i] * power) / power;
}
return coordinates;
};
if (Array.isArray(transformed)) {
transform(transformed);
} else {
transformed.applyTransform(transform);
}
}
return transformed;
};

View File

@@ -211,7 +211,9 @@ ol.format.GeoJSON.writeGeometryCollectionGeometry_ = function(
goog.asserts.assertInstanceof(geometry, ol.geom.GeometryCollection,
'geometry should be an ol.geom.GeometryCollection');
var geometries = geometry.getGeometriesArray().map(function(geometry) {
return ol.format.GeoJSON.writeGeometry_(geometry, opt_options);
var options = ol.object.assign({}, opt_options);
delete options.featureProjection;
return ol.format.GeoJSON.writeGeometry_(geometry, options);
});
return /** @type {GeoJSONGeometryCollection} */ ({
type: 'GeometryCollection',
@@ -518,14 +520,13 @@ ol.format.GeoJSON.prototype.writeFeature;
*
* @param {ol.Feature} feature Feature.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {GeoJSONObject} Object.
* @return {GeoJSONFeature} Object.
* @api stable
*/
ol.format.GeoJSON.prototype.writeFeatureObject = function(
feature, opt_options) {
ol.format.GeoJSON.prototype.writeFeatureObject = function(feature, opt_options) {
opt_options = this.adaptOptions(opt_options);
var object = /** @type {GeoJSONObject} */ ({
var object = /** @type {GeoJSONFeature} */ ({
'type': 'Feature'
});
var id = feature.getId();

View File

@@ -130,7 +130,7 @@ ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
if (flatLinearRing) {
var flatLinearRings = /** @type {Array.<Array.<number>>} */
(objectStack[objectStack.length - 1]);
goog.asserts.assert(goog.isArray(flatLinearRings),
goog.asserts.assert(Array.isArray(flatLinearRings),
'flatLinearRings should be an array');
goog.asserts.assert(flatLinearRings.length > 0,
'flatLinearRings should have an array length larger than 0');
@@ -155,7 +155,7 @@ ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
if (flatLinearRing) {
var flatLinearRings = /** @type {Array.<Array.<number>>} */
(objectStack[objectStack.length - 1]);
goog.asserts.assert(goog.isArray(flatLinearRings),
goog.asserts.assert(Array.isArray(flatLinearRings),
'flatLinearRings should be an array');
goog.asserts.assert(flatLinearRings.length > 0,
'flatLinearRings should have an array length larger than 0');
@@ -169,12 +169,12 @@ ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = Object({
ol.format.GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
'http://www.opengis.net/gml' : {
'coordinates': ol.xml.makeReplacer(
ol.format.GML2.prototype.readFlatCoordinates_)
}
});
};
/**
@@ -182,12 +182,12 @@ ol.format.GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = Object({
ol.format.GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
'http://www.opengis.net/gml' : {
'innerBoundaryIs': ol.format.GML2.prototype.innerBoundaryIsParser_,
'outerBoundaryIs': ol.format.GML2.prototype.outerBoundaryIsParser_
}
});
};
/**
@@ -195,12 +195,12 @@ ol.format.GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML2.prototype.BOX_PARSERS_ = Object({
ol.format.GML2.prototype.BOX_PARSERS_ = {
'http://www.opengis.net/gml' : {
'coordinates': ol.xml.makeArrayPusher(
ol.format.GML2.prototype.readFlatCoordinates_)
}
});
};
/**
@@ -208,7 +208,7 @@ ol.format.GML2.prototype.BOX_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML2.prototype.GEOMETRY_PARSERS_ = Object({
ol.format.GML2.prototype.GEOMETRY_PARSERS_ = {
'http://www.opengis.net/gml' : {
'Point': ol.xml.makeReplacer(ol.format.GMLBase.prototype.readPoint),
'MultiPoint': ol.xml.makeReplacer(
@@ -224,4 +224,4 @@ ol.format.GML2.prototype.GEOMETRY_PARSERS_ = Object({
ol.format.GMLBase.prototype.readMultiPolygon),
'Box': ol.xml.makeReplacer(ol.format.GML2.prototype.readBox_)
}
});
};

View File

@@ -247,7 +247,7 @@ ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) {
if (flatLinearRing) {
var flatLinearRings = /** @type {Array.<Array.<number>>} */
(objectStack[objectStack.length - 1]);
goog.asserts.assert(goog.isArray(flatLinearRings),
goog.asserts.assert(Array.isArray(flatLinearRings),
'flatLinearRings should be an array');
goog.asserts.assert(flatLinearRings.length > 0,
'flatLinearRings should have an array length of 1 or more');
@@ -272,7 +272,7 @@ ol.format.GML3.prototype.exteriorParser_ = function(node, objectStack) {
if (flatLinearRing) {
var flatLinearRings = /** @type {Array.<Array.<number>>} */
(objectStack[objectStack.length - 1]);
goog.asserts.assert(goog.isArray(flatLinearRings),
goog.asserts.assert(Array.isArray(flatLinearRings),
'flatLinearRings should be an array');
goog.asserts.assert(flatLinearRings.length > 0,
'flatLinearRings should have an array length of 1 or more');
@@ -453,12 +453,12 @@ ol.format.GML3.prototype.readFlatPosList_ = function(node, objectStack) {
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = Object({
ol.format.GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
'http://www.opengis.net/gml' : {
'pos': ol.xml.makeReplacer(ol.format.GML3.prototype.readFlatPos_),
'posList': ol.xml.makeReplacer(ol.format.GML3.prototype.readFlatPosList_)
}
});
};
/**
@@ -466,12 +466,12 @@ ol.format.GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = Object({
ol.format.GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
'http://www.opengis.net/gml' : {
'interior': ol.format.GML3.prototype.interiorParser_,
'exterior': ol.format.GML3.prototype.exteriorParser_
}
});
};
/**
@@ -479,7 +479,7 @@ ol.format.GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML3.prototype.GEOMETRY_PARSERS_ = Object({
ol.format.GML3.prototype.GEOMETRY_PARSERS_ = {
'http://www.opengis.net/gml' : {
'Point': ol.xml.makeReplacer(ol.format.GMLBase.prototype.readPoint),
'MultiPoint': ol.xml.makeReplacer(
@@ -501,7 +501,7 @@ ol.format.GML3.prototype.GEOMETRY_PARSERS_ = Object({
ol.format.GML3.prototype.readMultiCurve_),
'Envelope': ol.xml.makeReplacer(ol.format.GML3.prototype.readEnvelope_)
}
});
};
/**
@@ -509,14 +509,14 @@ ol.format.GML3.prototype.GEOMETRY_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML3.prototype.MULTICURVE_PARSERS_ = Object({
ol.format.GML3.prototype.MULTICURVE_PARSERS_ = {
'http://www.opengis.net/gml' : {
'curveMember': ol.xml.makeArrayPusher(
ol.format.GML3.prototype.curveMemberParser_),
'curveMembers': ol.xml.makeArrayPusher(
ol.format.GML3.prototype.curveMemberParser_)
}
});
};
/**
@@ -524,14 +524,14 @@ ol.format.GML3.prototype.MULTICURVE_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML3.prototype.MULTISURFACE_PARSERS_ = Object({
ol.format.GML3.prototype.MULTISURFACE_PARSERS_ = {
'http://www.opengis.net/gml' : {
'surfaceMember': ol.xml.makeArrayPusher(
ol.format.GML3.prototype.surfaceMemberParser_),
'surfaceMembers': ol.xml.makeArrayPusher(
ol.format.GML3.prototype.surfaceMemberParser_)
}
});
};
/**
@@ -539,13 +539,13 @@ ol.format.GML3.prototype.MULTISURFACE_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML3.prototype.CURVEMEMBER_PARSERS_ = Object({
ol.format.GML3.prototype.CURVEMEMBER_PARSERS_ = {
'http://www.opengis.net/gml' : {
'LineString': ol.xml.makeArrayPusher(
ol.format.GMLBase.prototype.readLineString),
'Curve': ol.xml.makeArrayPusher(ol.format.GML3.prototype.readCurve_)
}
});
};
/**
@@ -553,12 +553,12 @@ ol.format.GML3.prototype.CURVEMEMBER_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML3.prototype.SURFACEMEMBER_PARSERS_ = Object({
ol.format.GML3.prototype.SURFACEMEMBER_PARSERS_ = {
'http://www.opengis.net/gml' : {
'Polygon': ol.xml.makeArrayPusher(ol.format.GMLBase.prototype.readPolygon),
'Surface': ol.xml.makeArrayPusher(ol.format.GML3.prototype.readSurface_)
}
});
};
/**
@@ -566,11 +566,11 @@ ol.format.GML3.prototype.SURFACEMEMBER_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML3.prototype.SURFACE_PARSERS_ = Object({
ol.format.GML3.prototype.SURFACE_PARSERS_ = {
'http://www.opengis.net/gml' : {
'patches': ol.xml.makeReplacer(ol.format.GML3.prototype.readPatch_)
}
});
};
/**
@@ -578,11 +578,11 @@ ol.format.GML3.prototype.SURFACE_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML3.prototype.CURVE_PARSERS_ = Object({
ol.format.GML3.prototype.CURVE_PARSERS_ = {
'http://www.opengis.net/gml' : {
'segments': ol.xml.makeReplacer(ol.format.GML3.prototype.readSegment_)
}
});
};
/**
@@ -590,14 +590,14 @@ ol.format.GML3.prototype.CURVE_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML3.prototype.ENVELOPE_PARSERS_ = Object({
ol.format.GML3.prototype.ENVELOPE_PARSERS_ = {
'http://www.opengis.net/gml' : {
'lowerCorner': ol.xml.makeArrayPusher(
ol.format.GML3.prototype.readFlatPosList_),
'upperCorner': ol.xml.makeArrayPusher(
ol.format.GML3.prototype.readFlatPosList_)
}
});
};
/**
@@ -605,12 +605,12 @@ ol.format.GML3.prototype.ENVELOPE_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML3.prototype.PATCHES_PARSERS_ = Object({
ol.format.GML3.prototype.PATCHES_PARSERS_ = {
'http://www.opengis.net/gml' : {
'PolygonPatch': ol.xml.makeReplacer(
ol.format.GML3.prototype.readPolygonPatch_)
}
});
};
/**
@@ -618,12 +618,12 @@ ol.format.GML3.prototype.PATCHES_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GML3.prototype.SEGMENTS_PARSERS_ = Object({
ol.format.GML3.prototype.SEGMENTS_PARSERS_ = {
'http://www.opengis.net/gml' : {
'LineStringSegment': ol.xml.makeReplacer(
ol.format.GML3.prototype.readLineStringSegment_)
}
});
};
/**
@@ -1006,7 +1006,7 @@ ol.format.GML3.prototype.writeGeometryElement = function(node, geometry, objectS
var item = ol.object.assign({}, context);
item.node = node;
var value;
if (goog.isArray(geometry)) {
if (Array.isArray(geometry)) {
if (context.dataProjection) {
value = ol.proj.transformExtent(
geometry, context.featureProjection, context.dataProjection);
@@ -1233,7 +1233,7 @@ ol.format.GML3.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, o
goog.asserts.assert(ol.xml.isNode(parentNode),
'parentNode should be a node');
var nodeName;
if (!goog.isArray(value)) {
if (!Array.isArray(value)) {
goog.asserts.assertInstanceof(value, ol.geom.Geometry,
'value should be an ol.geom.Geometry');
nodeName = value.getType();

View File

@@ -111,7 +111,7 @@ ol.format.GMLBase.ONLY_WHITESPACE_RE_ = /^[\s\xa0]*$/;
ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
var localName = ol.xml.getLocalName(node);
var localName = node.localName;
var features;
if (localName == 'FeatureCollection') {
if (node.namespaceURI === 'http://www.opengis.net/wfs') {
@@ -163,7 +163,7 @@ ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
featureNS[defaultPrefix] = ns;
}
var parsersNS = {};
var featureTypes = goog.isArray(featureType) ? featureType : [featureType];
var featureTypes = Array.isArray(featureType) ? featureType : [featureType];
for (var p in featureNS) {
var parsers = {};
for (i = 0, ii = featureTypes.length; i < ii; ++i) {
@@ -219,7 +219,7 @@ ol.format.GMLBase.prototype.readFeatureElement = function(node, objectStack) {
ol.xml.getAttributeNS(node, ol.format.GMLBase.GMLNS, 'id');
var values = {}, geometryName;
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
var localName = ol.xml.getLocalName(n);
var localName = n.localName;
// Assume attribute elements have one child node and that the child
// is a text or CDATA node (to be treated as text).
// Otherwise assume it is a geometry node.
@@ -503,14 +503,14 @@ ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, object
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GMLBase.prototype.MULTIPOINT_PARSERS_ = Object({
ol.format.GMLBase.prototype.MULTIPOINT_PARSERS_ = {
'http://www.opengis.net/gml' : {
'pointMember': ol.xml.makeArrayPusher(
ol.format.GMLBase.prototype.pointMemberParser_),
'pointMembers': ol.xml.makeArrayPusher(
ol.format.GMLBase.prototype.pointMemberParser_)
}
});
};
/**
@@ -518,14 +518,14 @@ ol.format.GMLBase.prototype.MULTIPOINT_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GMLBase.prototype.MULTILINESTRING_PARSERS_ = Object({
ol.format.GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
'http://www.opengis.net/gml' : {
'lineStringMember': ol.xml.makeArrayPusher(
ol.format.GMLBase.prototype.lineStringMemberParser_),
'lineStringMembers': ol.xml.makeArrayPusher(
ol.format.GMLBase.prototype.lineStringMemberParser_)
}
});
};
/**
@@ -533,14 +533,14 @@ ol.format.GMLBase.prototype.MULTILINESTRING_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GMLBase.prototype.MULTIPOLYGON_PARSERS_ = Object({
ol.format.GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
'http://www.opengis.net/gml' : {
'polygonMember': ol.xml.makeArrayPusher(
ol.format.GMLBase.prototype.polygonMemberParser_),
'polygonMembers': ol.xml.makeArrayPusher(
ol.format.GMLBase.prototype.polygonMemberParser_)
}
});
};
/**
@@ -548,12 +548,12 @@ ol.format.GMLBase.prototype.MULTIPOLYGON_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GMLBase.prototype.POINTMEMBER_PARSERS_ = Object({
ol.format.GMLBase.prototype.POINTMEMBER_PARSERS_ = {
'http://www.opengis.net/gml' : {
'Point': ol.xml.makeArrayPusher(
ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_)
}
});
};
/**
@@ -561,12 +561,12 @@ ol.format.GMLBase.prototype.POINTMEMBER_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = Object({
ol.format.GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
'http://www.opengis.net/gml' : {
'LineString': ol.xml.makeArrayPusher(
ol.format.GMLBase.prototype.readLineString)
}
});
};
/**
@@ -574,12 +574,12 @@ ol.format.GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @private
*/
ol.format.GMLBase.prototype.POLYGONMEMBER_PARSERS_ = Object({
ol.format.GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
'http://www.opengis.net/gml' : {
'Polygon': ol.xml.makeArrayPusher(
ol.format.GMLBase.prototype.readPolygon)
}
});
};
/**
@@ -587,12 +587,12 @@ ol.format.GMLBase.prototype.POLYGONMEMBER_PARSERS_ = Object({
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
* @protected
*/
ol.format.GMLBase.prototype.RING_PARSERS = Object({
ol.format.GMLBase.prototype.RING_PARSERS = {
'http://www.opengis.net/gml' : {
'LinearRing': ol.xml.makeReplacer(
ol.format.GMLBase.prototype.readFlatLinearRing_)
}
});
};
/**
@@ -636,6 +636,6 @@ ol.format.GMLBase.prototype.readFeaturesFromNode = function(node, opt_options) {
* @inheritDoc
*/
ol.format.GMLBase.prototype.readProjectionFromNode = function(node) {
return ol.proj.get(this.srsName_ ? this.srsName_ :
return ol.proj.get(this.srsName ? this.srsName :
node.firstElementChild.getAttribute('srsName'));
};

View File

@@ -868,6 +868,8 @@ ol.format.GPX.GPX_SERIALIZERS_ = ol.xml.makeStructureNS(
/**
* Encode an array of features in the GPX format.
* LineString geometries are output as routes (`<rte>`), and MultiLineString
* as tracks (`<trk>`).
*
* @function
* @param {Array.<ol.Feature>} features Features.
@@ -880,6 +882,8 @@ ol.format.GPX.prototype.writeFeatures;
/**
* Encode an array of features in the GPX format as an XML node.
* LineString geometries are output as routes (`<rte>`), and MultiLineString
* as tracks (`<trk>`).
*
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Options.

View File

@@ -1,7 +1,6 @@
goog.provide('ol.format.JSONFeature');
goog.require('goog.asserts');
goog.require('goog.json');
goog.require('ol.format.Feature');
goog.require('ol.format.FormatType');
@@ -30,8 +29,8 @@ ol.format.JSONFeature.prototype.getObject_ = function(source) {
if (goog.isObject(source)) {
return source;
} else if (typeof source === 'string') {
var object = goog.json.parse(source);
return object ? object : null;
var object = JSON.parse(source);
return object ? /** @type {Object} */ (object) : null;
} else {
goog.asserts.fail();
return null;
@@ -121,7 +120,7 @@ ol.format.JSONFeature.prototype.readProjectionFromObject = goog.abstractMethod;
* @inheritDoc
*/
ol.format.JSONFeature.prototype.writeFeature = function(feature, opt_options) {
return goog.json.serialize(this.writeFeatureObject(feature, opt_options));
return JSON.stringify(this.writeFeatureObject(feature, opt_options));
};
@@ -136,9 +135,8 @@ ol.format.JSONFeature.prototype.writeFeatureObject = goog.abstractMethod;
/**
* @inheritDoc
*/
ol.format.JSONFeature.prototype.writeFeatures = function(
features, opt_options) {
return goog.json.serialize(this.writeFeaturesObject(features, opt_options));
ol.format.JSONFeature.prototype.writeFeatures = function(features, opt_options) {
return JSON.stringify(this.writeFeaturesObject(features, opt_options));
};
@@ -153,9 +151,8 @@ ol.format.JSONFeature.prototype.writeFeaturesObject = goog.abstractMethod;
/**
* @inheritDoc
*/
ol.format.JSONFeature.prototype.writeGeometry = function(
geometry, opt_options) {
return goog.json.serialize(this.writeGeometryObject(geometry, opt_options));
ol.format.JSONFeature.prototype.writeGeometry = function(geometry, opt_options) {
return JSON.stringify(this.writeGeometryObject(geometry, opt_options));
};

View File

@@ -426,7 +426,7 @@ ol.format.KML.createFeatureStyleFunction_ = function(style, styleUrl,
* @private
*/
ol.format.KML.findStyle_ = function(styleValue, defaultStyle, sharedStyles) {
if (goog.isArray(styleValue)) {
if (Array.isArray(styleValue)) {
return styleValue;
} else if (typeof styleValue === 'string') {
// KML files in the wild occasionally forget the leading `#` on styleUrls
@@ -1267,7 +1267,7 @@ ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
var placemarkObject = objectStack[objectStack.length - 1];
goog.asserts.assert(goog.isObject(placemarkObject),
'placemarkObject should be an Object');
if (goog.isArray(styleMapValue)) {
if (Array.isArray(styleMapValue)) {
placemarkObject['Style'] = styleMapValue;
} else if (typeof styleMapValue === 'string') {
placemarkObject['styleUrl'] = styleMapValue;
@@ -1327,7 +1327,7 @@ ol.format.KML.innerBoundaryIsParser_ = function(node, objectStack) {
if (flatLinearRing) {
var flatLinearRings = /** @type {Array.<Array.<number>>} */
(objectStack[objectStack.length - 1]);
goog.asserts.assert(goog.isArray(flatLinearRings),
goog.asserts.assert(Array.isArray(flatLinearRings),
'flatLinearRings should be an array');
goog.asserts.assert(flatLinearRings.length > 0,
'flatLinearRings array should not be empty');
@@ -1352,7 +1352,7 @@ ol.format.KML.outerBoundaryIsParser_ = function(node, objectStack) {
if (flatLinearRing) {
var flatLinearRings = /** @type {Array.<Array.<number>>} */
(objectStack[objectStack.length - 1]);
goog.asserts.assert(goog.isArray(flatLinearRings),
goog.asserts.assert(Array.isArray(flatLinearRings),
'flatLinearRings should be an array');
goog.asserts.assert(flatLinearRings.length > 0,
'flatLinearRings array should not be empty');
@@ -1745,7 +1745,7 @@ ol.format.KML.prototype.getExtensions = function() {
ol.format.KML.prototype.readDocumentOrFolder_ = function(node, objectStack) {
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
var localName = ol.xml.getLocalName(node);
var localName = node.localName;
goog.asserts.assert(localName == 'Document' || localName == 'Folder',
'localName should be Document or Folder');
// FIXME use scope somehow
@@ -1923,7 +1923,7 @@ ol.format.KML.prototype.readFeaturesFromNode = function(node, opt_options) {
return [];
}
var features;
var localName = ol.xml.getLocalName(node);
var localName = node.localName;
if (localName == 'Document' || localName == 'Folder') {
features = this.readDocumentOrFolder_(
node, [this.getReadOptions(node, opt_options)]);
@@ -2009,7 +2009,7 @@ ol.format.KML.prototype.readNameFromNode = function(node) {
}
}
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
var localName = ol.xml.getLocalName(n);
var localName = n.localName;
if (ol.array.includes(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
(localName == 'Document' ||
localName == 'Folder' ||
@@ -2080,7 +2080,7 @@ ol.format.KML.prototype.readNetworkLinksFromNode = function(node) {
}
}
for (n = node.firstElementChild; n; n = n.nextElementSibling) {
var localName = ol.xml.getLocalName(n);
var localName = n.localName;
if (ol.array.includes(ol.format.KML.NAMESPACE_URIS_, n.namespaceURI) &&
(localName == 'Document' ||
localName == 'Folder' ||
@@ -2386,7 +2386,7 @@ ol.format.KML.writePlacemark_ = function(node, feature, objectStack) {
// resolution-independent here
var styles = styleFunction.call(feature, 0);
if (styles) {
var style = goog.isArray(styles) ? styles[0] : styles;
var style = Array.isArray(styles) ? styles[0] : styles;
if (this.writeStyles_) {
properties['Style'] = style;
}
@@ -2484,7 +2484,9 @@ ol.format.KML.writePolyStyle_ = function(node, style, objectStack) {
* @private
*/
ol.format.KML.writeScaleTextNode_ = function(node, scale) {
ol.format.XSD.writeDecimalTextNode(node, scale * scale);
// the Math is to remove any excess decimals created by float arithmetic
ol.format.XSD.writeDecimalTextNode(node,
Math.round(scale * scale * 1e6) / 1e6);
};

View File

@@ -664,7 +664,7 @@ ol.format.WFS.prototype.writeGetFeature = function(options) {
bbox: options.bbox,
propertyNames: options.propertyNames ? options.propertyNames : []
};
goog.asserts.assert(goog.isArray(options.featureTypes),
goog.asserts.assert(Array.isArray(options.featureTypes),
'options.featureTypes should be an array');
ol.format.WFS.writeGetFeature_(node, options.featureTypes, [context]);
return node;

View File

@@ -75,7 +75,7 @@ ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = function(node, objectStack
node.setAttribute('namespaceURI', this.featureNS_);
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
'node.nodeType should be ELEMENT');
var localName = ol.xml.getLocalName(node);
var localName = node.localName;
/** @type {Array.<ol.Feature>} */
var features = [];
if (node.childNodes.length === 0) {

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