Compare commits

...

642 Commits

Author SHA1 Message Date
Andreas Hocevar
3279d5634b 4.3.0-beta.3 2017-08-09 14:49:58 -06:00
Tim Schaub
5b75666755 Merge pull request #7098 from ahocevar/no-math-round
Use fractional coordinates for CSS positioning
2017-08-09 14:32:39 -06:00
Andreas Hocevar
1c8734b150 Use fractional coordinates for CSS positioning 2017-08-09 14:15:47 -06:00
Tim Schaub
ff9ef481db Merge pull request #7064 from ahocevar/no-foreach
Do not use Array.prototype.forEach when dealing with potentially large arrays
2017-08-09 13:59:49 -06:00
Tim Schaub
02cc7d643a Merge pull request #7093 from tschaub/modify-source
Allow modify interaction to be configured with a source
2017-08-09 13:55:33 -06:00
Andreas Hocevar
efee061251 Merge pull request #7096 from ahocevar/getfeaturesatpixel
Add new Map#getFeaturesAtPixel method
2017-08-09 13:54:50 -06:00
Tim Schaub
3551679a7c Merge pull request #7094 from icholy/master
Add missing zIndex options
2017-08-09 13:45:09 -06:00
Tim Schaub
86eacefe19 Allow modify interaction to be configured with a source 2017-08-09 13:35:25 -06:00
Andreas Hocevar
7d260c54d3 Add new Map#getFeaturesAtPixel method 2017-08-09 12:58:24 -06:00
Ilia Choly
25dca1ea3b Add missing zIndex options 2017-08-09 10:39:39 -04:00
Andreas Hocevar
6fd844d24c Merge pull request #7087 from ahocevar/fix-scaleline
Fix scale line for EPSG:4326 maps
2017-08-08 06:49:01 -06:00
Frédéric Junod
9f6839c87b Merge pull request #7088 from openlayers/greenkeeper/sinon-3.1.0
Update sinon to the latest version 🚀
2017-08-08 10:39:00 +02:00
Frédéric Junod
e9611e6a6b Merge pull request #7085 from openlayers/greenkeeper/eslint-4.4.1
Update eslint to the latest version 🚀
2017-08-08 08:59:36 +02:00
greenkeeper[bot]
b9089c00e3 chore(package): update sinon to version 3.1.0 2017-08-08 06:45:52 +00:00
Andreas Hocevar
388e2a93cb Fix scale line for EPSG:4326 maps 2017-08-07 20:42:28 -06:00
Andreas Hocevar
ac13dbccf1 Merge pull request #7084 from ahocevar/fix-street-labels-typo
Fix a typo in the street-labels example
2017-08-07 12:29:10 -06:00
Andreas Hocevar
1795a86f7f Fix a typo in the street-labels example 2017-08-07 12:01:42 -06:00
greenkeeper[bot]
66da6fc150 chore(package): update eslint to version 4.4.1 2017-08-07 17:48:33 +00:00
Andreas Hocevar
e0eec51eb3 Merge pull request #7082 from openlayers/greenkeeper/eslint-4.4.0
Update eslint to the latest version 🚀
2017-08-07 02:48:43 +02:00
Andreas Hocevar
4b4d711dbc Merge pull request #7079 from ahocevar/optimize-custom-renderer
Optimize custom renderer code, examples and API
2017-08-06 16:01:18 +02:00
greenkeeper[bot]
bb405e2919 chore(package): update eslint to version 4.4.0 2017-08-05 18:46:05 +00:00
Andreas Hocevar
f133f4fc3c Merge pull request #7080 from openlayers/greenkeeper/jsdoc-3.5.4
Update jsdoc to the latest version 🚀
2017-08-05 02:56:00 +02:00
Andreas Hocevar
35f22fb52c Only create custom style for text we actually render 2017-08-05 00:15:58 +02:00
Andreas Hocevar
617151c8ff Simplify the renderer function API 2017-08-05 00:15:58 +02:00
greenkeeper[bot]
25e1e11550 fix(package): update jsdoc to version 3.5.4 2017-08-04 22:08:21 +00:00
Andreas Hocevar
67aa1a6dc9 Cache coordinates for reuse on replay, not on geometry 2017-08-04 21:06:22 +02:00
Frédéric Junod
3290039b32 Merge pull request #7078 from geosense/vectortile_layer_getsource_return_type
Fix return type annotation of ol.layer.VectorTile.getSource
2017-08-04 13:39:40 +02:00
Aleš Jiránek
e52ca96dc3 Fix return type annotation of ol.layer.VectorTile.getSource 2017-08-04 12:05:17 +02:00
Frédéric Junod
25b851e7cb Merge pull request #7073 from gberaudo/notify_hidden_layer_group_changes
Make ol.layer.Group change handling consistent
2017-08-04 08:29:57 +02:00
Frédéric Junod
9cbbc30ce1 Merge pull request #7075 from openlayers/greenkeeper/sinon-3.0.0
Update sinon to the latest version 🚀
2017-08-04 08:29:32 +02:00
greenkeeper[bot]
2392f87113 chore(package): update sinon to version 3.0.0 2017-08-03 14:40:32 +00:00
Guillaume Beraudo
63b14f5f32 Make ol.layer.Group change handling consistent
Changes to the layer were only propagated in some cases like addition/removal of a
layer to the group.

To make it consistent both with the rest of the group.js file and with the
layer.js file, the changes are now always notified.
2017-08-03 11:44:06 +02:00
Andreas Hocevar
ee7795e31d Merge pull request #7072 from ahocevar/vectortile-docs
Improve API docs for ol.VectorTile
2017-08-03 10:51:26 +02:00
Andreas Hocevar
aba1045304 Improve API docs for ol.VectorTile 2017-08-03 10:30:24 +02:00
Andreas Hocevar
83c35758c8 Merge pull request #7070 from ahocevar/mvt-tilepixelratio
Get tilePixelRatio from MVT tiles
2017-08-03 08:46:56 +02:00
Andreas Hocevar
d4d371a4c2 Remove the tilePixelRatio option from ol.source.VectorTile 2017-08-03 00:20:29 +02:00
Andreas Hocevar
b3be7e7ba9 Get tilePixelRatio from MVT tiles 2017-08-02 20:11:14 +02:00
Andreas Hocevar
60f9c4be2d Merge pull request #7069 from openlayers/greenkeeper/mocha-3.5.0
Update mocha to the latest version 🚀
2017-08-01 10:27:23 +02:00
greenkeeper[bot]
22dfe93f8b chore(package): update mocha to version 3.5.0 2017-07-31 22:28:11 +00:00
Andreas Hocevar
1bbcdea9bd Merge pull request #7068 from openlayers/greenkeeper/fs-extra-4.0.1
Update fs-extra to the latest version 🚀
2017-07-31 23:40:46 +02:00
greenkeeper[bot]
e91ad26ac9 fix(package): update fs-extra to version 4.0.1 2017-07-31 18:27:27 +00:00
Andreas Hocevar
0fc3b0f58e Merge pull request #7066 from ahocevar/extent-event
Fix ol.interaction.Extent event type and documentation
2017-07-31 11:15:06 +02:00
Frédéric Junod
afe0c10f45 Merge pull request #7032 from raiyni/icon-fix
Fix KML Export Icon Anchor
2017-07-31 08:30:55 +02:00
Andreas Hocevar
d5fd215632 Fix ol.interaction.Extent event type and documentation 2017-07-30 23:32:16 +02:00
Andreas Hocevar
d9c49092e4 Merge pull request #7065 from ahocevar/extent-api
Only use API functions in example
2017-07-30 23:11:05 +02:00
Andreas Hocevar
9fdce0f2b1 Only use API functions in example 2017-07-30 22:51:56 +02:00
Andreas Hocevar
007d8c2d5e Merge pull request #7022 from ahocevar/custom-renderers
Allow styles to configure a custom renderer
2017-07-30 22:24:59 +02:00
Andreas Hocevar
68f6b61217 Address review comments 2017-07-30 00:32:51 +02:00
Andreas Hocevar
1b46f38696 Do not use Array.prototype.forEach for potentially large arrays 2017-07-29 23:16:23 +02:00
Andreas Hocevar
c6b942f185 Allow styles to configure a custom renderer
Two new examples show how custom renderers can be used to render text along
paths, and to declutter labels using 3rd party libraries.
2017-07-29 17:57:38 +02:00
Andreas Hocevar
2258c00fca Merge pull request #7061 from ahocevar/issue-pr-templates
Update docs and issue and pull request instructions
2017-07-28 17:02:33 +02:00
Andreas Hocevar
f01e5d3eaf Update Browserify tutorial to use the ol package 2017-07-28 16:29:13 +02:00
Andreas Hocevar
52a9ca6518 Mention other options in the closure tutorial 2017-07-28 16:21:45 +02:00
Andreas Hocevar
0d0f3cadc8 Update docs and readme 2017-07-28 16:21:45 +02:00
Andreas Hocevar
e454d3220e Add pull request and issue templates 2017-07-28 16:21:45 +02:00
Andreas Hocevar
9b90ec099c Merge pull request #7059 from ahocevar/extent-interaction-extent
Allow to configure Extent interaction with an extent
2017-07-28 15:59:50 +02:00
Andreas Hocevar
fad485069b Merge pull request #7060 from wnordmann/EPSG3857CodeChange
Removing invalid urn
2017-07-28 15:58:25 +02:00
Willie Nordmann
9ee1f6df98 Removing invalid urn 2017-07-28 08:14:27 -05:00
Andreas Hocevar
b0b68983f7 Allow to configure Extent interaction with an extent 2017-07-28 13:07:18 +02:00
Andreas Hocevar
8dbbe3ba5d Merge pull request #7051 from wnordmann/EPSG3857CodeChange
Changing the EPSG3857.PROJECTION array assignment and adding urn:ogc:…
2017-07-27 17:19:19 +02:00
Andreas Hocevar
e94b660b04 Merge pull request #7045 from ahocevar/immediate-image-size
Respect pixelRatio when scaling images
2017-07-27 16:42:21 +02:00
Andreas Hocevar
6cf3a3ca28 Merge pull request #7023 from ahocevar/vectortile-sizes
Update tile size and resolutions of vector tile examples
2017-07-27 16:22:34 +02:00
Bart van den Eijnden
7782870522 Merge pull request #7005 from Sol1du2/issue/6992/EsriJsonFormat
Add spatial reference inside geometry in EsriFormat
2017-07-27 14:40:02 +02:00
Willie Nordmann
648cd0ca61 Missed EPSG:900913 2017-07-26 13:08:39 -05:00
Willie Nordmann
b9b70ea3ec Changing the EPSG3857.PROJECTION array assignment and adding urn:ogc:crs:EPSG::3857 while removing a duplicate 2017-07-26 12:52:37 -05:00
Andreas Hocevar
2f1bfc42ca Merge pull request #7034 from probins/packagejson
Move non-build dependencies to devDependencies
2017-07-26 17:22:21 +02:00
Andreas Hocevar
2c358387a2 Merge pull request #7050 from openlayers/greenkeeper/sinon-2.4.1
Update sinon to the latest version 🚀
2017-07-26 17:17:27 +02:00
greenkeeper[bot]
70af444b98 chore(package): update sinon to version 2.4.1 2017-07-26 14:25:06 +00:00
Andreas Hocevar
707bc4a708 Merge pull request #6976 from ehanoj/patch-1
Example - Earthquake Clusters - Change evt.type of interaction
2017-07-26 16:03:46 +02:00
Andreas Hocevar
ac48af204e Merge pull request #7048 from openlayers/greenkeeper/sinon-2.4.0
Update sinon to the latest version 🚀
2017-07-26 10:51:52 +02:00
greenkeeper[bot]
fd7272ab1e chore(package): update sinon to version 2.4.0 2017-07-26 06:34:54 +00:00
Andreas Hocevar
ecadb6b685 Respect pixelRatio when scaling images 2017-07-25 11:06:27 +02:00
Andreas Hocevar
fa41c0bad6 Merge pull request #7041 from openlayers/greenkeeper/eslint-4.3.0
Update eslint to the latest version 🚀
2017-07-25 10:55:25 +02:00
Andreas Hocevar
dd878e2a4c Remove lint 2017-07-25 10:42:18 +02:00
Andreas Hocevar
8666c8fee8 Merge pull request #7042 from gkresic/lineDashOffset
Line dash offset
2017-07-24 19:06:33 +02:00
Andreas Hocevar
dd914ef635 Add rendering tests 2017-07-24 18:36:40 +02:00
gkresic
719abf7265 Support for lineDashOffset 2017-07-24 18:36:39 +02:00
Andreas Hocevar
c86d13f032 Merge pull request #6980 from ZachTRice/tilewms-tileclass
Added tileClass to TileWMS
2017-07-24 10:59:34 +02:00
greenkeeper[bot]
1b34dd945e chore(package): update eslint to version 4.3.0 2017-07-21 18:06:19 +00:00
Peter Robins
cc13641216 Move non-build dependencies to devDependencies 2017-07-19 11:05:41 +00:00
Andreas Hocevar
13a0ca5ca1 Merge pull request #7028 from greggian/graticule-perf
Fix Graticule use of incorrect min/maxLon values
2017-07-18 15:11:01 +02:00
Greg Gianforcaro
704cd03d96 Fix Graticule use of incorrect min/maxLon values
Appears to have just been a typeo, using the minLon_, maxLon_ member variables rather than the function parameters provided.

This was creating very wide lines of parallel which were sometimes very slow in Chrome.
2017-07-17 17:53:39 -04:00
Andreas Hocevar
e79a4dd006 Fix resolution creation function 2017-07-15 16:15:14 +02:00
Andreas Hocevar
4bb2f6c1f5 Use de-facto standard 512px tile size for vectortile layers 2017-07-15 16:14:54 +02:00
Frédéric Junod
89ec2dacad Merge pull request #7021 from openlayers/greenkeeper/fs-extra-4.0.0
Update fs-extra to the latest version 🚀
2017-07-15 08:20:34 +02:00
greenkeeper[bot]
b97439cf8e fix(package): update fs-extra to version 4.0.0 2017-07-14 18:11:16 +00:00
Ron Young
f61bd6352d ignore anchor if in default position 2017-07-14 13:16:42 +01:00
Andreas Hocevar
b7b2ee0c57 Merge pull request #7018 from openlayers/greenkeeper/jsdoc-3.5.3
Update jsdoc to the latest version 🚀
2017-07-14 07:56:41 +02:00
greenkeeper[bot]
fe39b5da1b fix(package): update jsdoc to version 3.5.3 2017-07-14 02:54:50 +00:00
Frédéric Junod
bc0bc3f8a9 Merge pull request #7015 from openlayers/greenkeeper/sinon-2.3.8
Update sinon to the latest version 🚀
2017-07-13 13:21:35 +02:00
greenkeeper[bot]
9c0d0c5681 chore(package): update sinon to version 2.3.8 2017-07-13 08:23:48 +00:00
Frédéric Junod
b97daf844b Merge pull request #7014 from openlayers/greenkeeper/jsdoc-3.5.2
Update jsdoc to the latest version 🚀
2017-07-13 08:39:54 +02:00
Tim Schaub
f8237c9cd2 Merge pull request #7013 from tschaub/sphere
Remove ol.sphere.WGS84 and ol.sphere.NORMAL
2017-07-12 21:14:05 -06:00
greenkeeper[bot]
b317a4474e fix(package): update jsdoc to version 3.5.2 2017-07-12 18:20:07 +00:00
Frédéric Junod
b1772dae44 Merge pull request #6981 from gberaudo/intermediate_canvas_rendering
Render transparent vector layers to an intermediate canvas
2017-07-12 14:14:13 +02:00
Guillaume Beraudo
c33383d248 Add rendering test for transparent layer 2017-07-12 10:56:15 +02:00
Guillaume Beraudo
645e359cde Render transparent vector layers to an intermediate canvas
Until now, the features of transparent vector layers were rendered using
the layer opacity. This caused colors to mix together and the opacities
to stack up to an higher value than the expected layer opacity.

With this commit, the features are rendered at 100% opacity to an
intermediate canvas which ensures colors do not mix up even in the case
of features using an array of styles. The intermediate canvas is then
composed to the map canvas using the layer opacity.

Transparent layers are automatically detected, non-transparent layers
are not affected by the change.
2017-07-12 09:23:04 +02:00
Tim Schaub
fa71593a2a Remove ol.sphere.NORMAL 2017-07-11 08:10:46 -06:00
Tim Schaub
2e903c0293 Remove ol.sphere.WGS84 2017-07-11 08:00:41 -06:00
Tim Schaub
aced192bcd Merge pull request #6899 from probins/radii
Use number literal for sphere radius
2017-07-11 07:08:30 -06:00
Andreas Hocevar
19b0b956f7 Merge pull request #7011 from openlayers/greenkeeper/jsdoc-3.5.1
Update jsdoc to the latest version 🚀
2017-07-11 00:02:28 +02:00
greenkeeper[bot]
9f9355ac46 fix(package): update jsdoc to version 3.5.1 2017-07-10 18:22:28 +00:00
Andreas Hocevar
f28e6c2d95 Merge pull request #7008 from openlayers/greenkeeper/sinon-2.3.7
Update sinon to the latest version 🚀
2017-07-10 19:13:06 +02:00
Andreas Hocevar
e633380221 Merge pull request #7007 from openlayers/greenkeeper/rollup-0.45.0
fix(package): update rollup to version 0.45.0
2017-07-10 19:11:58 +02:00
Andreas Hocevar
5f6f757bd0 Update rollup configuration 2017-07-10 18:59:58 +02:00
greenkeeper[bot]
b29fc52842 chore(package): update sinon to version 2.3.7 2017-07-10 13:23:45 +00:00
greenkeeper[bot]
791ffaabeb fix(package): update rollup to version 0.45.0
Closes #7001
2017-07-10 14:48:30 +02:00
Andreas Hocevar
c31d67fe57 Merge pull request #6996 from ch08532/bugfix/6987
6987: Memory leak with WMS time source with reprojection
2017-07-10 13:01:46 +02:00
Andreas Hocevar
a1710be335 Merge pull request #7003 from openlayers/greenkeeper/jsdoc-3.5.0
Update jsdoc to the latest version 🚀
2017-07-10 12:36:56 +02:00
Andreas Hocevar
2260d92436 Return promise to avoid truncated stdout output 2017-07-10 12:02:33 +02:00
Andreas Hocevar
4d0e106d98 Change paths for jsdoc 3.5 2017-07-10 12:02:12 +02:00
Joao Gouveia
2be40953a8 Add spatial reference inside geometry in EsriFormat
As mentioned on issue 6992, EsriFormat was adding the spatial reference
outside the geometry, failing to insert data via the Arcgis rest API.
The spatial reference should be inside the geometry.
2017-07-10 10:24:04 +02:00
Frédéric Junod
8bc4bde5c3 Merge pull request #7004 from fredj/https
Use https for bing and stamen attributions
2017-07-10 08:58:49 +02:00
Frederic Junod
429e2982d0 Use https for bing and stamen attributions 2017-07-10 08:31:51 +02:00
greenkeeper[bot]
23f8540b4c fix(package): update jsdoc to version 3.5.0 2017-07-10 02:30:32 +00:00
Andreas Hocevar
59d8d749e3 Merge pull request #6998 from openlayers/greenkeeper/eslint-4.2.0
Update eslint to the latest version 🚀
2017-07-09 16:52:47 +02:00
Andreas Hocevar
cff9ef5e63 Remove lint 2017-07-09 16:11:36 +02:00
Andreas Hocevar
e6e0109a1b Merge pull request #6999 from ahocevar/vectortile-source-multilayer
Make VectorTile source work with multiple layers
2017-07-09 14:39:27 +02:00
Andreas Hocevar
7739239e89 Make VectorTile source work with multiple layers 2017-07-09 14:08:08 +02:00
greenkeeper[bot]
eb8d5bcade chore(package): update eslint to version 4.2.0 2017-07-09 03:45:00 +00:00
Chris Amaral
ff242ef28c timeimage.js - Added newTile.refreshInterimChain() to clean up interimTile references and preventing memory leak 2017-07-07 13:57:50 -04:00
Andreas Hocevar
4a0f97ac6a Merge pull request #6988 from ahocevar/vectortile-types
Add missing type annotations
2017-07-06 16:53:23 +02:00
Andreas Hocevar
a0e0e76995 Add missing type annotations 2017-07-06 12:31:57 +02:00
Frédéric Junod
b5f9b88d0e Merge pull request #6984 from openlayers/greenkeeper/closure-util-1.22.0
Update closure-util to the latest version 🚀
2017-07-06 11:20:14 +02:00
greenkeeper[bot]
339f048826 fix(package): update closure-util to version 1.22.0 2017-07-05 07:56:48 +00:00
ZachTRice
8db49fa981 Added tileClass to TileWMS 2017-07-04 10:20:02 -04:00
Andreas Hocevar
4f0bfbc1db Merge pull request #6970 from cmortazavi/patch-1
Fix Bug when adding/removing layer with no cache
2017-07-03 20:34:13 +02:00
ehanoj
77273321b7 Change evt.type of interaction
OriginalEvent 'mousemove' break default OL interaction move of map canvas. Using OL event 'pointermove' have same function and allow move of map canvas.
2017-07-02 23:03:09 +02:00
cmortazavi
db63cc1b23 Fix Bug when adding/removing layer with no cache 2017-07-02 09:34:14 +02:00
Andreas Hocevar
f88d8b8a7d Merge pull request #6972 from ahocevar/loaded-error-tiles
Handle error tiles properly
2017-06-29 09:33:33 +02:00
Andreas Hocevar
991328904d Merge pull request #6973 from openlayers/greenkeeper/clean-css-cli-4.1.6
Update clean-css-cli to the latest version 🚀
2017-06-29 09:33:03 +02:00
greenkeeper[bot]
9d3539b3cb chore(package): update clean-css-cli to version 4.1.6 2017-06-29 07:05:11 +00:00
Frédéric Junod
bd143c0ad1 Merge pull request #6971 from openlayers/greenkeeper/sinon-2.3.6
Update sinon to the latest version 🚀
2017-06-29 08:58:16 +02:00
Andreas Hocevar
970265acb0 Give preloaded lower resolution tiles a chance to display immediately 2017-06-29 00:02:24 +02:00
Andreas Hocevar
36c80f61bc Do not delete tile keys for error or empty tiles 2017-06-28 23:16:11 +02:00
greenkeeper[bot]
d86c7c22dc chore(package): update sinon to version 2.3.6 2017-06-28 18:22:37 +00:00
Andreas Hocevar
71b334d49c Merge pull request #6968 from ahocevar/spin-animation
Shortest arc rotation animation improvements and upgrade notes
2017-06-28 17:11:01 +02:00
Andreas Hocevar
ee0eb8b1a0 Normalize rotation to values between -180 and 180 degrees after animation 2017-06-28 16:36:33 +02:00
Andreas Hocevar
cd4ed759ed Upgrade notes and example update for shortest arc rotation animation 2017-06-28 15:31:26 +02:00
Andreas Hocevar
c0e4da6d8c Merge pull request #6966 from ahocevar/resolution-for-zoom
Add getResolutionForZoom method for ol.View
2017-06-28 13:01:54 +02:00
Andreas Hocevar
72f5ff917f Merge pull request #6965 from ahocevar/shortest-rotation
Use shortest rotation delta for animation
2017-06-28 13:01:33 +02:00
Andreas Hocevar
4c9c9fa719 Merge pull request #6967 from ahocevar/bing-road-on-demand
Add RoadOnDemand imagery set to Bing example
2017-06-28 10:56:54 +02:00
Frédéric Junod
163e01a2dc Merge pull request #6964 from fredj/kml_DataParser
Fix KML ExtendedData reading
2017-06-28 10:53:55 +02:00
Andreas Hocevar
79862ca8c2 Add RoadOnDemand imagery set to Bing example 2017-06-28 10:40:06 +02:00
Andreas Hocevar
aa8d7b0b36 Add getResolutionForZoom method for ol.View 2017-06-28 10:30:32 +02:00
Andreas Hocevar
8d0857fd7a Merge pull request #6958 from ahocevar/vectorimagetile-cleanup
Remove error tiles after loading is finished
2017-06-28 10:21:20 +02:00
Andreas Hocevar
67f69a32bb Use shortest rotation delta for animation 2017-06-28 10:06:10 +02:00
Frederic Junod
382674975e Fix KML ExtendedData reading 2017-06-28 09:51:18 +02:00
Frédéric Junod
eaaa895b0a Merge pull request #6793 from GaborFarkas/webgl_text
Webgl text
2017-06-27 15:44:57 +02:00
Tim Schaub
70b971d3a4 Merge pull request #6960 from tschaub/queue-then-load
Queue tiles before loading
2017-06-26 23:42:25 -06:00
Tim Schaub
3ddb8712a3 Queue tiles before loading 2017-06-26 18:31:53 -06:00
Andreas Hocevar
533ca8b9fe Remove error tiles after loading is finished 2017-06-26 16:16:47 +02:00
Andreas Hocevar
0fc710bc48 Merge pull request #6957 from openlayers/greenkeeper/eslint-4.1.1
Greenkeeper/eslint 4.1.1
2017-06-26 16:03:53 +02:00
Andreas Hocevar
fe18636ff9 Remove lint 2017-06-26 14:56:07 +02:00
Andreas Hocevar
c299bfcd0f Merge pull request #6955 from openlayers/greenkeeper/async-2.5.0
Update async to the latest version 🚀
2017-06-26 07:31:06 +02:00
greenkeeper[bot]
3f5a6bca26 chore(package): update eslint to version 4.1.1
Closes #6950
2017-06-26 02:33:20 +00:00
greenkeeper[bot]
a6b35e7d8a fix(package): update async to version 2.5.0 2017-06-26 00:06:01 +00:00
GaborFarkas
619e85e737 Fix linting issues 2017-06-23 21:12:27 +02:00
GaborFarkas
b3407b0554 Add reindented texture shader 2017-06-23 20:51:46 +02:00
GaborFarkas
a4c421e699 Use glyph atlases 2017-06-23 20:44:41 +02:00
GaborFarkas
a3a443324d Add tests for WebGL TextReplay 2017-06-23 20:44:41 +02:00
GaborFarkas
7b9833fdce Conform TextReplay to the new structure 2017-06-23 20:44:41 +02:00
GaborFarkas
bd87ec7c83 Conform ImageReplay to the new structure 2017-06-23 20:44:41 +02:00
GaborFarkas
26bfa7a172 Refactor WebGL ImageReplay 2017-06-23 20:37:37 +02:00
GaborFarkas
f82bc15013 Minimal working text renderer 2017-06-23 20:34:52 +02:00
GaborFarkas
da60b96445 Style texts and draw them on canvas 2017-06-23 20:34:52 +02:00
GaborFarkas
2ed5abed07 Add WebGL text defaults 2017-06-23 20:34:52 +02:00
Peter Robins
49dcda7794 Use number literal for sphere radii 2017-06-22 09:15:59 +00:00
Marc Jansen
9fc0fb5e74 Merge pull request #6916 from marcjansen/eslint-4-upgrade
Upgrade eslint to v4.0.0
2017-06-22 07:55:06 +02:00
Andreas Hocevar
d32006b324 Merge pull request #6943 from openlayers/greenkeeper/sinon-2.3.5
Update sinon to the latest version 🚀
2017-06-20 21:43:56 +02:00
Marc Jansen
feabb6440d Add reindented shader sources 2017-06-20 11:45:48 +02:00
Marc Jansen
87e9c9ad46 Change indentation of shader mustache template 2017-06-20 11:45:48 +02:00
Marc Jansen
7d6929c710 Manual adjustment of indentation 2017-06-20 10:41:03 +02:00
greenkeeper[bot]
887642e69c chore(package): update sinon to version 2.3.5 2017-06-20 07:47:44 +00:00
Andreas Hocevar
b9e6619b2d Merge pull request #6939 from ahocevar/cachesize-fix-abort
Abort loading when tile is disposed
2017-06-20 09:35:14 +02:00
Frédéric Junod
78b5fe5f8c Merge pull request #6930 from openlayers/translate_no_map
Handle setActive(false) on an interaction without map
2017-06-20 08:30:45 +02:00
Andreas Hocevar
72e9b74b3e Abort loading when tile is disposed 2017-06-19 18:26:10 +02:00
Andreas Hocevar
c6aeda1511 Merge pull request #6936 from ahocevar/cachesize-fix-tilequeue
Do not stop the render loop when all wanted tiles are aborted
2017-06-19 15:47:26 +02:00
Frédéric Junod
eb501e1244 Merge pull request #6920 from klokantech/type-strength-consistency-fix
Fix minor type strength inconsistency
2017-06-19 15:45:26 +02:00
Andreas Hocevar
1f51c14e7e Do not stop the render loop when all wanted tiles are aborted 2017-06-19 15:17:59 +02:00
Andreas Hocevar
dee3ebdc54 Merge pull request #6935 from ahocevar/no-data-uri
Use transparent image from canvas context
2017-06-19 13:30:08 +02:00
Marc Jansen
d0ef05977b Autofix indentation issues (eslint --fix) 2017-06-19 11:58:00 +02:00
Marc Jansen
a17db4f45c Configure indent rule more explicitly 2017-06-19 11:56:06 +02:00
Andreas Hocevar
20974fea55 Use transparent image from canvas context 2017-06-19 10:13:03 +02:00
Tim Schaub
416df98505 Merge pull request #6933 from probins/proj4
Improve proj.get() logic
2017-06-18 18:15:43 -06:00
Peter Robins
fb5891cd48 Improve proj.get() logic 2017-06-18 09:47:07 +00:00
Bart van den Eijnden
1d4a482c1a Merge pull request #6931 from bartvde/feature-prefix-wfs
Make sure we use the default featurePrefix
2017-06-15 22:04:51 +02:00
bartvde
8d57a879ce Make sure we use the default featurePrefix 2017-06-15 16:33:07 +02:00
Frederic Junod
3e7aecd094 Handle setActive(false) on an interaction without map 2017-06-15 08:41:52 +02:00
Andreas Hocevar
c46bc1f02a Merge pull request #6928 from ahocevar/reproj-resolution
Only adjust resolution when center within projection extent
2017-06-14 16:31:00 +02:00
Andreas Hocevar
0d0ed6c130 Only adjust resolution when center within projection extent 2017-06-14 15:33:16 +02:00
Frédéric Junod
0045bed6e7 Merge pull request #6923 from fredj/strict_mode
Load tasks/build-ext.js in strict mode
2017-06-14 09:46:48 +02:00
Frederic Junod
0982dc0551 Load tasks/build-ext.js in strict mode
For nodejs 4.x compatibility.
2017-06-13 16:50:29 +02:00
Andreas Hocevar
e38efc7cbe Merge pull request #6918 from ahocevar/image-reproject-pixelratio
Remove unnecessary pixelRatio check
2017-06-13 13:07:31 +02:00
Petr Sloup
ea4e5f2293 Fix minor type strength inconsistency 2017-06-13 12:58:57 +02:00
Andreas Hocevar
29d1590bc6 Remove unnecessary pixelRatio check 2017-06-13 11:12:27 +02:00
Andreas Hocevar
e14ee2ea72 Merge pull request #6917 from probins/patch-1
Correct typo in graticule docs
2017-06-13 11:09:41 +02:00
Peter Robins
68ca4b3c2a Correct typo in graticule docs 2017-06-13 09:42:18 +01:00
Marc Jansen
4ad85e52e2 Upgrade eslint to v4.0.0 2017-06-13 09:35:15 +02:00
Andreas Hocevar
4255e81b93 Merge pull request #6914 from openlayers/release-v4.2.0
Finish upgrade notes for v4.2.0
2017-06-12 16:36:29 +02:00
Andreas Hocevar
81e8cdc7ab Finish upgrade notes for v4.2.0 2017-06-12 16:34:29 +02:00
Andreas Hocevar
b1b5b54fd0 Merge pull request #6913 from openlayers/release-v4.2.0
Release v4.2.0
2017-06-12 16:30:36 +02:00
Andreas Hocevar
109362f147 Update package version to 4.2.0 2017-06-12 16:30:04 +02:00
Andreas Hocevar
b5038c18e2 Changelog for v4.2.0 2017-06-12 16:30:04 +02:00
Andreas Hocevar
87d889f96c Merge pull request #6912 from ahocevar/translate-cursor
Use class instead of style for Translate cursor
2017-06-12 14:26:41 +02:00
Andreas Hocevar
9b41ea4017 Use class instead of style for Translate cursor 2017-06-12 13:30:25 +02:00
Frédéric Junod
51658a0d7c Merge pull request #6858 from GaborFarkas/webgl_vector_improvements
Webgl vector improvements
2017-06-12 09:23:15 +02:00
Andreas Hocevar
2f45e14bea Merge pull request #6890 from ahocevar/movestart
Add a movestart event
2017-06-12 09:00:09 +02:00
Andreas Hocevar
aa56afdab7 Merge pull request #6910 from ahocevar/apidoc-no-duplicate-observables
Avoid duplicates in Observables list
2017-06-12 08:47:00 +02:00
Andreas Hocevar
9fda131d37 Add a movestart event 2017-06-12 08:39:12 +02:00
Andreas Hocevar
b3ddcd4ed9 Avoid duplicates in Observables list 2017-06-12 08:24:44 +02:00
Andreas Hocevar
107792635d Merge pull request #6902 from ahocevar/fix-kinetic
Require minimum duration for kinetic animation
2017-06-12 07:01:03 +02:00
GaborFarkas
7ea8cf5fb3 Don't introduce new self-intersections. Fixes #6823 2017-06-11 22:07:22 +02:00
Andreas Hocevar
1d6ce6db35 Merge pull request #6904 from openlayers/greenkeeper/sinon-2.3.4
chore(package): update sinon to version 2.3.4
2017-06-10 23:45:13 +02:00
greenkeeper[bot]
4e44a09072 chore(package): update sinon to version 2.3.4
Closes #6903
2017-06-10 10:38:14 +00:00
Andreas Hocevar
dc6d0c091a Require minimum duration for kinetic animation 2017-06-10 09:33:40 +02:00
Andreas Hocevar
af6aaf4bab Merge pull request #6901 from KlausBenndorf/regularShapePointsNotes
Added release note for changed methods of ol.style.regularShape
2017-06-10 09:16:12 +02:00
simonseyock
e822731f8c Added release note for changed methods of ol.style.regularShape
Regarding #6759
2017-06-09 22:57:41 +02:00
Frédéric Junod
a23246aca1 Merge pull request #6886 from gberaudo/extensible_cluster_source
Make ol.source.Cluster extensible
2017-06-09 15:12:44 +02:00
Andreas Hocevar
f31e45d7d2 Merge pull request #6887 from ahocevar/disable-rotation
Disable rotation for views with enableRotation: false
2017-06-09 14:07:58 +02:00
Andreas Hocevar
34e61da366 Merge pull request #6900 from openlayers/greenkeeper/clean-css-cli-4.1.4
Update clean-css-cli to the latest version 🚀
2017-06-09 14:02:13 +02:00
Frédéric Junod
451aef200f Merge pull request #6897 from probins/like
ProjectionLike in proj.getPointResolution
2017-06-09 13:57:05 +02:00
Guillaume Beraudo
bb8a1b061c Make ol.source.Cluster extensible
Change from private to protected to allow extension.
2017-06-09 13:43:07 +02:00
greenkeeper[bot]
d4367cdd7d chore(package): update clean-css-cli to version 4.1.4 2017-06-09 11:38:57 +00:00
Peter Robins
3b15bb80b9 ProjectionLike in proj.getPointResolution 2017-06-09 09:33:43 +00:00
Andreas Hocevar
399e11edf7 Merge pull request #6888 from probins/patch-1
Add note about custom functions to getPointResolution
2017-06-09 10:18:38 +02:00
Peter Robins
f97f370e5b Improve docs for getPointResolution functions 2017-06-09 08:07:35 +00:00
Andreas Hocevar
070f2e181c Merge pull request #6893 from tchandelle/decimals
Fix decimals options when writing features
2017-06-09 09:27:08 +02:00
Andreas Hocevar
9d9da4feb9 Merge pull request #6759 from KlausBenndorf/regularShapePoints
Regular shape points
2017-06-09 08:48:47 +02:00
Frédéric Junod
ce858a80ed Merge pull request #6892 from fredj/ProjectionLike
Accept a ol.ProjectionLike instead of ol.proj.Projection
2017-06-09 08:45:45 +02:00
Frederic Junod
4898c83590 Accept a ol.ProjectionLike in ol.control.MousePosition#setProjection 2017-06-09 08:29:14 +02:00
Frederic Junod
d8ed2eb1be Accept a ol.ProjectionLike in ol.Geolocation#setProjection 2017-06-09 08:28:29 +02:00
Andreas Hocevar
00c8a5845e Disable rotation for views with enableRotation: false 2017-06-08 17:29:47 +02:00
Thomas Chandelle
d8dba61b0a Rounds if decimals options = 0 2017-06-08 12:08:02 +02:00
Thomas Chandelle
b8117b3931 This method will never be used with an extent and write = true 2017-06-08 12:08:02 +02:00
Thomas Chandelle
aface2f43e Clone the geometry before applying the decimals transform
We may only do it if the geometry has not been previously transformed.
2017-06-08 12:08:02 +02:00
Frédéric Junod
9691130b83 Merge pull request #6883 from fredj/cleanup
Remove unused ol.pointer.EventSource#getMapping function
2017-06-08 11:12:09 +02:00
Frederic Junod
1fbf3caa50 Remove unused ol.pointer.EventSource#getMapping function 2017-06-08 10:42:10 +02:00
Andreas Hocevar
e3128c204e Merge pull request #6870 from kannes/patch-1
Center map on proper earth, not one to the left
2017-06-06 15:36:43 +02:00
Andreas Hocevar
1e6b27d42a Merge pull request #6872 from openlayers/greenkeeper/rollup-0.42.0
Update rollup to the latest version 🚀
2017-06-06 15:27:26 +02:00
Frédéric Junod
c24bd209e6 Merge pull request #6876 from fredj/filereader_tests
Only test ol.interaction.DragAndDrop if FileReader is supported
2017-06-06 13:45:42 +02:00
Frédéric Junod
df96cc6e56 Merge pull request #6874 from probins/patch-1
Remove unused var from ol.proj
2017-06-06 11:02:12 +02:00
Peter Robins
641549c9ed Remove unused var from ol.proj 2017-06-06 08:23:42 +00:00
Frederic Junod
66e0308028 Use 'in' operator instead of 'typeof'
In PhantomJS, `typeof XXX` returns `"object"`, not `"function"`
2017-06-06 09:48:02 +02:00
Frederic Junod
22939abb0d Only test ol.interaction.DragAndDrop if FileReader is supported 2017-06-06 09:43:59 +02:00
Frédéric Junod
dfc4bff579 Merge pull request #6875 from openlayers/greenkeeper/sinon-2.3.2
chore(package): update sinon to version 2.3.2
2017-06-06 08:58:40 +02:00
greenkeeper[bot]
588223915c fix(package): update rollup to version 0.42.0 2017-06-03 19:01:54 +00:00
Hannes
5702670bd3 removed bad [ 2017-06-02 14:20:52 +02:00
Hannes
d79760e9dd Center map on proper earth, not one to the left
The previous x coordinate was one earth to the left which led to confusing results with everything.
This change makes sure the map is centered in a proper location (pretty much the same as before) WITHIN proper bounds.
2017-06-02 14:10:37 +02:00
Frédéric Junod
21011d00ea Merge pull request #6867 from cs09g/cs09g-patch-1
add getArea to api
2017-06-01 08:20:30 +02:00
Chase(Seul-gi Choi)
23cb98272c add getArea to api
#6854
2017-06-01 11:44:44 +09:00
Andreas Hocevar
b8b2712f73 Merge pull request #6863 from cs09g/cs09g-patch-1
change size to optional
2017-05-31 13:37:52 +02:00
Frédéric Junod
8b6a29decf Merge pull request #6864 from openlayers/greenkeeper/closure-util-1.21.0
fix(package): update closure-util to version 1.21.0
2017-05-31 10:30:58 +02:00
Chase(Seul-gi Choi)
5475841ca0 fix parameter type string 2017-05-31 15:29:34 +09:00
cs09gi@gmail.com
e8a2ad1d1b change size to optional 2017-05-31 13:40:01 +09:00
Andreas Hocevar
54a62ea78d Merge pull request #6834 from notnotse/move-tolerance-option
Move tolerance option
2017-05-30 09:10:09 +02:00
GaborFarkas
bcda41b508 Do not bridge holes outside of outer ring 2017-05-29 15:55:16 +02:00
GaborFarkas
c0fac0f5ca Prepare replays for vector tiles 2017-05-29 15:53:53 +02:00
Andreas Hocevar
0faf0dd2a1 Merge pull request #6856 from oterral/fix_6848
Fix creation of new URL in readSharedStyle_ and readSharedStyleMap_
2017-05-29 14:32:32 +02:00
oterral
9a698ce1e8 Fix creation of new URL in readSharedStyle_ and readSharedStyleMap_ 2017-05-29 09:49:04 +02:00
greenkeeper[bot]
a7683c60c9 chore(package): update sinon to version 2.3.2 2017-05-26 17:27:50 +00:00
greenkeeper[bot]
9412b770bf fix(package): update closure-util to version 1.21.0 2017-05-26 13:38:43 +00:00
Andreas Hocevar
29a6473c3d Merge pull request #6852 from openlayers/greenkeeper/mocha-3.4.2
Update mocha to the latest version 🚀
2017-05-25 08:31:17 +02:00
greenkeeper[bot]
7ceed1f42d chore(package): update mocha to version 3.4.2 2017-05-24 17:33:13 +00:00
Andreas Hocevar
959367629e Merge pull request #6851 from ahocevar/draganddrop-active
Register/unregister listeners in setActive
2017-05-24 15:36:26 +02:00
Frédéric Junod
aeed1f79bb Merge pull request #6832 from oterral/fix_5269
Force state of error tiles when usInterimTilesOnError is false
2017-05-24 15:27:11 +02:00
Andreas Hocevar
278d3a0313 Register/unregister listeners in setActive 2017-05-24 14:51:39 +02:00
Andreas Hocevar
5af9f71d38 Merge pull request #6849 from oterral/fix_6848
Create URL object only when we can
2017-05-24 14:44:09 +02:00
Andreas Hocevar
b6f446e909 Merge pull request #6845 from tchandelle/snap-circle
Snap on circles
2017-05-24 14:34:07 +02:00
oterral
7804a2db86 Create URL object only when we can 2017-05-24 14:21:56 +02:00
Andreas Hocevar
0e4d2b50b4 Merge pull request #6842 from cs09g/cs09g-patch-1
add condition to check if active
2017-05-24 13:20:08 +02:00
Frédéric Junod
b594cf0d74 Merge pull request #6844 from openlayers/greenkeeper/sinon-2.3.1
Update sinon to the latest version 🚀
2017-05-24 08:28:27 +02:00
Thomas Chandelle
074fdeb212 Add snapping abilities on circles 2017-05-23 14:45:03 +02:00
Thomas Chandelle
a1355ee766 Changes snap example to allow Circle creations 2017-05-23 11:04:46 +02:00
greenkeeper[bot]
c3e1bb40f4 chore(package): update sinon to version 2.3.1 2017-05-23 09:04:09 +00:00
Chase(Seul-gi Choi)
661410a96e add condition to check if active
fixes #6840
"setMap" registers listeners to dropArea, but it doesn't check whether "active" is true or false. Simply add condition to check "active".
2017-05-23 10:48:12 +09:00
Andreas Hocevar
e272eced94 Merge pull request #6841 from openlayers/greenkeeper/sinon-2.3.0
Update sinon to the latest version 🚀
2017-05-22 13:07:06 +02:00
greenkeeper[bot]
4ab901ed43 chore(package): update sinon to version 2.3.0 2017-05-22 10:26:40 +00:00
oterral
c1abe4a550 Force state of error tiles when usInterimTilesOnError is false 2017-05-22 09:31:07 +02:00
Andreas Hocevar
3fc76f9c10 Merge pull request #6839 from openlayers/greenkeeper/async-2.4.1
Update async to the latest version 🚀
2017-05-22 07:37:55 +02:00
greenkeeper[bot]
1e304f56cb fix(package): update async to version 2.4.1 2017-05-22 04:23:48 +00:00
Andreas Hocevar
5929826c5f Merge pull request #6838 from openlayers/greenkeeper/handlebars-4.0.10
fix(package): update handlebars to version 4.0.10
2017-05-21 23:35:38 +02:00
greenkeeper[bot]
9dad36b117 fix(package): update handlebars to version 4.0.10
Closes #6837
2017-05-21 12:19:39 +00:00
Andreas Hocevar
8b9f994cea Merge pull request #6817 from ahocevar/topojson-layer
Multiple layers in TopoJSON vector tiles
2017-05-20 16:58:19 +02:00
Andreas Hocevar
7ecb2c0185 Add layerName and layers options to ol.source.TopoJSON 2017-05-20 16:48:42 +02:00
Andreas Hocevar
342c49f0bb Merge pull request #6833 from oterral/fix_6789
Fix geojson-vt example for line and point geometries
2017-05-20 09:31:25 +02:00
itjope
bb220b5c3b Add tests for isMoving 2017-05-20 09:08:03 +02:00
oterral
3455f00d23 Fix geojson-vt example for line and point geometries 2017-05-19 17:52:14 +02:00
Frédéric Junod
992ab7120c Merge pull request #6829 from openlayers/greenkeeper/clean-css-cli-4.1.3
Update clean-css-cli to the latest version 🚀
2017-05-19 12:34:11 +02:00
greenkeeper[bot]
5215722c78 chore(package): update clean-css-cli to version 4.1.3 2017-05-18 19:40:06 +00:00
itjope
56b3203fa9 Add moveTolerance option for ol.Map 2017-05-18 13:22:31 +02:00
Andreas Hocevar
3cc4a0c6e3 Merge pull request #6819 from ahocevar/vectortile-getfeatures
Adjust/fix API for working with vector tile features
2017-05-18 11:13:30 +02:00
Andreas Hocevar
556ede5960 Remove api annotation from ol.VectorImageTile#getImage 2017-05-17 10:15:45 +02:00
Andreas Hocevar
46c610f35e Merge pull request #6818 from ahocevar/tilejson
Add tileJSON option to ol.source.TileJSON
2017-05-17 08:45:57 +02:00
Frédéric Junod
18357be938 Merge pull request #6805 from fredj/better_box-selection_example
Display country name on click select
2017-05-17 08:20:58 +02:00
Andreas Hocevar
a9f369479f Dispose of vector tiles properly 2017-05-17 00:18:46 +02:00
Andreas Hocevar
8c00bbc91d Report ol.VectorTile instead of ol.VectorImageTile loads 2017-05-17 00:18:46 +02:00
Andreas Hocevar
9af01c515f Make ol.VectorTile#getFeatures and #getProjection exportable 2017-05-16 22:57:03 +02:00
Andreas Hocevar
567cc304ed Add tileJSON option to ol.source.TileJSON 2017-05-16 18:37:18 +02:00
Tim Schaub
98a1654b47 Merge pull request #6813 from tschaub/version-with-a-v
Prepend the version with a v
2017-05-16 09:02:08 -07:00
Andreas Hocevar
ddbe1986ad Merge pull request #6814 from ahocevar/renderfeature-getgeometry
Re-add ol.render.Feature#getGeometry()
2017-05-16 09:02:29 +02:00
Andreas Hocevar
ac19d4d19c Better documentation for ol.render.Feature#getGeometry 2017-05-16 08:43:08 +02:00
Andreas Hocevar
142f16afe4 Re-add the ol.render.Feature#getGeometry() method
This method does have value for users that want to switch between ol.Feature
and ol.render.Feature and still be able to use #getGeometry().getType() in a
style function to determine the feature geometry's type.
2017-05-16 08:41:55 +02:00
Tim Schaub
07810818cc Prepend the version with a v 2017-05-15 19:31:40 -07:00
Frédéric Junod
4664a19718 Merge pull request #6812 from openlayers/greenkeeper/mocha-3.4.1
Update mocha to the latest version 🚀
2017-05-15 08:42:33 +02:00
greenkeeper[bot]
46f59acdce chore(package): update mocha to version 3.4.1 2017-05-14 21:41:35 +00:00
Frédéric Junod
c61189121e Merge pull request #6786 from fredj/during_filter
Add ol.format.filter.during
2017-05-12 15:26:03 +02:00
Andreas Hocevar
8c14262efc Merge pull request #6806 from drnextgis/docs
Add note about features with the same id
2017-05-12 13:01:44 +02:00
drnextgis
fa398766d9 Add note about features with the same id 2017-05-12 17:49:37 +07:00
Frederic Junod
026fcc66c9 Display country name on click select
And not only when the box selection is used
2017-05-12 09:56:21 +02:00
Andreas Hocevar
7c5a3ae311 Merge pull request #6802 from ahocevar/vectorimage-nofeature
Remove unused setFeatures and getFormat methods
2017-05-12 08:50:47 +02:00
Andreas Hocevar
feacf7614e Remove unused getFormat() method and format_ member 2017-05-12 00:06:56 +02:00
Andreas Hocevar
8609e65fc2 Remove unused setFeatures method 2017-05-11 18:19:42 +02:00
Andreas Hocevar
3ff33699c8 Merge pull request #6801 from ahocevar/renderfeature-getid
Add getId method for ol.render.Feature
2017-05-11 17:07:53 +02:00
Andreas Hocevar
df72d7b20f Add getId() method for ol.render.Feature 2017-05-11 15:54:20 +02:00
Andreas Hocevar
1d7144564c Remove getGeometry() from the API 2017-05-11 15:53:55 +02:00
Frédéric Junod
aced2e4e94 Merge pull request #6778 from fredj/isMoving_tolerance
Add a small tolerance when testing pointer event positions
2017-05-11 09:43:24 +02:00
Andreas Hocevar
9b9ac03760 Merge pull request #6796 from ahocevar/rendered-resolution
Re-add accidently dropped condition
2017-05-11 08:55:03 +02:00
Frédéric Junod
c052de2bbc Merge pull request #6798 from openlayers/greenkeeper/clean-css-cli-4.1.2
chore(package): update clean-css-cli to version 4.1.2
2017-05-11 08:45:42 +02:00
Frederic Junod
85d0e9797c Add a small tolerance when testing pointer event positions 2017-05-11 08:36:11 +02:00
greenkeeper[bot]
f975319d02 chore(package): update clean-css-cli to version 4.1.2
Closes #6797
2017-05-11 08:32:24 +02:00
Frédéric Junod
b8164df349 Merge pull request #6795 from fredj/ol.DrawGeometryFunctionType_type
Fix ol.DrawGeometryFunctionType coordinates argument type
2017-05-11 08:26:58 +02:00
Andreas Hocevar
1458d77844 Merge pull request #6797 from openlayers/greenkeeper/clean-css-cli-4.1.1
Update clean-css-cli to the latest version 🚀
2017-05-11 00:40:28 +02:00
greenkeeper[bot]
052f2ac321 chore(package): update clean-css-cli to version 4.1.1 2017-05-10 17:53:06 +00:00
Andreas Hocevar
4a6945ac17 Merge pull request #6779 from ahocevar/vector-tile-grid
Decouple source and rendered tile grid of vector tile sources
2017-05-10 19:07:21 +02:00
Andreas Hocevar
c9ca9737a7 Re-add condition accidently dropped in 5061555 2017-05-10 19:04:55 +02:00
Frédéric Junod
2e1495fc07 Merge pull request #6785 from fredj/insertVertexCondition
Add insertVertexCondition to ol.interaction.Modify options
2017-05-10 13:37:59 +02:00
Frederic Junod
55de3020d3 Fix ol.DrawGeometryFunctionType coordinates argument type 2017-05-10 13:36:29 +02:00
Andreas Hocevar
366bf46ca1 Merge pull request #6792 from ahocevar/prepareframe-logic
Create intermediate canvas when resolutions have changed
2017-05-10 13:11:55 +02:00
Andreas Hocevar
50615557d9 Create intermediate canvas when resolutions have changed 2017-05-10 11:58:38 +02:00
Frédéric Junod
1c0f891427 Merge pull request #6790 from openlayers/greenkeeper/resemblejs-2.2.4
Update resemblejs to the latest version 🚀
2017-05-10 11:18:05 +02:00
greenkeeper[bot]
0c6c0ef6d5 chore(package): update resemblejs to version 2.2.4 2017-05-10 09:05:39 +00:00
Frederic Junod
ff91974345 Add insertVertexCondition to ol.interaction.Modify options 2017-05-09 15:34:43 +02:00
Andreas Hocevar
e7dc09cf9f Add more tests 2017-05-09 14:25:28 +02:00
Frederic Junod
fcf9649ef9 Add ol.format.filter.during 2017-05-09 14:07:33 +02:00
Andreas Hocevar
55e3746554 Avoid garbage creation on frame preparation/composition 2017-05-09 14:04:05 +02:00
Andreas Hocevar
a59a147dbd Handle tile state of ol.VectorImageTile properly 2017-05-09 14:04:05 +02:00
Andreas Hocevar
355ce9f679 Use same tile size in rendered and source tile grid 2017-05-09 14:04:04 +02:00
Andreas Hocevar
785e7135a7 Decouple source and rendered tile grid of vector tile sources 2017-05-09 14:04:04 +02:00
Frédéric Junod
735ab45480 Merge pull request #6784 from openlayers/greenkeeper/clean-css-cli-4.1.0
chore(package): update clean-css-cli to version 4.1.0
2017-05-09 13:15:47 +02:00
greenkeeper[bot]
55c2adc503 chore(package): update clean-css-cli to version 4.1.0
Closes #6780
2017-05-08 16:40:04 +00:00
Bart van den Eijnden
2486b25e5e Merge pull request #6556 from KlausBenndorf/kmlinsetpixel
Reading kml xunits/yunits insetPixels
2017-05-08 11:02:19 +02:00
Frédéric Junod
020a8da9bb Merge pull request #6775 from openlayers/greenkeeper/closure-util-1.20.0
Update closure-util to the latest version 🚀
2017-05-05 14:40:29 +02:00
greenkeeper[bot]
d559037f31 fix(package): update closure-util to version 1.20.0 2017-05-05 12:21:00 +00:00
Andreas Hocevar
cce81bcefb Merge pull request #6774 from openlayers/greenkeeper/fs-extra-3.0.1
Update fs-extra to the latest version 🚀
2017-05-05 07:01:52 +02:00
greenkeeper[bot]
fc73c4b1fd fix(package): update fs-extra to version 3.0.1 2017-05-05 00:07:26 +00:00
Tim Schaub
588efb1427 Merge pull request #6773 from openlayers/release-v4.1.1
Release v4.1.1
2017-05-03 08:48:41 -06:00
Tim Schaub
e7afe2cb9c Update package versions to 4.1.1 2017-05-03 08:30:29 -06:00
Frederic Junod
5e3ba9b7d1 Use firefox < 53 in travis 2017-05-03 08:20:13 -06:00
Frederic Junod
51230aa3fb Fix broken link in wmts-ign example 2017-05-03 08:15:53 -06:00
Frederic Junod
069ae0aff4 Fix tissot example docs 2017-05-03 08:15:47 -06:00
Tim Schaub
ec336e1d0e Out of beta 2017-05-03 08:14:14 -06:00
Tim Schaub
d2e571e3d1 Correct path to cleancss 2017-05-03 08:13:57 -06:00
Frederic Junod
1a9c41ae4e Add missing goog.require 2017-05-03 08:12:54 -06:00
Frederic Junod
10aebb58d2 Allow user selection in overlay container 2017-05-03 08:12:09 -06:00
Tim Schaub
2d46c83149 Merge pull request #6770 from tschaub/no-missing-requires
Enforce the "no missing requires" rule
2017-05-03 08:05:26 -06:00
Tim Schaub
3c62396533 Report on any warnings from the linter 2017-05-03 06:37:36 -06:00
Frédéric Junod
22f55a7aeb Merge pull request #6772 from fredj/cleanup
Remove html tag from shortdesc
2017-05-03 09:52:20 +02:00
Frederic Junod
3d7bd00abf Remove html tag from shortdesc 2017-05-03 09:34:57 +02:00
Frédéric Junod
7b1ed14e4e Merge pull request #6769 from openlayers/greenkeeper/handlebars-4.0.8
Update handlebars to the latest version 🚀
2017-05-03 08:38:49 +02:00
Tim Schaub
3c88e04d4c New task for bundling dependencies 2017-05-02 23:28:00 -06:00
Tim Schaub
9adab910f4 Ensure that the package builds 2017-05-02 23:21:52 -06:00
Tim Schaub
d7969931e8 Try to fix lint in the package 2017-05-02 23:21:45 -06:00
greenkeeper[bot]
94b6f27937 fix(package): update handlebars to version 4.0.8 2017-05-02 21:18:37 +00:00
Tim Schaub
8690bb7c12 Use @mapbox/vector-tile 2017-05-02 15:14:30 -06:00
Tim Schaub
49b5bbc964 Treat missing requires as an error 2017-05-02 15:04:20 -06:00
Tim Schaub
479d98212b Disable no-missing-requires rule in generated shader code 2017-05-02 15:04:20 -06:00
Tim Schaub
3f973e6fa3 Allow single (non-default) import from dependencies 2017-05-02 15:04:20 -06:00
Tim Schaub
584d4f67bd Uppercase for PBF constructor 2017-05-02 15:04:20 -06:00
Andreas Hocevar
642ed5f46e Merge pull request #6757 from hajjimurad/master
Fix crashing on creation of snap-interaction, if Circle is among the features to snap to.
2017-05-02 21:05:31 +02:00
Frédéric Junod
9a9e6e94ff Merge pull request #6766 from openlayers/greenkeeper/sinon-2.2.0
Update sinon to the latest version 🚀
2017-05-02 10:55:47 +02:00
Frédéric Junod
88b028e4a5 Merge pull request #6765 from fredj/fit_callback
Add new callback function to view.FitOptions
2017-05-02 10:36:37 +02:00
Frédéric Junod
fb07d2dad6 Merge pull request #6764 from mblinsitu/getInteracting
Added View#getInteracting() to the api
2017-05-02 10:35:53 +02:00
greenkeeper[bot]
b4f68ef021 chore(package): update sinon to version 2.2.0
https://greenkeeper.io/
2017-05-02 08:08:37 +00:00
Frederic Junod
403214f569 Add new callback function to view.FitOptions 2017-05-02 08:49:39 +02:00
Michel Beaudouin-Lafon
944f0df981 Fixed test to compare to true/false rather than 0/1 2017-05-01 17:09:27 +02:00
Michel Beaudouin-Lafon
97b3ff0499 Added View#getInteracting() to the api, similar to View#getAnimating() to access the hints 2017-05-01 14:09:44 +02:00
Andreas Hocevar
4507fb9368 Merge pull request #6760 from openlayers/greenkeeper/handlebars-4.0.7
Update handlebars to the latest version 🚀
2017-04-30 15:01:06 +02:00
Andreas Hocevar
cdd44c4db8 Merge pull request #6761 from openlayers/greenkeeper/async-2.4.0
Update async to the latest version 🚀
2017-04-30 09:36:23 +02:00
greenkeeper[bot]
983fe5e086 fix(package): update async to version 2.4.0
https://greenkeeper.io/
2017-04-29 23:29:45 +00:00
greenkeeper[bot]
f4686adced fix(package): update handlebars to version 4.0.7
https://greenkeeper.io/
2017-04-29 20:56:55 +00:00
simonseyock
25aeb58c87 ol.style.RegularShape#getRadius2
returns undefined if no radius2 was provided in the constructor
2017-04-29 11:43:46 +02:00
simonseyock
dd73ac8892 ol.style.RegularShape#getPoints
returns now same amount of points as provided to the constructor
2017-04-29 11:43:27 +02:00
Frédéric Junod
16f97a74d7 Merge pull request #6755 from fredj/missing_goog.require
Add missing goog.require
2017-04-28 11:49:03 +02:00
Murad Khafizov
242c55dcff formatting fixed 2017-04-28 10:50:05 +02:00
Murad Khafizov
1f87dcc6b8 fix crashing on using undefined segmentWriter 2017-04-28 10:49:58 +02:00
Frederic Junod
dafe3a0811 Add missing goog.require 2017-04-28 08:48:46 +02:00
Frédéric Junod
9ac4d137ff Merge pull request #6751 from openlayers/greenkeeper/coveralls-2.13.1
Update coveralls to the latest version 🚀
2017-04-28 08:28:58 +02:00
Frédéric Junod
3cb3113705 Merge pull request #6750 from openlayers/greenkeeper/fs-extra-3.0.0
Update fs-extra to the latest version 🚀
2017-04-28 08:28:39 +02:00
greenkeeper[bot]
239f9e817d chore(package): update coveralls to version 2.13.1
https://greenkeeper.io/
2017-04-27 21:47:42 +00:00
greenkeeper[bot]
b9f42ddc0f fix(package): update fs-extra to version 3.0.0
https://greenkeeper.io/
2017-04-27 19:40:01 +00:00
Frédéric Junod
c437afc15b Merge pull request #6741 from fredj/overlay_select
Allow user selection in overlay container
2017-04-26 09:04:16 +02:00
Frédéric Junod
41812172a7 Merge pull request #6744 from openlayers/greenkeeper/mocha-3.3.0
Update mocha to the latest version 🚀
2017-04-24 14:20:39 +02:00
greenkeeper[bot]
11e682e061 chore(package): update mocha to version 3.3.0
https://greenkeeper.io/
2017-04-24 09:17:05 +00:00
Andreas Hocevar
821cf24c5b Merge pull request #6737 from ahocevar/graticule-labels
Graticule labels
2017-04-24 10:49:43 +02:00
Andreas Hocevar
14f29e95a7 Add label support to ol.Graticule 2017-04-24 10:26:16 +02:00
Frederic Junod
8aa30ee8f6 Allow user selection in overlay container 2017-04-24 09:32:36 +02:00
Frédéric Junod
c9303f5889 Merge pull request #6740 from fredj/spelling
Fix spelling
2017-04-24 09:15:57 +02:00
Frederic Junod
b1f38ea0e8 Fix spelling 2017-04-24 08:58:19 +02:00
Andreas Hocevar
3e9cbade45 Improve internal usability of ol.coordinate.degreesToStringHDMS 2017-04-23 22:46:33 +02:00
Frédéric Junod
52af66e0f9 Merge pull request #6730 from openlayers/greenkeeper/metalsmith-layouts-1.8.1
Update metalsmith-layouts to the latest version 🚀
2017-04-20 11:23:19 +02:00
greenkeeper[bot]
c1911994ea fix(package): update metalsmith-layouts to version 1.8.1
https://greenkeeper.io/
2017-04-20 11:06:56 +02:00
Frédéric Junod
af62ef736d Merge pull request #6732 from fredj/ff_52
Use firefox < 53 in travis
2017-04-20 11:06:48 +02:00
Frederic Junod
4a6f427df7 Use firefox < 53 in travis 2017-04-20 10:58:12 +02:00
Bart van den Eijnden
00a2d7b1cb Merge pull request #6677 from Jenselme/wfst-3D
Add an option to writeTransaction to support 3D geometries
2017-04-20 10:44:54 +02:00
Julien Enselme
e2af6b9d04 Rename the is3D option for WFS transaction into hasZ
This is more consistent with existing code.
2017-04-20 10:39:02 +02:00
Julien Enselme
4955097a52 Prevent Z to be undefined in 3D WFS transactions
For newly created points, Z can be undefined. In these cases, we use 0
for Z.
2017-04-20 10:39:02 +02:00
Julien Enselme
870bc51ad9 Add an option to writeTransaction to support 3D geometries
Close #6630
2017-04-20 10:39:02 +02:00
Bart van den Eijnden
ea54543602 Merge pull request #6524 from Jenselme/dont-repeat-featurePrefix
Don't append feature prefix twice in WFS requests
2017-04-20 10:38:00 +02:00
Julien Enselme
bb278df881 Don't append feature prefix twice in WFS requests
Some WFS servers like tinyOWS require the feature prefix to be in the
feature type for the feature to be found (eg `prefix:layer`).

The problem was, the prefix was always added to the feature type which
gave us a type name like `prefix:prefix:feature` or
`feature:prefix:feature`. The requests were then rejected by the WFS
server.

We now check if the feature type starts with the prefix. If it does, we
don't append it again. If it doesn't we do.
2017-04-20 10:32:39 +02:00
Frédéric Junod
46fde0e439 Merge pull request #6727 from fredj/hitTolerance_doc
Add default value in doc for the hitTolerance option
2017-04-20 08:24:00 +02:00
Frédéric Junod
e3d895be4c Merge pull request #6724 from fredj/wrapX_stamen
Add wrapX option to Stamen source
2017-04-20 08:23:43 +02:00
Frédéric Junod
dd8d4b5ad8 Merge pull request #6728 from fredj/tissot_docs
Fix tissot examples docs
2017-04-19 15:13:36 +02:00
Frederic Junod
d956a3bdb3 Fix broken link in wmts-ign example 2017-04-19 14:58:16 +02:00
Frederic Junod
66930ab303 Fix tissot example docs 2017-04-19 14:43:38 +02:00
Frederic Junod
0f032a1388 Add default value in doc for the hitTolerance option 2017-04-19 12:05:03 +02:00
Frédéric Junod
5ce54c9e0d Merge pull request #6725 from openlayers/greenkeeper/initial
Update dependencies to enable Greenkeeper 🌴
2017-04-19 09:20:28 +02:00
greenkeeper[bot]
b86950da6f chore(package): update dependencies
https://greenkeeper.io/
2017-04-19 06:42:44 +00:00
Frederic Junod
f7c71bdaac Add wrapX option to Stamen source 2017-04-18 13:31:30 +02:00
Tim Schaub
ee2aa91d97 Merge pull request #6711 from tschaub/post-release
Correct path to cleancss
2017-04-14 05:12:34 -06:00
Tim Schaub
c353455b83 Out of beta 2017-04-13 21:21:37 -06:00
Tim Schaub
530419a839 Correct path to cleancss 2017-04-13 21:20:34 -06:00
Tim Schaub
2b5d6536ca Merge pull request #6710 from openlayers/release-v4.1.0
Release v4.1.0
2017-04-13 21:03:38 -06:00
Tim Schaub
8116d8c11f Update package versions to 4.1.0 2017-04-13 20:51:02 -06:00
Tim Schaub
04a1871ae3 Changelog for v4.1.0 2017-04-13 20:50:05 -06:00
Tim Schaub
41ebe62852 Merge pull request #6675 from tchandelle/translate-cursor
Reset cursor when translate interaction is removed or deactivated
2017-04-13 20:25:20 -06:00
Tim Schaub
51da8ed830 Merge pull request #6707 from tschaub/errors-url
Set version when building ol package
2017-04-13 20:24:36 -06:00
Frédéric Junod
515de3f6ad Merge pull request #6706 from fredj/cluster_getDistance
Add ol.source.Cluster#getDistance function
2017-04-13 15:09:36 +02:00
Tim Schaub
6604172c1c Throw a byte-saving AssertionError 2017-04-13 06:37:42 -06:00
Tim Schaub
4a9114cd4e Set ol.VERSION when creating ol package 2017-04-13 06:32:42 -06:00
Tim Schaub
525fba6405 Assume latest if no ol.VERSION 2017-04-13 06:32:42 -06:00
Tim Schaub
dff5cc63e7 Merge pull request #6695 from tschaub/unique-layers
Unique layers
2017-04-13 06:31:12 -06:00
Tim Schaub
3b83f666c1 Add notes about new duplicate layer behavior 2017-04-13 05:46:46 -06:00
Tim Schaub
9c8a3ba688 Test that resetting via collection.setAt() works 2017-04-13 05:38:49 -06:00
Tim Schaub
64b3302883 Require that map layers are unique 2017-04-13 05:38:49 -06:00
Tim Schaub
d28f50465b Support for unique collections 2017-04-13 05:38:49 -06:00
Frederic Junod
de057ac505 Add ol.source.Cluster#getDistance function 2017-04-13 11:27:21 +02:00
Marc Jansen
8b0e1b638b Merge pull request #6704 from openlayers/include-typedefs
Include typedefs.js in closure compiler tutorial build configurations
2017-04-13 08:27:19 +02:00
Marc Jansen
65103d5bd0 Include typedefs.js in example configurations 2017-04-13 07:51:34 +02:00
Andreas Hocevar
5d038d9d9b Merge pull request #6702 from openlayers/greenkeeper/clean-css-cli-4.0.12
Update clean-css-cli to the latest version 🚀
2017-04-12 22:30:38 +02:00
greenkeeper[bot]
45e8f7d0c9 chore(package): update clean-css-cli to version 4.0.12
https://greenkeeper.io/
2017-04-12 19:14:35 +00:00
Frédéric Junod
2b6e71ff46 Merge pull request #6693 from openlayers/greenkeeper/clean-css-cli-4.0.11
Update clean-css-cli to the latest version 🚀
2017-04-12 08:25:23 +02:00
Frédéric Junod
f206fab268 Merge pull request #6691 from fredj/cleanup
Move eslint globals to to test/.eslintrc
2017-04-12 08:25:01 +02:00
greenkeeper[bot]
4d30781673 chore(package): update clean-css-cli to version 4.0.11
https://greenkeeper.io/
2017-04-11 19:04:36 +00:00
Frédéric Junod
5b162ce2b9 Merge pull request #6689 from fredj/constrainResolution
Add new constrainResolution option to olx.interaction.DefaultsOptions
2017-04-11 13:53:33 +02:00
Andreas Hocevar
f12e0e3ed6 Merge pull request #6692 from ahocevar/scroll-gesture-docs
Improve docs for MouseWheelZoom constrainResolution
2017-04-11 13:50:39 +02:00
Andreas Hocevar
8a0e7439a7 Improve docs for MouseWheelZoom constrainResolution 2017-04-11 13:28:18 +02:00
Frederic Junod
15e6fa454d Add new constrainResolution option to olx.interaction.DefaultsOptions 2017-04-11 13:27:11 +02:00
Frederic Junod
72bb310386 Move eslint globals to to test/.eslintrc 2017-04-11 12:36:39 +02:00
Andreas Hocevar
55f8a2775e Merge pull request #6687 from tchandelle/extent-clip
Clip image only if the layer extent intersects the view extent
2017-04-11 10:07:39 +02:00
Thomas Chandelle
051d5651a5 Complete previous cursor tests
"respects existing cursor value" wasn't actually testing anything
2017-04-11 09:15:02 +02:00
Thomas Chandelle
5c23123b6d Reset cursor when translate interaction is removed or deactivated 2017-04-11 09:15:02 +02:00
Frédéric Junod
80b51d083e Merge pull request #6686 from fredj/removeLastPoint
Update finishCoordinate in ol.interaction.Draw#removeLastPoint
2017-04-11 08:20:30 +02:00
Thomas Chandelle
b301760976 Update composeFrame test with should/shouldn't clip cases 2017-04-10 15:11:11 +02:00
Thomas Chandelle
76ddcd405d Clip image only if the layer extent intersects the view extent 2017-04-10 14:42:57 +02:00
Frederic Junod
d97d5e5164 Update finishCoordinate in ol.interaction.Draw#removeLastPoint
And don't crash if the function is called but no feature is drawn
2017-04-10 12:34:49 +02:00
Andreas Hocevar
55ace18509 Merge pull request #6682 from ahocevar/mouseweel-typedef
Add example, docs and typedef for MouseWheelZoom's constrainResolution option
2017-04-10 10:26:55 +02:00
Andreas Hocevar
cf6cd968ec Add example for constrained wheel zooming 2017-04-10 10:10:33 +02:00
Andreas Hocevar
9a230fcacf Improve documentation 2017-04-10 10:10:26 +02:00
Frédéric Junod
aaf3256279 Merge pull request #6683 from fredj/this_defaultBoxEndCondition
Add this jsdoc tag to ol.interaction.DragBox.defaultBoxEndCondition
2017-04-10 09:29:47 +02:00
Andreas Hocevar
3285c11e9c Add constrainResolution to MouseWheelZoomOptions 2017-04-10 09:23:54 +02:00
Frederic Junod
5e84d806d7 Add this jsdoc tag to ol.interaction.DragBox.defaultBoxEndCondition 2017-04-10 09:08:09 +02:00
Frédéric Junod
fc1a0c6c3d Merge pull request #6681 from fredj/constrainResolution_typedef
Add constrainResolution in olx.interaction.PinchZoomOptions typedef
2017-04-10 08:56:55 +02:00
Andreas Hocevar
07b8d97751 Merge pull request #6671 from kaiCu/master
Add constraintResolution option to MouseWheelZoom for zoom with trackpad
2017-04-10 08:47:30 +02:00
Frederic Junod
639f40cb94 Add constrainResolution in olx.interaction.PinchZoomOptions typedef 2017-04-10 08:44:21 +02:00
Frédéric Junod
a6a0b2c158 Merge pull request #6680 from fredj/rm_ol.DRAG_BOX_HYSTERESIS_PIXELS
Remove ol.DRAG_BOX_HYSTERESIS_PIXELS define and add option
2017-04-10 08:28:28 +02:00
Frederic Junod
5c6c555b62 Remove ol.DRAG_BOX_HYSTERESIS_PIXELS define and add option 2017-04-07 15:31:59 +02:00
Frederic Junod
d767f8545f Fix comment indentation 2017-04-07 15:13:42 +02:00
Frédéric Junod
e7f91cd526 Merge pull request #6666 from fredj/cleanup
Use the optional extent in ol.structs.RBush#getExtent
2017-04-05 09:53:12 +02:00
Andreas Hocevar
c1a5a44dfc Improve documentation of opt_extent 2017-04-05 09:21:01 +02:00
Frédéric Junod
f0506211e2 Merge pull request #6670 from openlayers/greenkeeper/browserify-14.3.0
fix(package): update browserify to version 14.3.0
2017-04-05 08:50:14 +02:00
greenkeeper[bot]
5ca349d0f8 fix(package): update browserify to version 14.3.0
Closes #6669

https://greenkeeper.io/
2017-04-04 23:58:59 +00:00
Kai Culemann
c1adde6a13 Add constraintResolution option to MouseWheelZoom for zoom with trackpad 2017-04-04 15:06:08 +02:00
Frederic Junod
22ed575325 Add optional destination extent in ol.source.Vector#getExtent 2017-04-04 13:55:02 +02:00
Frederic Junod
f7c392342e Use the optional extent in ol.structs.RBush#getExtent 2017-04-04 10:54:33 +02:00
Tim Schaub
350b42ad91 Merge pull request #6664 from openlayers/greenkeeper/async-2.3.0
Update async to the latest version 🚀
2017-04-02 20:38:22 -06:00
greenkeeper[bot]
c74f2a526f fix(package): update async to version 2.3.0
https://greenkeeper.io/
2017-04-02 23:03:06 +00:00
Frédéric Junod
b62c4ec4a2 Merge pull request #6659 from openlayers/icon_examples_crossOrigin
Add crossOrigin to examples using ol.style.Icon
2017-04-01 06:10:04 +02:00
Tim Schaub
d409e5ac18 Merge pull request #6658 from tschaub/raster-fix
Fixes for raster source rendering
2017-03-31 07:15:27 -06:00
Frederic Junod
a9adaf2052 Add crossOrigin to examples using ol.style.Icon 2017-03-31 13:38:28 +02:00
Bart van den Eijnden
ce088d5919 Merge pull request #6620 from Jenselme/fix-gml2-desirializer-3D
Fix the parsing of flat coordinates in GML2 for 3D geometies
2017-03-31 11:45:18 +02:00
Julien Enselme
3a5de5483c Fix the parsing of flat coordinates in GML2 for 3D geometies
The code used to rely on the dimension. However, the dimension can only
be read from a GML3 document. This caused, for 3D geometries:
- An assertion error to be raised since the flatCoordinates list
contains more than 3 elements: "Assertion failed: flatCoordinates should
have a length of 3" The value of flatCoordinates for a 3D point was
something like `[2586394, 1232407, 0, 731, NaN, 0]`
- The value of the Z coordinates to be incorrect and always set to 0

This patch simplifies and correct the parsing of the coordinates:
- Don't parse groups of coords and the coordonates at the same time.
- Detect the dimension for the coordinates.
- If the Z coordinate exists, its value is used, otherwise, we use 0.
- Correct the presentation of test data to make it work with the new
parser.
- Add a test for a 3D point.
2017-03-31 10:46:27 +02:00
Tim Schaub
a65e30fe41 Reworked raster source rendering 2017-03-30 23:00:31 -06:00
Andreas Hocevar
f806670c85 Merge pull request #6657 from openlayers/greenkeeper/coveralls-2.13.0
Update coveralls to the latest version 🚀
2017-03-30 19:32:59 +02:00
greenkeeper[bot]
b51cca4a57 chore(package): update coveralls to version 2.13.0
https://greenkeeper.io/
2017-03-30 16:32:13 +00:00
Tim Schaub
7f74f238fd Merge pull request #6644 from tschaub/view-setters
Allow minZoom and maxZoom to be set on a view
2017-03-28 08:44:31 -06:00
Frédéric Junod
3bb5179e2d Merge pull request #6636 from fredj/scaleline_test
Add test for the metric unit displayed in the scaleline
2017-03-28 15:04:33 +02:00
Frederic Junod
57d39109e3 Add test for the metric unit displayed in the scaleline 2017-03-28 09:06:33 +02:00
Frédéric Junod
b4642903fd Merge pull request #6598 from hajjimurad/feature/micrometer_support
Add support of micrometers to scaleline
2017-03-28 09:04:51 +02:00
Tim Schaub
b1f4e14281 Example demonstrating view.setMinZoom() 2017-03-27 14:24:31 -06:00
Tim Schaub
e9c340b957 Allow min/max zoom to be set on a view 2017-03-27 14:18:16 -06:00
Tim Schaub
a4fabef86c Merge pull request #6643 from tschaub/proj-common
Add common transforms by default
2017-03-27 14:17:12 -06:00
Tim Schaub
4c1bf075c4 Allow options to be reapplied 2017-03-27 10:41:02 -06:00
Tim Schaub
9415899a03 Add common transforms by default 2017-03-27 10:07:00 -06:00
Tim Schaub
03700c0f01 Remove ol.proj dependency from EPSG3857 and EPSG4326 2017-03-27 09:47:03 -06:00
Andreas Hocevar
1316513a1e Merge pull request #6567 from nagytech/master
Overlay visible before updating render position
2017-03-27 10:42:08 +02:00
Andreas Hocevar
db6a5f34cd Merge pull request #6634 from Toilal/feature/yarn-custom-build-fix
Fix custom build when openlayers is installed from yarn package manager
2017-03-26 22:43:21 +02:00
Andreas Hocevar
e5ef1aa5a1 Add missing return annotation 2017-03-26 14:35:58 +02:00
Andreas Hocevar
166ef525f0 Remove lint 2017-03-26 14:26:23 +02:00
Andreas Hocevar
2305b18b18 Merge pull request #6639 from openlayers/greenkeeper/async-2.2.0
Update async to the latest version 🚀
2017-03-25 22:24:14 +01:00
greenkeeper[bot]
28fd5147ae fix(package): update async to version 2.2.0
https://greenkeeper.io/
2017-03-25 20:48:21 +00:00
Frédéric Junod
9d58b006e7 Merge pull request #6635 from Toilal/feature/custom-build-docs-externs
Add missing externs to custom builds examples
2017-03-24 14:09:49 +01:00
Toilal
e5f2e284ba Add missing externs to custom builds examples 2017-03-24 12:32:38 +01:00
Toilal
c4029fb9b6 Fix custom build when openlayers is installed from yarn package manager
This enhance the procedure to find path of jsdoc binary by checking if the file exists.
It also use 2 possible paths to perform this check, one for npm and the other for yarn.

Close #6633
2017-03-24 12:17:06 +01:00
Andreas Hocevar
3bf74f4a33 Merge pull request #6631 from ahocevar/wms-image-size
Fix request image size caclulation
2017-03-24 10:39:09 +01:00
Andreas Hocevar
28fb57ebeb Fix request image size caclulation 2017-03-23 22:26:58 +01:00
Bart van den Eijnden
59ba146463 Merge pull request #6627 from bartvde/unselectable
Change css selector for user-select none
2017-03-22 16:48:22 +01:00
Andreas Hocevar
eef0b8869f Merge pull request #6626 from ahocevar/reprojected-cache-size
Respect cacheSize for reprojected caches
2017-03-22 16:27:11 +01:00
bartvde
c24ca7966a Change css selector for user-select none 2017-03-22 16:23:13 +01:00
Andreas Hocevar
e731ff8118 Merge pull request #6623 from ahocevar/outerwidth-outerheight
Fix outerWidth and outerHeight calculation in IE
2017-03-22 15:52:52 +01:00
Andreas Hocevar
07d4492ece Respect cacheSize for reprojected caches 2017-03-22 15:50:58 +01:00
Andreas Hocevar
5721e27161 Merge pull request #6625 from openlayers/greenkeeper/clean-css-cli-4.0.10
Update clean-css-cli to the latest version 🚀
2017-03-22 15:33:40 +01:00
greenkeeper[bot]
f96a415e80 chore(package): update clean-css-cli to version 4.0.10
https://greenkeeper.io/
2017-03-22 14:13:38 +00:00
Andreas Hocevar
1843698daf Fix outerWidth and outerHeight calculation in IE 2017-03-22 15:07:06 +01:00
Andreas Hocevar
57e67e62bb Merge pull request #6622 from gberaudo/fix_proj4_type
Fix proj4 type
2017-03-22 10:34:42 +01:00
Andreas Hocevar
615f1333d3 Merge pull request #6617 from ahocevar/cache-geoserver
Use GeoServer/GWC caching when possible
2017-03-22 09:58:52 +01:00
Guillaume Beraudo
630d9c5200 Fix proj4 type
Previous typing was confusing the compiler. It could not figure out the
difference between the proj4 property and the constructor, which lead to
errors such as:

- ol.proj.setProj4(proj4)
ERR! compile /home/gberaudo/dev/ngeo/src/proj/epsg21781.js:8: ERROR - actual parameter 1 of ol.proj.setProj4 does not match formal parameter
ERR! compile found   : function (new:proj4): ?
ERR! compile required: (null|proj4)
ERR! compile   ol.proj.setProj4(proj4);
ERR! compile                    ^^^^^

- ol.proj.proj4.get().defs('EPSG:21781', epsg21781def)
ERR! compile /home/gberaudo/dev/ngeo/src/proj/epsg21781.js:26: ERROR - Property defs never defined on proj4
ERR! compile   ol.proj.proj4.get().defs('EPSG:21781', epsg21781def);
ERR! compile                       ^^^^
2017-03-22 09:47:29 +01:00
Frédéric Junod
f4bf92a488 Merge pull request #6614 from adube/filter-write-util-method
Filter write util method
2017-03-21 16:28:04 +01:00
Andreas Hocevar
2dcecb9d59 Use GeoServer/GWC caching when possible 2017-03-21 16:17:43 +01:00
Frédéric Junod
d65d816ac8 Merge pull request #6616 from fredj/fix_gml_tests
Fix closing tag in gml tests
2017-03-21 15:24:21 +01:00
Alexandre Dubé
827fabc849 Apply reviewer's comments 2017-03-21 10:15:32 -04:00
Frederic Junod
7aa6d6350a Fix closing tag in gml tests 2017-03-21 14:55:41 +01:00
Alexandre Dubé
ef1033dffc Test for ol.format.WFS.writerFilter method 2017-03-21 09:19:07 -04:00
Alexandre Dubé
8a5fb286b6 Add writeFilter method to WFS format 2017-03-21 08:57:15 -04:00
Bart van den Eijnden
14c78a138a Merge pull request #6612 from Jenselme/wfs-1.0.0-writeGetFeature
Add support for WFS 1.0.0 to ol.format.WFS#writeTransaction
2017-03-21 11:08:40 +01:00
Julien Enselme
ecafa44196 Add support for WFS 1.0.0 to ol.format.WFS#writeTransaction
- Add a version property to olx.format.WFSWriteTransactionOptions to set
the WFS protocol version to use
- Use the specified version to use the correct schema and version in the
GML request
- Use the version to select the proper GML serializer
2017-03-21 10:59:28 +01:00
Andreas Hocevar
d216962b64 Merge pull request #5887 from felixveysseyre/interactive-overview-map
Interactive overview map
2017-03-21 10:17:58 +01:00
Andreas Hocevar
1320168cca Merge pull request #6610 from ahocevar/ie-eventtype
Fix event type case of MSPointerDown
2017-03-21 08:39:13 +01:00
Andreas Hocevar
f681302409 Merge pull request #6611 from openlayers/greenkeeper/jquery-3.2.1
Update jquery to the latest version 🚀
2017-03-20 21:57:58 +01:00
greenkeeper[bot]
6df077be77 chore(package): update jquery to version 3.2.1
https://greenkeeper.io/
2017-03-20 19:05:02 +00:00
Andreas Hocevar
93ef22759a Fix event type case of MSPointerDown 2017-03-20 19:36:43 +01:00
Andreas Hocevar
802c5ee30f Merge pull request #6609 from openlayers/greenkeeper/sinon-2.1.0
Update sinon to the latest version 🚀
2017-03-20 18:49:13 +01:00
Andreas Hocevar
f5c1908058 Merge pull request #6606 from ahocevar/delete-segmentdata
Reset dragSegments after vertex deletion
2017-03-20 18:17:34 +01:00
greenkeeper[bot]
5cc6565078 chore(package): update sinon to version 2.1.0
https://greenkeeper.io/
2017-03-20 16:46:09 +00:00
Félix VEYSSEYRE
6202c1736f Made OvervieMap interactive option default behavior 2017-03-20 17:15:47 +01:00
Andreas Hocevar
35ef65e6b9 Reset dragSegments after vertex deletion 2017-03-20 09:39:34 +01:00
Bart van den Eijnden
d931a92a9f Merge pull request #6523 from Jenselme/gml2-writeGeometryElement
Add Gml2 serializers to support WFS-T 1.0.0
2017-03-20 09:32:44 +01:00
Frédéric Junod
576b646f36 Merge pull request #6579 from fredj/update_slimerjs
Update slimerjs to v0.10.3
2017-03-20 08:34:34 +01:00
Frédéric Junod
b7fcc3ec46 Merge pull request #6577 from fredj/optionsFromCapabilities_crossOrigin
Adding crossOrigin to optionsFromCapabilities
2017-03-20 08:25:46 +01:00
Frederic Junod
9ae7df918f Update slimerjs to v0.10.3 2017-03-20 08:22:31 +01:00
Andreas Hocevar
75e27cef98 Merge pull request #6604 from ahocevar/star-radius
Fix RegularShape documentation
2017-03-18 21:10:41 +01:00
Andreas Hocevar
518d433d64 Fix RegularShape documentation 2017-03-18 12:16:26 +01:00
Andreas Hocevar
48a9270fad Merge pull request #6603 from openlayers/greenkeeper/eslint-3.18.0
Update eslint to the latest version 🚀
2017-03-18 08:04:52 +01:00
greenkeeper[bot]
686c3e1128 chore(package): update eslint to version 3.18.0
https://greenkeeper.io/
2017-03-17 22:12:40 +00:00
Andreas Hocevar
fb26c11dfb Merge pull request #6601 from openlayers/greenkeeper/jquery-3.2.0
Update jquery to the latest version 🚀
2017-03-16 23:03:52 +01:00
Andreas Hocevar
4e7202c9ae Merge pull request #6600 from openlayers/greenkeeper/fs-extra-2.1.2
Update fs-extra to the latest version 🚀
2017-03-16 22:46:25 +01:00
greenkeeper[bot]
5ec294fd7f chore(package): update jquery to version 3.2.0
https://greenkeeper.io/
2017-03-16 21:34:49 +00:00
greenkeeper[bot]
33ccb6619c fix(package): update fs-extra to version 2.1.2
https://greenkeeper.io/
2017-03-16 19:10:07 +00:00
Andreas Hocevar
0608c91587 Merge pull request #6578 from icholy/master
Add ol.RenderOrderFunction typedef
2017-03-16 14:47:06 +01:00
Murad Khafizov
76b917bf36 Add support of micrometers to scaleline
For high resolutions it starts to use micrometers (μm) instead of millimeters(mm). For example "5 μm" instead of "0.005 mm"
2017-03-16 12:45:44 +01:00
Andreas Hocevar
52e5bdbc9b Merge pull request #6589 from openlayers/greenkeeper/sinon-2.0.0
Update sinon to the latest version 🚀
2017-03-16 11:23:07 +01:00
Andreas Hocevar
121b2457e7 Merge pull request #6592 from openlayers/greenkeeper/clean-css-cli-4.0.9
Update clean-css-cli to the latest version 🚀
2017-03-16 10:06:59 +01:00
Andreas Hocevar
f1b7306eb6 Merge pull request #6594 from openlayers/greenkeeper/fs-extra-2.1.0
Update fs-extra to the latest version 🚀
2017-03-16 09:46:48 +01:00
greenkeeper[bot]
7d39ccb0e3 fix(package): update fs-extra to version 2.1.0
https://greenkeeper.io/
2017-03-15 12:38:46 +00:00
greenkeeper[bot]
0c11024fd7 chore(package): update clean-css-cli to version 4.0.9
https://greenkeeper.io/
2017-03-15 10:30:45 +00:00
greenkeeper[bot]
b4eb3eb8ba chore(package): update sinon to version 2.0.0
https://greenkeeper.io/
2017-03-15 06:33:59 +00:00
Frédéric Junod
793bf2f154 Merge pull request #6580 from fredj/rm_esprima
Remove unused esprima package
2017-03-11 07:39:22 +01:00
Frederic Junod
99de8b2eb1 Remove unused esprima package
It was added in #6302 but never used
2017-03-11 07:26:01 +01:00
Ilia Choly
2dc656c098 Add ol.RenderOrderFunction typedef 2017-03-09 13:02:39 -05:00
SanderH
ebde179ab2 Adding crossOrigin to optionsFromCapabilities
This pull request should resolve: https://github.com/openlayers/openlayers/issues/6521

Now with var and single quotes
2017-03-09 14:49:48 +01:00
Frédéric Junod
1e3462d476 Merge pull request #6570 from openlayers/sinon_stub
Don't use deprecated sinon.stub(obj, 'meth', fn)
2017-03-09 08:37:10 +01:00
Frédéric Junod
80c5b90dea Merge pull request #6569 from fredj/wmts_layer_not_found
Return null if the layer was not found in the WMTS capabilities
2017-03-08 15:44:12 +01:00
Frederic Junod
3e95c424ab Don't use deprecated sinon.stub(obj, 'meth', fn)
Code updated using https://github.com/hurrymaplelad/sinon-codemod
2017-03-08 15:37:46 +01:00
Frederic Junod
2e22fce718 Return null if the layer was not found in the WMTS capabilities 2017-03-08 15:29:26 +01:00
Frédéric Junod
cc13ca68fa Merge pull request #6551 from fredj/regular_shape_default_color
Use the default fill and stroke color
2017-03-08 08:42:27 +01:00
Jonathan Nagy
915b83a068 Remove trailing whitespace. 2017-03-08 16:34:27 +11:00
Jonathan Nagy
c54bf85dfc Overlay visible before updating render position
Make the overlay visible before updating the render position
so that the `offsetWidth` and `offsetHeight` can be 
considered in evaluating the offset and positioning of the 
element

See openlayers/openlayers#6566
2017-03-08 15:53:42 +11:00
Frederic Junod
1d3eb2eb6e Use the default fill and stroke color 2017-03-07 12:04:22 +01:00
Bart van den Eijnden
49af45c8b7 Merge pull request #6560 from geosense/featureloader_500_response
Don’t crash if feature loader xhr response returns 500
2017-03-06 11:31:39 +01:00
Aleš Jiránek
9c20a5eec8 Don’t crash if feature loader xhr response returns 500 2017-03-06 11:15:16 +01:00
Frédéric Junod
c215a1c50f Merge pull request #6559 from fredj/cleanup
Remove unneeded type cast
2017-03-06 09:49:05 +01:00
Frédéric Junod
e3664dbf64 Merge pull request #6558 from openlayers/greenkeeper/coveralls-2.12.0
Update coveralls to the latest version 🚀
2017-03-06 08:40:39 +01:00
Frédéric Junod
72b6a5c392 Merge pull request #6553 from openlayers/greenkeeper/proj4-2.4.3
Update proj4 to the latest version 🚀
2017-03-06 08:40:20 +01:00
Frederic Junod
192e3a3197 Remove unneeded type cast 2017-03-06 08:39:47 +01:00
greenkeeper[bot]
5b020cc00b chore(package): update coveralls to version 2.12.0
https://greenkeeper.io/
2017-03-06 08:24:19 +01:00
Frédéric Junod
6679faf1e3 Merge pull request #6554 from openlayers/greenkeeper/eslint-3.17.0
Update eslint to the latest version 🚀
2017-03-06 08:23:38 +01:00
greenkeeper[bot]
a519d83316 chore(package): update proj4 to version 2.4.3
https://greenkeeper.io/
2017-03-06 08:22:57 +01:00
simonseyock
c027b4d127 Reading kml xunits/yunits insetPixels 2017-03-04 12:24:51 +01:00
greenkeeper[bot]
a078f01f7b chore(package): update eslint to version 3.17.0
https://greenkeeper.io/
2017-03-03 22:43:38 +00:00
Bart van den Eijnden
16d62f8d9b Merge pull request #6549 from bartvde/animating-api
Make getAnimating and cancelAnimations @api
2017-03-03 09:46:54 +01:00
bartvde
f06d1740e0 Make getAnimating and cancelAnimations @api 2017-03-02 13:48:50 +01:00
Bart van den Eijnden
0ed864383d Merge pull request #6547 from bartvde/rotate-cleanup
Clean up left-over code from animation changes
2017-03-02 13:46:23 +01:00
bartvde
3d18b54978 Cleanup left over code from animation changes 2017-03-02 13:34:49 +01:00
Frédéric Junod
b456250cbe Merge pull request #6540 from openlayers/getAccuracyGeometry_type
More precise ol.Geolocation#getAccuracyGeometry return type
2017-03-01 09:51:51 +01:00
Frédéric Junod
a561300e9d Merge pull request #6539 from openlayers/greenkeeper/sinon-2.0.0-pre.6
Update sinon to the latest version 🚀
2017-02-28 12:12:07 +01:00
Frederic Junod
c1be62e6c3 More precise ol.Geolocation#getAccuracyGeometry return type 2017-02-27 16:18:45 +01:00
greenkeeper[bot]
59a4bbf91e chore(package): update sinon to version 2.0.0-pre.6
https://greenkeeper.io/
2017-02-27 09:30:07 +00:00
Frédéric Junod
08a251103b Merge pull request #6535 from openlayers/greenkeeper/closure-util-1.18.0
Update closure-util to the latest version 🚀
2017-02-24 09:47:11 +01:00
greenkeeper[bot]
9fe42fdcd6 fix(package): update closure-util to version 1.18.0
https://greenkeeper.io/
2017-02-24 07:57:54 +00:00
Andreas Hocevar
aa2dd57f36 Merge pull request #6529 from openlayers/greenkeeper/clean-css-cli-4.0.8
Update clean-css-cli to the latest version 🚀
2017-02-22 23:40:31 +01:00
Andreas Hocevar
f2e834cd32 Merge pull request #6530 from openlayers/greenkeeper/eslint-3.16.1
Update eslint to the latest version 🚀
2017-02-22 23:39:00 +01:00
greenkeeper[bot]
16b6bf1743 chore(package): update eslint to version 3.16.1
https://greenkeeper.io/
2017-02-22 22:23:33 +00:00
greenkeeper[bot]
e3f11e9d8c chore(package): update clean-css-cli to version 4.0.8
https://greenkeeper.io/
2017-02-22 16:31:26 +00:00
Tim Schaub
1d47fc923f Merge pull request #6515 from tschaub/zoom
Add view methods for getting max zoom, min zoom, and any zoom for a resolution
2017-02-20 11:48:45 -07:00
Marc Jansen
bc1c948950 Merge pull request #6520 from openlayers/greenkeeper/eslint-3.16.0
Update eslint to the latest version 🚀
2017-02-20 18:33:14 +01:00
greenkeeper[bot]
fc9ed73ff4 chore(package): update eslint to version 3.16.0
https://greenkeeper.io/
2017-02-20 16:32:55 +00:00
Frédéric Junod
6d8fed6edc Merge pull request #6518 from fredj/fix_icon_src_type
Fix olx.style.IconOptions.prototype.src type
2017-02-20 13:17:35 +01:00
Frederic Junod
7c45a0dc4f Fix olx.style.IconOptions.prototype.src type
The `olx.style.IconOptions` `@typedef` was already correct.
2017-02-20 12:19:58 +01:00
Tim Schaub
b383e0ecb2 Add view.getMaxZoom() and view.getMinZoom() 2017-02-19 18:11:04 -07:00
Tim Schaub
719fa6e004 Add view.getZoomForResolution() 2017-02-19 17:16:20 -07:00
Tim Schaub
a10926ac74 Merge pull request #6513 from openlayers/greenkeeper/async-2.1.5
Update async to the latest version 🚀
2017-02-19 05:58:19 -07:00
Tim Schaub
ca5bf96cb9 Merge pull request #6512 from tschaub/avoid-undefined-zoom
Complete animations at target values
2017-02-19 05:55:11 -07:00
greenkeeper[bot]
6269b907c3 fix(package): update async to version 2.1.5
https://greenkeeper.io/
2017-02-19 01:33:38 +00:00
Tim Schaub
9bd48d06c3 Complete animations at target values 2017-02-17 13:06:20 -07:00
Andreas Hocevar
1834c11f48 Merge pull request #6511 from ahocevar/restore-wms-tiled-example
Revert accidently committed example change
2017-02-17 19:03:00 +01:00
Andreas Hocevar
e77aabdf1b Revert accidently committed example change 2017-02-17 18:25:12 +01:00
Tim Schaub
61404d5bd8 Merge pull request #6507 from probins/patch-1
ol.DEBUG no longer needed in transforms/module.js
2017-02-17 09:26:16 -07:00
Julien Enselme
5f5c906129 Add GML2 serializer for Envelope 2017-02-17 17:00:09 +01:00
Julien Enselme
fec279c460 Add GML2 serializer for MultiSurface and MultiPolygon 2017-02-17 16:57:45 +01:00
Julien Enselme
579ec3955e Add GML2 MultiLineString serialiazer 2017-02-17 16:50:54 +01:00
Julien Enselme
650837b207 Add GML2 serializer for MultiPoint 2017-02-17 16:39:48 +01:00
Julien Enselme
f8c6863fa7 Add GML2 serializer for Point 2017-02-17 16:28:52 +01:00
Julien Enselme
dd90c90819 Add GML2 serializer for Surface and Polygon
- Adapt the code from ol.format.GML3.
- Create utility function to create coordinates nodes with proper
attributes
2017-02-17 16:23:16 +01:00
Julien Enselme
21394826b6 Add GML2 serializer for Curve and LineString
Adapt the code from ol.format.GML3.
2017-02-17 15:48:10 +01:00
Julien Enselme
7f0ed44828 Boostrap GML2 serializers
- Add writeFeatureElement (copied and adapted from ol.format.GML3)
- Add writeGeometryElement (copied and adapted from ol.format.GML3)
- Add related constants (GEOMETRY_SERIALIZERS_, GEOMETRY_NODE_FACTORY_)
- Add empty serialization methods
2017-02-17 15:38:19 +01:00
Tim Schaub
8d7eb0e372 Merge pull request #6505 from tschaub/babelify
Update ol package to include Browserify config
2017-02-17 05:36:03 -07:00
Peter Robins
3161e435b8 ol.DEBUG no longer needed in transforms/module.js 2017-02-17 10:35:55 +00:00
Tim Schaub
4bf0365d85 Make it easier to apply the required Browserify transform 2017-02-16 17:04:43 -07:00
Tim Schaub
109d3149f4 Include stylesheet in the package 2017-02-16 16:51:00 -07:00
Tim Schaub
a3f40b2057 Merge pull request #6504 from tchandelle/drawing
Determine if we should handle the drawing while the pointer is moving
2017-02-16 13:52:24 -07:00
Thomas Chandelle
08a118cc94 Determine if we should handle the drawing when the pointer is moving 2017-02-16 16:52:04 +01:00
Andreas Hocevar
b05136ea53 Merge pull request #6499 from tchandelle/circle-modify
Be more tolerant when comparing vertices when modifying a circle
2017-02-16 13:49:42 +01:00
Thomas Chandelle
9bf6dcbdcb Find the closest vertex on the circle from the pixel coordinates 2017-02-16 10:35:01 +01:00
Andreas Hocevar
6020c147ed Merge pull request #6498 from ahocevar/update-travis-node
Travis failing on master - use Node v6.1.x
2017-02-15 22:27:47 +01:00
Andreas Hocevar
1f2f8f06dc Do not fail on failing 'npm ls' 2017-02-15 15:08:55 +01:00
Andreas Hocevar
3829d883a7 Make Travis use node v6.1 2017-02-15 14:36:23 +01:00
Andreas Hocevar
cf12639749 Merge pull request #6493 from ahocevar/vectortile-cleanup
Vector tile cleanup
2017-02-15 14:21:44 +01:00
Thomas Chandelle
0764be77c4 Failing test for "Circle Modification" 2017-02-15 09:46:51 +01:00
Andreas Hocevar
7db5eea56b Performance improvement: only create context when it is needed 2017-02-14 22:20:38 +01:00
Andreas Hocevar
302087b4ec Reuse properties from ol.layer.TileProperty 2017-02-14 22:19:38 +01:00
Andreas Hocevar
db58db396f Remove renderedResolution which is defined in superclass 2017-02-14 22:19:38 +01:00
Andreas Hocevar
6906046e9f Merge pull request #6483 from nearmap/tile-render-issue
Fix renderer.canvas.TileLayer to calculate correct canvas height for drawing.
2017-02-14 21:49:34 +01:00
Andreas Hocevar
1705a2ca5f Merge pull request #6488 from tchandelle/circle-pan
Do not draw circle when pointer not moved and freehand is on
2017-02-14 15:49:47 +01:00
Frédéric Junod
88be906ad5 Merge pull request #6491 from openlayers/greenkeeper/clean-css-cli-4.0.7
Update clean-css-cli to the latest version 🚀
2017-02-14 13:17:45 +01:00
greenkeeper[bot]
f2a7ed5ef1 chore(package): update clean-css-cli to version 4.0.7
https://greenkeeper.io/
2017-02-14 11:49:53 +00:00
Thomas Chandelle
73ef345a2d Abort drawing to clear the sketch feature 2017-02-14 09:26:35 +01:00
Thomas Chandelle
4575c4ab6f Do not draw circle when pointer not moved AND freehand is on 2017-02-14 09:22:07 +01:00
Andreas Hocevar
7037ca211d Add rendering test for 192x256 tiles 2017-02-13 18:27:34 +01:00
Jan Klaas Kollhof
b152f06973 Fix rendered.canvas.TileLayer to calculate correct canvas height for drawing. 2017-02-13 13:50:09 +11:00
Félix VEYSSEYRE
328862172d Moved logic into the constructor 2016-09-16 16:11:25 +02:00
Félix VEYSSEYRE
ac99b5011a Enabled ol.control.OverviewMap interactive option on example page 2016-09-15 15:10:41 +02:00
Félix VEYSSEYRE
2b7ed7381f Added interactive option to ol.control.OverviewMap 2016-09-15 15:10:01 +02:00
390 changed files with 10968 additions and 4350 deletions

View File

@@ -1,2 +1,3 @@
examples/Jugl.js
examples/resources/
build/package/**/*webgl*

7
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,7 @@
This issue tracker is for reporting bugs or feature requests, not for asking questions. For usage questions, refer to the (documentation)[http://openlayers.org/en/latest/doc/].
Ready to submit your bug or feature request? Make sure these boxes are checked before submitting your issue. Thank you!
- [ ] I have searched GitHub to see if a similar bug or feature request has already been reported.
- [ ] If reporting a bug, I have tried with the latest version of OpenLayers (see 'LATEST' on https://openlayers.org/)
- [ ] If reporting a bug, I have created a [CodePen](https://codepen.io) or prepared a stack trace (using the latest version and unminified code, so e.g. `ol-debug.js`, not `ol.js`) that shows the issue.

5
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,5 @@
Make sure these boxes are checked before submitting your pull request. Thank you!
- [ ] This pull request addresses an issue that has been marked with the 'Pull request accepted' label.
- [ ] It contains one or more small, incremental, logically separate commits, with no merge commits.
- [ ] I have used clear commit messages.

View File

@@ -3,7 +3,10 @@ sudo: false
language: node_js
node_js:
- "6"
- "6.1"
addons:
firefox: "52.0"
cache:
directories:
@@ -17,7 +20,7 @@ before_install:
before_script:
- "rm src/ol/renderer/webgl/*shader.js"
- "sh -e /etc/init.d/xvfb start"
- "npm ls"
- "npm ls || true"
script: "make ci"

View File

@@ -86,7 +86,7 @@ check-deps:
done ;\
.PHONY: ci
ci: lint build test test-rendering compile-examples check-examples apidoc
ci: lint build test test-rendering package compile-examples check-examples apidoc
.PHONY: compile-examples
compile-examples: build/compiled-examples/all.combined.js
@@ -253,7 +253,7 @@ build/timestamps/eslint-timestamp: $(SRC_JS) $(SPEC_JS) $(SPEC_RENDERING_JS) \
build/timestamps/node-modules-timestamp
@mkdir -p $(@D)
@echo "Running eslint..."
@./node_modules/.bin/eslint --quiet tasks test test_rendering src examples
@./node_modules/.bin/eslint tasks test test_rendering src examples
@touch $@
build/timestamps/node-modules-timestamp: package.json
@@ -308,4 +308,6 @@ package:
@cp -r package build
@cd ./src && cp -r ol/* ../build/package
@rm build/package/typedefs.js
@cp css/ol.css build/package
./node_modules/.bin/jscodeshift --transform transforms/module.js build/package
npm run lint-package

View File

@@ -9,9 +9,13 @@
## Getting Started
Use one of the following methods to use OpenLayers in your project:
- For use with mainstream bundlers and minifiers, install the [ol](https://www.npmjs.com/package/ol) npm package: `npm install ol`
- Use `ol.js` and `ol.css` from (cdnjs)[https://cdnjs.com/libraries/openlayers]
- Download the [latest release](https://openlayers.org/download/)
- Install with npm: `npm install openlayers`
- Clone the repo: `git clone git@github.com:openlayers/openlayers.git`
- For use with Closure Library, install the [openlayers](https://npmjs.com/package/openlayers) npm package and read the [tutorial](http://openlayers.org/en/latest/doc/tutorials/closure.html).
## Supported Browsers
@@ -33,4 +37,3 @@ Please see our guide on [contributing](CONTRIBUTING.md) if you're interested in
- Need help? Find it on [Stack Overflow using the tag 'openlayers'](http://stackoverflow.com/questions/tagged/openlayers)
- Follow [@openlayers](https://twitter.com/openlayers) on Twitter
- Discuss with openlayers users on IRC in `#openlayers` at `chat.freenode`

View File

@@ -2,6 +2,84 @@
### Next release
#### `ol.interaction.Modify` deletes with `alt` key only
To delete features with the modify interaction, press the `alt` key while clicking on an existing vertex. If you want to configure the modify interaction with a different delete condition, use the `deleteCondition` option. For example, to allow deletion on a single click with no modifier keys, configure the interaction like this:
```js
var interaction = new ol.interaction.Modify({
source: source,
deleteCondition: function(event) {
return ol.events.condition.noModifierKeys(event) && ol.events.condition.singleClick(event);
}
});
```
The motivation for this change is to make the modify, draw, and snap interactions all work well together. Previously, the use of these interactions with the default configuration would make it so you couldn't reliably add new vertices (click with no modifier) and delete existing vertices (click with no modifier).
#### `ol.source.VectorTile` no longer has a `tilePixelRatio` option
The `tilePixelRatio` option was only used for tiles in projections with `tile-pixels` as units. For tiles read with `ol.format.MVT` and the default tile loader, or tiles with the default pixel size of 4096 pixels, no changes are necessary. For the very rare cases that do not fall under these categories, a custom `tileLoadFunction` now needs to be configured on the `ol.source.VectorTile`. In addition to calling `tile.setFeatures()` and `tile.setProjection()`, it also needs to contain code like the following:
```js
var extent = tile.getFormat() instanceof ol.format.MVT ?
tile.getLastExtent() :
[0, 0, tilePixelRatio * tileSize, tilePixelRatio * tileSize];
tile.setExtent(extent);
```
#### `ol.animate` now takes the shortest arc for rotation animation
Usually rotation animations should animate along the shortest arc. There are rare occasions where a spinning animation effect is desired. So if you previously had something like
```js
map.getView().animate({
rotation: 2 * Math.PI,
duration: 2000
});
```
we recommend to split the animation into two parts and use different easing functions. The code below results in the same effect as the snippet above did with previous versions:
```js
map.getView().animate({
rotation: Math.PI,
easing: ol.easing.easeIn
}, {
rotation: 2 * Math.PI,
easing: ol.easing.easeOut
});
```
### v4.2.0
#### Return values of two `ol.style.RegularShape` getters have changed
To provide a more consistent behaviour the following getters now return the same value that was given to constructor:
`ol.style.RegularShape#getPoints` does not return the double amount of points anymore if a radius2 is set.
`ol.style.RegularShape#getRadius2` will return `undefined` if no radius2 is set.
### v4.1.0
#### Adding duplicate layers to a map throws
Previously, you could do this:
```js
map.addLayer(layer);
map.addLayer(layer);
```
However, after adding a duplicate layer, things failed if you tried to remove that layer.
Now, `map.addLayer()` throws if you try adding a layer that has already been added to the map.
#### Simpler `constrainResolution` configuration
The `constrainResolution` configuration for `ol.interaction.PinchZoom` and `ol.interaction.MouseWheelZoom`
can now be set directly with an option in `ol.interaction.defaults`:
```js
ol.interaction.defaults({
constrainResolution: true
});
```
### v4.0.0
#### Simpler `ol.source.Zoomify` `url` configuration

127
changelog/v4.1.0.md Normal file
View File

@@ -0,0 +1,127 @@
# 4.1.0
## Summary
The v4.1.0 release includes features and fixes from 91 pull requests.
#### Interactive overview map
The extent rectangle on the overview map can now be dragged to control the view for the main map.
#### Setting min and max zoom for a view
You can now change the min or max zoom for a view after it has been created. This can be useful if you want to limit how far out users can zoom based on changes in viewport width (use `view.setMinZoom()` for this).
#### Adding duplicate layers to a map throws
Previously, you could do this:
```js
map.addLayer(layer);
map.addLayer(layer);
```
However, after adding a duplicate layer, things failed if you tried to remove that layer.
Now, `map.addLayer()` throws if you try adding a layer that has already been added to the map.
#### Simpler `constrainResolution` configuration
The `constrainResolution` configuration for `ol.interaction.PinchZoom` and `ol.interaction.MouseWheelZoom`
can now be set directly with an option in `ol.interaction.defaults`:
```js
ol.interaction.defaults({
constrainResolution: true
});
```
## Detailed changes
* [#6675](https://github.com/openlayers/openlayers/pull/6675) - Reset cursor when translate interaction is removed or deactivated ([@tchandelle](https://github.com/tchandelle))
* [#6707](https://github.com/openlayers/openlayers/pull/6707) - Set version when building ol package ([@tschaub](https://github.com/tschaub))
* [#6706](https://github.com/openlayers/openlayers/pull/6706) - Add ol.source.Cluster#getDistance function ([@fredj](https://github.com/fredj))
* [#6695](https://github.com/openlayers/openlayers/pull/6695) - Unique layers ([@tschaub](https://github.com/tschaub))
* [#6704](https://github.com/openlayers/openlayers/pull/6704) - Include typedefs.js in closure compiler tutorial build configurations ([@openlayers](https://github.com/openlayers))
* [#6702](https://github.com/openlayers/openlayers/pull/6702) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6693](https://github.com/openlayers/openlayers/pull/6693) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6691](https://github.com/openlayers/openlayers/pull/6691) - Move eslint globals to to test/.eslintrc ([@fredj](https://github.com/fredj))
* [#6689](https://github.com/openlayers/openlayers/pull/6689) - Add new constrainResolution option to olx.interaction.DefaultsOptions ([@fredj](https://github.com/fredj))
* [#6692](https://github.com/openlayers/openlayers/pull/6692) - Improve docs for MouseWheelZoom constrainResolution ([@ahocevar](https://github.com/ahocevar))
* [#6687](https://github.com/openlayers/openlayers/pull/6687) - Clip image only if the layer extent intersects the view extent ([@tchandelle](https://github.com/tchandelle))
* [#6686](https://github.com/openlayers/openlayers/pull/6686) - Update finishCoordinate in ol.interaction.Draw#removeLastPoint ([@fredj](https://github.com/fredj))
* [#6682](https://github.com/openlayers/openlayers/pull/6682) - Add example, docs and typedef for MouseWheelZoom's constrainResolution option ([@ahocevar](https://github.com/ahocevar))
* [#6683](https://github.com/openlayers/openlayers/pull/6683) - Add this jsdoc tag to ol.interaction.DragBox.defaultBoxEndCondition ([@fredj](https://github.com/fredj))
* [#6681](https://github.com/openlayers/openlayers/pull/6681) - Add constrainResolution in olx.interaction.PinchZoomOptions typedef ([@fredj](https://github.com/fredj))
* [#6671](https://github.com/openlayers/openlayers/pull/6671) - Add constraintResolution option to MouseWheelZoom for zoom with trackpad ([@kaiCu](https://github.com/kaiCu))
* [#6680](https://github.com/openlayers/openlayers/pull/6680) - Remove ol.DRAG_BOX_HYSTERESIS_PIXELS define and add option ([@fredj](https://github.com/fredj))
* [#6666](https://github.com/openlayers/openlayers/pull/6666) - Use the optional extent in ol.structs.RBush#getExtent ([@fredj](https://github.com/fredj))
* [#6670](https://github.com/openlayers/openlayers/pull/6670) - fix(package): update browserify to version 14.3.0 ([@openlayers](https://github.com/openlayers))
* [#6664](https://github.com/openlayers/openlayers/pull/6664) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6659](https://github.com/openlayers/openlayers/pull/6659) - Add crossOrigin to examples using ol.style.Icon ([@openlayers](https://github.com/openlayers))
* [#6658](https://github.com/openlayers/openlayers/pull/6658) - Fixes for raster source rendering ([@tschaub](https://github.com/tschaub))
* [#6620](https://github.com/openlayers/openlayers/pull/6620) - Fix the parsing of flat coordinates in GML2 for 3D geometies ([@Jenselme](https://github.com/Jenselme))
* [#6657](https://github.com/openlayers/openlayers/pull/6657) - Update coveralls to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6644](https://github.com/openlayers/openlayers/pull/6644) - Allow minZoom and maxZoom to be set on a view ([@tschaub](https://github.com/tschaub))
* [#6636](https://github.com/openlayers/openlayers/pull/6636) - Add test for the metric unit displayed in the scaleline ([@fredj](https://github.com/fredj))
* [#6598](https://github.com/openlayers/openlayers/pull/6598) - Add support of micrometers to scaleline ([@hajjimurad](https://github.com/hajjimurad))
* [#6643](https://github.com/openlayers/openlayers/pull/6643) - Add common transforms by default ([@tschaub](https://github.com/tschaub))
* [#6567](https://github.com/openlayers/openlayers/pull/6567) - Overlay visible before updating render position ([@nagytech](https://github.com/nagytech))
* [#6634](https://github.com/openlayers/openlayers/pull/6634) - Fix custom build when openlayers is installed from yarn package manager ([@Toilal](https://github.com/Toilal))
* [#6639](https://github.com/openlayers/openlayers/pull/6639) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6635](https://github.com/openlayers/openlayers/pull/6635) - Add missing externs to custom builds examples ([@Toilal](https://github.com/Toilal))
* [#6631](https://github.com/openlayers/openlayers/pull/6631) - Fix request image size caclulation ([@ahocevar](https://github.com/ahocevar))
* [#6627](https://github.com/openlayers/openlayers/pull/6627) - Change css selector for user-select none ([@bartvde](https://github.com/bartvde))
* [#6626](https://github.com/openlayers/openlayers/pull/6626) - Respect cacheSize for reprojected caches ([@ahocevar](https://github.com/ahocevar))
* [#6623](https://github.com/openlayers/openlayers/pull/6623) - Fix outerWidth and outerHeight calculation in IE ([@ahocevar](https://github.com/ahocevar))
* [#6625](https://github.com/openlayers/openlayers/pull/6625) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6622](https://github.com/openlayers/openlayers/pull/6622) - Fix proj4 type ([@gberaudo](https://github.com/gberaudo))
* [#6617](https://github.com/openlayers/openlayers/pull/6617) - Use GeoServer/GWC caching when possible ([@ahocevar](https://github.com/ahocevar))
* [#6614](https://github.com/openlayers/openlayers/pull/6614) - Filter write util method ([@adube](https://github.com/adube))
* [#6616](https://github.com/openlayers/openlayers/pull/6616) - Fix closing tag in gml tests ([@fredj](https://github.com/fredj))
* [#6612](https://github.com/openlayers/openlayers/pull/6612) - Add support for WFS 1.0.0 to ol.format.WFS#writeTransaction ([@Jenselme](https://github.com/Jenselme))
* [#5887](https://github.com/openlayers/openlayers/pull/5887) - Interactive overview map ([@felixveysseyre](https://github.com/felixveysseyre))
* [#6610](https://github.com/openlayers/openlayers/pull/6610) - Fix event type case of MSPointerDown ([@ahocevar](https://github.com/ahocevar))
* [#6611](https://github.com/openlayers/openlayers/pull/6611) - Update jquery to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6609](https://github.com/openlayers/openlayers/pull/6609) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6606](https://github.com/openlayers/openlayers/pull/6606) - Reset dragSegments after vertex deletion ([@ahocevar](https://github.com/ahocevar))
* [#6523](https://github.com/openlayers/openlayers/pull/6523) - Add Gml2 serializers to support WFS-T 1.0.0 ([@Jenselme](https://github.com/Jenselme))
* [#6579](https://github.com/openlayers/openlayers/pull/6579) - Update slimerjs to v0.10.3 ([@fredj](https://github.com/fredj))
* [#6577](https://github.com/openlayers/openlayers/pull/6577) - Adding crossOrigin to optionsFromCapabilities ([@fredj](https://github.com/fredj))
* [#6604](https://github.com/openlayers/openlayers/pull/6604) - Fix RegularShape documentation ([@ahocevar](https://github.com/ahocevar))
* [#6603](https://github.com/openlayers/openlayers/pull/6603) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6601](https://github.com/openlayers/openlayers/pull/6601) - Update jquery to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6600](https://github.com/openlayers/openlayers/pull/6600) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6578](https://github.com/openlayers/openlayers/pull/6578) - Add ol.RenderOrderFunction typedef ([@icholy](https://github.com/icholy))
* [#6589](https://github.com/openlayers/openlayers/pull/6589) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6592](https://github.com/openlayers/openlayers/pull/6592) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6594](https://github.com/openlayers/openlayers/pull/6594) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6580](https://github.com/openlayers/openlayers/pull/6580) - Remove unused esprima package ([@fredj](https://github.com/fredj))
* [#6570](https://github.com/openlayers/openlayers/pull/6570) - Don't use deprecated sinon.stub(obj, 'meth', fn) ([@openlayers](https://github.com/openlayers))
* [#6569](https://github.com/openlayers/openlayers/pull/6569) - Return null if the layer was not found in the WMTS capabilities ([@fredj](https://github.com/fredj))
* [#6551](https://github.com/openlayers/openlayers/pull/6551) - Use the default fill and stroke color ([@fredj](https://github.com/fredj))
* [#6560](https://github.com/openlayers/openlayers/pull/6560) - Dont crash if feature loader xhr response returns 500 ([@geosense](https://github.com/geosense))
* [#6559](https://github.com/openlayers/openlayers/pull/6559) - Remove unneeded type cast ([@fredj](https://github.com/fredj))
* [#6558](https://github.com/openlayers/openlayers/pull/6558) - Update coveralls to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6553](https://github.com/openlayers/openlayers/pull/6553) - Update proj4 to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6554](https://github.com/openlayers/openlayers/pull/6554) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6549](https://github.com/openlayers/openlayers/pull/6549) - Make getAnimating and cancelAnimations @api ([@bartvde](https://github.com/bartvde))
* [#6547](https://github.com/openlayers/openlayers/pull/6547) - Clean up left-over code from animation changes ([@bartvde](https://github.com/bartvde))
* [#6540](https://github.com/openlayers/openlayers/pull/6540) - More precise ol.Geolocation#getAccuracyGeometry return type ([@openlayers](https://github.com/openlayers))
* [#6539](https://github.com/openlayers/openlayers/pull/6539) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6535](https://github.com/openlayers/openlayers/pull/6535) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6529](https://github.com/openlayers/openlayers/pull/6529) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6530](https://github.com/openlayers/openlayers/pull/6530) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6515](https://github.com/openlayers/openlayers/pull/6515) - Add view methods for getting max zoom, min zoom, and any zoom for a resolution ([@tschaub](https://github.com/tschaub))
* [#6520](https://github.com/openlayers/openlayers/pull/6520) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6518](https://github.com/openlayers/openlayers/pull/6518) - Fix olx.style.IconOptions.prototype.src type ([@fredj](https://github.com/fredj))
* [#6513](https://github.com/openlayers/openlayers/pull/6513) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6512](https://github.com/openlayers/openlayers/pull/6512) - Complete animations at target values ([@tschaub](https://github.com/tschaub))
* [#6511](https://github.com/openlayers/openlayers/pull/6511) - Revert accidently committed example change ([@ahocevar](https://github.com/ahocevar))
* [#6507](https://github.com/openlayers/openlayers/pull/6507) - ol.DEBUG no longer needed in transforms/module.js ([@probins](https://github.com/probins))
* [#6505](https://github.com/openlayers/openlayers/pull/6505) - Update ol package to include Browserify config ([@tschaub](https://github.com/tschaub))
* [#6504](https://github.com/openlayers/openlayers/pull/6504) - Determine if we should handle the drawing while the pointer is moving ([@tchandelle](https://github.com/tchandelle))
* [#6499](https://github.com/openlayers/openlayers/pull/6499) - Be more tolerant when comparing vertices when modifying a circle ([@tchandelle](https://github.com/tchandelle))
* [#6498](https://github.com/openlayers/openlayers/pull/6498) - Travis failing on master - use Node v6.1.x ([@ahocevar](https://github.com/ahocevar))
* [#6493](https://github.com/openlayers/openlayers/pull/6493) - Vector tile cleanup ([@ahocevar](https://github.com/ahocevar))
* [#6483](https://github.com/openlayers/openlayers/pull/6483) - Fix renderer.canvas.TileLayer to calculate correct canvas height for drawing. ([@nearmap](https://github.com/nearmap))
* [#6488](https://github.com/openlayers/openlayers/pull/6488) - Do not draw circle when pointer not moved and freehand is on ([@tchandelle](https://github.com/tchandelle))
* [#6491](https://github.com/openlayers/openlayers/pull/6491) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))

13
changelog/v4.1.1.md Normal file
View File

@@ -0,0 +1,13 @@
# 4.1.1
## Summary
This is a patch release to fix several minor issues and two regressions in the [4.1.0 release](https://github.com/openlayers/openlayers/releases/tag/v4.1.0).
## Changes
* [#6711](https://github.com/openlayers/openlayers/pull/6711) - Correct path to cleancss ([@tschaub](https://github.com/tschaub))
* [#6728](https://github.com/openlayers/openlayers/pull/6728) - Fix tissot examples docs ([@fredj](https://github.com/fredj))
* [#6732](https://github.com/openlayers/openlayers/pull/6732) - Use firefox < 53 in travis ([@fredj](https://github.com/fredj))
* [#6741](https://github.com/openlayers/openlayers/pull/6741) - Allow user selection in overlay container ([@fredj](https://github.com/fredj))
* [#6755](https://github.com/openlayers/openlayers/pull/6755) - Add missing goog.require ([@fredj](https://github.com/fredj))

151
changelog/v4.2.0.md Normal file
View File

@@ -0,0 +1,151 @@
# 4.2.0
## Summary
The v4.2.0 release includes features and fixes from 87 pull requests.
#### New `movestart` event on `ol.Map`
The map now has a `movestart` event, as countarpart to the already existing `moveend` event.
#### New `moveTolerance` option in `ol.Map`
Some touch devices do not play well with OpenLayers's way of detecting clicks. To overcome this, a new `moveTolerance` option was introduced, so users can override the 1 pixel threshold above which a touch-release sequence won't be considered a click any more.
#### Support for multiple layers in `ol.format.TopoJSON`
With the new `layerName` and `layers` options, applications can extract the layer as additional attribute for vector features from `ol.format.TopoJSON`. This can especially be useful for styling vector tile layers.
#### New `tileJSON` option for `ol.source.TileJSON`
Like `ol.source.TileUTFGrid`, `ol.source.TileJSON` now also has a `tileJSON` option to configue it with inline TileJSON instead of a TileJSON URL.
#### New `ol.format.filter.during` filter
Although OpenLayers has no support for WFS v2.0, we added `ol.format.filter.during` for the `During` temporal operator.
#### Improved vector tile rendering at non-native resolutions
The vector tile renderer now uses an internal tile grid for all resolutions to cache pre-rendered tiles, even if the tile source does not have tiles for the viewed resolution. This improves rendering quality and performance.
#### New `insertVertexCondition` for `ol.interaction.Modify`
Applications can now control whether a vertex will be inserted into the modified geometry. This makes it easier to modify custom geometries.
#### New `callback` option for `ol.View#fit()`
To allow applications to perform custom actions when an animation associated with `ol.View#fit()` is completed, that method now has a new `callback` option.
#### New `ol.View#getInteracting()` getter
Like `ol.View#getAnimating()` returns `true` during a view animation, `ol.View#getInteracting()` returns `true` while users are interacting with the view.
#### New `hasZ` option for `ol.format.WFS#writeTransaction()`
When the new `hasZ` option is set to `true`, 3D coordinates will be preserved and encoded when writing a WFS transaction.
#### New `wrapX` option for `ol.source.Stamen`
Like other tile sources, `ol.source.Stamen` now also has a `wrapX` option, which allows applications to turn off wrapping the world in x direction.
#### Label support for `ol.Graticule`
The `ol.Graticule` component has several new options to add and control the output of labels. To turn on labelling, configure `ol.Graticule` with `showLabels: true`. The new options to control label formatting are `lonLabelFormatter`, `latLabelFormatter`, `lonLabelPosition` and `latLabelPosition`.
#### Return values of two `ol.style.RegularShape` getters have changed
To provide a more consistent behaviour the following getters now return the same value that was given to constructor:
`ol.style.RegularShape#getPoints` does not return the double amount of points anymore if a radius2 is set.
`ol.style.RegularShape#getRadius2` will return `undefined` if no radius2 is set.
## Detailed changes
* [#6912](https://github.com/openlayers/openlayers/pull/6912) - Use class instead of style for Translate cursor ([@ahocevar](https://github.com/ahocevar))
* [#6858](https://github.com/openlayers/openlayers/pull/6858) - Webgl vector improvements ([@GaborFarkas](https://github.com/GaborFarkas))
* [#6890](https://github.com/openlayers/openlayers/pull/6890) - Add a movestart event ([@ahocevar](https://github.com/ahocevar))
* [#6910](https://github.com/openlayers/openlayers/pull/6910) - Avoid duplicates in Observables list ([@ahocevar](https://github.com/ahocevar))
* [#6902](https://github.com/openlayers/openlayers/pull/6902) - Require minimum duration for kinetic animation ([@ahocevar](https://github.com/ahocevar))
* [#6904](https://github.com/openlayers/openlayers/pull/6904) - chore(package): update sinon to version 2.3.4 ([@openlayers](https://github.com/openlayers))
* [#6901](https://github.com/openlayers/openlayers/pull/6901) - Added release note for changed methods of ol.style.regularShape ([@KlausBenndorf](https://github.com/KlausBenndorf))
* [#6886](https://github.com/openlayers/openlayers/pull/6886) - Make ol.source.Cluster extensible ([@gberaudo](https://github.com/gberaudo))
* [#6887](https://github.com/openlayers/openlayers/pull/6887) - Disable rotation for views with enableRotation: false ([@ahocevar](https://github.com/ahocevar))
* [#6900](https://github.com/openlayers/openlayers/pull/6900) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6897](https://github.com/openlayers/openlayers/pull/6897) - ProjectionLike in proj.getPointResolution ([@probins](https://github.com/probins))
* [#6888](https://github.com/openlayers/openlayers/pull/6888) - Add note about custom functions to getPointResolution ([@probins](https://github.com/probins))
* [#6893](https://github.com/openlayers/openlayers/pull/6893) - Fix decimals options when writing features ([@tchandelle](https://github.com/tchandelle))
* [#6759](https://github.com/openlayers/openlayers/pull/6759) - Regular shape points ([@KlausBenndorf](https://github.com/KlausBenndorf))
* [#6892](https://github.com/openlayers/openlayers/pull/6892) - Accept a ol.ProjectionLike instead of ol.proj.Projection ([@fredj](https://github.com/fredj))
* [#6883](https://github.com/openlayers/openlayers/pull/6883) - Remove unused ol.pointer.EventSource#getMapping function ([@fredj](https://github.com/fredj))
* [#6870](https://github.com/openlayers/openlayers/pull/6870) - Center map on proper earth, not one to the left ([@kannes](https://github.com/kannes))
* [#6872](https://github.com/openlayers/openlayers/pull/6872) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6876](https://github.com/openlayers/openlayers/pull/6876) - Only test ol.interaction.DragAndDrop if FileReader is supported ([@fredj](https://github.com/fredj))
* [#6874](https://github.com/openlayers/openlayers/pull/6874) - Remove unused var from ol.proj ([@probins](https://github.com/probins))
* [#6875](https://github.com/openlayers/openlayers/pull/6875) - chore(package): update sinon to version 2.3.2 ([@openlayers](https://github.com/openlayers))
* [#6867](https://github.com/openlayers/openlayers/pull/6867) - add getArea to api ([@cs09g](https://github.com/cs09g))
* [#6863](https://github.com/openlayers/openlayers/pull/6863) - change size to optional ([@cs09g](https://github.com/cs09g))
* [#6864](https://github.com/openlayers/openlayers/pull/6864) - fix(package): update closure-util to version 1.21.0 ([@openlayers](https://github.com/openlayers))
* [#6834](https://github.com/openlayers/openlayers/pull/6834) - Move tolerance option ([@notnotse](https://github.com/notnotse))
* [#6856](https://github.com/openlayers/openlayers/pull/6856) - Fix creation of new URL in readSharedStyle_ and readSharedStyleMap_ ([@oterral](https://github.com/oterral))
* [#6852](https://github.com/openlayers/openlayers/pull/6852) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6851](https://github.com/openlayers/openlayers/pull/6851) - Register/unregister listeners in setActive ([@ahocevar](https://github.com/ahocevar))
* [#6832](https://github.com/openlayers/openlayers/pull/6832) - Force state of error tiles when usInterimTilesOnError is false ([@oterral](https://github.com/oterral))
* [#6849](https://github.com/openlayers/openlayers/pull/6849) - Create URL object only when we can ([@oterral](https://github.com/oterral))
* [#6845](https://github.com/openlayers/openlayers/pull/6845) - Snap on circles ([@tchandelle](https://github.com/tchandelle))
* [#6842](https://github.com/openlayers/openlayers/pull/6842) - add condition to check if active ([@cs09g](https://github.com/cs09g))
* [#6844](https://github.com/openlayers/openlayers/pull/6844) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6841](https://github.com/openlayers/openlayers/pull/6841) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6839](https://github.com/openlayers/openlayers/pull/6839) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6838](https://github.com/openlayers/openlayers/pull/6838) - fix(package): update handlebars to version 4.0.10 ([@openlayers](https://github.com/openlayers))
* [#6817](https://github.com/openlayers/openlayers/pull/6817) - Multiple layers in TopoJSON vector tiles ([@ahocevar](https://github.com/ahocevar))
* [#6833](https://github.com/openlayers/openlayers/pull/6833) - Fix geojson-vt example for line and point geometries ([@oterral](https://github.com/oterral))
* [#6829](https://github.com/openlayers/openlayers/pull/6829) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6819](https://github.com/openlayers/openlayers/pull/6819) - Adjust/fix API for working with vector tile features ([@ahocevar](https://github.com/ahocevar))
* [#6818](https://github.com/openlayers/openlayers/pull/6818) - Add tileJSON option to ol.source.TileJSON ([@ahocevar](https://github.com/ahocevar))
* [#6805](https://github.com/openlayers/openlayers/pull/6805) - Display country name on click select ([@fredj](https://github.com/fredj))
* [#6813](https://github.com/openlayers/openlayers/pull/6813) - Prepend the version with a v ([@tschaub](https://github.com/tschaub))
* [#6814](https://github.com/openlayers/openlayers/pull/6814) - Re-add ol.render.Feature#getGeometry() ([@ahocevar](https://github.com/ahocevar))
* [#6812](https://github.com/openlayers/openlayers/pull/6812) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6786](https://github.com/openlayers/openlayers/pull/6786) - Add ol.format.filter.during ([@fredj](https://github.com/fredj))
* [#6806](https://github.com/openlayers/openlayers/pull/6806) - Add note about features with the same id ([@drnextgis](https://github.com/drnextgis))
* [#6802](https://github.com/openlayers/openlayers/pull/6802) - Remove unused setFeatures and getFormat methods ([@ahocevar](https://github.com/ahocevar))
* [#6801](https://github.com/openlayers/openlayers/pull/6801) - Add getId method for ol.render.Feature ([@ahocevar](https://github.com/ahocevar))
* [#6778](https://github.com/openlayers/openlayers/pull/6778) - Add a small tolerance when testing pointer event positions ([@fredj](https://github.com/fredj))
* [#6796](https://github.com/openlayers/openlayers/pull/6796) - Re-add accidently dropped condition ([@ahocevar](https://github.com/ahocevar))
* [#6798](https://github.com/openlayers/openlayers/pull/6798) - chore(package): update clean-css-cli to version 4.1.2 ([@openlayers](https://github.com/openlayers))
* [#6795](https://github.com/openlayers/openlayers/pull/6795) - Fix ol.DrawGeometryFunctionType coordinates argument type ([@fredj](https://github.com/fredj))
* [#6797](https://github.com/openlayers/openlayers/pull/6797) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6779](https://github.com/openlayers/openlayers/pull/6779) - Decouple source and rendered tile grid of vector tile sources ([@ahocevar](https://github.com/ahocevar))
* [#6785](https://github.com/openlayers/openlayers/pull/6785) - Add insertVertexCondition to ol.interaction.Modify options ([@fredj](https://github.com/fredj))
* [#6792](https://github.com/openlayers/openlayers/pull/6792) - Create intermediate canvas when resolutions have changed ([@ahocevar](https://github.com/ahocevar))
* [#6790](https://github.com/openlayers/openlayers/pull/6790) - Update resemblejs to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6784](https://github.com/openlayers/openlayers/pull/6784) - chore(package): update clean-css-cli to version 4.1.0 ([@openlayers](https://github.com/openlayers))
* [#6556](https://github.com/openlayers/openlayers/pull/6556) - Reading kml xunits/yunits insetPixels ([@KlausBenndorf](https://github.com/KlausBenndorf))
* [#6775](https://github.com/openlayers/openlayers/pull/6775) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6774](https://github.com/openlayers/openlayers/pull/6774) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6770](https://github.com/openlayers/openlayers/pull/6770) - Enforce the "no missing requires" rule ([@tschaub](https://github.com/tschaub))
* [#6772](https://github.com/openlayers/openlayers/pull/6772) - Remove html tag from shortdesc ([@fredj](https://github.com/fredj))
* [#6769](https://github.com/openlayers/openlayers/pull/6769) - Update handlebars to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6757](https://github.com/openlayers/openlayers/pull/6757) - Fix crashing on creation of snap-interaction, if Circle is among the features to snap to. ([@hajjimurad](https://github.com/hajjimurad))
* [#6766](https://github.com/openlayers/openlayers/pull/6766) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6765](https://github.com/openlayers/openlayers/pull/6765) - Add new callback function to view.FitOptions ([@fredj](https://github.com/fredj))
* [#6764](https://github.com/openlayers/openlayers/pull/6764) - Added View#getInteracting() to the api ([@mblinsitu](https://github.com/mblinsitu))
* [#6760](https://github.com/openlayers/openlayers/pull/6760) - Update handlebars to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6761](https://github.com/openlayers/openlayers/pull/6761) - Update async to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6755](https://github.com/openlayers/openlayers/pull/6755) - Add missing goog.require ([@fredj](https://github.com/fredj))
* [#6751](https://github.com/openlayers/openlayers/pull/6751) - Update coveralls to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6750](https://github.com/openlayers/openlayers/pull/6750) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6741](https://github.com/openlayers/openlayers/pull/6741) - Allow user selection in overlay container ([@fredj](https://github.com/fredj))
* [#6744](https://github.com/openlayers/openlayers/pull/6744) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6737](https://github.com/openlayers/openlayers/pull/6737) - Graticule labels ([@ahocevar](https://github.com/ahocevar))
* [#6740](https://github.com/openlayers/openlayers/pull/6740) - Fix spelling ([@fredj](https://github.com/fredj))
* [#6730](https://github.com/openlayers/openlayers/pull/6730) - Update metalsmith-layouts to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6732](https://github.com/openlayers/openlayers/pull/6732) - Use firefox < 53 in travis ([@fredj](https://github.com/fredj))
* [#6677](https://github.com/openlayers/openlayers/pull/6677) - Add an option to writeTransaction to support 3D geometries ([@Jenselme](https://github.com/Jenselme))
* [#6524](https://github.com/openlayers/openlayers/pull/6524) - Don't append feature prefix twice in WFS requests ([@Jenselme](https://github.com/Jenselme))
* [#6727](https://github.com/openlayers/openlayers/pull/6727) - Add default value in doc for the hitTolerance option ([@fredj](https://github.com/fredj))
* [#6724](https://github.com/openlayers/openlayers/pull/6724) - Add wrapX option to Stamen source ([@fredj](https://github.com/fredj))
* [#6728](https://github.com/openlayers/openlayers/pull/6728) - Fix tissot examples docs ([@fredj](https://github.com/fredj))
* [#6725](https://github.com/openlayers/openlayers/pull/6725) - Update dependencies to enable Greenkeeper 🌴 ([@openlayers](https://github.com/openlayers))
* [#6711](https://github.com/openlayers/openlayers/pull/6711) - Correct path to cleancss ([@tschaub](https://github.com/tschaub))

View File

@@ -1,7 +1,7 @@
{
"opts": {
"recurse": true,
"template": "config/jsdoc/api/template"
"template": "../../config/jsdoc/api/template"
},
"tags": {
"allowUnknownTags": true
@@ -16,12 +16,12 @@
]
},
"plugins": [
"node_modules/jsdoc/plugins/markdown",
"config/jsdoc/api/plugins/inheritdoc",
"config/jsdoc/api/plugins/typedefs",
"config/jsdoc/api/plugins/events",
"config/jsdoc/api/plugins/observable",
"config/jsdoc/api/plugins/api"
"plugins/markdown",
"../../config/jsdoc/api/plugins/inheritdoc",
"../../config/jsdoc/api/plugins/typedefs",
"../../config/jsdoc/api/plugins/events",
"../../config/jsdoc/api/plugins/observable",
"../../config/jsdoc/api/plugins/api"
],
"markdown": {
"parser": "gfm"

View File

@@ -41,7 +41,7 @@ exports.handlers = {
cls.observables = [];
}
observable = observables[doclet.observable];
if (cls.observables.indexOf(observable) == -1) {
if (observable.type && cls.observables.indexOf(observable) == -1) {
cls.observables.push(observable);
}
if (!cls.fires) {

View File

@@ -16,8 +16,10 @@
<tbody>
<?js
var self = this;
var propsByName = {};
props.forEach(function(prop) {
if (!prop) { return; }
if (!prop || propsByName[prop.name]) { return; }
propsByName[prop.name] = prop;
var setter = prop.readonly ? 'no' : 'yes';
?>

View File

@@ -1,7 +1,7 @@
{
"opts": {
"recurse": true,
"template": "config/jsdoc/info"
"template": "../../config/jsdoc/info"
},
"tags": {
"allowUnknownTags": true
@@ -10,8 +10,8 @@
"includePattern": "\\.js$"
},
"plugins": [
"config/jsdoc/info/api-plugin",
"config/jsdoc/info/define-plugin",
"config/jsdoc/info/virtual-plugin"
"../../config/jsdoc/info/api-plugin",
"../../config/jsdoc/info/define-plugin",
"../../config/jsdoc/info/virtual-plugin"
]
}

View File

@@ -3,7 +3,6 @@
* an api tag) and boolean defines (with a define tag and a default value).
*/
var assert = require('assert');
var fs = require('fs');
var path = require('path');
@@ -89,7 +88,6 @@ exports.publish = function(data, opts) {
types: getTypes(doc.type.names)
});
} else {
var types;
var symbol = {
name: doc.longname,
kind: doc.kind,
@@ -169,13 +167,15 @@ exports.publish = function(data, opts) {
return (symbol.name in augments || symbol.virtual);
});
process.stdout.write(
JSON.stringify({
symbols: symbols,
defines: defines,
typedefs: typedefs,
externs: externs,
base: base
}, null, 2));
return new Promise(function(resolve, reject) {
process.stdout.write(
JSON.stringify({
symbols: symbols,
defines: defines,
typedefs: typedefs,
externs: externs,
base: base
}, null, 2));
});
};

View File

@@ -34,16 +34,32 @@
.ol-unsupported {
display: none;
}
.ol-viewport .ol-unselectable {
.ol-viewport, .ol-unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.ol-selectable {
-webkit-touch-callout: default;
-webkit-user-select: auto;
-moz-user-select: auto;
-ms-user-select: auto;
user-select: auto;
}
.ol-grabbing {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
.ol-grab {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.ol-control {
position: absolute;
background-color: rgba(255,255,255,0.4);
@@ -239,3 +255,7 @@
.ol-overviewmap-box {
border: 2px dotted rgba(0,60,136,0.7);
}
.ol-overviewmap .ol-overviewmap-box:hover {
cursor: move;
}

View File

@@ -220,3 +220,7 @@ The `{-y}` placeholder requires a tile grid with extent.
### 57
At least 2 conditions are required.
### 58
Duplicate item added to a unique collection. For example, it may be that you tried to add the same layer to a map twice. Check for calls to `map.addLayer()` or other places where the map's layer collection is modified.

View File

@@ -11,7 +11,7 @@ For a more in-depth overview of OpenLayers core concepts, check out the [tutoria
Make sure to also check out the [OpenLayers workshop](/workshop/).
Find additional reference material in the [API docs](../apidoc).
Find additional reference material in the [API docs](../apidoc) and [examples](../examples).
# Frequently Asked Questions (FAQ)
@@ -19,4 +19,4 @@ We have put together a document that lists [Frequently Asked Questions (FAQ)](fa
# More questions?
If you cannot find an answer in the documentation or the FAQ, you can ask your question on [Stack Overflow using the tag 'openlayers'](http://stackoverflow.com/questions/tagged/openlayers).
If you cannot find an answer in the documentation or the FAQ, you can search [Stack Overflow](http://stackoverflow.com/questions/tagged/openlayers). If you cannot find an answer there, ask a new question there, using the tag 'openlayers'.

View File

@@ -5,57 +5,56 @@ layout: doc.hbs
# Introduction
When going beyond modifying existing examples you might be looking for a
way to setup your own code with dependency management together with external
dependencies like OpenLayers.
When going beyond modifying existing examples you might be looking for a way to setup your own code with dependency management together with external dependencies like OpenLayers.
This tutorial serves as a suggested project setup using NPM and Browserify
for the most basic needs. There are several other options and in particular
you might be interested in
[compiling your own code together with OpenLayers](closure.html).
This tutorial serves as a suggested project setup using NPM and Browserify for the most basic needs. There are several other options, and in particular you might be interested in a more modern one (ES2015) [using Webpack with OpenLayers](https://gist.github.com/tschaub/79025aef325cd2837364400a105405b8).
## Initial steps
Create a new empty directory for your project and navigate to it by running
`mkdir new-project && cd new-project`. Initialize your project using `npm init`
and answer the questions asked.
Create a new empty directory for your project and navigate to it by running `mkdir new-project && cd new-project`. Initialize your project using `npm init` and answer the questions asked.
At this point you can ask NPM to add required dependencies by running
`npm install --save-dev openlayers browserify watchify uglify-js`. Watchify and
Uglify will be used to monitor for changes and to build into a minified
bundle.
Add OpenLayers as dependency to your application with `npm install --save ol`.
At this point you can ask NPM to add required development dependencies by running
```
npm install --save-dev cssify browserify cssify http-server uglify-js watchify
npm install --save-dev babelify babel-plugin-transform-es2015-modules-commonjs
```
We will be using `cssify` to include the css definitions required by OpenLayers in our bundle. `watchify`, `http-server` and `uglify-js` are used to monitor for changes and to build into a minified bundle. `babelify` and `babel-plugin-transform-es2015-modules-commonjs` are used to make the `ol` package, which was created using ES2015 modules, work with CommonJS.
## Application code and index.html
Place your application code in `index.js`. Here is a simple starting point:
```js
var ol = require('openlayers');
var map = new ol.Map({
require('ol/ol.css');
var ol_Map = require('ol/map').default;
var ol_layer_Tile = require('ol/layer/tile').default;
var ol_source_OSM = require('ol/source/osm').default;
var ol_View = require('ol/view').default;
var map = new ol_Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
new ol_layer_Tile({
source: new ol_source_OSM()
})
],
view: new ol.View({
view: new ol_View({
center: [0, 0],
zoom: 0
})
});
```
You will also need an `ìndex.html` file that will use your bundle. Here is a simple
example:
You will also need an `ìndex.html` file that will use your bundle. Here is a simple example:
```html
<!doctype html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Using Browserify with OpenLayers</title>
<link rel="stylesheet" href="node_modules/openlayers/dist/ol.css" type="text/css">
<style>
#map {
width: 400px;
@@ -72,18 +71,17 @@ example:
## Creating a bundle
With simple scripts you can introduce the commands `npm run build` and `npm start` to
manually build your bundle and watch for changes, respectively. Add the following
to the script section in `package.json`:
With simple scripts you can introduce the commands `npm run build` and `npm start` to manually build your bundle and watch for changes, respectively. Add the following to the script section in `package.json`:
```json
"scripts": {
"start": "watchify index.js --outfile bundle.js",
"build": "browserify index.js | uglifyjs --compress --output bundle.js"
"start": "watchify index.js -g cssify --outfile bundle.js & http-server",
"build": "browserify -g cssify index.js | uglifyjs --compress --output bundle.js"
}
```
Now to test your application open http://localhost:8080/ in your browser. `watchify` will update `bundle.js` whenever you change something. You simply need to reload the page in your browser to see the changes.
```
$ npm start
```
Note that `bundle.js` will contain your application code and all dependencies
used in your application, in this case the official full build of OpenLayers.
If you only need parts of OpenLayers you can create
[custom builds](../../builder).
Note that `bundle.js` will contain your application code and all dependencies used in your application. From OpenLayers, it only contains the required components.

View File

@@ -5,11 +5,15 @@ layout: doc.hbs
# Compiling Application with Closure Compiler
**Note**: When building an application with dependencies that are available as [npm](https://npmjs.com/) packages, it will probably be easier to use the [ol](https://npmjs.com/package/ol) package and follow the instructions there.
The OpenLayers code uses the Closure Library, and it is compiled with the
Closure Compiler. Using OpenLayers in an application does not require using
Closure. But using Closure in an OpenLayers application is possible. And this
is what this tutorial is about.
When you want to include OpenLayers as separate script without bundling with your application, follow the [Creating custom builds](./custom-builds.html) tutorial instead.
This tutorial will teach you how to set up an OpenLayers application based on
the [`closure-util`](https://github.com/openlayers/closure-util) node package,
which provides utilities for working with Closure. Using `closure-util` is one
@@ -172,6 +176,7 @@ The minimum config file looks like this:
"ol.ENABLE_WEBGL=false"
],
"js": [
"node_modules/openlayers/src/ol/typedefs.js",
"node_modules/openlayers/externs/olx.js",
"node_modules/openlayers/externs/oli.js"
],
@@ -223,6 +228,7 @@ Here is a version of `config.json` with more compilation checks enabled:
"ol.ENABLE_WEBGL=false"
],
"js": [
"node_modules/openlayers/src/ol/typedefs.js",
"node_modules/openlayers/externs/olx.js",
"node_modules/openlayers/externs/oli.js"
],

View File

@@ -51,7 +51,9 @@ Creating a custom build requires writing a build configuration file. The format
"compile": {
"externs": [
"externs/bingmaps.js",
"externs/cartodb.js",
"externs/closure-compiler.js",
"externs/esrijson.js",
"externs/geojson.js",
"externs/oli.js",
"externs/olx.js",
@@ -201,9 +203,16 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](https://openl
],
"compile": {
"externs": [
"externs/bingmaps.js",
"externs/cartodb.js",
"externs/closure-compiler.js",
"externs/esrijson.js",
"externs/geojson.js",
"externs/olx.js",
"externs/oli.js"
"externs/oli.js",
"externs/proj4js.js",
"externs/tilejson.js",
"externs/topojson.js"
],
"define": [
"ol.ENABLE_WEBGL=false",

View File

@@ -45,7 +45,7 @@ The easiest way to use a custom projection is to add the [Proj4js](http://proj4j
Following example shows definition of a [British National Grid](https://epsg.io/27700):
``` html
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.3/proj4.js"></script>
```
``` javascript

View File

@@ -1,5 +1,6 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.easing');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
@@ -73,9 +74,16 @@ onClick('rotate-right', function() {
});
onClick('rotate-around-rome', function() {
// Rotation animation takes the shortest arc, so animate in two parts
var rotation = view.getRotation();
view.animate({
rotation: view.getRotation() + 2 * Math.PI,
anchor: rome
rotation: rotation + Math.PI,
anchor: rome,
easing: ol.easing.easeIn
}, {
rotation: rotation + 2 * Math.PI,
anchor: rome,
easing: ol.easing.easeOut
});
});
@@ -103,10 +111,19 @@ onClick('bounce-to-istanbul', function() {
});
onClick('spin-to-rome', function() {
// Rotation animation takes the shortest arc, so animate in two parts
var center = view.getCenter();
view.animate({
center: [
center[0] + (rome[0] - center[0]) / 2,
center[1] + (rome[1] - center[1]) / 2
],
rotation: Math.PI,
easing: ol.easing.easeIn
}, {
center: rome,
rotation: 2 * Math.PI,
duration: 2000
easing: ol.easing.easeOut
});
});

View File

@@ -12,7 +12,8 @@ cloak:
<select id="layer-select">
<option value="Aerial">Aerial</option>
<option value="AerialWithLabels" selected>Aerial with labels</option>
<option value="Road">Road</option>
<option value="Road">Road (static)</option>
<option value="RoadOnDemand">Road (dynamic)</option>
<option value="collinsBart">Collins Bart</option>
<option value="ordnanceSurvey">Ordnance Survey</option>
</select>

View File

@@ -6,6 +6,7 @@ goog.require('ol.source.BingMaps');
var styles = [
'Road',
'RoadOnDemand',
'Aerial',
'AerialWithLabels',
'collinsBart',

View File

@@ -45,29 +45,29 @@ var dragBox = new ol.interaction.DragBox({
map.addInteraction(dragBox);
var infoBox = document.getElementById('info');
dragBox.on('boxend', function() {
// features that intersect the box are added to the collection of
// selected features, and their names are displayed in the "info"
// div
var info = [];
// selected features
var extent = dragBox.getGeometry().getExtent();
vectorSource.forEachFeatureIntersectingExtent(extent, function(feature) {
selectedFeatures.push(feature);
info.push(feature.get('name'));
});
if (info.length > 0) {
infoBox.innerHTML = info.join(', ');
}
});
// clear selection when drawing a new box and when clicking on the map
dragBox.on('boxstart', function() {
selectedFeatures.clear();
infoBox.innerHTML = '&nbsp;';
});
map.on('click', function() {
selectedFeatures.clear();
infoBox.innerHTML = '&nbsp;';
var infoBox = document.getElementById('info');
selectedFeatures.on(['add', 'remove'], function() {
var names = selectedFeatures.getArray().map(function(feature) {
return feature.get('name');
});
if (names.length > 0) {
infoBox.innerHTML = names.join(', ');
} else {
infoBox.innerHTML = 'No countries selected';
}
});

View File

@@ -1,7 +1,7 @@
---
layout: example.html
title: Clustered Features
shortdesc: Example of using <code>ol.source.Cluster</code>.
shortdesc: Example of using ol.source.Cluster.
docs: >
This example shows how to do clustering on point features.
tags: "cluster, vector"

View File

@@ -97,7 +97,7 @@ function rgb2xyz(x) {
function xyz2rgb(x) {
return 255 * (x <= 0.0031308 ?
12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
}
var raster = new ol.source.Raster({

View File

@@ -142,7 +142,7 @@ var lineFeature = new ol.Feature(
var polygonFeature = new ol.Feature(
new ol.geom.Polygon([[[-3e6, -1e6], [-3e6, 1e6],
[-1e6, 1e6], [-1e6, -1e6], [-3e6, -1e6]]]));
[-1e6, 1e6], [-1e6, -1e6], [-3e6, -1e6]]]));
var map = new ol.Map({

View File

@@ -1,9 +1,8 @@
goog.require('ol.Collection');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.events.condition');
goog.require('ol.interaction.Draw');
goog.require('ol.interaction.Modify');
goog.require('ol.interaction.Snap');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
@@ -17,18 +16,9 @@ var raster = new ol.layer.Tile({
source: new ol.source.OSM()
});
var map = new ol.Map({
layers: [raster],
target: 'map',
view: new ol.View({
center: [-11000000, 4600000],
zoom: 4
})
});
var features = new ol.Collection();
var featureOverlay = new ol.layer.Vector({
source: new ol.source.Vector({features: features}),
var source = new ol.source.Vector();
var vector = new ol.layer.Vector({
source: source,
style: new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.2)'
@@ -45,38 +35,40 @@ var featureOverlay = new ol.layer.Vector({
})
})
});
featureOverlay.setMap(map);
var modify = new ol.interaction.Modify({
features: features,
// the SHIFT key must be pressed to delete vertices, so
// that new vertices can be drawn at the same position
// of existing vertices
deleteCondition: function(event) {
return ol.events.condition.shiftKeyOnly(event) &&
ol.events.condition.singleClick(event);
}
var map = new ol.Map({
layers: [raster, vector],
target: 'map',
view: new ol.View({
center: [-11000000, 4600000],
zoom: 4
})
});
var modify = new ol.interaction.Modify({source: source});
map.addInteraction(modify);
var draw; // global so we can remove it later
var draw, snap; // global so we can remove them later
var typeSelect = document.getElementById('type');
function addInteraction() {
function addInteractions() {
draw = new ol.interaction.Draw({
features: features,
source: source,
type: /** @type {ol.geom.GeometryType} */ (typeSelect.value)
});
map.addInteraction(draw);
}
snap = new ol.interaction.Snap({source: source});
map.addInteraction(snap);
}
/**
* Handle change event.
*/
typeSelect.onchange = function() {
map.removeInteraction(draw);
addInteraction();
map.removeInteraction(snap);
addInteractions();
};
addInteraction();
addInteractions();

View File

@@ -144,7 +144,7 @@ var map = new ol.Map({
layers: [raster, vector],
interactions: ol.interaction.defaults().extend([new ol.interaction.Select({
condition: function(evt) {
return evt.originalEvent.type == 'mousemove' ||
return evt.type == 'pointermove' ||
evt.type == 'singleclick';
},
style: selectStyleFunction

View File

@@ -11,7 +11,8 @@ var layers = [
source: new ol.source.TileWMS({
url: 'https://ahocevar.com/geoserver/wms',
params: {
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR',
'TILED': true
}
})
})

View File

@@ -198,7 +198,7 @@ function stopAnimation(ended) {
// if animation cancelled set the marker at the beginning
var coord = ended ? routeCoords[routeLength - 1] : routeCoords[0];
/** @type {ol.geom.Point} */ (geoMarker.getGeometry())
.setCoordinates(coord);
.setCoordinates(coord);
//remove listener
map.un('postcompose', moveFeature);
}

View File

@@ -17,18 +17,30 @@ var replacer = function(key, value) {
var geometry = value.geometry;
if (rawType === 1) {
type = geometry.length === 1 ? 'Point' : 'MultiPoint';
type = 'MultiPoint';
if (geometry.length == 1) {
type = 'Point';
geometry = geometry[0];
}
} else if (rawType === 2) {
type = geometry.length === 1 ? 'LineString' : 'MultiLineString';
type = 'MultiLineString';
if (geometry.length == 1) {
type = 'LineString';
geometry = geometry[0];
}
} else if (rawType === 3) {
type = geometry.length === 1 ? 'Polygon' : 'MultiPolygon';
type = 'Polygon';
if (geometry.length > 1) {
type = 'MultiPolygon';
geometry = [geometry];
}
}
return {
'type': 'Feature',
'geometry': {
'type': type,
'coordinates': geometry.length == 1 ? geometry : [geometry]
'coordinates': geometry
},
'properties': value.tags
};
@@ -66,17 +78,16 @@ fetch(url).then(function(response) {
var vectorSource = new ol.source.VectorTile({
format: new ol.format.GeoJSON(),
tileGrid: ol.tilegrid.createXYZ(),
tilePixelRatio: 16,
tileLoadFunction: function(tile) {
var format = tile.getFormat();
var tileCoord = tile.getTileCoord();
var data = tileIndex.getTile(tileCoord[0], tileCoord[1], -tileCoord[2] - 1);
var features = format.readFeatures(
JSON.stringify({
type: 'FeatureCollection',
features: data ? data.features : []
}, replacer));
JSON.stringify({
type: 'FeatureCollection',
features: data ? data.features : []
}, replacer));
tile.setLoader(function() {
tile.setFeatures(features);
tile.setProjection(tilePixels);

View File

@@ -83,7 +83,7 @@ positionFeature.setStyle(new ol.style.Style({
geolocation.on('change:position', function() {
var coordinates = geolocation.getPosition();
positionFeature.setGeometry(coordinates ?
new ol.geom.Point(coordinates) : null);
new ol.geom.Point(coordinates) : null);
});
new ol.layer.Vector({

View File

@@ -6,7 +6,7 @@ goog.require('ol.source.TileWMS');
var wmsSource = new ol.source.TileWMS({
url: 'https://ahocevar.com/geoserver/wms',
params: {'LAYERS': 'ne:ne'},
params: {'LAYERS': 'ne:ne', 'TILED': true},
serverType: 'geoserver',
crossOrigin: 'anonymous'
});

View File

@@ -27,6 +27,8 @@ var graticule = new ol.Graticule({
color: 'rgba(255,120,0,0.9)',
width: 2,
lineDash: [0.5, 4]
})
}),
showLabels: true
});
graticule.setMap(map);

View File

@@ -81,11 +81,11 @@ var map = new ol.Map({
function createUrl(tpl, layerDesc) {
return tpl
.replace('{base}', layerDesc.base)
.replace('{type}', layerDesc.type)
.replace('{scheme}', layerDesc.scheme)
.replace('{app_id}', layerDesc.app_id)
.replace('{app_code}', layerDesc.app_code);
.replace('{base}', layerDesc.base)
.replace('{type}', layerDesc.type)
.replace('{scheme}', layerDesc.scheme)
.replace('{app_id}', layerDesc.app_id)
.replace('{app_code}', layerDesc.app_code);
}
var select = document.getElementById('layer-select');

View File

@@ -26,6 +26,7 @@ var madrid = new ol.Feature({
rome.setStyle(new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
color: '#8959A8',
crossOrigin: 'anonymous',
src: 'data/dot.png'
}))
}));
@@ -33,6 +34,7 @@ rome.setStyle(new ol.style.Style({
london.setStyle(new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
color: '#4271AE',
crossOrigin: 'anonymous',
src: 'data/dot.png'
}))
}));
@@ -40,6 +42,7 @@ london.setStyle(new ol.style.Style({
madrid.setStyle(new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
color: [113, 140, 0],
crossOrigin: 'anonymous',
src: 'data/dot.png'
}))
}));

View File

@@ -15,6 +15,7 @@ function createStyle(src, img) {
return new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 0.96],
crossOrigin: 'anonymous',
src: src,
img: img,
imgSize: img ? [img.width, img.height] : undefined

View File

@@ -51,6 +51,7 @@ for (i = 0; i < iconCount; ++i) {
rotation: info.rotation,
scale: info.scale,
size: info.size,
crossOrigin: 'anonymous',
src: 'data/Butterfly.png'
});
}

View File

@@ -3,7 +3,7 @@ layout: example.html
title: Advanced Mapbox Vector Tiles
shortdesc: Example of a Mapbox vector tiles map with custom tile grid.
docs: >
A vector tiles map which reuses the same tiles for subsequent zoom levels to save bandwith on mobile devices. **Note**: No map will be visible when the access token has expired.
A vector tiles map which reuses the same source tiles for subsequent zoom levels to save bandwidth on mobile devices. **Note**: No map will be visible when the access token has expired.
tags: "mapbox, vector, tiles, mobile"
resources:
- resources/mapbox-streets-v6-style.js

View File

@@ -15,25 +15,16 @@ goog.require('ol.tilegrid.TileGrid');
var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
// For how many zoom levels do we want to use the same vector tiles?
// 1 means "use tiles from all zoom levels". 2 means "use the same tiles for 2
// subsequent zoom levels".
var reuseZoomLevels = 2;
// Offset of loaded tiles from web mercator zoom level 0.
// 0 means "At map zoom level 0, use tiles from zoom level 0". 1 means "At map
// zoom level 0, use tiles from zoom level 1".
var zoomOffset = 1;
// Calculation of tile urls
// Calculation of resolutions that match zoom levels 1, 3, 5, 7, 9, 11, 13, 15.
var resolutions = [];
for (var z = zoomOffset / reuseZoomLevels; z <= 22 / reuseZoomLevels; ++z) {
resolutions.push(156543.03392804097 / Math.pow(2, z * reuseZoomLevels));
for (var i = 0; i <= 8; ++i) {
resolutions.push(156543.03392804097 / Math.pow(2, i * 2));
}
// Calculation of tile urls for zoom levels 1, 3, 5, 7, 9, 11, 13, 15.
function tileUrlFunction(tileCoord) {
return ('https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
'{z}/{x}/{y}.vector.pbf?access_token=' + key)
.replace('{z}', String(tileCoord[0] * reuseZoomLevels + zoomOffset))
.replace('{z}', String(tileCoord[0] * 2 - 1))
.replace('{x}', String(tileCoord[1]))
.replace('{y}', String(-tileCoord[2] - 1))
.replace('{a-d}', 'abcd'.substr(
@@ -43,8 +34,6 @@ function tileUrlFunction(tileCoord) {
var map = new ol.Map({
layers: [
new ol.layer.VectorTile({
renderMode: 'vector',
preload: Infinity,
source: new ol.source.VectorTile({
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
'© <a href="https://www.openstreetmap.org/copyright">' +
@@ -52,9 +41,9 @@ var map = new ol.Map({
format: new ol.format.MVT(),
tileGrid: new ol.tilegrid.TileGrid({
extent: ol.proj.get('EPSG:3857').getExtent(),
resolutions: resolutions
resolutions: resolutions,
tileSize: 512
}),
tilePixelRatio: 16,
tileUrlFunction: tileUrlFunction
}),
style: createMapboxStreetsV6Style()

View File

@@ -23,8 +23,7 @@ var map = new ol.Map({
'© <a href="https://www.openstreetmap.org/copyright">' +
'OpenStreetMap contributors</a>',
format: new ol.format.MVT(),
tileGrid: ol.tilegrid.createXYZ({maxZoom: 22}),
tilePixelRatio: 16,
tileGrid: ol.tilegrid.createXYZ({tileSize: 512, maxZoom: 22}),
url: 'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
'{z}/{x}/{y}.vector.pbf?access_token=' + key
}),

12
examples/min-zoom.html Normal file
View File

@@ -0,0 +1,12 @@
---
layout: example.html
title: View Min-Zoom
shortdesc: Demonstrates how the view's minimum zoom level can be changed.
docs: >
The <code>minZoom</code> option for a view limits how far out you can
zoom. This property can be updated by calling <code>view.setMinZoom(newMinZoom)</code>.
In this example, the minimum zoom level is set so that you only see one
world at a time. Resize your browser window to change the threshold.
tags: "min, zoom"
---
<div id="map" class="map"></div>

36
examples/min-zoom.js Normal file
View File

@@ -0,0 +1,36 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
var viewport = document.getElementById('map');
function getMinZoom() {
var width = viewport.clientWidth;
return Math.ceil(Math.LOG2E * Math.log(width / 256));
}
var initialZoom = getMinZoom();
var view = new ol.View({
center: [0, 0],
minZoom: initialZoom,
zoom: initialZoom
});
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
target: 'map',
view: view
});
window.addEventListener('resize', function() {
var minZoom = getMinZoom();
if (minZoom !== view.getMinZoom()) {
view.setMinZoom(minZoom);
}
});

View File

@@ -96,8 +96,8 @@ var geojsonObject = {
'geometry': {
'type': 'Polygon',
'coordinates': [[[-5e6, -1e6], [-4e6, 1e6],
[-3e6, -1e6], [-5e6, -1e6]], [[-4.5e6, -0.5e6],
[-3.5e6, -0.5e6], [-4e6, 0.5e6], [-4.5e6, -0.5e6]]]
[-3e6, -1e6], [-5e6, -1e6]], [[-4.5e6, -0.5e6],
[-3.5e6, -0.5e6], [-4e6, 0.5e6], [-4.5e6, -0.5e6]]]
}
}, {
'type': 'Feature',
@@ -117,11 +117,11 @@ var geojsonObject = {
'type': 'MultiPolygon',
'coordinates': [
[[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6],
[-3e6, 6e6], [-5e6, 6e6]]],
[-3e6, 6e6], [-5e6, 6e6]]],
[[[-3e6, 6e6], [-2e6, 8e6], [0, 8e6],
[0, 6e6], [-3e6, 6e6]]],
[0, 6e6], [-3e6, 6e6]]],
[[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6],
[3e6, 6e6], [1e6, 6e6]]]
[3e6, 6e6], [1e6, 6e6]]]
]
}
}, {
@@ -222,7 +222,13 @@ var select = new ol.interaction.Select({
var modify = new ol.interaction.Modify({
features: select.getFeatures(),
style: overlayStyle
style: overlayStyle,
insertVertexCondition: function() {
// prevent new vertices to be added to the polygons
return !this.features_.getArray().every(function(feature) {
return feature.getGeometry().getType().match(/Polygon/);
});
}
});
var map = new ol.Map({

View File

@@ -4,7 +4,6 @@ goog.require('ol.control');
goog.require('ol.control.MousePosition');
goog.require('ol.coordinate');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
var mousePositionControl = new ol.control.MousePosition({
@@ -37,7 +36,7 @@ var map = new ol.Map({
var projectionSelect = document.getElementById('projection');
projectionSelect.addEventListener('change', function(event) {
mousePositionControl.setProjection(ol.proj.get(event.target.value));
mousePositionControl.setProjection(event.target.value);
});
var precisionInput = document.getElementById('precision');

View File

@@ -0,0 +1,12 @@
---
layout: example.html
title: Mousewheel/Trackpad Zoom
shortdesc: Restrict wheel/trackpad zooming to integer zoom levels.
docs: >
By default, the `ol.interaction.MouseWheelZoom` can leave the map at
fractional zoom levels. If instead you want to constrain wheel/trackpad
zooming to integer zoom levels, set <code>constrainResolution: true</code>
when constructing the interaction.
tags: "trackpad, mousewheel, zoom, interaction"
---
<div id="map" class="map"></div>

View File

@@ -0,0 +1,25 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.interaction');
goog.require('ol.interaction.MouseWheelZoom');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
var map = new ol.Map({
interactions: ol.interaction.defaults({mouseWheelZoom: false}).extend([
new ol.interaction.MouseWheelZoom({
constrainResolution: true // force zooming to a integer zoom
})
]),
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 2
})
});

View File

@@ -3,7 +3,7 @@ layout: example.html
title: OSM Vector Tiles
shortdesc: Using OpenStreetMap vector tiles.
docs: >
A simple vector tiles map with Mapzen vector tiles. **Note**: TopoJSON vector tiles are not optimized for rendering - they might clip geometries exactly at the tile boundary instead of adding a buffer, and use geographic coordinates instead of tile relative pixel coordinates in view projection.
A simple vector tiles map with Mapzen vector tiles. This example uses the TopoJSON format's `layerName` option to determine the layer ("water", "roads", "buildings") for styling. **Note**: [`ol.format.MVT`](../apidoc/ol.format.MVT.html) is an even more efficient format for vector tiles.
tags: "vector, tiles, osm, mapzen"
cloak:
vector-tiles-5eJz6JX: Your Mapzen API key from https://mapzen.com/developers

View File

@@ -1,4 +1,3 @@
goog.require('ol.Attribution');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.TopoJSON');
@@ -13,11 +12,6 @@ goog.require('ol.tilegrid');
var key = 'vector-tiles-5eJz6JX';
var attribution = [new ol.Attribution({
html: '&copy; OpenStreetMap contributors, Whos On First, Natural Earth, and openstreetmapdata.com'
})];
var format = new ol.format.TopoJSON();
var tileGrid = ol.tilegrid.createXYZ({maxZoom: 19});
var roadStyleCache = {};
var roadColor = {
'major_road': '#776',
@@ -34,65 +28,58 @@ var buildingStyle = new ol.style.Style({
width: 1
})
});
var waterStyle = new ol.style.Style({
fill: new ol.style.Fill({
color: '#9db9e8'
})
});
var roadStyle = function(feature) {
var kind = feature.get('kind');
var railway = feature.get('railway');
var sort_key = feature.get('sort_key');
var styleKey = kind + '/' + railway + '/' + sort_key;
var style = roadStyleCache[styleKey];
if (!style) {
var color, width;
if (railway) {
color = '#7de';
width = 1;
} else {
color = roadColor[kind];
width = kind == 'highway' ? 1.5 : 1;
}
style = new ol.style.Style({
stroke: new ol.style.Stroke({
color: color,
width: width
}),
zIndex: sort_key
});
roadStyleCache[styleKey] = style;
}
return style;
};
var map = new ol.Map({
layers: [
new ol.layer.VectorTile({
source: new ol.source.VectorTile({
attributions: attribution,
format: format,
tileGrid: tileGrid,
url: 'https://tile.mapzen.com/mapzen/vector/v1/water/{z}/{x}/{y}.topojson?api_key=' + key
attributions: '&copy; OpenStreetMap contributors, Whos On First, ' +
'Natural Earth, and openstreetmapdata.com',
format: new ol.format.TopoJSON({
layerName: 'layer',
layers: ['water', 'roads', 'buildings']
}),
tileGrid: ol.tilegrid.createXYZ({tileSize: 512, maxZoom: 19}),
url: 'https://tile.mapzen.com/mapzen/vector/v1/all/{z}/{x}/{y}.topojson?api_key=' + key
}),
style: new ol.style.Style({
fill: new ol.style.Fill({
color: '#9db9e8'
})
})
}),
new ol.layer.VectorTile({
source: new ol.source.VectorTile({
attributions: attribution,
format: format,
tileGrid: tileGrid,
url: 'https://tile.mapzen.com/mapzen/vector/v1/roads/{z}/{x}/{y}.topojson?api_key=' + key
}),
style: function(feature) {
var kind = feature.get('kind');
var railway = feature.get('railway');
var sort_key = feature.get('sort_key');
var styleKey = kind + '/' + railway + '/' + sort_key;
var style = roadStyleCache[styleKey];
if (!style) {
var color, width;
if (railway) {
color = '#7de';
width = 1;
} else {
color = roadColor[kind];
width = kind == 'highway' ? 1.5 : 1;
}
style = new ol.style.Style({
stroke: new ol.style.Stroke({
color: color,
width: width
}),
zIndex: sort_key
});
roadStyleCache[styleKey] = style;
style: function(feature, resolution) {
switch (feature.get('layer')) {
case 'water': return waterStyle;
case 'roads': return roadStyle(feature);
case 'buildings': return (resolution < 10) ? buildingStyle : null;
default: return null;
}
return style;
}
}),
new ol.layer.VectorTile({
source: new ol.source.VectorTile({
attributions: attribution,
format: format,
tileGrid: tileGrid,
url: 'https://tile.mapzen.com/mapzen/vector/v1/buildings/{z}/{x}/{y}.topojson?api_key=' + key
}),
style: function(f, resolution) {
return (resolution < 10) ? buildingStyle : null;
}
})
],

View File

@@ -54,28 +54,28 @@ var geojsonObject = {
'geometry': {
'type': 'Polygon',
'coordinates': [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6],
[-3e6, 6e6], [-5e6, 6e6]]]
[-3e6, 6e6], [-5e6, 6e6]]]
}
}, {
'type': 'Feature',
'geometry': {
'type': 'Polygon',
'coordinates': [[[-2e6, 6e6], [-2e6, 8e6], [0, 8e6],
[0, 6e6], [-2e6, 6e6]]]
[0, 6e6], [-2e6, 6e6]]]
}
}, {
'type': 'Feature',
'geometry': {
'type': 'Polygon',
'coordinates': [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6],
[3e6, 6e6], [1e6, 6e6]]]
[3e6, 6e6], [1e6, 6e6]]]
}
}, {
'type': 'Feature',
'geometry': {
'type': 'Polygon',
'coordinates': [[[-2e6, -1e6], [-1e6, 1e6],
[0, -1e6], [-2e6, -1e6]]]
[0, -1e6], [-2e6, -1e6]]]
}
}]
};

View File

@@ -162,13 +162,13 @@ function plot(resolution, counts, threshold) {
var value = counts.min + (index * counts.delta);
return 'bar' + (value >= threshold ? ' selected' : '');
})
.attr('width', barWidth - 2);
.attr('width', barWidth - 2);
bar.transition().attr('transform', function(value, index) {
return 'translate(' + (index * barWidth) + ', ' +
(plotHeight - yScale(value)) + ')';
})
.attr('height', yScale);
.attr('height', yScale);
bar.on('mousemove', function(count, index) {
var threshold = counts.min + (index * counts.delta);

View File

@@ -8,7 +8,7 @@ docs: >
in <a href="https://epsg.io/">EPSG.io</a> database.
tags: "reprojection, projection, proj4js, epsg.io"
resources:
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.3/proj4.js
---
<div id="map" class="map"></div>
<form class="form-inline">

View File

@@ -6,6 +6,6 @@ docs: >
This example shows client-side reprojection of single image source.
tags: "reprojection, projection, proj4js, image, imagestatic"
resources:
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.3/proj4.js
---
<div id="map" class="map"></div>

View File

@@ -6,7 +6,7 @@ docs: >
This example shows client-side raster reprojection between various projections.
tags: "reprojection, projection, proj4js, osm, wms, wmts, hidpi"
resources:
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.3/proj4.js
---
<div id="map" class="map"></div>
<form class="form-inline">

View File

@@ -72,7 +72,8 @@ layers['wms4326'] = new ol.layer.Tile({
url: 'https://ahocevar.com/geoserver/wms',
crossOrigin: '',
params: {
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR',
'TILED': true
},
projection: 'EPSG:4326'
})
@@ -99,13 +100,15 @@ fetch(url).then(function(response) {
return response.text();
}).then(function(text) {
var result = parser.read(text);
var options = ol.source.WMTS.optionsFromCapabilities(result,
{layer: 'OSM_Land_Mask', matrixSet: 'EPSG3413_250m'});
var options = ol.source.WMTS.optionsFromCapabilities(result, {
layer: 'OSM_Land_Mask',
matrixSet: 'EPSG3413_250m'
});
options.crossOrigin = '';
options.projection = 'EPSG:3413';
options.wrapX = false;
layers['wmts3413'] = new ol.layer.Tile({
source: new ol.source.WMTS(options)
source: new ol.source.WMTS(/** @type {!olx.source.WMTSOptions} */ (options))
});
});
@@ -131,7 +134,7 @@ layers['states'] = new ol.layer.Tile({
source: new ol.source.TileWMS({
url: 'https://ahocevar.com/geoserver/wms',
crossOrigin: '',
params: {'LAYERS': 'topp:states', 'TILED': true},
params: {'LAYERS': 'topp:states'},
serverType: 'geoserver',
tileGrid: new ol.tilegrid.TileGrid({
extent: [-13884991, 2870341, -7455066, 6338219],
@@ -174,7 +177,7 @@ function updateViewProjection() {
});
map.setView(newView);
// Example how to prevent double occurence of map by limiting layer extent
// Example how to prevent double occurrence of map by limiting layer extent
if (newProj == ol.proj.get('EPSG:3857')) {
layers['bng'].setExtent([-1057216, 6405988, 404315, 8759696]);
} else {

View File

@@ -18,7 +18,7 @@ var map = new ol.Map({
})
}),
view: new ol.View({
center: [-25860000, 4130000],
center: [14200000, 4130000],
rotation: Math.PI / 6,
zoom: 10
})

View File

@@ -6,6 +6,6 @@ docs: >
This example shows client-side reprojection of OpenStreetMap to NAD83 Indiana East, including a ScaleLine control with US units.
tags: "reprojection, projection, openstreetmap, nad83, tile, scaleline"
resources:
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.3/proj4.js
---
<div id="map" class="map"></div>

View File

@@ -29,6 +29,7 @@ tags: "draw, edit, modify, vector, snap"
<option value="Point">Point</option>
<option value="LineString">LineString</option>
<option value="Polygon">Polygon</option>
<option value="Circle">Circle</option>
</select>
</div>
</form>

View File

@@ -81,6 +81,8 @@ var Draw = {
this.LineString.setActive(false);
map.addInteraction(this.Polygon);
this.Polygon.setActive(false);
map.addInteraction(this.Circle);
this.Circle.setActive(false);
},
Point: new ol.interaction.Draw({
source: vector.getSource(),
@@ -94,6 +96,10 @@ var Draw = {
source: vector.getSource(),
type: /** @type {ol.geom.GeometryType} */ ('Polygon')
}),
Circle: new ol.interaction.Draw({
source: vector.getSource(),
type: /** @type {ol.geom.GeometryType} */ ('Circle')
}),
getActive: function() {
return this.activeType ? this[this.activeType].getActive() : false;
},

View File

@@ -6,6 +6,6 @@ docs: >
Example of a Sphere Mollweide map with a Graticule component.
tags: "graticule, Mollweide, projection, proj4js"
resources:
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.3/proj4.js
---
<div id="map" class="map"></div>

View File

@@ -0,0 +1,17 @@
---
layout: example.html
title: Street Labels
shortdesc: Render street names with a custom render.
docs: >
Example showing the use of a custom renderer to render text along a path. [Labelgun](https://github.com/Geovation/labelgun) is used to avoid label collisions. [label-segment](https://github.com/ahocevar/label-segment) makes sure that labels are placed on suitable street segments. [textpath](https://github.com/ahocevar/textpath) arranges the letters of a label along the geometry. The data is fetched from OSM using the [Overpass API](https://overpass-api.de).
tags: "vector, label, collision detection, labelgun, linelabel, overpass"
resources:
- https://cdn.polyfill.io/v2/polyfill.min.js?features=Set"
- https://unpkg.com/rbush@2.0.1/rbush.min.js
- https://unpkg.com/labelgun@0.1.1/lib/labelgun.min.js
- https://unpkg.com/textpath@1.0.1/dist/textpath.js
- https://unpkg.com/label-segment@1.0.0/dist/label-segment.js
cloak:
As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5: Your Bing Maps Key from http://www.bingmapsportal.com/ here
---
<div id="map" class="map"></div>

115
examples/street-labels.js Normal file
View File

@@ -0,0 +1,115 @@
// NOCOMPILE
/* global labelgun, labelSegment, textPath */
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.extent');
goog.require('ol.format.OSMXML');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.BingMaps');
goog.require('ol.source.Vector');
goog.require('ol.style.Style');
var emptyFn = function() {};
var labelEngine = new labelgun['default'](emptyFn, emptyFn);
var context, pixelRatio; // Will be set in the map's postcompose listener
function measureText(text) {
return context.measureText(text).width * pixelRatio;
}
var extent, letters; // Will be set in the style's renderer function
function collectDrawData(letter, x, y, angle) {
ol.extent.extend(extent, [x, y, x, y]);
letters.push([x, y, angle, letter]);
}
var style = new ol.style.Style({
renderer: function(coords, context) {
var feature = context.feature;
var text = feature.get('name');
// Only create label when geometry has a long and straight segment
var path = labelSegment(coords, Math.PI / 8, measureText(text));
if (path) {
extent = ol.extent.createEmpty();
letters = [];
textPath(text, path, measureText, collectDrawData);
ol.extent.buffer(extent, 5 * pixelRatio, extent);
var bounds = {
bottomLeft: ol.extent.getBottomLeft(extent),
topRight: ol.extent.getTopRight(extent)
};
labelEngine.ingestLabel(bounds, feature.getId(), 1, letters, text, false);
}
}
});
var rasterLayer = new ol.layer.Tile({
source: new ol.source.BingMaps({
key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial'
})
});
var source = new ol.source.Vector();
// Request streets from OSM, using the Overpass API
fetch('https://overpass-api.de/api/interpreter', {
method: 'POST',
body: '(way["highway"](48.19642,16.32580,48.22050,16.41986));(._;>;);out meta;'
}).then(function(response) {
return response.text();
}).then(function(responseText) {
var features = new ol.format.OSMXML().readFeatures(responseText, {
featureProjection: 'EPSG:3857'
});
source.addFeatures(features);
});
var vectorLayer = new ol.layer.Vector({
source: source,
style: function(feature) {
if (feature.getGeometry().getType() == 'LineString' && feature.get('name')) {
return style;
}
}
});
var viewExtent = [1817379, 6139595, 1827851, 6143616];
var map = new ol.Map({
layers: [rasterLayer, vectorLayer],
target: 'map',
view: new ol.View({
extent: viewExtent,
center: ol.extent.getCenter(viewExtent),
zoom: 17,
minZoom: 14
})
});
vectorLayer.on('precompose', function() {
labelEngine.destroy();
});
vectorLayer.on('postcompose', function(e) {
context = e.context;
pixelRatio = e.frameState.pixelRatio;
context.save();
context.font = 'normal 11px "Open Sans", "Arial Unicode MS"';
context.fillStyle = 'white';
context.textBaseline = 'middle';
context.textAlign = 'center';
var labels = labelEngine.getShown();
for (var i = 0, ii = labels.length; i < ii; ++i) {
// Render label letter by letter
var letters = labels[i].labelObject;
for (var j = 0, jj = letters.length; j < jj; ++j) {
var labelData = letters[j];
context.save();
context.translate(labelData[0], labelData[1]);
context.rotate(labelData[2]);
context.scale(pixelRatio, pixelRatio);
context.fillText(labelData[3], 0, 0);
context.restore();
}
}
context.restore();
});

View File

@@ -3,7 +3,7 @@ layout: example.html
title: Tissot Indicatrix
shortdesc: Draw Tissot's indicatrices on maps.
docs: >
Example of [Tissot indicatrix](http://en.wikipedia.org/wiki/Tissot's_indicatrix)</a> maps. The map on the left is an EPSG:4326 map. The one on the right is EPSG:3857.
Example of [Tissot indicatrix](http://en.wikipedia.org/wiki/Tissot's_indicatrix) maps. The map on the top is an `EPSG:4326` map. The one on the bottom is `EPSG:3857`.
tags: "tissot, circle"
---
<h4>EPSG:4326</h4>

View File

@@ -22,7 +22,8 @@ var map4326 = new ol.Map({
source: new ol.source.TileWMS({
url: 'https://ahocevar.com/geoserver/wms',
params: {
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR',
'TILED': true
}
})
}),
@@ -42,7 +43,8 @@ var map3857 = new ol.Map({
source: new ol.source.TileWMS({
url: 'https://ahocevar.com/geoserver/wms',
params: {
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR',
'TILED': true
}
})
}),

View File

@@ -29,13 +29,14 @@ var style = new ol.style.Style({
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
url: 'data/topojson/world-110m.json',
format: new ol.format.TopoJSON(),
format: new ol.format.TopoJSON({
// don't want to render the full world polygon (stored as 'land' layer),
// which repeats all countries
layers: ['countries']
}),
overlaps: false
}),
style: function(feature) {
// don't want to render the full world polygon, which repeats all countries
return feature.getId() !== undefined ? style : null;
}
style: style
});
var map = new ol.Map({

View File

@@ -0,0 +1,13 @@
---
layout: example.html
title: Vector Label Decluttering
shortdesc: Label decluttering with a custom renderer.
resources:
- https://cdn.polyfill.io/v2/polyfill.min.js?features=Set"
- https://unpkg.com/rbush@2.0.1/rbush.min.js
- https://unpkg.com/labelgun@0.1.1/lib/labelgun.min.js
docs: >
A custom `renderer` function is used instead of an `ol.style.Text` to label the countries of the world. Only texts that are not wider than their country's bounding box are considered and handed over to [Labelgun](https://github.com/Geovation/labelgun) for decluttering.
tags: "vector, renderer, labelgun, label"
---
<div id="map" class="map"></div>

View File

@@ -0,0 +1,125 @@
// NOCOMPILE
/* global labelgun */
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.extent');
goog.require('ol.format.GeoJSON');
goog.require('ol.layer.Vector');
goog.require('ol.source.Vector');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
// Style for labels
function setStyle(context) {
context.font = '12px Calibri,sans-serif';
context.fillStyle = '#000';
context.strokeStyle = '#fff';
context.lineWidth = 3;
context.textBaseline = 'hanging';
context.textAlign = 'start';
}
// A separate canvas context for measuring label width and height.
var textMeasureContext = document.createElement('CANVAS').getContext('2d');
setStyle(textMeasureContext);
// The label height is approximated by the width of the text 'WI'.
var height = textMeasureContext.measureText('WI').width;
// A cache for reusing label images once they have been created.
var textCache = {};
var map = new ol.Map({
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 1
})
});
var emptyFn = function() {};
var labelEngine = new labelgun['default'](emptyFn, emptyFn);
function createLabel(canvas, text, coord) {
var halfWidth = canvas.width / 2;
var halfHeight = canvas.height / 2;
var bounds = {
bottomLeft: [Math.round(coord[0] - halfWidth), Math.round(coord[1] - halfHeight)],
topRight: [Math.round(coord[0] + halfWidth), Math.round(coord[1] + halfHeight)]
};
labelEngine.ingestLabel(bounds, coord.toString(), 1, canvas, text, false);
}
// For multi-polygons, we only label the widest polygon. This is done by sorting
// by extent width in descending order, and take the first from the array.
function sortByWidth(a, b) {
return ol.extent.getWidth(b.getExtent()) - ol.extent.getWidth(a.getExtent());
}
var labelStyle = new ol.style.Style({
renderer: function(coords, state) {
var text = state.feature.get('name');
createLabel(textCache[text], text, coords);
}
});
var countryStyle = new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.6)'
}),
stroke: new ol.style.Stroke({
color: '#319FD3',
width: 1
})
});
var styleWithLabel = [countryStyle, labelStyle];
var styleWithoutLabel = [countryStyle];
var pixelRatio; // This is set by the map's precompose listener
var vectorLayer = new ol.layer.Vector({
source: new ol.source.Vector({
url: 'data/geojson/countries.geojson',
format: new ol.format.GeoJSON()
}),
style: function(feature, resolution) {
var text = feature.get('name');
var width = textMeasureContext.measureText(text).width;
var geometry = feature.getGeometry();
if (geometry.getType() == 'MultiPolygon') {
geometry = geometry.getPolygons().sort(sortByWidth)[0];
}
var extentWidth = ol.extent.getWidth(geometry.getExtent());
if (extentWidth / resolution > width) {
// Only consider label when it fits its geometry's extent
if (!(text in textCache)) {
// Draw the label to its own canvas and cache it.
var canvas = textCache[text] = document.createElement('CANVAS');
canvas.width = width * pixelRatio;
canvas.height = height * pixelRatio;
var context = canvas.getContext('2d');
context.scale(pixelRatio, pixelRatio);
setStyle(context);
context.strokeText(text, 0, 0);
context.fillText(text, 0, 0);
}
labelStyle.setGeometry(geometry.getInteriorPoint());
return styleWithLabel;
} else {
return styleWithoutLabel;
}
}
});
vectorLayer.on('precompose', function(e) {
pixelRatio = e.frameState.pixelRatio;
labelEngine.destroy();
});
vectorLayer.on('postcompose', function(e) {
var labels = labelEngine.getShown();
for (var i = 0, ii = labels.length; i < ii; ++i) {
var label = labels[i];
// Draw label to the map canvas
e.context.drawImage(label.labelObject, label.minX, label.minY);
}
});
map.addLayer(vectorLayer);

View File

@@ -47,8 +47,8 @@ var featureRequest = new ol.format.WFS().writeGetFeature({
featureTypes: ['water_areas'],
outputFormat: 'application/json',
filter: ol.format.filter.and(
ol.format.filter.like('name', 'Mississippi*'),
ol.format.filter.equalTo('waterway', 'riverbank')
ol.format.filter.like('name', 'Mississippi*'),
ol.format.filter.equalTo('waterway', 'riverbank')
)
});

View File

@@ -6,7 +6,7 @@ docs: >
With [Proj4js](http://proj4js.org/) integration, OpenLayers can transform coordinates between arbitrary projections.
tags: "wms, single image, proj4js, projection"
resources:
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.3/proj4.js
- https://epsg.io/21781-1753.js
---
<div id="map" class="map"></div>

View File

@@ -15,6 +15,7 @@ var layers = [
source: new ol.source.ImageWMS({
url: 'https://ahocevar.com/geoserver/wms',
params: {'LAYERS': 'topp:states'},
ratio: 1,
serverType: 'geoserver'
})
})

View File

@@ -3,7 +3,7 @@ layout: example.html
title: WMS Time
shortdesc: Example of smooth tile transitions when changing the time dimension of a tiled WMS layer.
docs: >
Demonstrates smooth reloading of layers when changing the time dimension continously. Data shown: IEM generated CONUS composite of NWS NEXRAD WSR-88D level III base reflectivity.
Demonstrates smooth reloading of layers when changing the time dimension continuously. Data shown: IEM generated CONUS composite of NWS NEXRAD WSR-88D level III base reflectivity.
tags: "wms, time, dimensions, transition, nexrad"
---
<div id="map" class="map"></div>

View File

@@ -3,7 +3,7 @@ layout: example.html
title: WMTS Tile Transitions
shortdesc: Example of smooth tile transitions when changing the dimension of a WMTS layer.
docs: >
Demonstrates smooth reloading of layers when changing a dimension continously. The demonstration layer is a global sea-level computation (flooding computation from <a href="http://scalgo.com">SCALGO</a>, underlying data from <a href="http://www.cgiar-csi.org/data/srtm-90m-digital-elevation-database-v4-1">CGIAR-CSI SRTM</a>) where cells that are flooded if the sea-level rises to more than <em>x</em> m are colored blue. The user selects the sea-level dimension using a slider.
Demonstrates smooth reloading of layers when changing a dimension continuously. The demonstration layer is a global sea-level computation (flooding computation from <a href="http://scalgo.com">SCALGO</a>, underlying data from <a href="http://www.cgiar-csi.org/data/srtm-90m-digital-elevation-database-v4-1">CGIAR-CSI SRTM</a>) where cells that are flooded if the sea-level rises to more than <em>x</em> m are colored blue. The user selects the sea-level dimension using a slider.
tags: "wmts, parameter, transition"
---
<div id="map" class="map"></div>

View File

@@ -34,6 +34,6 @@ fetch(capabilitiesUrl).then(function(response) {
});
options.tilePixelRatio = tilePixelRatio;
map.addLayer(new ol.layer.Tile({
source: new ol.source.WMTS(options)
source: new ol.source.WMTS(/** @type {!olx.source.WMTSOptions} */ (options))
}));
});

View File

@@ -5,10 +5,10 @@ shortdesc: Demonstrates displaying IGN (France) WMTS layers.
docs: >
In this example an IGN WMTS layer is displayed.
For more information on IGN's WMTS service see the
<a href="http://professionnels.ign.fr/api-sig">IGN Géoportail API web page
</a> and
<a href="http://www.geoportail.gouv.fr/depot/api/cgu/DT_APIGeoportail.pdf">
Descriptif technique des web services du Géoportail</a> (french).
[IGN Géoportail API web page](http://api.ign.fr/accueil)
and
[Descriptif technique des web services du Géoportail](http://www.geoportail.gouv.fr/depot/api/cgu/DT_APIGeoportail.pdf)
(french).
tags: "french, ign, geoportail, wmts"
---
<div id="map" class="map"></div>

View File

@@ -12,8 +12,10 @@ fetch('data/WMTSCapabilities.xml').then(function(response) {
return response.text();
}).then(function(text) {
var result = parser.read(text);
var options = ol.source.WMTS.optionsFromCapabilities(result,
{layer: 'layer-7328', matrixSet: 'EPSG:3857'});
var options = ol.source.WMTS.optionsFromCapabilities(result, {
layer: 'layer-7328',
matrixSet: 'EPSG:3857'
});
map = new ol.Map({
layers: [
@@ -23,7 +25,7 @@ fetch('data/WMTSCapabilities.xml').then(function(response) {
}),
new ol.layer.Tile({
opacity: 1,
source: new ol.source.WMTS(options)
source: new ol.source.WMTS(/** @type {!olx.source.WMTSOptions} */ (options))
})
],
target: 'map',

View File

@@ -28,8 +28,8 @@ var map = new ol.Map({
tileSize: tileSize,
tileUrlFunction: function(tileCoord) {
return urlTemplate.replace('{z}', (tileCoord[0] - 1).toString())
.replace('{x}', tileCoord[1].toString())
.replace('{y}', (-tileCoord[2] - 1).toString());
.replace('{x}', tileCoord[1].toString())
.replace('{y}', (-tileCoord[2] - 1).toString());
},
wrapX: true
})

View File

@@ -91,6 +91,17 @@ oli.DrawEvent = function() {};
oli.DrawEvent.prototype.feature;
/**
* @interface
*/
oli.ExtentEvent = function() {};
/**
* @type {ol.Extent}
*/
oli.ExtentEvent.prototype.extent;
/**
* @interface
*/

View File

@@ -8,6 +8,21 @@ var olx;
/* typedefs for object literals provided by applications */
/**
* @typedef {{unique: (boolean|undefined)}}
*/
olx.CollectionOptions;
/**
* Disallow the same item from being added to the collection twice. Default is
* false.
* @type {boolean|undefined}
* @api
*/
olx.CollectionOptions.prototype.unique;
/**
* @typedef {{html: string,
* tileRanges: (Object.<string, Array.<ol.TileRange>>|undefined)}}
@@ -97,7 +112,14 @@ olx.LogoOptions.prototype.src;
* @typedef {{map: (ol.Map|undefined),
* maxLines: (number|undefined),
* strokeStyle: (ol.style.Stroke|undefined),
* targetSize: (number|undefined)}}
* targetSize: (number|undefined),
* showLabels: (boolean|undefined),
* lonLabelFormatter: (undefined|function(number):string),
* latLabelFormatter: (undefined|function(number):string),
* lonLabelPosition: (number|undefined),
* latLabelPosition: (number|undefined),
* lonLabelStyle: (ol.style.Text|undefined),
* latLabelStyle: (ol.style.Text|undefined)}}
*/
olx.GraticuleOptions;
@@ -142,6 +164,106 @@ olx.GraticuleOptions.prototype.strokeStyle;
olx.GraticuleOptions.prototype.targetSize;
/**
* Render a label with the respective latitude/longitude for each graticule
* line. Default is false.
*
* @type {boolean|undefined}
* @api
*/
olx.GraticuleOptions.prototype.showLabels;
/**
* Label formatter for longitudes. This function is called with the longitude as
* argument, and should return a formatted string representing the longitude.
* By default, labels are formatted as degrees, minutes, seconds and hemisphere.
*
* @type {undefined|function(number):string}
* @api
*/
olx.GraticuleOptions.prototype.lonLabelFormatter;
/**
* Label formatter for latitudes. This function is called with the latitude as
* argument, and should return a formatted string representing the latitude.
* By default, labels are formatted as degrees, minutes, seconds and hemisphere.
*
* @type {undefined|function(number):string}
* @api
*/
olx.GraticuleOptions.prototype.latLabelFormatter;
/**
* Longitude label position in fractions (0..1) of view extent. 0 means at the
* bottom of the viewport, 1 means at the top. Default is 0.
* @type {number|undefined}
* @api
*/
olx.GraticuleOptions.prototype.lonLabelPosition;
/**
* Latitude label position in fractions (0..1) of view extent. 0 means at the
* left of the viewport, 1 means at the right. Default is 1.
* @type {number|undefined}
* @api
*/
olx.GraticuleOptions.prototype.latLabelPosition;
/**
* Longitude label text style. The default is
* ```js
* new ol.style.Text({
* font: '12px Calibri,sans-serif',
* textBaseline: 'bottom',
* fill: new ol.style.Fill({
* color: 'rgba(0,0,0,1)'
* }),
* stroke: new ol.style.Stroke({
* color: 'rgba(255,255,255,1)',
* width: 3
* })
* });
* ```
* Note that the default's `textBaseline` configuration will not work well for
* `lonLabelPosition` configurations that position labels close to the top of
* the viewport.
*
* @type {ol.style.Text|undefined}
* @api
*/
olx.GraticuleOptions.prototype.lonLabelStyle;
/**
* Latitude label text style. The default is
* ```js
* new ol.style.Text({
* font: '12px Calibri,sans-serif',
* textAlign: 'end',
* fill: new ol.style.Fill({
* color: 'rgba(0,0,0,1)'
* }),
* stroke: new ol.style.Stroke({
* color: 'rgba(255,255,255,1)',
* width: 3
* })
* });
* ```
* Note that the default's `textAlign` configuration will not work well for
* `latLabelPosition` configurations that position labels close to the left of
* the viewport.
*
* @type {ol.style.Text|undefined}
* @api
*/
olx.GraticuleOptions.prototype.latLabelStyle;
/**
* Object literal with config options for interactions.
* @typedef {{handleEvent: function(ol.MapBrowserEvent):boolean}}
@@ -170,6 +292,7 @@ olx.interaction.InteractionOptions.prototype.handleEvent;
* loadTilesWhileAnimating: (boolean|undefined),
* loadTilesWhileInteracting: (boolean|undefined),
* logo: (boolean|string|olx.LogoOptions|Element|undefined),
* moveTolerance: (number|undefined),
* overlays: (ol.Collection.<ol.Overlay>|Array.<ol.Overlay>|undefined),
* renderer: (ol.renderer.Type|Array.<ol.renderer.Type>|undefined),
* target: (Element|string|undefined),
@@ -263,6 +386,17 @@ olx.MapOptions.prototype.loadTilesWhileInteracting;
olx.MapOptions.prototype.logo;
/**
* The minimum distance in pixels the cursor must move to be detected
* as a map move event instead of a click. Increasing this value can make it
* easier to click on the map.
* Default is `1`.
* @type {number|undefined}
* @api
*/
olx.MapOptions.prototype.moveTolerance;
/**
* Overlays initially added to the map. By default, no overlays are added.
* @type {ol.Collection.<ol.Overlay>|Array.<ol.Overlay>|undefined}
@@ -546,7 +680,8 @@ olx.ProjectionOptions.prototype.worldExtent;
/**
* Function to determine resolution at a point. The function is called with a
* `{number}` view resolution and an `{ol.Coordinate}` as arguments, and returns
* the `{number}` resolution at the passed coordinate.
* the `{number}` resolution at the passed coordinate. If this is `undefined`,
* the default {@link ol.proj#getPointResolution} function will be used.
* @type {(function(number, ol.Coordinate):number|undefined)}
* @api
*/
@@ -1859,9 +1994,9 @@ olx.format.MVTOptions;
* {@link ol.Feature} to get full editing and geometry support at the cost of
* decreased rendering performance. The default is {@link ol.render.Feature},
* which is optimized for rendering and hit detection.
* @type {undefined|function((ol.geom.Geometry|Object.<string, *>)=)|
* @type {undefined|function((ol.geom.Geometry|Object.<string,*>)=)|
* function(ol.geom.GeometryType,Array.<number>,
* (Array.<number>|Array.<Array.<number>>),Object.<string, *>)}
* (Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)}
* @api
*/
olx.format.MVTOptions.prototype.featureClass;
@@ -1918,7 +2053,11 @@ olx.format.PolylineOptions.prototype.geometryLayout;
/**
* @typedef {{defaultDataProjection: ol.ProjectionLike}}
* @typedef {{
* defaultDataProjection: ol.ProjectionLike,
* layerName: (string|undefined),
* layers: (Array.<string>|undefined)
* }}
*/
olx.format.TopoJSONOptions;
@@ -1931,6 +2070,38 @@ olx.format.TopoJSONOptions;
olx.format.TopoJSONOptions.prototype.defaultDataProjection;
/**
* Set the name of the TopoJSON topology `objects`'s children as feature
* property with the specified name. This means that when set to `'layer'`, a
* topology like
* ```
* {
* "type": "Topology",
* "objects": {
* "example": {
* "type": "GeometryCollection",
* "geometries": []
* }
* }
* }
* ```
* will result in features that have a property `'layer'` set to `'example'`.
* When not set, no property will be added to features.
* @type {string|undefined}
* @api
*/
olx.format.TopoJSONOptions.prototype.layerName;
/**
* Names of the TopoJSON topology's `objects`'s children to read features from.
* If not provided, features will be read from all children.
* @type {Array.<string>|undefined}
* @api
*/
olx.format.TopoJSONOptions.prototype.layers;
/**
* @typedef {{altitudeMode: (ol.format.IGCZ|undefined)}}
*/
@@ -2284,8 +2455,10 @@ olx.format.WFSWriteGetFeatureOptions.prototype.resultType;
* featureType: string,
* srsName: (string|undefined),
* handle: (string|undefined),
* hasZ: (boolean|undefined),
* nativeElements: Array.<Object>,
* gmlOptions: (olx.format.GMLOptions|undefined)}}
* gmlOptions: (olx.format.GMLOptions|undefined),
* version: (string|undefined)}}
*/
olx.format.WFSWriteTransactionOptions;
@@ -2331,6 +2504,15 @@ olx.format.WFSWriteTransactionOptions.prototype.srsName;
olx.format.WFSWriteTransactionOptions.prototype.handle;
/**
* Must be set to true if the transaction is for a 3D layer. This will allow
* the Z coordinate to be included in the transaction.
* @type {boolean|undefined}
* @api
*/
olx.format.WFSWriteTransactionOptions.prototype.hasZ;
/**
* Native elements. Currently not supported.
* @type {Array.<Object>}
@@ -2347,6 +2529,15 @@ olx.format.WFSWriteTransactionOptions.prototype.nativeElements;
olx.format.WFSWriteTransactionOptions.prototype.gmlOptions;
/**
* WFS version to use for the transaction. Can be either `1.0.0` or `1.1.0`.
* Default is `1.1.0`.
* @type {string|undefined}
* @api
*/
olx.format.WFSWriteTransactionOptions.prototype.version;
/**
* @typedef {{splitCollection: (boolean|undefined)}}
*/
@@ -2388,7 +2579,9 @@ olx.interaction;
/**
* Interactions for the map. Default is `true` for all options.
* @typedef {{altShiftDragRotate: (boolean|undefined),
* @typedef {{
* altShiftDragRotate: (boolean|undefined),
* constrainResolution: (boolean|undefined),
* doubleClickZoom: (boolean|undefined),
* keyboard: (boolean|undefined),
* mouseWheelZoom: (boolean|undefined),
@@ -2397,7 +2590,8 @@ olx.interaction;
* pinchRotate: (boolean|undefined),
* pinchZoom: (boolean|undefined),
* zoomDelta: (number|undefined),
* zoomDuration: (number|undefined)}}
* zoomDuration: (number|undefined)
* }}
*/
olx.interaction.DefaultsOptions;
@@ -2410,6 +2604,15 @@ olx.interaction.DefaultsOptions;
olx.interaction.DefaultsOptions.prototype.altShiftDragRotate;
/**
* Zoom to the closest integer zoom level after the wheel/trackpad or
* pinch gesture ends. Default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.DefaultsOptions.prototype.constrainResolution;
/**
* Whether double click zoom is desired. Default is `true`.
* @type {boolean|undefined}
@@ -2540,6 +2743,7 @@ olx.interaction.DragAndDropOptions.prototype.target;
/**
* @typedef {{className: (string|undefined),
* condition: (ol.EventsConditionType|undefined),
* minArea: (number|undefined),
* boxEndCondition: (ol.DragBoxEndConditionType|undefined)}}
*/
olx.interaction.DragBoxOptions;
@@ -2563,19 +2767,19 @@ olx.interaction.DragBoxOptions.prototype.className;
olx.interaction.DragBoxOptions.prototype.condition;
/**
* The minimum area of the box in pixel, this value is used by the default
* `boxEndCondition` function. Default is `64`.
* @type {number|undefined}
* @api
*/
olx.interaction.DragBoxOptions.prototype.minArea;
/**
* A function that takes a {@link ol.MapBrowserEvent} and two
* {@link ol.Pixel}s to indicate whether a boxend event should be fired.
* Default is:
* ```js
* function(mapBrowserEvent,
* startPixel, endPixel) {
* var width = endPixel[0] - startPixel[0];
* var height = endPixel[1] - startPixel[1];
* return width * width + height * height >=
* ol.DRAG_BOX_HYSTERESIS_PIXELS_SQUARED;
* }
* ```
* {@link ol.Pixel}s to indicate whether a `boxend` event should be fired.
* Default is `true` if the area of the box is bigger than the `minArea` option.
* @type {ol.DragBoxEndConditionType|undefined}
* @api
*/
@@ -2867,7 +3071,7 @@ olx.interaction.DrawOptions.prototype.wrapX;
olx.interaction.ExtentOptions;
/**
* Initial extent. Defaults to no inital extent
* Initial extent. Defaults to no initial extent
* @type {ol.Extent|undefined}
* @api
*/
@@ -2932,7 +3136,7 @@ olx.interaction.TranslateOptions.prototype.layers;
/**
* Hit-detection tolerance. Pixels inside the radius around the given position
* will be checked for features. This only works for the canvas renderer and
* not for WebGL.
* not for WebGL. Default is `0`.
* @type {number|undefined}
* @api
*/
@@ -3009,12 +3213,16 @@ olx.interaction.KeyboardZoomOptions.prototype.delta;
/**
* @typedef {{condition: (ol.EventsConditionType|undefined),
* @typedef {{
* condition: (ol.EventsConditionType|undefined),
* deleteCondition: (ol.EventsConditionType|undefined),
* insertVertexCondition: (ol.EventsConditionType|undefined),
* pixelTolerance: (number|undefined),
* style: (ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined),
* features: ol.Collection.<ol.Feature>,
* wrapX: (boolean|undefined)}}
* source: (ol.source.Vector|undefined),
* features: (ol.Collection.<ol.Feature>|undefined),
* wrapX: (boolean|undefined)
* }}
*/
olx.interaction.ModifyOptions;
@@ -3041,6 +3249,16 @@ olx.interaction.ModifyOptions.prototype.condition;
olx.interaction.ModifyOptions.prototype.deleteCondition;
/**
* A function that takes an {@link ol.MapBrowserEvent} and returns a boolean
* to indicate whether a new vertex can be added to the sketch features.
* Default is {@link ol.events.condition.always}
* @type {ol.EventsConditionType|undefined}
* @api
*/
olx.interaction.ModifyOptions.prototype.insertVertexCondition;
/**
* Pixel tolerance for considering the pointer close enough to a segment or
* vertex for editing. Default is `10`.
@@ -3060,8 +3278,18 @@ olx.interaction.ModifyOptions.prototype.style;
/**
* The features the interaction works on.
* @type {ol.Collection.<ol.Feature>}
* The vector source with features to modify. If a vector source is not
* provided, a feature collection must be provided with the features option.
* @type {ol.source.Vector|undefined}
* @api
*/
olx.interaction.ModifyOptions.prototype.source;
/**
* The features the interaction works on. If a feature collection is not
* provided, a vector source must be provided with the source option.
* @type {ol.Collection.<ol.Feature>|undefined}
* @api
*/
olx.interaction.ModifyOptions.prototype.features;
@@ -3076,7 +3304,8 @@ olx.interaction.ModifyOptions.prototype.wrapX;
/**
* @typedef {{duration: (number|undefined),
* @typedef {{constrainResolution: (boolean|undefined),
* duration: (number|undefined),
* timeout: (number|undefined),
* useAnchor: (boolean|undefined)}}
*/
@@ -3099,6 +3328,16 @@ olx.interaction.MouseWheelZoomOptions.prototype.duration;
olx.interaction.MouseWheelZoomOptions.prototype.timeout;
/**
* When using a trackpad or magic mouse, zoom to the closest integer zoom level
* after the scroll gesture ends.
* Default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.MouseWheelZoomOptions.prototype.constrainResolution;
/**
* Enable zooming using the mouse's location as the anchor. Default is `true`.
* When set to false, zooming in and out will zoom to the center of the screen
@@ -3133,7 +3372,10 @@ olx.interaction.PinchRotateOptions.prototype.threshold;
/**
* @typedef {{duration: (number|undefined)}}
* @typedef {{
* duration: (number|undefined),
* constrainResolution: (boolean|undefined)
* }}
*/
olx.interaction.PinchZoomOptions;
@@ -3339,7 +3581,7 @@ olx.interaction.SelectOptions.prototype.wrapX;
/**
* Hit-detection tolerance. Pixels inside the radius around the given position
* will be checked for features. This only works for the canvas renderer and
* not for WebGL.
* not for WebGL. Default is `0`.
* @type {number|undefined}
* @api
*/
@@ -3620,7 +3862,8 @@ olx.layer.GroupOptions.prototype.layers;
* maxResolution: (number|undefined),
* opacity: (number|undefined),
* source: (ol.source.Vector|undefined),
* visible: (boolean|undefined)}}
* visible: (boolean|undefined),
* zIndex: (number|undefined)}}
*/
olx.layer.HeatmapOptions;
@@ -3717,6 +3960,15 @@ olx.layer.HeatmapOptions.prototype.source;
olx.layer.HeatmapOptions.prototype.visible;
/**
* The z-index for layer rendering. At rendering time, the layers will be
* ordered, first by Z-index and then by position. The default Z-index is 0.
* @type {number|undefined}
* @api
*/
olx.layer.HeatmapOptions.prototype.zIndex;
/**
* @typedef {{opacity: (number|undefined),
* map: (ol.Map|undefined),
@@ -3724,7 +3976,8 @@ olx.layer.HeatmapOptions.prototype.visible;
* visible: (boolean|undefined),
* extent: (ol.Extent|undefined),
* minResolution: (number|undefined),
* maxResolution: (number|undefined)}}
* maxResolution: (number|undefined),
* zIndex: (number|undefined)}}
*/
olx.layer.ImageOptions;
@@ -3789,6 +4042,15 @@ olx.layer.ImageOptions.prototype.minResolution;
olx.layer.ImageOptions.prototype.maxResolution;
/**
* The z-index for layer rendering. At rendering time, the layers will be
* ordered, first by Z-index and then by position. The default Z-index is 0.
* @type {number|undefined}
* @api
*/
olx.layer.ImageOptions.prototype.zIndex;
/**
* @typedef {{opacity: (number|undefined),
* preload: (number|undefined),
@@ -3798,7 +4060,8 @@ olx.layer.ImageOptions.prototype.maxResolution;
* extent: (ol.Extent|undefined),
* minResolution: (number|undefined),
* maxResolution: (number|undefined),
* useInterimTilesOnError: (boolean|undefined)}}
* useInterimTilesOnError: (boolean|undefined),
* zIndex: (number|undefined)}}
*/
olx.layer.TileOptions;
@@ -3881,7 +4144,16 @@ olx.layer.TileOptions.prototype.useInterimTilesOnError;
/**
* @typedef {{renderOrder: (function(ol.Feature, ol.Feature):number|null|undefined),
* The z-index for layer rendering. At rendering time, the layers will be
* ordered, first by Z-index and then by position. The default Z-index is 0.
* @type {number|undefined}
* @api
*/
olx.layer.TileOptions.prototype.zIndex;
/**
* @typedef {{renderOrder: (ol.RenderOrderFunction|null|undefined),
* minResolution: (number|undefined),
* maxResolution: (number|undefined),
* opacity: (number|undefined),
@@ -3891,7 +4163,8 @@ olx.layer.TileOptions.prototype.useInterimTilesOnError;
* style: (ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined),
* updateWhileAnimating: (boolean|undefined),
* updateWhileInteracting: (boolean|undefined),
* visible: (boolean|undefined)}}
* visible: (boolean|undefined),
* zIndex: (number|undefined)}}
*/
olx.layer.VectorOptions;
@@ -3900,7 +4173,7 @@ olx.layer.VectorOptions;
* Render order. Function to be used when sorting features before rendering. By
* default features are drawn in the order that they are created. Use `null` to
* avoid the sort, but get an undefined draw order.
* @type {function(ol.Feature, ol.Feature):number|null|undefined}
* @type {ol.RenderOrderFunction|null|undefined}
* @api
*/
olx.layer.VectorOptions.prototype.renderOrder;
@@ -4006,6 +4279,15 @@ olx.layer.VectorOptions.prototype.updateWhileInteracting;
olx.layer.VectorOptions.prototype.visible;
/**
* The z-index for layer rendering. At rendering time, the layers will be
* ordered, first by Z-index and then by position. The default Z-index is 0.
* @type {number|undefined}
* @api
*/
olx.layer.VectorOptions.prototype.zIndex;
/**
* @typedef {{extent: (ol.Extent|undefined),
* map: (ol.Map|undefined),
@@ -4015,12 +4297,13 @@ olx.layer.VectorOptions.prototype.visible;
* preload: (number|undefined),
* renderBuffer: (number|undefined),
* renderMode: (ol.layer.VectorTileRenderType|string|undefined),
* renderOrder: (function(ol.Feature, ol.Feature):number|undefined),
* renderOrder: (ol.RenderOrderFunction|undefined),
* source: (ol.source.VectorTile|undefined),
* style: (ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined),
* updateWhileAnimating: (boolean|undefined),
* updateWhileInteracting: (boolean|undefined),
* visible: (boolean|undefined)}}
* visible: (boolean|undefined),
* zIndex: (number|undefined)}}
*/
olx.layer.VectorTileOptions;
@@ -4058,7 +4341,7 @@ olx.layer.VectorTileOptions.prototype.renderMode;
/**
* Render order. Function to be used when sorting features before rendering. By
* default features are drawn in the order that they are created.
* @type {function(ol.Feature, ol.Feature):number|undefined}
* @type {ol.RenderOrderFunction|undefined}
* @api
*/
olx.layer.VectorTileOptions.prototype.renderOrder;
@@ -4162,6 +4445,15 @@ olx.layer.VectorTileOptions.prototype.updateWhileInteracting;
olx.layer.VectorTileOptions.prototype.visible;
/**
* The z-index for layer rendering. At rendering time, the layers will be
* ordered, first by Z-index and then by position. The default Z-index is 0.
* @type {number|undefined}
* @api
*/
olx.layer.VectorOptions.prototype.zIndex;
/**
* Namespace.
* @type {Object}
@@ -4169,6 +4461,50 @@ olx.layer.VectorTileOptions.prototype.visible;
olx.render;
/**
* @typedef {{context: CanvasRenderingContext2D,
* feature: (ol.Feature|ol.render.Feature),
* geometry: ol.geom.SimpleGeometry,
* pixelRatio: number,
* resolution: number,
* rotation: number}}
*/
olx.render.State;
/**
* Canvas context that the layer is being rendered to.
* @type {CanvasRenderingContext2D}
* @api
*/
olx.render.State.prototype.context;
/**
* Pixel ratio used by the layer renderer.
* @type {number}
* @api
*/
olx.render.State.prototype.pixelRatio;
/**
* Resolution that the render batch was created and optimized for. This is
* not the view's resolution that is being rendered.
* @type {number}
* @api
*/
olx.render.State.prototype.resolution;
/**
* Rotation of the rendered layer in radians.
* @type {number}
* @api
*/
olx.render.State.prototype.rotation;
/**
* @typedef {{size: (ol.Size|undefined),
* pixelRatio: (number|undefined)}}
@@ -4625,7 +4961,6 @@ olx.source.TileImageOptions.prototype.wrapX;
* ol.TileLoadFunctionType)|undefined),
* tileGrid: (ol.tilegrid.TileGrid|undefined),
* tileLoadFunction: (ol.TileLoadFunctionType|undefined),
* tilePixelRatio: (number|undefined),
* tileUrlFunction: (ol.TileUrlFunctionType|undefined),
* url: (string|undefined),
* urls: (Array.<string>|undefined),
@@ -4695,7 +5030,7 @@ olx.source.VectorTileOptions.prototype.state;
/**
* Class used to instantiate image tiles. Default is {@link ol.VectorTile}.
* Class used to instantiate vector tiles. Default is {@link ol.VectorTile}.
* @type {function(new: ol.VectorTile, ol.TileCoord,
* ol.TileState, string, ol.format.Feature,
* ol.TileLoadFunctionType)|undefined}
@@ -4721,6 +5056,8 @@ olx.source.VectorTileOptions.prototype.tileGrid;
* var format = tile.getFormat();
* tile.setFeatures(format.readFeatures(data));
* tile.setProjection(format.readProjection(data));
* // uncomment the line below for ol.format.MVT only
* //tile.setExtent(format.getLastExtent());
* };
* });
* ```
@@ -4730,17 +5067,6 @@ olx.source.VectorTileOptions.prototype.tileGrid;
olx.source.VectorTileOptions.prototype.tileLoadFunction;
/**
* The pixel ratio used by the tile service. For example, if the tile
* service advertizes 256px by 256px tiles but actually sends 512px
* by 512px tiles (for retina/hidpi devices) then `tilePixelRatio`
* should be set to `2`. Default is `1`.
* @type {number|undefined}
* @api
*/
olx.source.VectorTileOptions.prototype.tilePixelRatio;
/**
* Optional function to get tile URL given a tile coordinate and the projection.
* @type {ol.TileUrlFunctionType|undefined}
@@ -5506,14 +5832,17 @@ olx.source.ImageWMSOptions.prototype.url;
/**
* @typedef {{cacheSize: (number|undefined),
* @typedef {{
* cacheSize: (number|undefined),
* layer: string,
* minZoom: (number|undefined),
* maxZoom: (number|undefined),
* opaque: (boolean|undefined),
* reprojectionErrorThreshold: (number|undefined),
* tileLoadFunction: (ol.TileLoadFunctionType|undefined),
* url: (string|undefined)}}
* url: (string|undefined),
* wrapX: (boolean|undefined)
* }}
*/
olx.source.StamenOptions;
@@ -5587,6 +5916,14 @@ olx.source.StamenOptions.prototype.tileLoadFunction;
olx.source.StamenOptions.prototype.url;
/**
* Whether to wrap the world horizontally. Default is `true`.
* @type {boolean|undefined}
* @api
*/
olx.source.StamenOptions.prototype.wrapX;
/**
* @typedef {{attributions: (ol.AttributionLike|undefined),
* crossOrigin: (null|string|undefined),
@@ -5811,8 +6148,9 @@ olx.source.TileArcGISRestOptions.prototype.urls;
* crossOrigin: (null|string|undefined),
* jsonp: (boolean|undefined),
* reprojectionErrorThreshold: (number|undefined),
* tileJSON: (TileJSON|undefined),
* tileLoadFunction: (ol.TileLoadFunctionType|undefined),
* url: string,
* url: (string|undefined),
* wrapX: (boolean|undefined)}}
*/
olx.source.TileJSONOptions;
@@ -5866,6 +6204,15 @@ olx.source.TileJSONOptions.prototype.jsonp;
olx.source.TileJSONOptions.prototype.reprojectionErrorThreshold;
/**
* TileJSON configuration for this source. If not provided, `url` must be
* configured.
* @type {TileJSON|undefined}
* @api
*/
olx.source.TileJSONOptions.prototype.tileJSON;
/**
* Optional function to load a tile given a URL. The default is
* ```js
@@ -5880,8 +6227,8 @@ olx.source.TileJSONOptions.prototype.tileLoadFunction;
/**
* URL to the TileJSON file.
* @type {string}
* URL to the TileJSON file. If not provided, `tileJSON` must be configured.
* @type {string|undefined}
* @api
*/
olx.source.TileJSONOptions.prototype.url;
@@ -5903,6 +6250,9 @@ olx.source.TileJSONOptions.prototype.wrapX;
* gutter: (number|undefined),
* hidpi: (boolean|undefined),
* logo: (string|olx.LogoOptions|undefined),
* tileClass: (function(new: ol.ImageTile, ol.TileCoord,
* ol.TileState, string, ?string,
* ol.TileLoadFunctionType)|undefined),
* tileGrid: (ol.tilegrid.TileGrid|undefined),
* projection: ol.ProjectionLike,
* reprojectionErrorThreshold: (number|undefined),
@@ -5985,6 +6335,16 @@ olx.source.TileWMSOptions.prototype.hidpi;
olx.source.TileWMSOptions.prototype.logo;
/**
* Class used to instantiate image tiles. Default is {@link ol.ImageTile}.
* @type {function(new: ol.ImageTile, ol.TileCoord,
* ol.TileState, string, ?string,
* ol.TileLoadFunctionType)|undefined}
* @api
*/
olx.source.TileWMSOptions.prototype.tileClass;
/**
* Tile grid. Base this on the resolutions, tilesize and extent supported by the
* server.
@@ -6986,7 +7346,7 @@ olx.style.IconOptions.prototype.opacity;
/**
* Scale.
* Scale. Default is `1`.
* @type {number|undefined}
* @api
*/
@@ -7044,7 +7404,7 @@ olx.style.IconOptions.prototype.imgSize;
/**
* Image source URI.
* @type {string}
* @type {string|undefined}
* @api
*/
olx.style.IconOptions.prototype.src;
@@ -7093,7 +7453,7 @@ olx.style.RegularShapeOptions.prototype.radius;
/**
* Inner radius of a star.
* Outer radius of a star.
* @type {number|undefined}
* @api
*/
@@ -7101,7 +7461,7 @@ olx.style.RegularShapeOptions.prototype.radius1;
/**
* Outer radius of a star.
* Inner radius of a star.
* @type {number|undefined}
* @api
*/
@@ -7356,6 +7716,7 @@ olx.style.TextOptions.prototype.stroke;
* @typedef {{geometry: (undefined|string|ol.geom.Geometry|ol.StyleGeometryFunction),
* fill: (ol.style.Fill|undefined),
* image: (ol.style.Image|undefined),
* renderer: (ol.StyleRenderFunction|undefined),
* stroke: (ol.style.Stroke|undefined),
* text: (ol.style.Text|undefined),
* zIndex: (number|undefined)}}
@@ -7388,6 +7749,16 @@ olx.style.StyleOptions.prototype.fill;
olx.style.StyleOptions.prototype.image;
/**
* Custom renderer. When configured, `fill`, `stroke` and `image` will be
* ignored, and the provided function will be called with each render frame for
* each geometry.
*
* @type {ol.StyleRenderFunction|undefined}
*/
olx.style.StyleOptions.prototype.renderer;
/**
* Stroke style.
* @type {ol.style.Stroke|undefined}
@@ -7669,7 +8040,8 @@ olx.view;
* maxZoom: (number|undefined),
* minResolution: (number|undefined),
* duration: (number|undefined),
* easing: (undefined|function(number):number)
* easing: (undefined|function(number):number),
* callback: (undefined|function(boolean))
* }}
*/
olx.view.FitOptions;
@@ -7747,6 +8119,16 @@ olx.view.FitOptions.prototype.duration;
olx.view.FitOptions.prototype.easing;
/**
* Optional function called when the view is in it's final position. The callback will be
* called with `true` if the animation series completed on its own or `false`
* if it was cancelled.
* @type {undefined|function(boolean)}
* @api
*/
olx.view.FitOptions.prototype.callback;
/* typedefs for object literals exposed by the library */

View File

@@ -7,25 +7,31 @@
/**
* @constructor
*/
var proj4 = function() {};
var Proj4 = function() {};
/**
* @type {function(Array.<number>): Array.<number>}
* @param {ol.Coordinate} coordinates
* @return {ol.Coordinate}
*/
proj4.prototype.forward;
Proj4.prototype.forward = function(coordinates) {};
/**
* @type {function(Array.<number>): Array.<number>}
* @param {ol.Coordinate} coordinates
* @return {ol.Coordinate}
*/
proj4.prototype.inverse;
Proj4.prototype.inverse = function(coordinates) {};
/**
* @param {string} name
* @param {(string|Object)=} opt_def
* @return {undefined|Object.<string, Object.<{axis: string, units: string,
* to_meter: number}>>}
* @return {undefined|Object.<string, Object.<{axis: string, units: string, to_meter: number}>>}
*/
proj4.defs = function(name, opt_def) {};
Proj4.prototype.defs = function(name, opt_def) {};
/**
* @type {Proj4}
*/
var proj4;

View File

@@ -5,7 +5,6 @@
*/
/**
* @constructor
*/

View File

@@ -1,6 +1,6 @@
{
"name": "openlayers",
"version": "4.0.1",
"version": "4.3.0-beta.3",
"description": "Build tools and sources for developing OpenLayers based mapping applications",
"keywords": [
"map",
@@ -13,6 +13,7 @@
"postinstall": "closure-util update",
"start": "node tasks/serve.js",
"pretest": "eslint tasks test test_rendering src examples",
"lint-package": "eslint --fix build/package",
"test": "node tasks/test.js",
"debug-server": "node tasks/serve-lib.js"
},
@@ -30,47 +31,48 @@
"css/ol.css"
],
"dependencies": {
"async": "2.1.4",
"browserify": "14.0.0",
"closure-util": "1.17.0",
"derequire": "2.0.6",
"fs-extra": "2.0.0",
"glob": "7.1.1",
"handlebars": "4.0.6",
"jsdoc": "3.4.3",
"marked": "0.3.6",
"metalsmith": "2.3.0",
"metalsmith-layouts": "1.8.0",
"async": "2.5.0",
"closure-util": "1.22.0",
"fs-extra": "4.0.1",
"jsdoc": "3.5.4",
"nomnom": "1.8.1",
"pbf": "3.0.5",
"pixelworks": "1.1.0",
"rbush": "2.0.1",
"rollup": "^0.45.0",
"rollup-plugin-cleanup": "^1.0.0",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-node-resolve": "^3.0.0",
"temp": "0.8.3",
"vector-tile": "1.3.0",
"@mapbox/vector-tile": "1.3.0",
"walk": "2.3.9"
},
"devDependencies": {
"clean-css-cli": "4.0.6",
"coveralls": "2.11.16",
"clean-css-cli": "4.1.6",
"coveralls": "2.13.1",
"debounce": "^1.0.0",
"eslint": "3.15.0",
"eslint": "4.4.1",
"eslint-config-openlayers": "7.0.0",
"eslint-plugin-openlayers-internal": "^3.1.0",
"esprima": "2.x",
"expect.js": "0.3.1",
"gaze": "^1.0.0",
"glob": "7.1.1",
"handlebars": "4.0.10",
"istanbul": "0.4.5",
"jquery": "3.1.1",
"jquery": "3.2.1",
"jscodeshift": "^0.3.30",
"mocha": "3.2.0",
"marked": "0.3.6",
"metalsmith": "2.3.0",
"metalsmith-layouts": "1.8.1",
"mocha": "3.5.0",
"mocha-phantomjs-core": "^2.1.0",
"mustache": "2.3.0",
"phantomjs-prebuilt": "2.1.14",
"proj4": "2.3.17",
"resemblejs": "2.2.3",
"proj4": "2.4.3",
"resemblejs": "2.2.4",
"serve-files": "1.0.1",
"sinon": "1.17.7",
"slimerjs": "0.906.2"
"sinon": "3.1.0",
"slimerjs": "0.10.3"
},
"eslintConfig": {
"extends": "openlayers",
@@ -92,31 +94,50 @@
"no-constant-condition": 0,
"openlayers-internal/enum": 2,
"openlayers-internal/no-duplicate-requires": 2,
"openlayers-internal/no-missing-requires": 1,
"openlayers-internal/no-missing-requires": 2,
"openlayers-internal/no-unused-requires": 2,
"openlayers-internal/one-provide": 2,
"openlayers-internal/requires-first": 2,
"openlayers-internal/valid-provide": 2,
"openlayers-internal/valid-requires": 2
"openlayers-internal/valid-requires": 2,
"indent": [
2,
2,
{
"VariableDeclarator": 2,
"SwitchCase": 1,
"MemberExpression": 2,
"FunctionDeclaration": {
"parameters": 2,
"body": 1
},
"FunctionExpression": {
"parameters": 2,
"body": 1
},
"CallExpression": {
"arguments": 2
}
}
]
}
},
"ext": [
{
"module": "rbush",
"browserify": true
"module": "rbush"
},
{
"module": "pbf",
"browserify": true
"name": "PBF"
},
{
"module": "pixelworks",
"browserify": true
"import": "Processor"
},
{
"module": "vector-tile",
"module": "@mapbox/vector-tile",
"name": "vectortile",
"browserify": true
"import": "VectorTile"
}
]
}

5
package/.eslintrc Normal file
View File

@@ -0,0 +1,5 @@
{
"parserOptions": {
"sourceType": "module"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "ol",
"version": "4.0.1-beta.1",
"version": "4.2.0",
"description": "OpenLayers as ES2015 modules",
"main": "index.js",
"module": "index.js",
@@ -9,6 +9,16 @@
"pbf": "3.0.5",
"pixelworks": "1.1.0",
"rbush": "2.0.1",
"vector-tile": "1.3.0"
"@mapbox/vector-tile": "1.3.0"
},
"browserify": {
"transform": [
[
"babelify",
{
"plugins": ["transform-es2015-modules-commonjs"]
}
]
]
}
}

View File

@@ -2,8 +2,6 @@
OpenLayers as ES2015 modules.
**Note: This package is in beta and the API is subject to change before a final stable release.**
## Usage
Add the `ol` package as a dependency to your project.
@@ -51,5 +49,4 @@ Utility functions are available as properties of the default export from utility
## Caveats
* Module identifiers and the structure of the exports are subject to change while this package is in beta.
* The WebGL renderer is not available in this package.

View File

@@ -13,11 +13,12 @@ goog.require('ol');
*/
ol.AssertionError = function(code) {
var path = ol.VERSION ? ol.VERSION.split('-')[0] : 'latest';
/**
* @type {string}
*/
this.message = 'Assertion failed. See ' +
(ol.VERSION ? 'https://openlayers.org/en/' + ol.VERSION.split('-')[0] : '') +
this.message = 'Assertion failed. See https://openlayers.org/en/' + path +
'/doc/errors/#' + code + ' for details.';
/**

View File

@@ -9,20 +9,20 @@ goog.require('ol.math');
*/
ol.CenterConstraint.createExtent = function(extent) {
return (
/**
* @param {ol.Coordinate|undefined} center Center.
* @return {ol.Coordinate|undefined} Center.
*/
function(center) {
if (center) {
return [
ol.math.clamp(center[0], extent[0], extent[2]),
ol.math.clamp(center[1], extent[1], extent[3])
];
} else {
return undefined;
}
});
/**
* @param {ol.Coordinate|undefined} center Center.
* @return {ol.Coordinate|undefined} Center.
*/
function(center) {
if (center) {
return [
ol.math.clamp(center[0], extent[0], extent[2]),
ol.math.clamp(center[1], extent[1], extent[3])
];
} else {
return undefined;
}
});
};

View File

@@ -6,6 +6,7 @@
goog.provide('ol.Collection');
goog.require('ol');
goog.require('ol.AssertionError');
goog.require('ol.CollectionEventType');
goog.require('ol.Object');
goog.require('ol.events.Event');
@@ -22,20 +23,35 @@ goog.require('ol.events.Event');
* @constructor
* @extends {ol.Object}
* @fires ol.Collection.Event
* @param {!Array.<T>=} opt_array Array.
* @param {Array.<T>=} opt_array Array.
* @param {olx.CollectionOptions=} opt_options Collection options.
* @template T
* @api
*/
ol.Collection = function(opt_array) {
ol.Collection = function(opt_array, opt_options) {
ol.Object.call(this);
var options = opt_options || {};
/**
* @private
* @type {boolean}
*/
this.unique_ = !!options.unique;
/**
* @private
* @type {!Array.<T>}
*/
this.array_ = opt_array ? opt_array : [];
if (this.unique_) {
for (var i = 0, ii = this.array_.length; i < ii; ++i) {
this.assertUnique_(this.array_[i], i);
}
}
this.updateLength_();
};
@@ -79,7 +95,11 @@ ol.Collection.prototype.extend = function(arr) {
* @api
*/
ol.Collection.prototype.forEach = function(f, opt_this) {
this.array_.forEach(f, opt_this);
var fn = (opt_this) ? f.bind(opt_this) : f;
var array = this.array_;
for (var i = 0, ii = array.length; i < ii; ++i) {
fn(array[i], i, array);
}
};
@@ -125,6 +145,9 @@ ol.Collection.prototype.getLength = function() {
* @api
*/
ol.Collection.prototype.insertAt = function(index, elem) {
if (this.unique_) {
this.assertUnique_(elem);
}
this.array_.splice(index, 0, elem);
this.updateLength_();
this.dispatchEvent(
@@ -150,6 +173,9 @@ ol.Collection.prototype.pop = function() {
* @api
*/
ol.Collection.prototype.push = function(elem) {
if (this.unique_) {
this.assertUnique_(elem);
}
var n = this.getLength();
this.insertAt(n, elem);
return this.getLength();
@@ -200,6 +226,9 @@ ol.Collection.prototype.removeAt = function(index) {
ol.Collection.prototype.setAt = function(index, elem) {
var n = this.getLength();
if (index < n) {
if (this.unique_) {
this.assertUnique_(elem, index);
}
var prev = this.array_[index];
this.array_[index] = elem;
this.dispatchEvent(
@@ -224,6 +253,20 @@ ol.Collection.prototype.updateLength_ = function() {
};
/**
* @private
* @param {T} elem Element.
* @param {number=} opt_except Optional index to ignore.
*/
ol.Collection.prototype.assertUnique_ = function(elem, opt_except) {
for (var i = 0, ii = this.array_.length; i < ii; ++i) {
if (this.array_[i] === elem && i !== opt_except) {
throw new ol.AssertionError(58);
}
}
};
/**
* @enum {string}
* @private

View File

@@ -72,56 +72,56 @@ ol.color.fromNamed = function(color) {
* @return {ol.Color} Color.
*/
ol.color.fromString = (
function() {
function() {
// We maintain a small cache of parsed strings. To provide cheap LRU-like
// semantics, whenever the cache grows too large we simply delete an
// arbitrary 25% of the entries.
// We maintain a small cache of parsed strings. To provide cheap LRU-like
// semantics, whenever the cache grows too large we simply delete an
// arbitrary 25% of the entries.
/**
* @const
* @type {number}
*/
var MAX_CACHE_SIZE = 1024;
/**
* @type {Object.<string, ol.Color>}
*/
var cache = {};
/**
* @type {number}
*/
var cacheSize = 0;
return (
/**
* @const
* @type {number}
* @param {string} s String.
* @return {ol.Color} Color.
*/
var MAX_CACHE_SIZE = 1024;
/**
* @type {Object.<string, ol.Color>}
*/
var cache = {};
/**
* @type {number}
*/
var cacheSize = 0;
return (
/**
* @param {string} s String.
* @return {ol.Color} Color.
*/
function(s) {
var color;
if (cache.hasOwnProperty(s)) {
color = cache[s];
} else {
if (cacheSize >= MAX_CACHE_SIZE) {
var i = 0;
var key;
for (key in cache) {
if ((i++ & 3) === 0) {
delete cache[key];
--cacheSize;
}
}
function(s) {
var color;
if (cache.hasOwnProperty(s)) {
color = cache[s];
} else {
if (cacheSize >= MAX_CACHE_SIZE) {
var i = 0;
var key;
for (key in cache) {
if ((i++ & 3) === 0) {
delete cache[key];
--cacheSize;
}
color = ol.color.fromStringInternal_(s);
cache[s] = color;
++cacheSize;
}
return color;
});
}
color = ol.color.fromStringInternal_(s);
cache[s] = color;
++cacheSize;
}
return color;
});
})();
})();
/**

View File

@@ -23,8 +23,8 @@ ol.colorlike.asColorLike = function(color) {
*/
ol.colorlike.isColorLike = function(color) {
return (
typeof color === 'string' ||
color instanceof CanvasPattern ||
color instanceof CanvasGradient
typeof color === 'string' ||
color instanceof CanvasPattern ||
color instanceof CanvasGradient
);
};

View File

@@ -1,29 +0,0 @@
goog.provide('ol.Constraints');
/**
* @constructor
* @param {ol.CenterConstraintType} centerConstraint Center constraint.
* @param {ol.ResolutionConstraintType} resolutionConstraint
* Resolution constraint.
* @param {ol.RotationConstraintType} rotationConstraint
* Rotation constraint.
*/
ol.Constraints = function(centerConstraint, resolutionConstraint, rotationConstraint) {
/**
* @type {ol.CenterConstraintType}
*/
this.center = centerConstraint;
/**
* @type {ol.ResolutionConstraintType}
*/
this.resolution = resolutionConstraint;
/**
* @type {ol.RotationConstraintType}
*/
this.rotation = rotationConstraint;
};

View File

@@ -35,7 +35,7 @@ ol.control.defaults = function(opt_options) {
}
var attributionControl = options.attribution !== undefined ?
options.attribution : true;
options.attribution : true;
if (attributionControl) {
controls.push(new ol.control.Attribution(options.attributionOptions));
}

View File

@@ -53,7 +53,7 @@ ol.control.Attribution = function(opt_options) {
* @type {boolean}
*/
this.collapsible_ = options.collapsible !== undefined ?
options.collapsible : true;
options.collapsible : true;
if (!this.collapsible_) {
this.collapsed_ = false;
@@ -91,7 +91,7 @@ ol.control.Attribution = function(opt_options) {
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
this.collapseLabel_ : this.label_;
this.collapseLabel_ : this.label_;
var button = document.createElement('button');
button.setAttribute('type', 'button');
button.title = tipLabel;

View File

@@ -115,7 +115,7 @@ ol.control.Control.prototype.setMap = function(map) {
this.map_ = map;
if (this.map_) {
var target = this.target_ ?
this.target_ : map.getOverlayContainerStopEvent();
this.target_ : map.getOverlayContainerStopEvent();
target.appendChild(this.element);
if (this.render !== ol.nullFunction) {
this.listenerKeys.push(ol.events.listen(map,

View File

@@ -12,7 +12,7 @@ goog.require('ol.events.EventType');
* @classdesc
* Provides a button that when clicked fills up the full screen with the map.
* The full screen source element is by default the element containing the map viewport unless
* overriden by providing the `source` option. In which case, the dom
* overridden by providing the `source` option. In which case, the dom
* element introduced using this parameter will be displayed in full screen.
*
* When in full screen mode, a close button is shown to exit full screen mode.
@@ -34,7 +34,7 @@ ol.control.FullScreen = function(opt_options) {
* @type {string}
*/
this.cssClassName_ = options.className !== undefined ? options.className :
'ol-full-screen';
'ol-full-screen';
var label = options.label !== undefined ? options.label : '\u2922';
@@ -43,7 +43,7 @@ ol.control.FullScreen = function(opt_options) {
* @type {Node}
*/
this.labelNode_ = typeof label === 'string' ?
document.createTextNode(label) : label;
document.createTextNode(label) : label;
var labelActive = options.labelActive !== undefined ? options.labelActive : '\u00d7';
@@ -52,7 +52,7 @@ ol.control.FullScreen = function(opt_options) {
* @type {Node}
*/
this.labelActiveNode_ = typeof labelActive === 'string' ?
document.createTextNode(labelActive) : labelActive;
document.createTextNode(labelActive) : labelActive;
var tipLabel = options.tipLabel ? options.tipLabel : 'Toggle full-screen';
var button = document.createElement('button');

View File

@@ -31,7 +31,7 @@ ol.control.MousePosition = function(opt_options) {
element.className = options.className !== undefined ? options.className : 'ol-mouse-position';
var render = options.render ?
options.render : ol.control.MousePosition.render;
options.render : ol.control.MousePosition.render;
ol.control.Control.call(this, {
element: element,
@@ -47,7 +47,7 @@ ol.control.MousePosition = function(opt_options) {
this.setCoordinateFormat(options.coordinateFormat);
}
if (options.projection) {
this.setProjection(ol.proj.get(options.projection));
this.setProjection(options.projection);
}
/**
@@ -122,7 +122,7 @@ ol.control.MousePosition.prototype.handleProjectionChanged_ = function() {
*/
ol.control.MousePosition.prototype.getCoordinateFormat = function() {
return /** @type {ol.CoordinateFormatType|undefined} */ (
this.get(ol.control.MousePosition.Property_.COORDINATE_FORMAT));
this.get(ol.control.MousePosition.Property_.COORDINATE_FORMAT));
};
@@ -135,7 +135,7 @@ ol.control.MousePosition.prototype.getCoordinateFormat = function() {
*/
ol.control.MousePosition.prototype.getProjection = function() {
return /** @type {ol.proj.Projection|undefined} */ (
this.get(ol.control.MousePosition.Property_.PROJECTION));
this.get(ol.control.MousePosition.Property_.PROJECTION));
};
@@ -192,13 +192,13 @@ ol.control.MousePosition.prototype.setCoordinateFormat = function(format) {
/**
* Set the projection that is used to report the mouse position.
* @param {ol.proj.Projection} projection The projection to report mouse
* @param {ol.ProjectionLike} projection The projection to report mouse
* position in.
* @observable
* @api
*/
ol.control.MousePosition.prototype.setProjection = function(projection) {
this.set(ol.control.MousePosition.Property_.PROJECTION, projection);
this.set(ol.control.MousePosition.Property_.PROJECTION, ol.proj.get(projection));
};

View File

@@ -42,7 +42,7 @@ ol.control.OverviewMap = function(opt_options) {
* @type {boolean}
*/
this.collapsible_ = options.collapsible !== undefined ?
options.collapsible : true;
options.collapsible : true;
if (!this.collapsible_) {
this.collapsed_ = false;
@@ -80,7 +80,7 @@ ol.control.OverviewMap = function(opt_options) {
}
var activeLabel = (this.collapsible_ && !this.collapsed_) ?
this.collapseLabel_ : this.label_;
this.collapseLabel_ : this.label_;
var button = document.createElement('button');
button.setAttribute('type', 'button');
button.title = tipLabel;
@@ -148,6 +148,44 @@ ol.control.OverviewMap = function(opt_options) {
render: render,
target: options.target
});
/* Interactive map */
var scope = this;
var overlay = this.boxOverlay_;
var overlayBox = this.boxOverlay_.getElement();
/* Functions definition */
var computeDesiredMousePosition = function(mousePosition) {
return {
clientX: mousePosition.clientX - (overlayBox.offsetWidth / 2),
clientY: mousePosition.clientY + (overlayBox.offsetHeight / 2)
};
};
var move = function(event) {
var coordinates = ovmap.getEventCoordinate(computeDesiredMousePosition(event));
overlay.setPosition(coordinates);
};
var endMoving = function(event) {
var coordinates = ovmap.getEventCoordinate(event);
scope.getMap().getView().setCenter(coordinates);
window.removeEventListener('mousemove', move);
window.removeEventListener('mouseup', endMoving);
};
/* Binding */
overlayBox.addEventListener('mousedown', function() {
window.addEventListener('mousemove', move);
window.addEventListener('mouseup', endMoving);
});
};
ol.inherits(ol.control.OverviewMap, ol.control.Control);

View File

@@ -120,16 +120,8 @@ ol.control.Rotate.prototype.resetNorth_ = function() {
// upon it
return;
}
var currentRotation = view.getRotation();
if (currentRotation !== undefined) {
if (view.getRotation() !== undefined) {
if (this.duration_ > 0) {
currentRotation = currentRotation % (2 * Math.PI);
if (currentRotation < -Math.PI) {
currentRotation += 2 * Math.PI;
}
if (currentRotation > Math.PI) {
currentRotation -= 2 * Math.PI;
}
view.animate({
rotation: 0,
duration: this.duration_,

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