Compare commits

..

548 Commits

Author SHA1 Message Date
Tim Schaub
a9b62af3fc Merge pull request #6232 from openlayers/release-v3.20.0
Release v3.20.0
2016-12-10 13:10:00 -07:00
Tim Schaub
53473ddeb1 Add note about WebGL rendering 2016-12-10 12:50:06 -07:00
Tim Schaub
49b3359aa8 Update package version to 3.20.0 2016-12-10 12:24:34 -07:00
Tim Schaub
b21944fb50 Changelog for v3.20.0 2016-12-10 12:24:02 -07:00
Tim Schaub
4db2177c1d Merge pull request #6230 from tschaub/attribution-ignore-duplicates
Ignore duplicated attributions
2016-12-10 11:50:54 -07:00
Tim Schaub
bb62360213 Create a lookup of unique attributions 2016-12-10 11:36:27 -07:00
Andreas Hocevar
adacfb6453 Add test for duplicated attribution 2016-12-10 11:31:22 -07:00
Attila Berényi
bedda42c3e Ignore duplicate attributions.
See https://github.com/openlayers/ol3/issues/5297
2016-12-10 11:31:05 -07:00
Tim Schaub
862152f9db Merge pull request #6192 from tchandelle/delete-vertex
Modify interaction: always stop event propagation when removing vertex
2016-12-10 11:18:37 -07:00
Tim Schaub
da419ffc6c Merge pull request #6228 from tschaub/rename-example
Rename the pinch zoom example
2016-12-09 12:42:49 -07:00
Andreas Hocevar
676b3efbd7 Merge pull request #6229 from openlayers/greenkeeper-phantomjs-prebuilt-2.1.14
Update phantomjs-prebuilt to version 2.1.14 🚀
2016-12-09 20:35:47 +01:00
greenkeeperio-bot
f0dc965974 chore(package): update phantomjs-prebuilt to version 2.1.14
https://greenkeeper.io/
2016-12-09 10:44:14 -07:00
Tim Schaub
1f742da046 Merge pull request #6196 from raiyni/ExtendedData
KML ExtendedData Export
2016-12-09 10:41:33 -07:00
Tim Schaub
a2fc950b44 Merge pull request #6227 from openlayers/greenkeeper-eslint-3.12.0
Update eslint to version 3.12.0 🚀
2016-12-09 10:33:07 -07:00
Tim Schaub
2bb61dab60 Example wording 2016-12-09 10:32:06 -07:00
Tim Schaub
8d5042c1b1 Dash as word separators in URLs for consistency 2016-12-09 10:24:55 -07:00
Tim Schaub
4ff87a0eef Merge pull request #6224 from aAXEe/pinZoom-allowFractionalZoom
Pinch zoom: allow fractional zoom
2016-12-09 10:22:05 -07:00
greenkeeperio-bot
403bc4bbe1 chore(package): update eslint to version 3.12.0
https://greenkeeper.io/
2016-12-09 10:15:41 -07:00
Axel Utech
61ac0c47ed add an upgrade note about the new pinchZoom behavior 2016-12-09 18:03:20 +01:00
Axel Utech
f5a27d2788 add a pinchZoom example demonstrating the old behavior with constrained zooms 2016-12-09 18:03:01 +01:00
Axel Utech
321b1f72ad add an option to make the pinchZoom constrain zoom levels to integers
Changes the default behavior of ol.interaction.PinchZoom to keep
the fractional zoom level after the gesture.
The old behavior of zooming to the next whole-number level can be
enforced with the new parameter `constrainResolution`.
2016-12-09 18:02:36 +01:00
Tim Schaub
fbbc42f8f9 Merge pull request #6226 from tchandelle/doc-anchors
Improve the headers styles in the api doc
2016-12-09 09:42:38 -07:00
Andreas Hocevar
26f31e3771 Merge pull request #5995 from KlausBenndorf/hitTolerance
Add hit tolerance parameter to ol.Map#forEachFeatureAtPixel
2016-12-08 11:06:46 +01:00
simonseyock
f28e0ebc1f Added hitTolerance parameter to reworked files 2016-12-08 10:21:57 +01:00
simonseyock
f10ae6c474 Adressed review.
Reusing transform
Changing either size of the canvas or clearing it
adding unit of hitTolerance to jsdoc
2016-12-08 10:14:36 +01:00
simonseyock
55ec0af072 Simplified api 2016-12-08 10:14:36 +01:00
simonseyock
8edc2be103 Added hitTolerance to TranslateInteraction 2016-12-08 10:14:09 +01:00
simonseyock
a469803941 adjusted hitTolerance by pixelRatio 2016-12-08 10:14:09 +01:00
simonseyock
00a4f3b410 buffering extent by resolution*hitTolerance 2016-12-08 10:14:09 +01:00
simonseyock
f6ee11bb68 Documentation and linting 2016-12-08 10:14:09 +01:00
simonseyock
eede027417 Added buffer to ol.renderer.canvas.VectorTileLayer#forEachFeatureAtCoordinate
buffering by pointResolution times hitTolerance
2016-12-08 10:14:09 +01:00
simonseyock
3a08cfd7c6 Added test for ol.render.canvas.ReplayGroup#getCircleArray_ 2016-12-08 10:14:09 +01:00
simonseyock
e9d2b913ea removed uses of lazy evaluation of || 2016-12-08 10:14:09 +01:00
simonseyock
4640c44f2a Added old syntax and hasFeatureAtPixel to changelog 2016-12-08 10:14:09 +01:00
simonseyock
c93b0ba859 Added upgrade note 2016-12-08 10:14:09 +01:00
simonseyock
5608e7284b Renamed FeatureAtPixelOptions to AtPixelOptions for future use in forEachLayerAtPixel 2016-12-08 10:14:09 +01:00
simonseyock
f0439685ad minor typos 2016-12-08 10:14:09 +01:00
simonseyock
da020d77e9 Added cache for circle arrays. Reusing context. 2016-12-08 10:14:09 +01:00
simonseyock
e0edefb4d7 Added hitTolerance to select interaction. Added hitTolerance to select interaction example. 2016-12-08 10:14:09 +01:00
simonseyock
2ea41afe6e Added hitTolerance to hasFeatureAtPixel. Corrected JsDoc problems. 2016-12-08 10:14:09 +01:00
simonseyock
63f57768a3 Removed olx.LayerFilter 2016-12-08 10:14:09 +01:00
simonseyock
80e392ea52 Satisfying linter, jsdoc & compiler 2016-12-08 10:14:09 +01:00
simonseyock
2493eb2c20 Implemented midpoint circle algorithm 2016-12-08 10:13:47 +01:00
simonseyock
5ce0d8aa2a changed signature of internal methods 2016-12-08 10:13:47 +01:00
simonseyock
80188b2044 Change signature of api methods 2016-12-08 10:12:42 +01:00
simonseyock
a6c768ae07 Make forEachFeatureAtCoordinate work with variable hitContext size 2016-12-08 10:12:42 +01:00
simonseyock
85893646c4 Added hitTolerance test 2016-12-08 10:12:42 +01:00
Frédéric Junod
e95778e47f Merge pull request #6220 from fredj/collection_push_length
Fix ol.Collection#push return value
2016-12-08 08:26:31 +01:00
Frédéric Junod
000453a0e1 Merge pull request #6213 from drnextgis/preload
Add preload option to olx.layer.VectorTileOptions
2016-12-08 08:25:56 +01:00
Andreas Hocevar
0061b15a91 Merge pull request #6222 from ahocevar/fix-foreachlayeratpixel
Fix forEachLayerAtPixel and improve class hierarchy
2016-12-07 22:29:05 +01:00
Andreas Hocevar
d854222c4b Fix forEachLayerAtPixel and improve class hierarchy 2016-12-07 19:39:52 +01:00
Marc Jansen
f795019215 Merge pull request #6075 from tchandelle/modify_stride
Keep the other dim from the original segment when modifying vertex
2016-12-07 19:22:59 +01:00
Frederic Junod
5e0ce08804 Fix ol.Collection#push return value 2016-12-07 15:11:31 +01:00
Frédéric Junod
10e36a0529 Merge pull request #6218 from gberaudo/modify_interaction_check_map_rendered
Make modify interaction more robust
2016-12-07 12:14:05 +01:00
Guillaume Beraudo
109e6a8324 Make modify interaction more robust
When the map has not been rendered yet, adding a feature should not
trigger coordinate related functions as they make use of the framestate.
2016-12-07 11:15:28 +01:00
drnextgis
f492d69691 Add preload option to olx.layer.VectorTileOptions 2016-12-07 10:22:13 +07:00
Tim Schaub
59e802737e Merge pull request #6205 from tschaub/no-extra-provides
Rework remaining modules with multiple provides
2016-12-06 17:46:44 -07:00
Tim Schaub
63e952a91a Treat one-provide violations as errors 2016-12-06 14:50:35 -07:00
Tim Schaub
041766d53c Reworked mapbrowser* things 2016-12-06 14:49:43 -07:00
Tim Schaub
57e3e7273e Add Property enum to ol.layer.Base 2016-12-06 14:49:43 -07:00
Tim Schaub
66dc2582ef Dedicated module for GeometryLayout 2016-12-06 14:49:43 -07:00
Tim Schaub
7858b68fc0 Dedicated module for GeometryType enum 2016-12-06 14:49:43 -07:00
Tim Schaub
c00906cde9 Add Event to ol.Object 2016-12-06 14:49:43 -07:00
Tim Schaub
daba1fbcb6 Add EventType enum to ol.Object 2016-12-06 14:49:43 -07:00
Tim Schaub
3d2f677f2a Add OperationType enum to ol.source.Raster 2016-12-06 14:49:43 -07:00
Tim Schaub
c0fe3f1e4f Dedicated module for ol.extent.Relationship enum 2016-12-06 14:49:43 -07:00
Tim Schaub
780bb1b30d Dedicated module for ol.extent.Corner enum 2016-12-06 14:49:43 -07:00
Tim Schaub
82c0dcdc00 Merge pull request #6207 from tschaub/require-all
Require all when generating exports
2016-12-06 14:41:02 -07:00
Tim Schaub
fc8915d8b7 Merge pull request #6204 from tschaub/proj
Refactored proj modules
2016-12-06 14:38:35 -07:00
Andreas Hocevar
db5032af49 Merge pull request #6209 from ahocevar/not-to-be
Test array with to.eql(), not to.be.eql()
2016-12-06 16:25:08 +01:00
Andreas Hocevar
132be598e7 Test array with to.eql(), not to.be.eql() 2016-12-06 16:03:35 +01:00
Andreas Hocevar
89ebf0a182 Merge pull request #6091 from tchandelle/linedash
Apply pixelRatio to line dash
2016-12-06 15:53:23 +01:00
Andreas Hocevar
621589b318 Merge pull request #6082 from ahocevar/unified-canvas-rendering
Unified canvas rendering
2016-12-06 08:59:40 +01:00
Andreas Hocevar
93d86e63fc Defer frame preparation when too much time was spent 2016-12-06 08:51:55 +01:00
Andreas Hocevar
ee7b894350 Refactor VectorTile renderer and add lower resolution clipping 2016-12-06 08:51:55 +01:00
Andreas Hocevar
0d65d1d813 Remove support for skipped features 2016-12-06 08:47:41 +01:00
Andreas Hocevar
2aa4f0c01c Fix forEachLayerAtPixel for the canvas renderer 2016-12-06 08:47:41 +01:00
Andreas Hocevar
ccdb955cd9 Simplify canvas tile renderer with image composition 2016-12-06 08:47:40 +01:00
Tim Schaub
f898a3b182 Merge pull request #6173 from bjornharrtell/topolis
Topolis example
2016-12-05 18:11:20 -07:00
Tim Schaub
c8064d15b7 Merge pull request #6206 from tschaub/zero
Stop asserting that zero duration animations take time
2016-12-05 08:59:05 -07:00
Thomas Chandelle
3b64133f21 Add tests for linedash for HiDPI display 2016-12-05 09:26:06 +01:00
Thomas Chandelle
7ee04ec200 Compare current linedash and new linedash as arrays 2016-12-05 09:24:13 +01:00
Thomas Chandelle
a0e310700c Apply pixelRatio to line dash 2016-12-05 09:24:13 +01:00
Tim Schaub
99eddbb31f Require all when generating exports 2016-12-04 16:43:15 -07:00
Tim Schaub
dfbc7bb743 Stop dividing by zero 2016-12-04 15:10:53 -07:00
Tim Schaub
12add87603 Stop asserting that zero duration animations take time 2016-12-04 15:04:54 -07:00
Tim Schaub
6259caf634 Consistently return a function or undefined 2016-12-04 12:58:33 -08:00
Tim Schaub
6d22119425 One provide per proj module 2016-12-04 12:44:04 -08:00
Tim Schaub
08569d4eb3 Dedicated module for ol.proj.Projection 2016-12-04 12:41:04 -08:00
Tim Schaub
a33caa598c Dedicated module for proj4 access 2016-12-04 10:37:33 -08:00
Tim Schaub
b54342dfb8 Dedicated module for projections cache 2016-12-04 10:24:43 -08:00
Tim Schaub
679fe298aa Dedicated module for transforms cache 2016-12-04 10:09:32 -08:00
Tim Schaub
fd6116ab6b Dedicated module for ol.proj.Units 2016-12-04 09:17:24 -08:00
Tim Schaub
f6a3ec513e Merge pull request #6203 from tschaub/missing-requires
Address a few missing requires
2016-12-04 10:11:28 -07:00
Tim Schaub
ab640a20d0 Move CLONE_PROPS to ol.pointer.PointerEventHandler 2016-12-03 10:48:32 -08:00
Tim Schaub
fda2d8e40e Functions in ol.geom.flat.interpolate namespace 2016-12-03 10:45:52 -08:00
Tim Schaub
37c445275f Require ol.MapBrowserEvent 2016-12-03 10:37:49 -08:00
Tim Schaub
e87407c28f Merge pull request #6201 from tschaub/arcgis-fix
Remove assertion in TileArcGISRest source
2016-12-03 10:29:07 -08:00
Tim Schaub
a3f3c24c51 Merge pull request #6202 from tschaub/animate-zero
Allow animation duration to be zero
2016-12-03 10:28:18 -08:00
Tim Schaub
c04a011077 Merge pull request #6198 from oterral/flyTo
Fix sourceResolution value in view.animate
2016-12-02 23:07:30 -08:00
Tim Schaub
dfb4c800b9 Allow animation duration to be zero 2016-12-02 19:15:34 -08:00
Tim Schaub
fdec14c425 Merge pull request #6177 from tchandelle/fit-animations
Add duration and easing options to view.fit() for animations
2016-12-02 19:09:08 -08:00
Tim Schaub
ce8cf27ad3 Remove assertion 2016-12-02 15:22:10 -08:00
oterral
9eda6df821 Fix sourceResolution value in view.animate 2016-12-02 16:39:25 +01:00
Ron Young
85881082b0 use feature geometry in filter 2016-12-01 21:38:13 -06:00
Ron Young
fdff4c5c7c export ExtendedData tests 2016-12-01 21:11:13 -06:00
Ron Young
aa08f88105 node factories, serializers, and writers for exporing ExtendedData 2016-12-01 21:10:07 -06:00
Ron Young
cde48521d0 add ol.format.XSD CDATA writer 2016-12-01 20:33:47 -06:00
Marc Jansen
bdeaafcdf7 Merge pull request #6078 from bjornharrtell/windingnumber
Use winding number algorithm for linearRingContainsXY
2016-12-01 13:46:07 +01:00
Thomas Chandelle
510076290d Always stop event propagation when removing vertex 2016-12-01 10:27:47 +01:00
Andreas Hocevar
9dc300d520 Merge pull request #6187 from openlayers/greenkeeper-pbf-3.0.5
Update pbf to version 3.0.5 🚀
2016-11-30 16:25:13 +01:00
greenkeeperio-bot
5c0a6de288 chore(package): update pbf to version 3.0.5
https://greenkeeper.io/
2016-11-30 06:35:35 -08:00
Thomas Chandelle
b77b5e5a55 Replace the anchor by an empty div element 2016-11-29 17:00:29 +01:00
Andreas Hocevar
794628782c Merge pull request #6175 from tchandelle/projection-perf
Generate projection transform function only when requested
2016-11-29 13:21:11 +01:00
Andreas Hocevar
fe758c2606 Simplify and make the compiler happy 2016-11-29 12:14:11 +01:00
Andreas Hocevar
c03f19bf5c Merge pull request #6181 from ahocevar/bing-key
Replace expired Bing key with a new one
2016-11-29 11:41:06 +01:00
Andreas Hocevar
d9453890eb Replace expired Bing key with a new one 2016-11-29 11:31:17 +01:00
Marc Jansen
4dc828c691 Merge pull request #6164 from marcjansen/color-parsing
Simplify color parsing and allow more decimals
2016-11-29 11:03:22 +01:00
Marc Jansen
88cfdb435c Use indexOf instead of RegExp as suggested 2016-11-29 10:55:04 +01:00
Björn Harrtell
656af72615 Use winding number algorithm for linearRingContainsXY 2016-11-29 09:10:47 +01:00
Björn Harrtell
6c644186ba Add test case for ol.geom.flat.contains 2016-11-29 09:07:10 +01:00
Frédéric Junod
51f7bfb415 Merge pull request #6178 from fredj/missing_require
Add missing goog.require
2016-11-29 08:20:57 +01:00
Andreas Hocevar
8f7aee4847 Merge pull request #6176 from tchandelle/animation-easing
Doc: easing option is optional
2016-11-28 19:28:08 +01:00
Andreas Hocevar
8c6437fba5 Merge pull request #6180 from openlayers/greenkeeper-eslint-3.11.1
Update eslint to version 3.11.1 🚀
2016-11-28 19:27:33 +01:00
greenkeeperio-bot
65c89199f1 chore(package): update eslint to version 3.11.1
https://greenkeeper.io/
2016-11-28 10:33:30 -07:00
Frédéric Junod
9ef0434be2 Merge pull request #6179 from fredj/rm_unused
Remove unused ol.Map.removePreRenderFunction function
2016-11-28 16:53:15 +01:00
Frederic Junod
59b8d969d6 Remove unused ol.Map.removePreRenderFunction function
The function is no longer used after #6079
2016-11-28 14:02:42 +01:00
Thomas Chandelle
5b04771d3f Add duration and easing options to view.fit() for animations 2016-11-28 13:55:40 +01:00
Frederic Junod
1b6c239114 Add missing goog.require 2016-11-28 13:46:26 +01:00
Thomas Chandelle
c4af981b01 easing option is optional
jsdoc was probably interpreting function(number):number|undefined as
a function that returns a number or undefined.
2016-11-28 13:07:02 +01:00
Thomas Chandelle
c898cda2e6 Generate projection transform function only when requested 2016-11-28 09:50:41 +01:00
Bart van den Eijnden
d47e5aed10 Merge pull request #6052 from oterral/teo_dflt_style
Remove the use of ol.format.KML.DEFAULT_IMAGE_SCALE_MULTIPLIER_ when …
2016-11-28 09:38:10 +01:00
Björn Harrtell
7ad519fbf3 Topolis example 2016-11-27 00:46:25 +01:00
Frédéric Junod
8fe783d975 Merge pull request #6159 from tchandelle/examples-require-carriage-return
Remove carriage return after goog.require in examples
2016-11-25 13:20:15 +01:00
Frédéric Junod
15769101af Merge pull request #6169 from tchandelle/image-rotation-webgl
Image rotation in WebGL was anti-clockwise
2016-11-25 10:18:10 +01:00
Tobias Sauerwein
0e95905c6f Merge pull request #5590 from thhomas/kml-region-extendeddata
Kml format: improved support for region and extendeddata
2016-11-25 09:33:46 +01:00
Thomas Chandelle
9ffa103a79 Image rotation in WebGL was anti-clockwise 2016-11-25 09:02:20 +01:00
Marc Jansen
7f0d914161 Merge pull request #5462 from GaborFarkas/webgl_vector
WebGL vector support
2016-11-25 09:01:10 +01:00
Frédéric Junod
66a55d126b Merge pull request #6168 from openlayers/greenkeeper-mocha-3.2.0
Update mocha to version 3.2.0 🚀
2016-11-25 08:45:26 +01:00
greenkeeperio-bot
d5c7692a96 chore(package): update mocha to version 3.2.0
https://greenkeeper.io/
2016-11-24 17:34:54 -07:00
Bart van den Eijnden
3e31ff113b Merge pull request #5589 from thhomas/wmts-tilematrixlimits
Wmts tilematrixlimits
2016-11-24 10:14:25 +01:00
Thomas Tilak
1f04a0aad9 adds TileMatrixSetLimits to WMTS format reader
enhance wmtstilegrid to use it when building matrixId and resolution arrays
2016-11-23 18:50:24 +01:00
Thomas Tilak
d2e3017088 improve kml parsing of <Region> and <ExtendedData> tags 2016-11-23 17:46:04 +01:00
Marc Jansen
02d41caa8a Simplify color parsing and allow more decimals 2016-11-23 16:06:08 +01:00
GaborFarkas
dba0934112 Refactor LineString GLSL & clean up 2016-11-23 10:14:20 +01:00
GaborFarkas
d27591dea7 Adjust WebGL immediate test 2016-11-23 09:51:38 +01:00
GaborFarkas
0f204641e3 Clean up GLSLs somewhat 2016-11-23 09:51:37 +01:00
GaborFarkas
02461b3416 Add no-op WebGL text replay 2016-11-23 09:51:37 +01:00
GaborFarkas
3e56dba1b4 Do not draw vectors outside viewport 2016-11-23 09:51:37 +01:00
GaborFarkas
3b2ff5a2ee Revamp WebGL CircleReplay 2016-11-23 09:51:37 +01:00
GaborFarkas
efbc4ead8d Minor fixes according to review 2016-11-23 09:51:37 +01:00
GaborFarkas
dd905ffb5b Cleanup and fix DPR in WebGL CircleReplay 2016-11-23 09:51:37 +01:00
GaborFarkas
a7ddda7d81 Force close polygon contours (WebGL) 2016-11-23 09:51:37 +01:00
GaborFarkas
ca1414b2d0 Add depth test to PolygonReplay 2016-11-23 09:51:37 +01:00
GaborFarkas
310fabe94a Add tests for WebGL Immediate API 2016-11-23 09:51:37 +01:00
GaborFarkas
0c45b52a7a Add functions to WebGL Immediate API 2016-11-23 09:51:37 +01:00
GaborFarkas
8a6b206220 Add more tests 2016-11-23 09:51:37 +01:00
GaborFarkas
0cb0ea2a8a Add tests for ol.render.webgl.CircleReplay 2016-11-23 09:51:37 +01:00
GaborFarkas
c675a33235 Add tests for ol.render.webgl.Replay 2016-11-23 09:51:37 +01:00
GaborFarkas
62fb8d8fd8 Fix typos 2016-11-23 09:51:37 +01:00
GaborFarkas
36df9a9c09 Add missing requires 2016-11-23 09:51:37 +01:00
GaborFarkas
dc360c2d7f Refactor WebGL render tests 2016-11-23 09:51:37 +01:00
GaborFarkas
763bbca549 Fix skipping replay 2016-11-23 09:51:37 +01:00
GaborFarkas
697cbf16f0 Fix some rendering issues with complex styling 2016-11-23 09:51:37 +01:00
GaborFarkas
dd7e49c217 Fix canvas cricle test 2016-11-23 09:51:37 +01:00
GaborFarkas
58afee6706 Clean up polygon replay GLSL 2016-11-23 09:51:37 +01:00
GaborFarkas
ac6408be3b Add circle replay to WebGL renderer 2016-11-23 09:51:36 +01:00
GaborFarkas
86c914f3df Fix glitched lines with rotated view 2016-11-23 09:51:36 +01:00
GaborFarkas
5fb0a84579 Fix WebGL PolygonReplay#bridgeHole_ 2016-11-23 09:51:36 +01:00
GaborFarkas
a002474761 Fix typo in polygon rendering test 2016-11-23 09:51:36 +01:00
GaborFarkas
e124b34b24 Correctly draw polygons with transparent border 2016-11-23 09:51:36 +01:00
GaborFarkas
3af5c2805e Add tests to WebGL triangulating functions 2016-11-23 09:51:36 +01:00
GaborFarkas
004c0f7e27 Fix WebGL PolygonReplay#getPointsInTriangle_ 2016-11-23 09:51:36 +01:00
GaborFarkas
0c3d5eca5c Add tests for the linked list struct 2016-11-23 09:51:36 +01:00
GaborFarkas
71d790ccfd Add zIndex support to WebGL renderer 2016-11-23 09:51:36 +01:00
GaborFarkas
8e8098b362 Add some test to PolygonReplay 2016-11-23 09:51:36 +01:00
GaborFarkas
5cf2e9c072 Add shutdown methods to replays 2016-11-23 09:51:36 +01:00
GaborFarkas
360e77481d Restructure webgl replays 2016-11-23 09:51:36 +01:00
GaborFarkas
dc27f768d0 Correctly triangulate simple polygons. 2016-11-23 09:51:36 +01:00
GaborFarkas
a0089b5126 Correctly triangulate bad polygons. 2016-11-23 09:51:36 +01:00
GaborFarkas
657f2c7b6c Optimize processing flat coordinates 2016-11-23 09:51:36 +01:00
GaborFarkas
5d65028d26 Initial ear clipping algorithm 2016-11-23 09:51:33 +01:00
GaborFarkas
88f7e7a38d Utilities for polygon renderer 2016-11-23 09:49:48 +01:00
GaborFarkas
610084d456 Linked list structure for polygon renderer 2016-11-23 09:49:48 +01:00
GaborFarkas
18bc820f8b Prevent overdraw in PolygonReplay. 2016-11-23 09:49:48 +01:00
GaborFarkas
4b2fb38954 Fix preparation of multipolygons with holes. 2016-11-23 09:49:48 +01:00
GaborFarkas
226bf5a9ea Allow empty fillStyle for polygons. 2016-11-23 09:49:48 +01:00
GaborFarkas
16a50ee0c7 Extend PolygonReplay with hit detection and skipping. 2016-11-23 09:49:48 +01:00
GaborFarkas
ce3b286cd3 RTE correct only once. 2016-11-23 09:49:48 +01:00
GaborFarkas
112fae228a Sanity check fill colors. 2016-11-23 09:49:48 +01:00
GaborFarkas
18cf6c30bd Add basic polygon renderer. 2016-11-23 09:49:48 +01:00
GaborFarkas
269c3eb943 Set WebGL LineString threshold to 14.6
This commit will be a fixup for the previous one, or get deleted eventually.
2016-11-23 09:49:48 +01:00
GaborFarkas
e893603966 Add tests to LineStringReplay 2016-11-23 09:49:47 +01:00
GaborFarkas
638b7752fa Fix bugs in LineStringReplay. 2016-11-23 09:49:47 +01:00
GaborFarkas
f96a4a7301 Properly handle zeros in stroke style. 2016-11-23 09:49:47 +01:00
GaborFarkas
1c7203a203 Add skipping capability to LineStringReplay 2016-11-23 09:49:47 +01:00
GaborFarkas
48d3bfe297 Take line width into account when forming miters. 2016-11-23 09:49:47 +01:00
GaborFarkas
16dfc5dfba Adjust replays to new version. 2016-11-23 09:49:47 +01:00
GaborFarkas
c966e21e40 Fix black canvas when image is missing 2016-11-23 09:49:47 +01:00
GaborFarkas
2415050500 Add hit detection support to LineStringReplay
Also, making it more consistent with ImageReplay
2016-11-23 09:49:47 +01:00
GaborFarkas
b7396b0b94 Improve code quality
Cleaning up, making the code more consistent, and restructuring commonly used methods.
2016-11-23 09:49:47 +01:00
GaborFarkas
3897312af6 Add full support to different styles in one layer. 2016-11-23 09:49:47 +01:00
GaborFarkas
9d6a860cd1 Fix overdraw issue with Firefox
As usual, Firefox is the good guy here, too, and this is an issue with Chrome
2016-11-23 09:49:47 +01:00
GaborFarkas
4d8777220a Fix compiler and compiled lib related problems. 2016-11-23 09:49:47 +01:00
GaborFarkas
b0d11391b2 Fix rounding problems
Fragment shader does not know about the projection matrix, thus it has to take the pixel ratio into account.
2016-11-23 09:49:47 +01:00
GaborFarkas
249084dcd4 Eliminate overdraw with a nice little trick 2016-11-23 09:49:47 +01:00
GaborFarkas
c9c970303f Handling sharp angles in linestring GLSL 2016-11-23 09:49:47 +01:00
GaborFarkas
3f828248b9 Rework isClosed with added tests 2016-11-23 09:49:47 +01:00
GaborFarkas
e64549c50c Fix weird behaviour of boundaries
With drawElements, it seems like we cannot connect an old index with a much fresher one, as it will produce weird errors.
2016-11-23 09:49:47 +01:00
GaborFarkas
4be8de62ae Refactor linestring geom validation
Now it only focuses on issues not addressed by ol.geom.flat.simplify methods.
2016-11-23 09:49:47 +01:00
GaborFarkas
f15a9652d8 Fix rendering of boundaries. 2016-11-23 09:49:47 +01:00
GaborFarkas
eba006b796 Falling back to bevel when exceeding miterLimit 2016-11-23 09:49:47 +01:00
GaborFarkas
8c561a45b9 Inspect linestring validity before drawing 2016-11-23 09:49:46 +01:00
GaborFarkas
99e4009b19 Minor improvements
ol.render.webgl.LineStringReplay.startIndices_ is initialized with a 0, and the end index of a valid line is added in every valid iteration.

drawElements_ is refactored for a clearer code.
2016-11-23 09:49:46 +01:00
GaborFarkas
e2ec6d0b82 Adding support for closed lines 2016-11-23 09:49:46 +01:00
GaborFarkas
0f8e1a7e40 Refactoring ol.render.webgl.LineStringReplay 2016-11-23 09:49:46 +01:00
GaborFarkas
c13d09ba23 Handle case of one segment lines with identical coordinates + quality improvements 2016-11-23 09:49:46 +01:00
GaborFarkas
fb71860a03 Adding linestring cap support 2016-11-23 09:49:46 +01:00
GaborFarkas
350d1add81 Change goog.base to call, and goog.inherits to ol.inherits 2016-11-23 09:49:46 +01:00
GaborFarkas
0972988bdb Properly triangulate linestrings 2016-11-23 09:49:46 +01:00
GaborFarkas
c7edd21cc3 Extend linestring renderer with GLSL and indexed geometries. 2016-11-23 09:49:46 +01:00
GaborFarkas
caeb8e4820 Eliminating jitter by restructuring 2016-11-23 09:49:46 +01:00
GaborFarkas
6e958514ee Taking line width into account 2016-11-23 09:49:46 +01:00
GaborFarkas
628db9146d Creating a webgl.Replay struct, making the WebGL LineString renderer compilable 2016-11-23 09:49:46 +01:00
GaborFarkas
f5978c659c Adding some defaults 2016-11-23 09:49:46 +01:00
GaborFarkas
a6ddee0c5f Updating old code to current ol3 version 2016-11-23 09:49:46 +01:00
GaborFarkas
a052b645df Fix dependencies 2016-11-23 09:49:46 +01:00
Guillaume Beraudo
e40b545e40 Add basic WEBGL LineString rendering
Use gl.LINES and hardcode a width.
Implement polygon stroking using the line string replay.
2016-11-23 09:49:46 +01:00
Guillaume Beraudo
8e9b589ca9 Add tests to PolygonReplay renderer 2016-11-23 09:49:46 +01:00
Guillaume Beraudo
581ea8c775 Add color to WEBGL polygons 2016-11-23 09:49:46 +01:00
Guillaume Beraudo
2519cf36fc Basic WEBGL rendering of polygons 2016-11-23 09:49:46 +01:00
Guillaume Beraudo
8bdbe7aae0 Add earcut to package.json and wrap it in ol.ext
Earcut is a library for triangulating polygons.
See https://github.com/mapbox/earcut.
2016-11-23 09:49:46 +01:00
Bart van den Eijnden
c8d35e4fb0 Merge pull request #6155 from romanzoller/gpx-geometry-layout
Set GeometryLayout correctly when reading GPX
2016-11-23 08:52:26 +01:00
Frédéric Junod
13884dac4d Merge pull request #6161 from openlayers/greenkeeper-async-2.1.4
Update async to version 2.1.4 🚀
2016-11-23 08:22:23 +01:00
greenkeeperio-bot
9a900becd3 chore(package): update async to version 2.1.4
https://greenkeeper.io/
2016-11-22 12:28:01 -07:00
Thomas Chandelle
d8c428a8a2 Remove also carriage return after goog.require in examples 2016-11-22 16:49:12 +01:00
Roman Zoller
f56b2c8a75 Set GeometryLayout correctly when reading GPX
Fixes #6148
2016-11-22 10:42:11 +01:00
Bart van den Eijnden
d759ad603a Merge pull request #6153 from romanzoller/remove-licenses
Remove legacy licenses folder
2016-11-22 09:32:11 +01:00
Andreas Hocevar
caef2b51b4 Merge pull request #6154 from openlayers/greenkeeper-mocha-phantomjs-core-2.1.0
Update mocha-phantomjs-core to version 2.1.0 🚀
2016-11-21 23:07:37 +01:00
greenkeeperio-bot
2842938514 chore(package): update mocha-phantomjs-core to version 2.1.0
https://greenkeeper.io/
2016-11-21 12:41:06 -07:00
Roman Zoller
6ce1731a03 Remove legacy licenses folder
Fixes #6152
2016-11-21 15:38:04 +01:00
Tim Schaub
76e1f4e041 Merge pull request #6146 from tchandelle/circle-as-regularshape
Merge ol.style.Circle and RegularShape together
2016-11-18 12:44:51 -07:00
Thomas Chandelle
800c6f53a9 Merge ol.style.Circle and RegularShape together 2016-11-18 15:17:35 +01:00
Bart van den Eijnden
fd3c9f58bf Merge pull request #6139 from bartvde/wmts-proj
Match equivalent projections from WMTS caps
2016-11-16 18:27:33 +01:00
Bart van den Eijnden
c990cab0c3 Match equivalent projections from WMTS caps 2016-11-16 16:17:55 +01:00
Andreas Hocevar
d0a957d484 Merge pull request #6138 from openlayers/greenkeeper-clean-css-3.4.21
Update clean-css to version 3.4.21 🚀
2016-11-16 13:56:36 +01:00
Andreas Hocevar
886ddb160c Merge pull request #6132 from tohu12/getColor_to_Icon
Add getter for color property to ol.style.Icon
2016-11-16 13:54:24 +01:00
Bart van den Eijnden
26a80af517 Merge pull request #6127 from omarkljung/format_wkt_z
Format WKT Z, M and ZM
2016-11-16 12:03:54 +01:00
greenkeeperio-bot
5fa1bd4bf0 chore(package): update clean-css to version 3.4.21
https://greenkeeper.io/
2016-11-16 03:59:30 -07:00
Tomas Hulek
e7e425c288 Added getter for Color property to ol.style.Icon and updated test 2016-11-16 11:12:49 +01:00
Tim Schaub
d0ada3442d Merge pull request #6136 from openlayers/greenkeeper-eslint-3.10.2
Update eslint to version 3.10.2 🚀
2016-11-15 17:38:12 -07:00
greenkeeperio-bot
4b1dfd7897 chore(package): update eslint to version 3.10.2
https://greenkeeper.io/
2016-11-15 16:45:19 -07:00
Olle Markljung
f436f2d5e2 Adds support for M, Z and ZM WKT formatting 2016-11-15 21:04:56 +01:00
Andreas Hocevar
5b59ddd473 Merge pull request #6133 from KlausBenndorf/docuFix
Doc clarification ol.MapBrowserEvent#pixel, ol.MapBrowserEvent#coordinate, ol.Map#getEventCoordinate
2016-11-15 20:48:11 +01:00
simonseyock
8c49f6db46 Changed wording 2016-11-15 18:41:29 +01:00
Andreas Hocevar
9fd55e50f7 Merge pull request #6134 from dnlkoch/add-style-setters
Add setter methods for fill, image, stroke and text styles
2016-11-15 18:34:27 +01:00
Daniel Koch
c60e1d0fb3 Setter methods for fill, image, stroke and text 2016-11-15 17:19:49 +01:00
simonseyock
a133beb168 Documentation clarification
Clarified the description of the pixel and coordinate attribute of the ol.MapBrowserEvent
2016-11-15 17:13:23 +01:00
Andreas Hocevar
b87564335e Merge pull request #6129 from openlayers/greenkeeper-pbf-3.0.4
Update pbf to version 3.0.4 🚀
2016-11-14 23:04:30 +01:00
greenkeeperio-bot
ca1c6c343e chore(package): update pbf to version 3.0.4
https://greenkeeper.io/
2016-11-14 14:38:31 -07:00
Tim Schaub
940b5e18b5 Merge pull request #6121 from tschaub/hint-change-means-view-change
Hint change means view change
2016-11-14 11:55:36 -07:00
Tim Schaub
8401d22f28 Setting a view hint triggers change 2016-11-14 10:18:39 -07:00
Tim Schaub
1ae6921e53 Make view.setHint() trigger change 2016-11-14 10:18:39 -07:00
Tim Schaub
15c4dadbaf Merge pull request #6120 from tschaub/hint-changed
Set interacting hint during trackpad scroll
2016-11-14 10:17:12 -07:00
Tim Schaub
82e6508dea Merge pull request #6128 from openlayers/greenkeeper-pbf-3.0.3
Update pbf to version 3.0.3 🚀
2016-11-14 06:15:46 -07:00
greenkeeperio-bot
8c7d5e9cbc chore(package): update pbf to version 3.0.3
https://greenkeeper.io/
2016-11-14 05:55:40 -07:00
Marc Jansen
8dbd16ee40 Merge pull request #6124 from marcjansen/more-digits
Allow up to 16 decimals for alpha channel when parsing rgba strings to colors
2016-11-14 10:33:42 +01:00
Marc Jansen
9af73a1588 Allow max 16 decimals for alpha when parsing rgba 2016-11-14 08:40:39 +01:00
Tim Schaub
0ac620c817 Set interacting hint during trackpad scroll 2016-11-13 10:25:45 -07:00
Tim Schaub
5b85f8ecc9 Render on view changes 2016-11-13 10:25:20 -07:00
Tim Schaub
8f6e07bfb8 Merge pull request #6117 from openlayers/greenkeeper-handlebars-4.0.6
Update handlebars to version 4.0.6 🚀
2016-11-12 19:43:58 -07:00
greenkeeperio-bot
70d7a865d7 chore(package): update handlebars to version 4.0.6
https://greenkeeper.io/
2016-11-12 18:33:00 -07:00
Tim Schaub
51cab63032 Merge pull request #6113 from tschaub/scroll-zoom
Smooth trackpad zooming
2016-11-12 15:00:05 -07:00
Tim Schaub
455b28d2fa Merge pull request #6105 from tschaub/feature-loader
Move vector tile loader functions into vector tile module
2016-11-12 14:55:53 -07:00
Tim Schaub
3c8d339617 Merge pull request #6114 from tschaub/curly
Updated linter config and curly conditional blocks
2016-11-12 14:54:44 -07:00
Tim Schaub
d4295e7ed7 Updated linter config and curly conditional blocks 2016-11-12 13:29:19 -07:00
Tim Schaub
7c5e428578 Merge pull request #6106 from tschaub/types
Add type annotations for vector tiles
2016-11-12 12:11:10 -07:00
Tim Schaub
489d37d384 Use representative wheel delta values in the tests 2016-11-12 12:07:57 -07:00
Tim Schaub
e6f8288d36 Cancel and restart animation when wheel zooming 2016-11-12 11:34:54 -07:00
Tim Schaub
e2be8611ef Unconstrainted zooming 2016-11-12 11:27:41 -07:00
Tim Schaub
7dd7eb1b6f Adjust resolution then animate to next 2016-11-12 11:27:41 -07:00
Tim Schaub
94e6dc4e4e Keep track of scroll mode 2016-11-12 11:27:41 -07:00
Tim Schaub
822b0a49b4 Merge pull request #6107 from tschaub/more-animation
Reset hint first and notify of change when cancelling animations
2016-11-12 11:21:43 -07:00
Marc Jansen
5baf107078 Merge pull request #6112 from openlayers/greenkeeper-eslint-3.10.0
Update eslint to version 3.10.0 🚀
2016-11-11 23:37:36 +01:00
greenkeeperio-bot
c39f05623e chore(package): update eslint to version 3.10.0
https://greenkeeper.io/
2016-11-11 13:29:27 -07:00
Tim Schaub
9b828afad3 Merge pull request #6110 from openlayers/greenkeeper-coveralls-2.11.15
Update coveralls to version 2.11.15 🚀
2016-11-11 12:43:01 -07:00
greenkeeperio-bot
16f2cf4809 chore(package): update coveralls to version 2.11.15
https://greenkeeper.io/
2016-11-11 09:53:30 -07:00
Tim Schaub
7f01de9261 Reset hint first and notify of change when cancelling animations 2016-11-11 06:31:26 -07:00
Tim Schaub
9272db1d25 Let the compiler know these are vector tiles 2016-11-11 05:48:06 -07:00
Tim Schaub
a20bd72aa9 Move loader functions and response handlers to tile module 2016-11-11 05:35:20 -07:00
Tim Schaub
b829471c85 Move default tile load function to tile module 2016-11-11 05:04:36 -07:00
Bart van den Eijnden
64057d7e6b Merge pull request #6077 from bartvde/bing-hidpi
Optionally enable hidpi support for Bing
2016-11-11 09:17:08 +01:00
Tim Schaub
447c6800ca Merge pull request #6103 from tschaub/inanimate
Properly complete multiple parallel animations
2016-11-10 18:12:16 -07:00
Tim Schaub
291766c48d Let people zoom a lot with the button 2016-11-10 10:20:47 -07:00
Tim Schaub
97d942c8e2 Correctly prune completed animation series 2016-11-10 10:18:42 -07:00
Tim Schaub
0c54d141cb Merge pull request #6101 from tschaub/wheel-zoom
Avoid starting new zoom animation while already animating
2016-11-10 08:20:46 -07:00
Andreas Hocevar
2d711a59b5 Merge pull request #6099 from tchandelle/modify-test
Modify interaction tests : check for change events
2016-11-10 15:53:58 +01:00
Tim Schaub
25770e7ef4 Only zoom if not zooming 2016-11-10 06:25:03 -07:00
Andreas Hocevar
61df657cfb Merge pull request #6069 from tchandelle/translate-no-features
If there is no features option, all features will be translated.
2016-11-10 13:32:52 +01:00
Thomas Chandelle
5d214567ab Add test for Translate interaction, without features option 2016-11-09 14:36:25 +01:00
Andreas Hocevar
902003ee12 Merge pull request #6097 from tchandelle/doc-index
API index page : Fix link anchor to static members
2016-11-09 14:32:07 +01:00
Thomas Chandelle
af82f972da Check for middle events
Most of the times, there is only 3 events. This loop is supposed to
check the middle one, but never does;
2016-11-09 14:25:33 +01:00
Thomas Chandelle
60e352fa09 Make Translate options optional 2016-11-09 13:54:10 +01:00
Thomas Chandelle
741494098e Fix link anchor to static members 2016-11-09 13:30:57 +01:00
Andreas Hocevar
100990cc12 Merge pull request #6095 from tchandelle/line-arrows
LineString Arrows example: rotate with the view
2016-11-09 10:44:21 +01:00
Thomas Chandelle
5b00095bd0 Rotate the arrows with the view 2016-11-09 09:42:08 +01:00
Andreas Hocevar
6090051661 Merge pull request #6093 from openlayers/greenkeeper-mustache-2.3.0
Update mustache to version 2.3.0 🚀
2016-11-08 21:26:41 +01:00
greenkeeperio-bot
c52d6f2c6b chore(package): update mustache to version 2.3.0
https://greenkeeper.io/
2016-11-08 09:29:48 -07:00
Bart van den Eijnden
183266beef Update externs definition 2016-11-07 19:27:33 +01:00
Andreas Hocevar
d52b3715d9 Fix tile size and pixel ratio 2016-11-07 19:22:19 +01:00
Tim Schaub
77ec54e245 Merge pull request #6079 from tschaub/animate
Add view animation
2016-11-07 09:50:41 -07:00
Tim Schaub
2b82f7281f Merge pull request #6081 from openlayers/greenkeeper-metalsmith-layouts-1.7.0
Update metalsmith-layouts to version 1.7.0 🚀
2016-11-06 17:37:37 -07:00
Tim Schaub
474e6ea643 Add upgrade notes about view.animate() 2016-11-06 17:13:13 -07:00
Tim Schaub
ea9fea000a Deprecation warning for map.beforeRender() and ol.animation functions 2016-11-06 17:13:03 -07:00
Tim Schaub
7fde4a48f4 Test that zoom is preferred over resolution 2016-11-06 16:48:04 -07:00
Tim Schaub
8d15a00b81 Add a tour to the animation example 2016-11-06 16:47:59 -07:00
Tim Schaub
2eedffa100 Separate olx.OverlayPanOptions from olx.animation.PanOptions 2016-11-06 10:40:27 -07:00
Tim Schaub
fee761b159 Correct ol.ViewAnimation typedef 2016-11-06 10:16:09 -07:00
Tim Schaub
6f08498684 Run animations in series 2016-11-06 10:06:58 -07:00
Tim Schaub
337c6bb73e Improve example legibility 2016-11-06 09:47:15 -07:00
Tim Schaub
3455686734 Doc updates 2016-11-06 09:39:35 -07:00
Tim Schaub
f4579dacd8 Add view.animate() to the API 2016-11-06 09:28:53 -07:00
Tim Schaub
4b19f12c29 Link to view.animate() 2016-11-06 09:17:14 -07:00
Tim Schaub
6b00e2ace4 Documentation for view.animate() 2016-11-06 09:13:59 -07:00
Tim Schaub
da8eb97f54 Use the animating hint 2016-11-06 09:13:59 -07:00
Tim Schaub
f6ad883db6 Use view.animate() to auto-pan an overlay 2016-11-06 09:13:55 -07:00
Tim Schaub
a484cf0910 Remove use of map.beforeRender() in geolocation orientation example 2016-11-06 09:12:24 -07:00
Tim Schaub
e447df39f7 Use view.animate() on zoom slider drag end 2016-11-06 09:12:24 -07:00
Tim Schaub
e13d3f6d2b Use view.animate() in zoom slider control 2016-11-06 09:12:24 -07:00
Tim Schaub
f16d1b06eb Use view.animation() when rotating 2016-11-06 09:12:18 -07:00
Tim Schaub
1147d51f2f Use view.animate() in drag zoom interaction 2016-11-06 07:59:48 -07:00
Tim Schaub
01da26b1c4 Unused kinetic.pan() method 2016-11-06 07:56:53 -07:00
Tim Schaub
5fb9a2ebf8 Test animation callback 2016-11-06 07:53:19 -07:00
greenkeeperio-bot
b37f978c29 chore(package): update metalsmith-layouts to version 1.7.0
https://greenkeeper.io/
2016-11-06 07:19:38 -07:00
Tim Schaub
3acfe79c78 Support anchor for rotation animations 2016-11-05 20:49:15 -06:00
Tim Schaub
c95aa39dde Support anchor for resolution animations 2016-11-05 20:41:40 -06:00
Tim Schaub
8529a74063 Put maps side by side 2016-11-05 18:29:29 -06:00
Tim Schaub
f6e9c12161 Use view.animate() in the pan interaction 2016-11-05 18:26:24 -06:00
Tim Schaub
dd079e915a Use view.animate() in the rotation control 2016-11-05 18:11:04 -06:00
Tim Schaub
0c8c5a003b Use view.animate() in zoom control 2016-11-05 18:08:37 -06:00
Tim Schaub
61ef7bf95d Use view.animate() after drag panning 2016-11-05 18:05:44 -06:00
Tim Schaub
c452164b8a Ensure that all animations complete 2016-11-05 17:31:49 -06:00
Tim Schaub
3d26d3bdc6 Update the animation example 2016-11-05 13:23:45 -06:00
Tim Schaub
83b7a1e2fc View animation 2016-11-05 13:22:17 -06:00
Tim Schaub
e979baa3dc Stub out view animation 2016-11-05 12:16:11 -06:00
Tim Schaub
16954f8df0 New view animation options 2016-11-05 12:15:45 -06:00
Bart van den Eijnden
02c0a6a533 Optionally enable hidpi support for Bing 2016-11-04 17:17:07 +01:00
Thomas Chandelle
5d61218134 Keep the other dim from the original segment when modifying vertex 2016-11-04 09:47:30 +01:00
Bart van den Eijnden
bccc841ebd Merge pull request #6074 from tchandelle/example-modify
Fix typo on style name on Modify Features Test example
2016-11-04 09:39:12 +01:00
Bart van den Eijnden
c0f960cf71 Merge pull request #6073 from tchandelle/errors-link
Fix link to errors doc
2016-11-04 09:12:07 +01:00
Frédéric Junod
d58103087f Merge pull request #6072 from openlayers/greenkeeper-metalsmith-2.3.0
Update metalsmith to version 2.3.0 🚀
2016-11-04 07:01:32 +01:00
greenkeeperio-bot
bf13dfeb50 chore(package): update metalsmith to version 2.3.0
https://greenkeeper.io/
2016-11-03 14:43:50 -06:00
Andreas Hocevar
0f58fa32eb Merge pull request #6068 from ahocevar/geojson-write-transform
Fix GeoJSON writeGeometry tests
2016-11-03 14:54:36 +01:00
Andreas Hocevar
73f970f350 Merge pull request #6067 from ahocevar/freehand-circle
Do not draw circle when pointer not moved
2016-11-03 14:47:33 +01:00
Andreas Hocevar
3656529252 Fix GeoJSON writeGeometry tests 2016-11-03 14:44:04 +01:00
Thomas Chandelle
2420ad56c1 If there is no features option, all features will be translated. 2016-11-03 14:03:11 +01:00
Andreas Hocevar
fb1a8335ac Do not draw circle when pointer not moved 2016-11-03 12:59:36 +01:00
oterral
a28576d2b9 Remove the use of ol.format.KML.DEFAULT_IMAGE_SCALE_MULTIPLIER_ when it's not wanted 2016-11-03 11:11:53 +01:00
Andreas Hocevar
760a231306 Merge pull request #6064 from ahocevar/better-modify-box
Make vertex candidate selection work better on rotated views
2016-11-03 09:34:06 +01:00
Andreas Hocevar
c2aa18dcbf Make vertex candidate selection work better on rotated views 2016-11-02 19:21:45 +01:00
Tim Schaub
b934eb6e59 Merge pull request #6054 from openlayers/greenkeeper-eslint-3.9.1
Update eslint to version 3.9.1 🚀
2016-11-01 10:11:16 -06:00
Tim Schaub
bd4808d161 Merge pull request #6058 from openlayers/greenkeeper-fs-extra-1.0.0
Update fs-extra to version 1.0.0 🚀
2016-11-01 08:48:22 -06:00
greenkeeperio-bot
337c9a7e93 chore(package): update fs-extra to version 1.0.0
https://greenkeeper.io/
2016-11-01 08:06:43 -06:00
greenkeeperio-bot
71ebed07bf chore(package): update eslint to version 3.9.1
https://greenkeeper.io/
2016-11-01 11:51:06 +01:00
Frédéric Junod
5f5bc2ecdb Merge pull request #6053 from openlayers/greenkeeper-glob-7.1.1
Update glob to version 7.1.1 🚀
2016-10-31 13:12:05 +01:00
Tim Schaub
888032dcc9 Merge pull request #6045 from tschaub/sealevel
Add an example using Mapbox Terrain-RGB tiles
2016-10-28 09:21:56 -06:00
Tim Schaub
df83f6633f Add an example using Mapbox Terrain-RGB tiles 2016-10-28 09:08:35 -06:00
Andreas Hocevar
7492a91c10 Merge pull request #6042 from oterral/teo_dflt_style
Set constants of KML format even if a default style is provided
2016-10-28 16:01:01 +02:00
oterral
f369ea2e29 Set constants of KML format even if a default style is provided 2016-10-28 14:53:44 +02:00
Andreas Hocevar
b4e59a99e8 Merge branch 'release-v3.19.1' 2016-10-28 14:21:58 +02:00
Andreas Hocevar
48c1d09a95 Merge branch 'master' into release-v3.19.1 2016-10-28 14:21:34 +02:00
Marc Jansen
6092e6ecbb Update package version to 3.19.1 2016-10-28 11:51:29 +02:00
Marc Jansen
849b04b882 Changelog for v3.19.1 2016-10-28 11:51:07 +02:00
Andreas Hocevar
cc0452a2d9 Merge pull request #6039 from ahocevar/undefined-fillstyle
Do not fill when there is no fillStyle
2016-10-28 11:48:08 +02:00
Andreas Hocevar
cfe78f2766 Merge pull request #6034 from ahocevar/gradient-pattern-origin
Use geometry extent's top left corner as pattern/gradient origin
2016-10-28 11:48:01 +02:00
Andreas Hocevar
b9fe59c269 Merge pull request #6027 from bjornharrtell/issue-6023
Close polygon sketch at all times
2016-10-28 11:47:55 +02:00
Andreas Hocevar
a3b474623e Merge pull request #6022 from ahocevar/white-lines
Revert "Merge pull request #5890 from ahocevar/no-white-lines"
2016-10-28 11:47:49 +02:00
Andreas Hocevar
04f070b159 Merge pull request #6039 from ahocevar/undefined-fillstyle
Do not fill when there is no fillStyle
2016-10-28 11:20:46 +02:00
Marc Jansen
14f575f207 Merge pull request #6040 from openlayers/coveralls-badge
Update the coveralls badge
2016-10-28 11:03:47 +02:00
Marc Jansen
8a69f1f6ea Update the coveralls badge 2016-10-28 10:51:34 +02:00
Andreas Hocevar
aa7e54833d Do not fill when there is no fillStyle 2016-10-28 10:34:27 +02:00
Frédéric Junod
39abb2b143 Merge pull request #6036 from fredj/mousewheel_timeout_option
Add new timeout option to ol.interaction.MouseWheelZoom
2016-10-28 09:46:12 +02:00
Andreas Hocevar
d90bfbde58 Merge pull request #6034 from ahocevar/gradient-pattern-origin
Use geometry extent's top left corner as pattern/gradient origin
2016-10-28 09:16:30 +02:00
Frederic Junod
e0a9910d4e Add new timeout option to ol.interaction.MouseWheelZoom
And remove the `ol.MOUSEWHEELZOOM_TIMEOUT_DURATION` define.
2016-10-28 09:07:42 +02:00
Andreas Hocevar
7834a95210 Merge pull request #6027 from bjornharrtell/issue-6023
Close polygon sketch at all times
2016-10-28 00:37:22 +02:00
Andreas Hocevar
f4d12ad448 Merge pull request #6035 from openlayers/greenkeeper-metalsmith-2.2.1
Update metalsmith to version 2.2.1 🚀
2016-10-28 00:35:43 +02:00
greenkeeperio-bot
5d5d49ad12 chore(package): update metalsmith to version 2.2.1
https://greenkeeper.io/
2016-10-27 14:44:29 -06:00
Andreas Hocevar
a2a2a53e08 Use geometry extent's top left corner as pattern/gradient origin 2016-10-27 21:27:17 +02:00
Björn Harrtell
9d5453a927 Test to validate sketch polygon 2016-10-27 18:56:11 +02:00
Björn Harrtell
1bd11c1958 Close polygon sketch at all times 2016-10-25 22:36:40 +02:00
Andreas Hocevar
767bec4dc7 Merge pull request #6022 from ahocevar/white-lines
Revert "Merge pull request #5890 from ahocevar/no-white-lines"
2016-10-25 13:03:08 +02:00
Andreas Hocevar
70338b928e Revert "Merge pull request #5890 from ahocevar/no-white-lines"
This partially reverts commit 5f18246355,
reversing most of the changes made to
004afa6b9a.
2016-10-25 11:34:02 +02:00
Marc Jansen
dd6b05b285 Merge pull request #6020 from marcjansen/ol.obj-tests
Test that ol.obj.assign throws on undefined/null
2016-10-24 14:14:42 +02:00
Marc Jansen
e59b90377f Merge pull request #6012 from marcjansen/combined-coverage
Combine standard coverage and rendering coverage
2016-10-24 14:14:20 +02:00
Bart van den Eijnden
e0a0804040 Merge pull request #6019 from bartvde/issue-6018
Make sure updateParams reloads in TileArcGISRest
2016-10-24 13:17:26 +02:00
Marc Jansen
f973eaa24d Test that ol.obj.assign throws on undefined/null 2016-10-24 10:39:48 +02:00
Bart van den Eijnden
2fe4d63893 Make sure updateParams reloads in TileArcGISRest 2016-10-24 10:31:15 +02:00
Bart van den Eijnden
908f254bd2 Merge pull request #6017 from bartvde/revert-i18n-workshop
Revert "Point to the English workshop"
2016-10-24 09:46:28 +02:00
Bart van den Eijnden
2132a02f76 Revert "Point to the English workshop"
This reverts commit ede6fc6e01.
2016-10-24 09:31:38 +02:00
Tim Schaub
78f283c32b Merge pull request #6014 from openlayers/greenkeeper-browserify-13.1.1
Update browserify to version 13.1.1 🚀
2016-10-23 19:30:51 -07:00
greenkeeperio-bot
9659d8598c chore(package): update browserify to version 13.1.1
https://greenkeeper.io/
2016-10-22 12:05:00 -07:00
Marc Jansen
42d1c51cbb Combine standard coverage and rendering coverage 2016-10-22 14:42:40 +02:00
Frédéric Junod
c34f097ffd Merge pull request #6011 from fredj/rm_unused
Remove unused function
2016-10-21 15:44:08 +02:00
Frederic Junod
0a2b145fd5 Remove unused ol.extent.empty function 2016-10-21 14:25:46 +02:00
Frederic Junod
0f8d26d829 Remove unused ol.extent.touches function 2016-10-21 14:23:31 +02:00
Frederic Junod
2a1a9ec337 Remove unused ol.extent.isInfinite function 2016-10-21 14:22:37 +02:00
Frederic Junod
5627a467cd Remove unused ol.extent.normalize function 2016-10-21 14:20:33 +02:00
Marc Jansen
5498f5f7db Merge pull request #6008 from marcjansen/release-v3.19.0
Release v3.19.0
2016-10-21 10:31:20 +02:00
Marc Jansen
84a3d6bee0 Update package version to 3.19.0 2016-10-21 10:19:03 +02:00
Marc Jansen
47c5e8fef7 Changelog for v3.19.0 2016-10-21 10:19:03 +02:00
Marc Jansen
d6f157a792 Merge pull request #6007 from marcjansen/export-example-note
Add note to example that canvas.toBlob() is required
2016-10-21 09:36:54 +02:00
Marc Jansen
d88f5a8c2c Add note that canvas.toBlob() is required 2016-10-21 09:26:07 +02:00
Marc Jansen
574c570242 Merge pull request #5979 from fredj/export_map
Use FileSaver.js in export-map example
2016-10-21 09:23:33 +02:00
Andreas Hocevar
7584c6d540 Merge pull request #6004 from ahocevar/osmxml
Bring back the vector-osm example, using a different service
2016-10-20 14:15:39 +02:00
Andreas Hocevar
dc7f367eaa Bring back the vector-osm example, using a different service 2016-10-20 13:58:17 +02:00
Andreas Hocevar
12fb632999 Merge pull request #6002 from ahocevar/gutter-pixel-ratio
Use tile pixel ratio for gutter calculation
2016-10-20 13:56:43 +02:00
Frédéric Junod
1fbfd4aced Merge pull request #5991 from openlayers/Array.isView_tests
Only test ol.format.MVT if ArrayBuffer.isView is supported
2016-10-20 13:40:45 +02:00
Frederic Junod
0345055cfb Use tile pixel ratio for gutter calculation (webgl and tests) 2016-10-20 13:15:06 +02:00
Frederic Junod
88cebbf6c1 Remove projection param in ol.VectorTile constructor 2016-10-20 12:36:12 +02:00
Frederic Junod
e8bc38b6a9 Use a mock format instead of ol.format.MVT in tests 2016-10-20 12:36:12 +02:00
Frederic Junod
61fcc4a326 Only test ol.format.MVT if ArrayBuffer.isView is supported 2016-10-20 12:18:23 +02:00
Andreas Hocevar
76e0a37d69 Use tile pixel ratio for gutter calculation 2016-10-20 10:52:55 +02:00
Andreas Hocevar
de5b16c0d3 Merge pull request #6000 from ahocevar/fix-tilelayer-mock
Fix mockup of tile layer to keep drawImage arguments in range
2016-10-20 08:54:29 +02:00
Andreas Hocevar
8fb6b6b6e6 Fix mockup of tile layer to keep drawImage arguments in range 2016-10-19 19:48:48 +02:00
Marc Jansen
4e1ccaafcd Merge pull request #5997 from marcjansen/ms-edge-URL-polyfill
Always load a gated URL polyfill when testing
2016-10-19 17:10:09 +02:00
Marc Jansen
3ce93a51ed Always load a gated URL polyfill when testing
Otherwise the tests fail to run in MS Edge, whose user agent doesn't
trigger the inclusion of the polyfill without `always`.
2016-10-19 15:12:24 +02:00
Frédéric Junod
e542c622a7 Merge pull request #5963 from fredj/modify_deactivate
Remove the vertex on ol.interaction.Modify deactivation
2016-10-19 12:14:06 +02:00
Frederic Junod
e853f1ed2a Remove the vertex on ol.interaction.Modify deactivation 2016-10-19 11:06:29 +02:00
Marc Jansen
1311f65ece Merge pull request #5994 from marcjansen/fix-component-no-available-5993
Setup a loaded image with src for TileLayer test
2016-10-19 10:50:32 +02:00
Frederic Junod
92bd1d67a8 Use FileSaver.js in export-map example
Instead of relying on the download attribute.
2016-10-19 10:33:20 +02:00
Marc Jansen
2c200dcf5f Setup a loaded image with src for TileLayer test 2016-10-19 09:56:16 +02:00
Frédéric Junod
b89eb77f20 Merge pull request #5989 from openlayers/rm_vector-osm_example
Remove vector-osm example
2016-10-18 16:05:26 +02:00
Frederic Junod
e890b4b1d6 Remove vector-osm example
fixes #5988
2016-10-18 15:18:24 +02:00
Andreas Hocevar
bca5fde854 Merge pull request #5985 from ahocevar/new-mapzen-url-scheme
Update Mapzen urls to new scheme
2016-10-18 00:50:44 +02:00
Andreas Hocevar
dc23683c0c Merge pull request #5984 from ahocevar/more-https
Less examples with mixed content
2016-10-18 00:50:01 +02:00
Tim Schaub
24d03bc014 Merge pull request #5986 from openlayers/greenkeeper-eslint-3.8.1
Update eslint to version 3.8.1 🚀
2016-10-17 16:13:58 -06:00
greenkeeperio-bot
8456270316 chore(package): update eslint to version 3.8.1
https://greenkeeper.io/
2016-10-17 15:11:21 -06:00
Andreas Hocevar
6caf8adc4c Update Mapzen urls to new scheme 2016-10-17 23:08:39 +02:00
Andreas Hocevar
74bf0dfd72 Merge pull request #5982 from ahocevar/geoserver-https
Use a https enabled GeoServer
2016-10-17 22:59:31 +02:00
Andreas Hocevar
68488eced9 Use https logo for IGN 2016-10-17 22:53:33 +02:00
Andreas Hocevar
910c9d7c4e Use https resource for OpenCycleMap 2016-10-17 22:53:19 +02:00
Andreas Hocevar
f6b2858348 Remove unused JQuery (which uses http) 2016-10-17 22:52:53 +02:00
Andreas Hocevar
971faf230d Use https resources for ski map KML 2016-10-17 22:52:26 +02:00
Tim Schaub
625273c017 Merge pull request #5977 from tschaub/draw-box
Convenience function for drawing boxes
2016-10-17 12:56:49 -06:00
Andreas Hocevar
1181607f39 Use a https enabled GeoServer 2016-10-17 19:53:52 +02:00
tchandelle
dc9770911f Wrong link to errors 2016-10-17 09:45:47 +02:00
Tim Schaub
884e05b90b Merge pull request #5978 from openlayers/greenkeeper-async-2.1.2
Update async to version 2.1.2 🚀
2016-10-16 21:03:07 -06:00
greenkeeperio-bot
4904b5035e chore(package): update async to version 2.1.2
https://greenkeeper.io/
2016-10-16 17:01:52 -06:00
Tim Schaub
5644fe3e2f Add example demonstrating freehand drawing 2016-10-16 16:45:42 -06:00
Tim Schaub
ac805e804b Divide the draw features example into two examples 2016-10-16 16:38:00 -06:00
Tim Schaub
ec1ad89338 Correct docs for createRegularPolygon() function 2016-10-16 15:54:15 -06:00
Tim Schaub
1e6c4472b2 Use the createBox() geometry function 2016-10-16 15:54:15 -06:00
Tim Schaub
9b12cac5c6 Convenience function for drawing box-shaped polygons 2016-10-16 15:54:15 -06:00
Tim Schaub
92583542eb Merge pull request #5975 from tschaub/freehand-finish
Finish drawing on pointerup when in freehand mode
2016-10-16 01:30:17 -06:00
Tim Schaub
7068081c67 Merge pull request #5976 from tschaub/https
Use https where available
2016-10-16 01:14:39 -06:00
Tim Schaub
8e6f74fecd Use https for mesonet.agron.iastate.edu 2016-10-16 01:02:31 -06:00
Tim Schaub
7c983058ad Use https for sampleserver3.arcgisonline.com 2016-10-16 01:00:38 -06:00
Tim Schaub
2e5ecd1efb Use https for services.arcgis.com 2016-10-16 00:58:51 -06:00
Tim Schaub
626968f72e Use https for tiles.openseamap.org 2016-10-16 00:55:40 -06:00
Tim Schaub
0925538525 Use https for overpass-api.de 2016-10-16 00:53:03 -06:00
Tim Schaub
c016a497c3 Use https for map1.vis.earthdata.nasa.gov 2016-10-16 00:44:10 -06:00
Tim Schaub
0382c34c78 Use https for upload.wikimedia.org 2016-10-16 00:41:08 -06:00
Tim Schaub
324e67fac1 Use https for epsg.io 2016-10-16 00:39:07 -06:00
Tim Schaub
8c8246a33f Use https for www.osgeo.org 2016-10-16 00:38:25 -06:00
Tim Schaub
ff754a0a9f Use https for www.openstreetmap.org 2016-10-16 00:34:06 -06:00
Tim Schaub
da402b22af Use https for www.opencyclemap.org 2016-10-16 00:26:50 -06:00
Tim Schaub
100c42e671 Use https for services.arcgisonline.com 2016-10-16 00:25:47 -06:00
Tim Schaub
9875df39bf Use https for openlayers.org 2016-10-16 00:16:15 -06:00
Tim Schaub
978548b085 Use https for cdn.polyfill.io 2016-10-16 00:14:52 -06:00
Tim Schaub
8f57ebd2c6 Finish drawing on pointerup when in freehand mode 2016-10-15 13:47:34 -06:00
Tim Schaub
484b684d20 Merge pull request #5973 from tschaub/freehand-option
Add a freehand option to the draw interaction
2016-10-15 12:40:35 -06:00
Andreas Hocevar
cba270efa1 Merge pull request #5964 from ahocevar/icon-text-transform
Set one-off transform instead of transforming back and forth
2016-10-15 19:46:47 +02:00
Tim Schaub
4b0e857b93 Add freehand to the typedef 2016-10-15 06:36:59 -06:00
Tim Schaub
1c8ed12b68 Assert that the freehand option properly sets the condition 2016-10-15 05:45:23 -06:00
Tim Schaub
fad6d368a6 Allow freehand drawing without a modifier key 2016-10-15 05:37:15 -06:00
Tim Schaub
8d68d68c9d Merge pull request #5970 from tschaub/freehand-shape
Allow circles, squares, and boxes to be drawn in freehand mode
2016-10-15 05:36:35 -06:00
Tim Schaub
a80d073da9 Merge pull request #5972 from openlayers/greenkeeper-eslint-3.8.0
Update eslint to version 3.8.0 🚀
2016-10-14 17:36:45 -06:00
greenkeeperio-bot
333ccb6ae4 chore(package): update eslint to version 3.8.0
https://greenkeeper.io/
2016-10-14 16:12:06 -06:00
Tim Schaub
c58d98248a Allow circles, squares, and boxes to be drawn in freehand mode 2016-10-14 11:11:43 -06:00
Andreas Hocevar
fdae2e8e00 Set one-off transform instead of transforming back and forth 2016-10-14 17:54:21 +02:00
Andreas Hocevar
068c9ceba4 Merge pull request #5969 from ahocevar/not-only
Test all, not just one
2016-10-14 17:52:37 +02:00
Andreas Hocevar
b563e9079f Update expected result after #5950 2016-10-14 17:40:24 +02:00
Andreas Hocevar
78082e2833 Test all, not just one 2016-10-14 16:12:31 +02:00
Frédéric Junod
eacc3a52bb Merge pull request #5967 from fredj/cleanup
Add missing jsdoc to ol.render.canvas.Replay#fill_ function
2016-10-14 15:35:05 +02:00
Frederic Junod
988b3f8b9b Add missing jsdoc to ol.render.canvas.Replay#fill_ function 2016-10-14 15:05:30 +02:00
Thomas Chandelle
32f112659f Typo for MultiLineString style 2016-10-13 16:58:41 +02:00
Andreas Hocevar
761c63585d Merge pull request #5962 from ahocevar/proj4js-examples
Use same proj4js version in examples and tests
2016-10-13 15:18:45 +02:00
Andreas Hocevar
6be7dcf9d2 Merge pull request #5961 from ahocevar/remove-unused-error-codes
Remove unused error codes
2016-10-13 15:17:25 +02:00
Frédéric Junod
07a413efff Merge pull request #5960 from fredj/rename
More renaming to have one provide per file
2016-10-13 14:49:24 +02:00
Andreas Hocevar
22084aa960 Use same proj4js version in examples and tests 2016-10-13 14:27:43 +02:00
Andreas Hocevar
f5eaba4255 Remove unused error codes 2016-10-13 14:06:36 +02:00
Andreas Hocevar
674e2ab37e Merge pull request #5959 from ahocevar/getlayer-no-assert
Remove unnecessary and misleading assertion
2016-10-13 13:44:07 +02:00
Frederic Junod
ed677cec4e Rename ol.render.EventType to ol.render.Event.Type 2016-10-13 12:02:51 +02:00
Andreas Hocevar
58d459bca0 Remove unnecessary and misleading assertion 2016-10-13 11:54:32 +02:00
Frederic Junod
5a3794752a Rename ol.interaction.InteractionProperty to ol.interaction.Interaction.Property 2016-10-13 11:50:42 +02:00
Frederic Junod
189a7f1759 Rename ol.layer.VectorTileProperty to ol.layer.VectorTile.Property 2016-10-13 11:43:40 +02:00
Frederic Junod
80a6512d55 Rename ol.layer.VectorProperty to ol.layer.Vector.Property 2016-10-13 11:42:17 +02:00
Frederic Junod
99dcaf3830 Add missing goog.require('ol') 2016-10-13 11:40:06 +02:00
Andreas Hocevar
74450f40be Merge pull request #5950 from ahocevar/fill-movewithview
Move gradient and pattern fills with the view
2016-10-13 09:41:40 +02:00
Andreas Hocevar
f655f6740e Move gradient and pattern fills with the view 2016-10-13 09:30:09 +02:00
Andreas Hocevar
cd4f2cc2d8 Merge pull request #5957 from openlayers/greenkeeper-async-2.1.1
Update async to version 2.1.1 🚀
2016-10-12 21:29:16 +02:00
greenkeeperio-bot
ba9e332baa chore(package): update async to version 2.1.1
https://greenkeeper.io/
2016-10-12 13:15:08 -06:00
Andreas Hocevar
a0ab27c182 Merge pull request #5956 from openlayers/greenkeeper-async-2.1.0
Update async to version 2.1.0 🚀
2016-10-12 20:52:40 +02:00
greenkeeperio-bot
8c4abaf47a chore(package): update async to version 2.1.0
https://greenkeeper.io/
2016-10-12 12:39:35 -06:00
Bart van den Eijnden
941fbbedc0 Merge pull request #5955 from bartvde/bing-getters
Add getters to BingMaps source for api key and imagerySet
2016-10-12 16:13:03 +02:00
Bart van den Eijnden
df4f2ff28d Add getters to BingMaps source for api key and imagerySet 2016-10-12 16:04:10 +02:00
Tim Schaub
cbf5d0bae0 Merge pull request #5944 from tschaub/geojson-as-features
Allow readFeature and readFeatures to be called with GeoJSON geometries
2016-10-11 14:07:36 -06:00
Tim Schaub
0d686fe88b Corrected test description 2016-10-11 13:55:37 -06:00
Marc Jansen
043a8ab1db Merge pull request #5949 from marcjansen/attributionlike-prose-doc
Add prose documentation for ol.AttributionLike
2016-10-11 13:59:20 +02:00
Marc Jansen
0c4705fb9d Merge pull request #5948 from marcjansen/getstyle-docs
Fix API docs of ol.Feature#getStyle
2016-10-11 13:59:06 +02:00
Marc Jansen
9094894a41 Add prose documentation for ol.AttributionLike 2016-10-11 12:25:10 +02:00
Marc Jansen
857c9e83ac Fix API docs of ol.Feature#getStyle 2016-10-11 12:01:06 +02:00
Andreas Hocevar
251ff89c70 Merge pull request #5946 from openlayers/greenkeeper-mocha-3.1.2
Update mocha to version 3.1.2 🚀
2016-10-11 09:45:14 +02:00
greenkeeperio-bot
de4728b1b7 chore(package): update mocha to version 3.1.2
https://greenkeeper.io/
2016-10-11 00:37:47 -06:00
Tim Schaub
309b2145cf Allow readFeature and readFeatures to be called with geometries 2016-10-10 13:31:19 -06:00
Andreas Hocevar
c1c7c8bc11 Merge pull request #5941 from openlayers/greenkeeper-mocha-3.1.1
Update mocha to version 3.1.1 🚀
2016-10-10 12:50:14 +02:00
Andreas Hocevar
5f18246355 Merge pull request #5890 from ahocevar/no-white-lines
No gaps between tiles of different resolutions
2016-10-10 10:48:07 +02:00
Andreas Hocevar
f23921367b Use a common origin and resolution factors for tile alignment 2016-10-10 10:25:29 +02:00
greenkeeperio-bot
e26a4b36bb chore(package): update mocha to version 3.1.1
https://greenkeeper.io/
2016-10-10 01:27:43 -06:00
greenkeeperio-bot
86e879be5d chore(package): update glob to version 7.1.1
https://greenkeeper.io/
2016-10-07 15:58:58 -06:00
Tim Schaub
004afa6b9a Merge pull request #5935 from tschaub/friendly-transform
Keep transformed coordinates within valid y range
2016-10-07 06:40:04 -06:00
Andreas Hocevar
fe874938c3 Merge pull request #5937 from ahocevar/one-require-vectortile
One provide per file for vector tiles
2016-10-07 07:46:15 +02:00
Tim Schaub
7cf1e74ae3 Integration test for rendering a world spanning polygon 2016-10-06 20:48:58 -06:00
Andreas Hocevar
04649a74cd One provide per file for vector tiles 2016-10-06 22:52:02 +02:00
Tim Schaub
8ac6c85f0f Reuse half size 2016-10-05 08:23:41 -06:00
Tim Schaub
321c65b023 Keep transformed coordinates within valid y range 2016-10-05 07:26:41 -06:00
Frédéric Junod
5cdbd76b1e Merge pull request #5933 from openlayers/greenkeeper-phantomjs-prebuilt-2.1.13
Update phantomjs-prebuilt to version 2.1.13 🚀
2016-10-05 08:25:37 +02:00
greenkeeperio-bot
9f8315762a chore(package): update phantomjs-prebuilt to version 2.1.13
https://greenkeeper.io/
2016-10-04 09:13:44 -06:00
Andreas Hocevar
869153e7ac Merge pull request #5932 from openlayers/greenkeeper-eslint-3.7.1
Update eslint to version 3.7.1 🚀
2016-10-04 02:06:20 +02:00
Andreas Hocevar
1bdf480670 Merge pull request #5931 from openlayers/greenkeeper-jsdoc-3.4.2
Update jsdoc to version 3.4.2 🚀
2016-10-04 01:20:53 +02:00
greenkeeperio-bot
eab85a2107 chore(package): update eslint to version 3.7.1
https://greenkeeper.io/
2016-10-03 16:55:05 -06:00
greenkeeperio-bot
3f2424c0d8 chore(package): update jsdoc to version 3.4.2
https://greenkeeper.io/
2016-10-03 12:22:56 -06:00
Andreas Hocevar
74466a3561 Merge pull request #5923 from openlayers/greenkeeper-pbf-3.0.2
Update pbf to version 3.0.2 🚀
2016-10-02 22:42:03 +02:00
Andreas Hocevar
09eee4aa43 Merge pull request #5926 from adube/fix-map-collection-element-type
Ensure correct type of event.element
2016-10-02 16:00:38 +02:00
greenkeeperio-bot
19c5518c96 chore(package): update pbf to version 3.0.2
https://greenkeeper.io/
2016-09-30 15:11:35 -06:00
Marc Jansen
da32e5e367 Merge pull request #5928 from openlayers/greenkeeper-eslint-3.7.0
Update eslint to version 3.7.0 🚀
2016-09-30 23:11:14 +02:00
greenkeeperio-bot
8669dec33b chore(package): update eslint to version 3.7.0
https://greenkeeper.io/
2016-09-30 13:11:02 -06:00
Alexandre Dubé
72e0ad13b3 Ensure correct type of event.element 2016-09-30 09:57:16 -04:00
Andreas Hocevar
40c639b194 Merge pull request #5919 from openlayers/greenkeeper-resemblejs-2.2.2
Update resemblejs to version 2.2.2 🚀
2016-09-27 21:52:54 +02:00
Andreas Hocevar
fb8c4820d0 Merge pull request #5909 from openlayers/greenkeeper-jquery-3.1.1
Update jquery to version 3.1.1 🚀
2016-09-27 21:52:41 +02:00
greenkeeperio-bot
eb4b2d4bcc chore(package): update resemblejs to version 2.2.2
https://greenkeeper.io/
2016-09-27 09:55:16 -06:00
Tim Schaub
5973644c4b Merge pull request #5917 from tschaub/format-options
Accept feature projection in GeoJSON constructor
2016-09-27 06:11:50 -06:00
greenkeeperio-bot
0e6919462d chore(package): update jquery to version 3.1.1
https://greenkeeper.io/
2016-09-27 05:03:00 -06:00
Marc Jansen
6f4f2f100e Merge pull request #5918 from openlayers/greenkeeper-mocha-3.1.0
Update mocha to version 3.1.0 🚀
2016-09-27 13:02:33 +02:00
greenkeeperio-bot
cad455f635 chore(package): update mocha to version 3.1.0
https://greenkeeper.io/
2016-09-27 02:59:02 -06:00
Tim Schaub
529da77b49 Merge pull request #5916 from openlayers/greenkeeper-eslint-3.6.1
Update eslint to version 3.6.1 🚀
2016-09-26 22:57:08 -06:00
Tim Schaub
4b6e907f69 Accept feature projection in GeoJSON constructor 2016-09-26 22:56:07 -06:00
greenkeeperio-bot
2ce2e5bf27 chore(package): update eslint to version 3.6.1
https://greenkeeper.io/
2016-09-26 17:09:58 -06:00
350 changed files with 17593 additions and 7518 deletions

View File

@@ -77,7 +77,7 @@ Then, just point your browser <http://localhost:3000/build/examples> in your bro
Run examples against the `ol.js` standalone build: Run examples against the `ol.js` standalone build:
The examples can also be run against the `ol.js` standalone build, just like The examples can also be run against the `ol.js` standalone build, just like
the examples [hosted](http://openlayers.org/en/master/examples/) on GitHub. the examples [hosted](https://openlayers.org/en/master/examples/) on GitHub.
Start by executing the `host-examples` build target: Start by executing the `host-examples` build target:
$ make host-examples $ make host-examples

View File

@@ -1,14 +1,14 @@
# OpenLayers 3 # OpenLayers 3
[![Travis CI Status](https://secure.travis-ci.org/openlayers/ol3.svg)](http://travis-ci.org/#!/openlayers/ol3) [![Travis CI Status](https://secure.travis-ci.org/openlayers/ol3.svg)](http://travis-ci.org/#!/openlayers/ol3)
[![Coverage Status](https://coveralls.io/repos/openlayers/ol3/badge.svg?branch=master)](https://coveralls.io/r/openlayers/ol3?branch=master) [![Coverage Status](https://coveralls.io/repos/github/openlayers/ol3/badge.svg?branch=master)](https://coveralls.io/github/openlayers/ol3?branch=master)
[![OSGeo Project](https://img.shields.io/badge/OSGeo-Project-brightgreen.svg)](http://osgeo.org/) [![OSGeo Project](https://img.shields.io/badge/OSGeo-Project-brightgreen.svg)](http://osgeo.org/)
[OpenLayers 3](http://openlayers.org/) is a high-performance, feature-packed library for creating interactive maps on the web. It can display map tiles, vector data and markers loaded from any source on any web page. OpenLayers has been developed to further the use of geographic information of all kinds. It is completely free, Open Source JavaScript, released under the 2-clause BSD License (also known as the FreeBSD). [OpenLayers 3](https://openlayers.org/) is a high-performance, feature-packed library for creating interactive maps on the web. It can display map tiles, vector data and markers loaded from any source on any web page. OpenLayers has been developed to further the use of geographic information of all kinds. It is completely free, Open Source JavaScript, released under the 2-clause BSD License (also known as the FreeBSD).
## Getting Started ## Getting Started
- Download the [latest release](http://openlayers.org/download/) - Download the [latest release](https://openlayers.org/download/)
- Install with npm: `npm install openlayers` - Install with npm: `npm install openlayers`
- Clone the repo: `git clone git@github.com:openlayers/ol3.git` - Clone the repo: `git clone git@github.com:openlayers/ol3.git`
@@ -18,7 +18,7 @@ OpenLayers runs on all modern browsers that support [HTML5](https://html.spec.wh
## Documentation ## Documentation
Check out the [hosted examples](http://openlayers.org/en/latest/examples/), the [workshop](http://openlayers.org/workshop/) or the [API documentation](http://openlayers.org/en/latest/apidoc/). Check out the [hosted examples](https://openlayers.org/en/latest/examples/), the [workshop](https://openlayers.org/workshop/) or the [API documentation](https://openlayers.org/en/latest/apidoc/).
## Bugs ## Bugs

View File

@@ -1,5 +1,107 @@
## Upgrade notes ## Upgrade notes
### v3.20.0
#### Use `view.animate()` instead of `map.beforeRender()` and `ol.animation` functions
The `map.beforeRender()` and `ol.animation` functions have been deprecated in favor of a new `view.animate()` function. Use of the deprecated functions will result in a warning during development. These functions are subject to removal in an upcoming release.
For details on the `view.animate()` method, see the API docs and the view animation example. Upgrading should be relatively straightforward. For example, if you wanted to have an animated pan, zoom, and rotation previously, you might have done this:
```js
var zoom = ol.animation.zoom({
resolution: view.getResolution()
});
var pan = ol.animation.pan({
source: view.getCenter()
});
var rotate = ol.animation.rotate({
rotation: view.getRotation()
});
map.beforeRender(zoom, pan, rotate);
map.setZoom(1);
map.setCenter([0, 0]);
map.setRotation(Math.PI);
```
Now, the same can be accomplished with this:
```js
view.animate({
zoom: 1,
center: [0, 0],
rotation: Math.PI
});
```
#### `ol.Map#forEachFeatureAtPixel` and `ol.Map#hasFeatureAtPixel` parameters have changed
If you are using the layer filter of one of these methods, please note that you now have to pass in the layer filter via an `ol.AtPixelOptions` object. If you are not using the layer filter the usage has not changed.
Old syntax:
```js
map.forEachFeatureAtPixel(pixel, callback, callbackThis, layerFilterFn, layerFilterThis);
map.hasFeatureAtPixel(pixel, layerFilterFn, layerFilterThis);
```
New syntax:
```js
map.forEachFeatureAtPixel(pixel, callback.bind(callbackThis), {
layerFilter: layerFilterFn.bind(layerFilterThis)
});
map.hasFeatureAtPixel(pixel, {
layerFilter: layerFilterFn.bind(layerFilterThis)
});
```
This change is due to the introduction of the `hitTolerance` parameter which can be passed in via this `ol.AtPixelOptions` object, too.
#### Use `ol.proj.getPointResolution()` instead of `projection.getPointResolution()`
The experimental `getPointResolution` method has been removed from `ol.Projection` instances. Since the implementation of this method required an inverse transform (function for transforming projected coordinates to geographic coordinates) and `ol.Projection` instances are not constructed with forward or inverse transforms, it does not make sense that a projection instance can always calculate the point resolution.
As a substitute for the `projection.getPointResolution()` function, a `ol.proj.getPointResolution()` function has been added. To upgrade, you will need to change things like this:
```js
projection.getPointResolution(resolution, point);
```
into this:
```js
ol.proj.getPointResolution(projection, resolution, point);
```
Note that if you were previously creating a projection with a `getPointResolution` function in the constructor (or calling `projection.setGetPointResolution()` after construction), this function will be used by `ol.proj.getPointResolution()`.
#### `ol.interaction.PinchZoom` no longer zooms to a whole-number zoom level after the gesture ends
The old behavior of `ol.interaction.PinchZoom` was to zoom to the next integer zoom level after the user ends the gesture.
Now the pinch zoom keeps the user selected zoom level even if it is a fractional zoom.
To get the old behavior set the new `constrainResolution` parameter to `true` like this:
```js
new ol.interaction.PinchZoom({constrainResolution: true})
```
See the new `pinch-zoom` example for a complete implementation.
### v3.19.1
#### `ol.style.Fill` with `CanvasGradient` or `CanvasPattern`
The origin for gradients and patterns has changed from `[0, 0]` to the top-left
corner of the extent of the geometry being filled.
### v3.19.0
#### `ol.style.Fill` with `CanvasGradient` or `CanvasPattern`
Previously, gradients and patterns were aligned with the canvas, so they did not
move and rotate with the map. This was changed to a more expected behavior by anchoring the fill to the map origin (usually at map coordinate `[0, 0]`).
#### `goog.DEBUG` define was renamed to `ol.DEBUG` #### `goog.DEBUG` define was renamed to `ol.DEBUG`
As last step in the removal of the dependency on Google Closure Library, the `goog.DEBUG` compiler define was renamed to `ol.DEBUG`. Please change accordingly in your custom build configuration json files. As last step in the removal of the dependency on Google Closure Library, the `goog.DEBUG` compiler define was renamed to `ol.DEBUG`. Please change accordingly in your custom build configuration json files.
@@ -22,6 +124,7 @@ A number of internal types have been renamed. This will not affect those who us
* rename `ol.OverlayProperty` to `ol.Overlay.Property` * rename `ol.OverlayProperty` to `ol.Overlay.Property`
* rename `ol.control.MousePositionProperty` to `ol.control.MousePosition.Property` * rename `ol.control.MousePositionProperty` to `ol.control.MousePosition.Property`
* rename `ol.format.IGCZ` to `ol.format.IGC.Z` * rename `ol.format.IGCZ` to `ol.format.IGC.Z`
* rename `ol.interaction.InteractionProperty` to `ol.interaction.Interaction.Property`
* rename `ol.interaction.DrawMode` to `ol.interaction.Draw.Mode` * rename `ol.interaction.DrawMode` to `ol.interaction.Draw.Mode`
* rename `ol.interaction.DrawEvent` to `ol.interaction.Draw.Event` * rename `ol.interaction.DrawEvent` to `ol.interaction.Draw.Event`
* rename `ol.interaction.DrawEventType` to `ol.interaction.Draw.EventType` * rename `ol.interaction.DrawEventType` to `ol.interaction.Draw.EventType`
@@ -42,6 +145,7 @@ A number of internal types have been renamed. This will not affect those who us
* rename `ol.MapProperty` to `ol.Map.Property` * rename `ol.MapProperty` to `ol.Map.Property`
* rename `ol.ModifyEventType` to `ol.interaction.Modify.EventType` * rename `ol.ModifyEventType` to `ol.interaction.Modify.EventType`
* rename `ol.RendererType` to `ol.renderer.Type` * rename `ol.RendererType` to `ol.renderer.Type`
* rename `ol.render.EventType` to `ol.render.Event.Type`
* rename `ol.source.ImageEvent` to `ol.source.Image.Event` * rename `ol.source.ImageEvent` to `ol.source.Image.Event`
* rename `ol.source.ImageEventType` to `ol.source.Image.EventType` * rename `ol.source.ImageEventType` to `ol.source.Image.EventType`
* rename `ol.source.RasterEvent` to `ol.source.Raster.Event` * rename `ol.source.RasterEvent` to `ol.source.Raster.Event`
@@ -63,7 +167,7 @@ The DOM renderer has been removed. Instead, the Canvas renderer should be used.
#### Changes in the way assertions are handled #### Changes in the way assertions are handled
Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on http://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks in debug mode when the `goog.DEBUG` compiler flag is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.' Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on https://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks in debug mode when the `goog.DEBUG` compiler flag is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.'
#### Removal of `ol.ENABLE_NAMED_COLORS` #### Removal of `ol.ENABLE_NAMED_COLORS`
@@ -172,7 +276,7 @@ var v3source = new ol.source.TileUTFGrid({
#### Internet Explorer 9 support #### Internet Explorer 9 support
As of this release, OpenLayers requires a `classList` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features#Element_prototype_classList. As of this release, OpenLayers requires a `classList` polyfill for IE 9 support. See https://cdn.polyfill.io/v2/docs/features#Element_prototype_classList.
#### Immediate rendering API #### Immediate rendering API
@@ -221,7 +325,7 @@ The default cache size is `2048`.
#### Internet Explorer 9 support #### Internet Explorer 9 support
As of this release, OpenLayers requires a `requestAnimationFrame`/`cancelAnimationFrame` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features/#requestAnimationFrame. As of this release, OpenLayers requires a `requestAnimationFrame`/`cancelAnimationFrame` polyfill for IE 9 support. See https://cdn.polyfill.io/v2/docs/features/#requestAnimationFrame.
#### Layer pre-/postcompose event changes #### Layer pre-/postcompose event changes
@@ -539,7 +643,7 @@ now specify an `extent` instead of `widths`. These settings are used to restrict
}); });
``` ```
See http://openlayers.org/en/master/examples/vector-layer.html for a real example. See https://openlayers.org/en/master/examples/vector-layer.html for a real example.
Note that you no longer need to set a `projection` on the source! Note that you no longer need to set a `projection` on the source!
@@ -561,7 +665,7 @@ now specify an `extent` instead of `widths`. These settings are used to restrict
The above code uses jQuery to send an Ajax request, but you can obviously use any Ajax library. The above code uses jQuery to send an Ajax request, but you can obviously use any Ajax library.
See http://openlayers.org/en/master/examples/igc.html for a real example. See https://openlayers.org/en/master/examples/igc.html for a real example.
* Note about KML * Note about KML
@@ -619,9 +723,9 @@ now specify an `extent` instead of `widths`. These settings are used to restrict
}); });
``` ```
See http://openlayers.org/en/master/examples/vector-osm.html for a real example. See https://openlayers.org/en/master/examples/vector-osm.html for a real example.
* The experimental `ol.loadingstrategy.createTile` function has been renamed to `ol.loadingstrategy.tile`. The signature of the function hasn't changed. See http://openlayers.org/en/master/examples/vector-osm.html for an example. * The experimental `ol.loadingstrategy.createTile` function has been renamed to `ol.loadingstrategy.tile`. The signature of the function hasn't changed. See https://openlayers.org/en/master/examples/vector-osm.html for an example.
#### Change to `ol.style.Icon` #### Change to `ol.style.Icon`

View File

@@ -17,7 +17,7 @@ The v3.14.0 release includes features and fixes from 93 pull requests since the
#### Internet Explorer 9 support #### Internet Explorer 9 support
As of this release, OpenLayers requires a `requestAnimationFrame`/`cancelAnimationFrame` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features/#requestAnimationFrame. As of this release, OpenLayers requires a `requestAnimationFrame`/`cancelAnimationFrame` polyfill for IE 9 support. See https://cdn.polyfill.io/v2/docs/features/#requestAnimationFrame.
#### Layer pre-/postcompose event changes #### Layer pre-/postcompose event changes

View File

@@ -18,7 +18,7 @@ The v3.15.0 release includes features and fixes from 136 pull requests since the
#### Internet Explorer 9 support #### Internet Explorer 9 support
As of this release, OpenLayers requires a `classList` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features#Element_prototype_classList. As of this release, OpenLayers requires a `classList` polyfill for IE 9 support. See https://cdn.polyfill.io/v2/docs/features#Element_prototype_classList.
#### Immediate rendering API #### Immediate rendering API

View File

@@ -14,7 +14,7 @@ The v3.18.0 release includes features and fixes from almost 120 pull requests si
#### Changes in the way assertions are handled #### Changes in the way assertions are handled
Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on http://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks in debug mode when the `goog.DEBUG` compiler flag is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.' Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on https://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks in debug mode when the `goog.DEBUG` compiler flag is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.'
#### Removal of `ol.ENABLE_NAMED_COLORS` #### Removal of `ol.ENABLE_NAMED_COLORS`

203
changelog/v3.19.0.md Normal file
View File

@@ -0,0 +1,203 @@
# v3.19.0
## Summary
The v3.19.0 release includes features and fixes from a little more than 120 pull requests with more than 380 commits. Most of the changes are bug fixes, documentation enhancements or target the continuing removal of the dependency on Closure Library. Some notable new or enhanced features are:
* Vector fills with `CanvasGradient` or `CanvasPattern` now move and rotate with the map which is far more intuitive ([#5950](https://github.com/openlayers/ol3/pull/5950))
* Drawing in `freehand`-mode also became more intuitive ([#5970](https://github.com/openlayers/ol3/pull/5970), [#5973](https://github.com/openlayers/ol3/pull/5973), [#5975](https://github.com/openlayers/ol3/pull/5975))
* When tiles of different resolutions are combined for a layer (which is the case before all tiles of the best resolution have been loaded), lower resolution tiles now align with higher resolution tiles resulting in a map without gaps ([#5890](https://github.com/openlayers/ol3/pull/5890))
* Styles can now easily be cloned ([#5832](https://github.com/openlayers/ol3/pull/5832))
Additionally the [openlayers.org](https://openlayers.org) homepage is now available via the `https`-protocol.
## Upgrade notes
#### `ol.style.Fill` with `CanvasGradient` or `CanvasPattern`
Previously, gradients and patterns were aligned with the canvas, so they did not
move and rotate with the map. This was changed to a more expected behavior by anchoring the fill to the map origin (usually at map coordinate `[0, 0]`).
#### `goog.DEBUG` define was renamed to `ol.DEBUG`
As last step in the removal of the dependency on Google Closure Library, the `goog.DEBUG` compiler define was renamed to `ol.DEBUG`. Please change accordingly in your custom build configuration json files.
#### `ol.format.ogc.filter` namespace was renamed to `ol.format.filter`
`ol.format.ogc.filter` was simplified to `ol.format.filter`; to upgrade your code, simply remove the `ogc` string from the name.
For example: `ol.format.ogc.filter.and` to `ol.format.filter.and`.
#### Changes only relevant to those who compile their applications together with the Closure Compiler
A number of internal types have been renamed. This will not affect those who use the API provided by the library, but if you are compiling your application together with OpenLayers and using type names, you'll need to do the following:
* rename `ol.CollectionProperty` to `ol.Collection.Property`
* rename `ol.DeviceOrientationProperty` to `ol.DeviceOrientation.Property`
* rename `ol.DragBoxEvent` to `ol.interaction.DragBox.Event`
* rename `ol.DragBoxEventType` to `ol.interaction.DragBox.EventType`
* rename `ol.GeolocationProperty` to `ol.Geolocation.Property`
* rename `ol.OverlayPositioning` to `ol.Overlay.Positioning`
* rename `ol.OverlayProperty` to `ol.Overlay.Property`
* rename `ol.control.MousePositionProperty` to `ol.control.MousePosition.Property`
* rename `ol.format.IGCZ` to `ol.format.IGC.Z`
* rename `ol.interaction.InteractionProperty` to `ol.interaction.Interaction.Property`
* rename `ol.interaction.DrawMode` to `ol.interaction.Draw.Mode`
* rename `ol.interaction.DrawEvent` to `ol.interaction.Draw.Event`
* rename `ol.interaction.DrawEventType` to `ol.interaction.Draw.EventType`
* rename `ol.interaction.ExtentEvent` to `ol.interaction.Extent.Event`
* rename `ol.interaction.ExtentEventType` to `ol.interaction.Extent.EventType`
* rename `ol.interaction.DragAndDropEvent` to `ol.interaction.DragAndDrop.Event`
* rename `ol.interaction.DragAndDropEventType` to `ol.interaction.DragAndDrop.EventType`
* rename `ol.interaction.ModifyEvent` to `ol.interaction.Modify.Event`
* rename `ol.interaction.SelectEvent` to `ol.interaction.Select.Event`
* rename `ol.interaction.SelectEventType` to `ol.interaction.Select.EventType`
* rename `ol.interaction.TranslateEvent` to `ol.interaction.Translate.Event`
* rename `ol.interaction.TranslateEventType` to `ol.interaction.Translate.EventType`
* rename `ol.layer.GroupProperty` to `ol.layer.Group.Property`
* rename `ol.layer.HeatmapLayerProperty` to `ol.layer.Heatmap.Property`
* rename `ol.layer.TileProperty` to `ol.layer.Tile.Property`
* rename `ol.layer.VectorTileRenderType` to `ol.layer.VectorTile.RenderType`
* rename `ol.MapEventType` to `ol.MapEvent.Type`
* rename `ol.MapProperty` to `ol.Map.Property`
* rename `ol.ModifyEventType` to `ol.interaction.Modify.EventType`
* rename `ol.RendererType` to `ol.renderer.Type`
* rename `ol.render.EventType` to `ol.render.Event.Type`
* rename `ol.source.ImageEvent` to `ol.source.Image.Event`
* rename `ol.source.ImageEventType` to `ol.source.Image.EventType`
* rename `ol.source.RasterEvent` to `ol.source.Raster.Event`
* rename `ol.source.RasterEventType` to `ol.source.Raster.EventType`
* rename `ol.source.TileEvent` to `ol.source.Tile.Event`
* rename `ol.source.TileEventType` to `ol.source.Tile.EventType`
* rename `ol.source.VectorEvent` to `ol.source.Vector.Event`
* rename `ol.source.VectorEventType` to `ol.source.Vector.EventType`
* rename `ol.source.wms.ServerType` to `ol.source.WMSServerType`
* rename `ol.source.WMTSRequestEncoding` to `ol.source.WMTS.RequestEncoding`
* rename `ol.style.IconAnchorUnits` to `ol.style.Icon.AnchorUnits`
* rename `ol.style.IconOrigin` to `ol.style.Icon.Origin`
## Full list of changes
* [#6007](https://github.com/openlayers/ol3/pull/6007) - Add note to example that canvas.toBlob() is required ([@marcjansen](https://github.com/marcjansen))
* [#5979](https://github.com/openlayers/ol3/pull/5979) - Use FileSaver.js in export-map example ([@fredj](https://github.com/fredj))
* [#6004](https://github.com/openlayers/ol3/pull/6004) - Bring back the vector-osm example, using a different service ([@ahocevar](https://github.com/ahocevar))
* [#6002](https://github.com/openlayers/ol3/pull/6002) - Use tile pixel ratio for gutter calculation ([@ahocevar](https://github.com/ahocevar))
* [#5991](https://github.com/openlayers/ol3/pull/5991) - Only test ol.format.MVT if ArrayBuffer.isView is supported ([@openlayers](https://github.com/openlayers))
* [#6000](https://github.com/openlayers/ol3/pull/6000) - Fix mockup of tile layer to keep drawImage arguments in range ([@ahocevar](https://github.com/ahocevar))
* [#5997](https://github.com/openlayers/ol3/pull/5997) - Always load a gated URL polyfill when testing ([@marcjansen](https://github.com/marcjansen))
* [#5963](https://github.com/openlayers/ol3/pull/5963) - Remove the vertex on ol.interaction.Modify deactivation ([@fredj](https://github.com/fredj))
* [#5994](https://github.com/openlayers/ol3/pull/5994) - Setup a loaded image with src for TileLayer test ([@marcjansen](https://github.com/marcjansen))
* [#5989](https://github.com/openlayers/ol3/pull/5989) - Remove vector-osm example ([@openlayers](https://github.com/openlayers))
* [#5985](https://github.com/openlayers/ol3/pull/5985) - Update Mapzen urls to new scheme ([@ahocevar](https://github.com/ahocevar))
* [#5984](https://github.com/openlayers/ol3/pull/5984) - Less examples with mixed content ([@ahocevar](https://github.com/ahocevar))
* [#5986](https://github.com/openlayers/ol3/pull/5986) - Update eslint to version 3.8.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5982](https://github.com/openlayers/ol3/pull/5982) - Use a https enabled GeoServer ([@ahocevar](https://github.com/ahocevar))
* [#5977](https://github.com/openlayers/ol3/pull/5977) - Convenience function for drawing boxes ([@tschaub](https://github.com/tschaub))
* [#5978](https://github.com/openlayers/ol3/pull/5978) - Update async to version 2.1.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#5975](https://github.com/openlayers/ol3/pull/5975) - Finish drawing on pointerup when in freehand mode ([@tschaub](https://github.com/tschaub))
* [#5976](https://github.com/openlayers/ol3/pull/5976) - Use https where available ([@tschaub](https://github.com/tschaub))
* [#5973](https://github.com/openlayers/ol3/pull/5973) - Add a freehand option to the draw interaction ([@tschaub](https://github.com/tschaub))
* [#5964](https://github.com/openlayers/ol3/pull/5964) - Set one-off transform instead of transforming back and forth ([@ahocevar](https://github.com/ahocevar))
* [#5970](https://github.com/openlayers/ol3/pull/5970) - Allow circles, squares, and boxes to be drawn in freehand mode ([@tschaub](https://github.com/tschaub))
* [#5972](https://github.com/openlayers/ol3/pull/5972) - Update eslint to version 3.8.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5969](https://github.com/openlayers/ol3/pull/5969) - Test all, not just one ([@ahocevar](https://github.com/ahocevar))
* [#5967](https://github.com/openlayers/ol3/pull/5967) - Add missing jsdoc to ol.render.canvas.Replay#fill_ function ([@fredj](https://github.com/fredj))
* [#5962](https://github.com/openlayers/ol3/pull/5962) - Use same proj4js version in examples and tests ([@ahocevar](https://github.com/ahocevar))
* [#5961](https://github.com/openlayers/ol3/pull/5961) - Remove unused error codes ([@ahocevar](https://github.com/ahocevar))
* [#5960](https://github.com/openlayers/ol3/pull/5960) - More renaming to have one provide per file ([@fredj](https://github.com/fredj))
* [#5959](https://github.com/openlayers/ol3/pull/5959) - Remove unnecessary and misleading assertion ([@ahocevar](https://github.com/ahocevar))
* [#5950](https://github.com/openlayers/ol3/pull/5950) - Move gradient and pattern fills with the view ([@ahocevar](https://github.com/ahocevar))
* [#5957](https://github.com/openlayers/ol3/pull/5957) - Update async to version 2.1.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5956](https://github.com/openlayers/ol3/pull/5956) - Update async to version 2.1.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5955](https://github.com/openlayers/ol3/pull/5955) - Add getters to BingMaps source for api key and imagerySet ([@bartvde](https://github.com/bartvde))
* [#5944](https://github.com/openlayers/ol3/pull/5944) - Allow readFeature and readFeatures to be called with GeoJSON geometries ([@tschaub](https://github.com/tschaub))
* [#5949](https://github.com/openlayers/ol3/pull/5949) - Add prose documentation for ol.AttributionLike ([@marcjansen](https://github.com/marcjansen))
* [#5948](https://github.com/openlayers/ol3/pull/5948) - Fix API docs of ol.Feature#getStyle ([@marcjansen](https://github.com/marcjansen))
* [#5946](https://github.com/openlayers/ol3/pull/5946) - Update mocha to version 3.1.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#5941](https://github.com/openlayers/ol3/pull/5941) - Update mocha to version 3.1.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5890](https://github.com/openlayers/ol3/pull/5890) - No gaps between tiles of different resolutions ([@ahocevar](https://github.com/ahocevar))
* [#5935](https://github.com/openlayers/ol3/pull/5935) - Keep transformed coordinates within valid y range ([@tschaub](https://github.com/tschaub))
* [#5937](https://github.com/openlayers/ol3/pull/5937) - One provide per file for vector tiles ([@ahocevar](https://github.com/ahocevar))
* [#5933](https://github.com/openlayers/ol3/pull/5933) - Update phantomjs-prebuilt to version 2.1.13 🚀 ([@openlayers](https://github.com/openlayers))
* [#5932](https://github.com/openlayers/ol3/pull/5932) - Update eslint to version 3.7.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5931](https://github.com/openlayers/ol3/pull/5931) - Update jsdoc to version 3.4.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#5923](https://github.com/openlayers/ol3/pull/5923) - Update pbf to version 3.0.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#5926](https://github.com/openlayers/ol3/pull/5926) - Ensure correct type of event.element ([@adube](https://github.com/adube))
* [#5928](https://github.com/openlayers/ol3/pull/5928) - Update eslint to version 3.7.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5919](https://github.com/openlayers/ol3/pull/5919) - Update resemblejs to version 2.2.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#5909](https://github.com/openlayers/ol3/pull/5909) - Update jquery to version 3.1.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5917](https://github.com/openlayers/ol3/pull/5917) - Accept feature projection in GeoJSON constructor ([@tschaub](https://github.com/tschaub))
* [#5918](https://github.com/openlayers/ol3/pull/5918) - Update mocha to version 3.1.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5916](https://github.com/openlayers/ol3/pull/5916) - Update eslint to version 3.6.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5914](https://github.com/openlayers/ol3/pull/5914) - Allow clipping by MultiPolygon ([@tschaub](https://github.com/tschaub))
* [#5894](https://github.com/openlayers/ol3/pull/5894) - Reuse arrays for rendered tiles and extent ([@ahocevar](https://github.com/ahocevar))
* [#5895](https://github.com/openlayers/ol3/pull/5895) - Always use the frameState's extent ([@ahocevar](https://github.com/ahocevar))
* [#5911](https://github.com/openlayers/ol3/pull/5911) - Update eslint to version 3.6.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5903](https://github.com/openlayers/ol3/pull/5903) - Rename ol.format.ogc.filter namespace to ol.format.filter ([@fredj](https://github.com/fredj))
* [#5913](https://github.com/openlayers/ol3/pull/5913) - Update clean-css to version 3.4.20 🚀 ([@openlayers](https://github.com/openlayers))
* [#5776](https://github.com/openlayers/ol3/pull/5776) - Add ol.style.Circle#setRadius ([@jonataswalker](https://github.com/jonataswalker))
* [#5905](https://github.com/openlayers/ol3/pull/5905) - Update pbf to version 3.0.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5904](https://github.com/openlayers/ol3/pull/5904) - Fix changelog/upgrade-notes.md formating ([@fredj](https://github.com/fredj))
* [#5906](https://github.com/openlayers/ol3/pull/5906) - Update glob to version 7.1.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5898](https://github.com/openlayers/ol3/pull/5898) - Update sinon to version 1.17.6 🚀 ([@openlayers](https://github.com/openlayers))
* [#5888](https://github.com/openlayers/ol3/pull/5888) - Remove unused functions ([@fredj](https://github.com/fredj))
* [#5900](https://github.com/openlayers/ol3/pull/5900) - Update coveralls to version 2.11.14 🚀 ([@openlayers](https://github.com/openlayers))
* [#5897](https://github.com/openlayers/ol3/pull/5897) - Show NEXRAD data in WMS Time example ([@ahocevar](https://github.com/ahocevar))
* [#5896](https://github.com/openlayers/ol3/pull/5896) - Remove plain string from Map renderer option ([@probins](https://github.com/probins))
* [#5893](https://github.com/openlayers/ol3/pull/5893) - Fix fillStyle or strokeStyle defined assertion ([@ahocevar](https://github.com/ahocevar))
* [#5892](https://github.com/openlayers/ol3/pull/5892) - Remove getRendererFromQueryString from examples ([@probins](https://github.com/probins))
* [#5889](https://github.com/openlayers/ol3/pull/5889) - Update coveralls to version 2.11.13 🚀 ([@openlayers](https://github.com/openlayers))
* [#5886](https://github.com/openlayers/ol3/pull/5886) - Remove unused functions ([@fredj](https://github.com/fredj))
* [#5885](https://github.com/openlayers/ol3/pull/5885) - Remove unused pruneTileRange function ([@bartvde](https://github.com/bartvde))
* [#5853](https://github.com/openlayers/ol3/pull/5853) - Allow more than one digit range in ol.TileUrlFunction.expandUrl ([@fredj](https://github.com/fredj))
* [#5445](https://github.com/openlayers/ol3/pull/5445) - Select interaction default styling function can now handle geometry less features ([@fblackburn](https://github.com/fblackburn))
* [#5884](https://github.com/openlayers/ol3/pull/5884) - Fix jsdoc tag indentation ([@fredj](https://github.com/fredj))
* [#5863](https://github.com/openlayers/ol3/pull/5863) - Allow CanvasPattern or CanvasGradient as stroke style ([@fredj](https://github.com/fredj))
* [#5838](https://github.com/openlayers/ol3/pull/5838) - Require ol where ol.DEBUG is being used ([@marcjansen](https://github.com/marcjansen))
* [#5878](https://github.com/openlayers/ol3/pull/5878) - Smarter handling of closed rings and closePath() instructions ([@ahocevar](https://github.com/ahocevar))
* [#5880](https://github.com/openlayers/ol3/pull/5880) - More work towards one provide per file ([@marcjansen](https://github.com/marcjansen))
* [#5857](https://github.com/openlayers/ol3/pull/5857) - Fixed issue with multi option of ol.interaction.Select ([@KlausBenndorf](https://github.com/KlausBenndorf))
* [#5876](https://github.com/openlayers/ol3/pull/5876) - Use clone method in kml format ([@KlausBenndorf](https://github.com/KlausBenndorf))
* [#5832](https://github.com/openlayers/ol3/pull/5832) - Add clone methods to styles ([@KlausBenndorf](https://github.com/KlausBenndorf))
* [#5869](https://github.com/openlayers/ol3/pull/5869) - Update jsdoc to version 3.4.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#5872](https://github.com/openlayers/ol3/pull/5872) - Keep ol.Color as Array<number> ([@tschaub](https://github.com/tschaub))
* [#5870](https://github.com/openlayers/ol3/pull/5870) - Update eslint to version 3.5.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5867](https://github.com/openlayers/ol3/pull/5867) - Add dedicated example using CanvasPattern and CanvasGradient for styling vectors ([@marcjansen](https://github.com/marcjansen))
* [#5864](https://github.com/openlayers/ol3/pull/5864) - More renaming ([@fredj](https://github.com/fredj))
* [#5861](https://github.com/openlayers/ol3/pull/5861) - More renaming to have one provide per file ([@fredj](https://github.com/fredj))
* [#5860](https://github.com/openlayers/ol3/pull/5860) - Rename ol.MapProperty and ol.interaction.DragAndDropEvent* ([@fredj](https://github.com/fredj))
* [#5855](https://github.com/openlayers/ol3/pull/5855) - Rename ol.DragBoxEvent* to ol.interaction.DragBox.Event* ([@fredj](https://github.com/fredj))
* [#5859](https://github.com/openlayers/ol3/pull/5859) - Rename ol.RendererType to ol.renderer.Type ([@fredj](https://github.com/fredj))
* [#5846](https://github.com/openlayers/ol3/pull/5846) - Remove unused goog.require('ol') ([@probins](https://github.com/probins))
* [#5854](https://github.com/openlayers/ol3/pull/5854) - Use a canvas pattern in the vector-layer example ([@fredj](https://github.com/fredj))
* [#5852](https://github.com/openlayers/ol3/pull/5852) - ol.interaction.extent cleanup ([@fredj](https://github.com/fredj))
* [#5851](https://github.com/openlayers/ol3/pull/5851) - Remove unused imageByContext_ in ol.ImageTile ([@fredj](https://github.com/fredj))
* [#5849](https://github.com/openlayers/ol3/pull/5849) - Remove 'global' from externs/closure-compiler.js ([@fredj](https://github.com/fredj))
* [#5837](https://github.com/openlayers/ol3/pull/5837) - Remove ol.global ([@tschaub](https://github.com/tschaub))
* [#5842](https://github.com/openlayers/ol3/pull/5842) - Remove extra provide causing a circular dependency ([@ahocevar](https://github.com/ahocevar))
* [#5795](https://github.com/openlayers/ol3/pull/5795) - Render older loaded tiles while waiting for new tiles ([@thomasmoelhave](https://github.com/thomasmoelhave))
* [#5840](https://github.com/openlayers/ol3/pull/5840) - Rename source.wms.ServerType ➛ source.WMSServerType ([@marcjansen](https://github.com/marcjansen))
* [#5839](https://github.com/openlayers/ol3/pull/5839) - Rename source.VectorEvent(*) to source.Vector.Event(*) ([@marcjansen](https://github.com/marcjansen))
* [#5835](https://github.com/openlayers/ol3/pull/5835) - document and test ol.getUid sequence behavior ([@thomasmoelhave](https://github.com/thomasmoelhave))
* [#5834](https://github.com/openlayers/ol3/pull/5834) - Rename goog.DEBUG to ol.DEBUG ([@thomasmoelhave](https://github.com/thomasmoelhave))
* [#5815](https://github.com/openlayers/ol3/pull/5815) - Remove the DOM renderer ([@tschaub](https://github.com/tschaub))
* [#5828](https://github.com/openlayers/ol3/pull/5828) - Always close polygon rings ([@ahocevar](https://github.com/ahocevar))
* [#5794](https://github.com/openlayers/ol3/pull/5794) - Fix more missing requires ([@openlayers](https://github.com/openlayers))
* [#5820](https://github.com/openlayers/ol3/pull/5820) - Change ol.format.Format to ol.format.Feature in format/readme.md ([@fredj](https://github.com/fredj))
* [#5819](https://github.com/openlayers/ol3/pull/5819) - Add ArrayBuffer.isView method in externs/closure-compiler.js ([@fredj](https://github.com/fredj))
* [#5793](https://github.com/openlayers/ol3/pull/5793) - Closure bye bye ([@ahocevar](https://github.com/ahocevar))
* [#5809](https://github.com/openlayers/ol3/pull/5809) - Reuse ol.LayerState object ([@fredj](https://github.com/fredj))
* [#5811](https://github.com/openlayers/ol3/pull/5811) - Use ol.global.getComputedStyle instead of window.getComputedStyle ([@fredj](https://github.com/fredj))
* [#5810](https://github.com/openlayers/ol3/pull/5810) - ESLint rule typo ([@gberaudo](https://github.com/gberaudo))
* [#5807](https://github.com/openlayers/ol3/pull/5807) - Update pbf to version 3.0.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5806](https://github.com/openlayers/ol3/pull/5806) - Fix olx.style.TextOptions.rotateWithView option in externs ([@fredj](https://github.com/fredj))
* [#5770](https://github.com/openlayers/ol3/pull/5770) - Update ol.source.Vector comments ([@fredj](https://github.com/fredj))
* [#5803](https://github.com/openlayers/ol3/pull/5803) - V3.18.1 ([@openlayers](https://github.com/openlayers))
* [#5801](https://github.com/openlayers/ol3/pull/5801) - Remove ol.style.ImageState and use ol.ImageState instead ([@fredj](https://github.com/fredj))
* [#5790](https://github.com/openlayers/ol3/pull/5790) - Fix vector tile rotation on HiDPI devices ([@ahocevar](https://github.com/ahocevar))
* [#5798](https://github.com/openlayers/ol3/pull/5798) - Move to 90° along the circle, not 0° ([@ahocevar](https://github.com/ahocevar))
* [#5800](https://github.com/openlayers/ol3/pull/5800) - Wrap values in <Literal> for InBetween filter ([@tsauerwein](https://github.com/tsauerwein))
* [#5769](https://github.com/openlayers/ol3/pull/5769) - Only call addToDrawing if sketchFeature ([@bartvde](https://github.com/bartvde))
* [#5745](https://github.com/openlayers/ol3/pull/5745) - removed dependencies on goog.object.clone and fixed placemark rendering ([@tamarmot](https://github.com/tamarmot))
* [#5290](https://github.com/openlayers/ol3/pull/5290) - Add extent interaction ([@tbarsballe](https://github.com/tbarsballe))
* [#5786](https://github.com/openlayers/ol3/pull/5786) - Update eslint to version 3.4.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5785](https://github.com/openlayers/ol3/pull/5785) - Release v3.18.0 ([@openlayers](https://github.com/openlayers))

22
changelog/v3.19.1.md Normal file
View File

@@ -0,0 +1,22 @@
# v3.19.1
## Summary
The v3.19.1 release is a patch release that addresses four regressions in the
v3.19.0 release. See the
[v3.19.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.19.0)
for details on upgrading from v3.18.x.
## Upgrade notes
#### `ol.style.Fill` with `CanvasGradient` or `CanvasPattern`
The origin for gradients and patterns has changed from `[0, 0]` to the top-left
corner of the extent of the geometry being filled.
## Fixes
* [#6039](https://github.com/openlayers/ol3/pull/6039) - Do not fill when there is no fillStyle ([@ahocevar](https://github.com/ahocevar))
* [#6034](https://github.com/openlayers/ol3/pull/6034) - Use geometry extent's top left corner as pattern/gradient origin ([@ahocevar](https://github.com/ahocevar))
* [#6027](https://github.com/openlayers/ol3/pull/6027) - Close polygon sketch at all times ([@bjornharrtell](https://github.com/bjornharrtell))
* [#6022](https://github.com/openlayers/ol3/pull/6022) - Revert "Merge pull request #5890 from ahocevar/no-white-lines" ([@ahocevar](https://github.com/ahocevar))

View File

@@ -2,7 +2,7 @@
## Summary ## Summary
The 3.1.0 release includes 70 merged pull requests since 3.1.0. Of note, the KML format [now parses `NetworkingLink` tags](https://github.com/openlayers/ol3/pull/3171). The [measure example](http://openlayers.org/en/v3.2.0/examples/measure.html) was [reworked](https://github.com/openlayers/ol3/pull/3206) to display measurements and help messages while drawing. A WMTS GetCapabilities format was [added](https://github.com/openlayers/ol3/pull/3026). The WebGL renderer [now supports feature hit detection](https://github.com/openlayers/ol3/pull/3065) (on point features). And you can now [detect](https://github.com/openlayers/ol3/pull/3172) features/colored pixels on image and tile layers! See the full list of [changes](#changes) below. The 3.1.0 release includes 70 merged pull requests since 3.1.0. Of note, the KML format [now parses `NetworkingLink` tags](https://github.com/openlayers/ol3/pull/3171). The [measure example](https://openlayers.org/en/v3.2.0/examples/measure.html) was [reworked](https://github.com/openlayers/ol3/pull/3206) to display measurements and help messages while drawing. A WMTS GetCapabilities format was [added](https://github.com/openlayers/ol3/pull/3026). The WebGL renderer [now supports feature hit detection](https://github.com/openlayers/ol3/pull/3065) (on point features). And you can now [detect](https://github.com/openlayers/ol3/pull/3172) features/colored pixels on image and tile layers! See the full list of [changes](#changes) below.
## Upgrade notes ## Upgrade notes

195
changelog/v3.20.0.md Normal file
View File

@@ -0,0 +1,195 @@
# v3.20.0
## Summary
The v3.20.0 release includes enhancements and fixes from 89 pull requests since the previous release.
Among the changes, take a look at the new `view.animate()` function. This replaces the previous `map.beforeRender()` and `ol.animation` functions with more intuitive view animations that allow for chaining together multiple transitions and support a callback on animation end. In addition, two or more maps that share a view will be animated together. See the upgrade notes and the animation example for more detail.
On the subject of view transitions, scrolling with a trackpad or magic mouse now transitions the view resolution smoothly. Instead of jumping to the next integer zoom level, trackpad or magic mouse scrolling can leave the view at a fractional zoom level. In line with this trackpad behavior, pinch zooming on touch devices also now leaves the view at a fractional zoom level (see the upgrade notes for an option to restore the old behavior).
On the rendering front, the Canvas renderer got another overhaul. This release brings back the strategy of rendering to a dedicated Canvas element per layer. If you were experiencing issues with gaps between tiles on rotated views or when zooming, this change should bring rendering improvements.
Also on the rendering front, @GaborFarkas completed a nearly 5 month effort to bring line and polygon support to the WebGL renderer. If you're interested in experimenting with WebGL for vector rendering, use `renderer: 'webgl'` in your map constructor.
See the full list of changes below. There are some other gems down there.
## Upgrade notes
#### Use `view.animate()` instead of `map.beforeRender()` and `ol.animation` functions
The `map.beforeRender()` and `ol.animation` functions have been deprecated in favor of a new `view.animate()` function. Use of the deprecated functions will result in a warning during development. These functions are subject to removal in an upcoming release.
For details on the `view.animate()` method, see the API docs and the view animation example. Upgrading should be relatively straightforward. For example, if you wanted to have an animated pan, zoom, and rotation previously, you might have done this:
```js
var zoom = ol.animation.zoom({
resolution: view.getResolution()
});
var pan = ol.animation.pan({
source: view.getCenter()
});
var rotate = ol.animation.rotate({
rotation: view.getRotation()
});
map.beforeRender(zoom, pan, rotate);
map.setZoom(1);
map.setCenter([0, 0]);
map.setRotation(Math.PI);
```
Now, the same can be accomplished with this:
```js
view.animate({
zoom: 1,
center: [0, 0],
rotation: Math.PI
});
```
#### `ol.Map#forEachFeatureAtPixel` and `ol.Map#hasFeatureAtPixel` parameters have changed
If you are using the layer filter of one of these methods, please note that you now have to pass in the layer filter via an `ol.AtPixelOptions` object. If you are not using the layer filter the usage has not changed.
Old syntax:
```js
map.forEachFeatureAtPixel(pixel, callback, callbackThis, layerFilterFn, layerFilterThis);
map.hasFeatureAtPixel(pixel, layerFilterFn, layerFilterThis);
```
New syntax:
```js
map.forEachFeatureAtPixel(pixel, callback.bind(callbackThis), {
layerFilter: layerFilterFn.bind(layerFilterThis)
});
map.hasFeatureAtPixel(pixel, {
layerFilter: layerFilterFn.bind(layerFilterThis)
});
```
This change is due to the introduction of the `hitTolerance` parameter which can be passed in via this `ol.AtPixelOptions` object, too.
#### Use `ol.proj.getPointResolution()` instead of `projection.getPointResolution()`
The experimental `getPointResolution` method has been removed from `ol.Projection` instances. Since the implementation of this method required an inverse transform (function for transforming projected coordinates to geographic coordinates) and `ol.Projection` instances are not constructed with forward or inverse transforms, it does not make sense that a projection instance can always calculate the point resolution.
As a substitute for the `projection.getPointResolution()` function, a `ol.proj.getPointResolution()` function has been added. To upgrade, you will need to change things like this:
```js
projection.getPointResolution(resolution, point);
```
into this:
```js
ol.proj.getPointResolution(projection, resolution, point);
```
Note that if you were previously creating a projection with a `getPointResolution` function in the constructor (or calling `projection.setGetPointResolution()` after construction), this function will be used by `ol.proj.getPointResolution()`.
#### `ol.interaction.PinchZoom` no longer zooms to a whole-number zoom level after the gesture ends
The old behavior of `ol.interaction.PinchZoom` was to zoom to the next integer zoom level after the user ends the gesture.
Now the pinch zoom keeps the user selected zoom level even if it is a fractional zoom.
To get the old behavior set the new `constrainResolution` parameter to `true` like this:
```js
new ol.interaction.PinchZoom({constrainResolution: true})
```
See the new `pinch-zoom` example for a complete implementation.
## Detailed changes
* [#6230](https://github.com/openlayers/ol3/pull/6230) - Ignore duplicated attributions ([@tschaub](https://github.com/tschaub))
* [#6192](https://github.com/openlayers/ol3/pull/6192) - Modify interaction: always stop event propagation when removing vertex ([@tchandelle](https://github.com/tchandelle))
* [#6228](https://github.com/openlayers/ol3/pull/6228) - Rename the pinch zoom example ([@tschaub](https://github.com/tschaub))
* [#6229](https://github.com/openlayers/ol3/pull/6229) - Update phantomjs-prebuilt to version 2.1.14 🚀 ([@openlayers](https://github.com/openlayers))
* [#6196](https://github.com/openlayers/ol3/pull/6196) - KML ExtendedData Export ([@raiyni](https://github.com/raiyni))
* [#6227](https://github.com/openlayers/ol3/pull/6227) - Update eslint to version 3.12.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#6224](https://github.com/openlayers/ol3/pull/6224) - Pinch zoom: allow fractional zoom ([@aAXEe](https://github.com/aAXEe))
* [#6226](https://github.com/openlayers/ol3/pull/6226) - Improve the headers styles in the api doc ([@tchandelle](https://github.com/tchandelle))
* [#5995](https://github.com/openlayers/ol3/pull/5995) - Add hit tolerance parameter to ol.Map#forEachFeatureAtPixel ([@KlausBenndorf](https://github.com/KlausBenndorf))
* [#6220](https://github.com/openlayers/ol3/pull/6220) - Fix ol.Collection#push return value ([@fredj](https://github.com/fredj))
* [#6213](https://github.com/openlayers/ol3/pull/6213) - Add preload option to olx.layer.VectorTileOptions ([@drnextgis](https://github.com/drnextgis))
* [#6222](https://github.com/openlayers/ol3/pull/6222) - Fix forEachLayerAtPixel and improve class hierarchy ([@ahocevar](https://github.com/ahocevar))
* [#6075](https://github.com/openlayers/ol3/pull/6075) - Keep the other dim from the original segment when modifying vertex ([@tchandelle](https://github.com/tchandelle))
* [#6218](https://github.com/openlayers/ol3/pull/6218) - Make modify interaction more robust ([@gberaudo](https://github.com/gberaudo))
* [#6205](https://github.com/openlayers/ol3/pull/6205) - Rework remaining modules with multiple provides ([@tschaub](https://github.com/tschaub))
* [#6207](https://github.com/openlayers/ol3/pull/6207) - Require all when generating exports ([@tschaub](https://github.com/tschaub))
* [#6204](https://github.com/openlayers/ol3/pull/6204) - Refactored proj modules ([@tschaub](https://github.com/tschaub))
* [#6209](https://github.com/openlayers/ol3/pull/6209) - Test array with to.eql(), not to.be.eql() ([@ahocevar](https://github.com/ahocevar))
* [#6091](https://github.com/openlayers/ol3/pull/6091) - Apply pixelRatio to line dash ([@tchandelle](https://github.com/tchandelle))
* [#6082](https://github.com/openlayers/ol3/pull/6082) - Unified canvas rendering ([@ahocevar](https://github.com/ahocevar))
* [#6173](https://github.com/openlayers/ol3/pull/6173) - Topolis example ([@bjornharrtell](https://github.com/bjornharrtell))
* [#6206](https://github.com/openlayers/ol3/pull/6206) - Stop asserting that zero duration animations take time ([@tschaub](https://github.com/tschaub))
* [#6203](https://github.com/openlayers/ol3/pull/6203) - Address a few missing requires ([@tschaub](https://github.com/tschaub))
* [#6201](https://github.com/openlayers/ol3/pull/6201) - Remove assertion in TileArcGISRest source ([@tschaub](https://github.com/tschaub))
* [#6202](https://github.com/openlayers/ol3/pull/6202) - Allow animation duration to be zero ([@tschaub](https://github.com/tschaub))
* [#6198](https://github.com/openlayers/ol3/pull/6198) - Fix sourceResolution value in view.animate ([@oterral](https://github.com/oterral))
* [#6177](https://github.com/openlayers/ol3/pull/6177) - Add duration and easing options to view.fit() for animations ([@tchandelle](https://github.com/tchandelle))
* [#6078](https://github.com/openlayers/ol3/pull/6078) - Use winding number algorithm for linearRingContainsXY ([@bjornharrtell](https://github.com/bjornharrtell))
* [#6187](https://github.com/openlayers/ol3/pull/6187) - Update pbf to version 3.0.5 🚀 ([@openlayers](https://github.com/openlayers))
* [#6175](https://github.com/openlayers/ol3/pull/6175) - Generate projection transform function only when requested ([@tchandelle](https://github.com/tchandelle))
* [#6181](https://github.com/openlayers/ol3/pull/6181) - Replace expired Bing key with a new one ([@ahocevar](https://github.com/ahocevar))
* [#6164](https://github.com/openlayers/ol3/pull/6164) - Simplify color parsing and allow more decimals ([@marcjansen](https://github.com/marcjansen))
* [#6178](https://github.com/openlayers/ol3/pull/6178) - Add missing goog.require ([@fredj](https://github.com/fredj))
* [#6176](https://github.com/openlayers/ol3/pull/6176) - Doc: easing option is optional ([@tchandelle](https://github.com/tchandelle))
* [#6180](https://github.com/openlayers/ol3/pull/6180) - Update eslint to version 3.11.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#6179](https://github.com/openlayers/ol3/pull/6179) - Remove unused ol.Map.removePreRenderFunction function ([@fredj](https://github.com/fredj))
* [#6052](https://github.com/openlayers/ol3/pull/6052) - Remove the use of ol.format.KML.DEFAULT_IMAGE_SCALE_MULTIPLIER_ when … ([@oterral](https://github.com/oterral))
* [#6159](https://github.com/openlayers/ol3/pull/6159) - Remove carriage return after goog.require in examples ([@tchandelle](https://github.com/tchandelle))
* [#6169](https://github.com/openlayers/ol3/pull/6169) - Image rotation in WebGL was anti-clockwise ([@tchandelle](https://github.com/tchandelle))
* [#5590](https://github.com/openlayers/ol3/pull/5590) - Kml format: improved support for region and extendeddata ([@thhomas](https://github.com/thhomas))
* [#5462](https://github.com/openlayers/ol3/pull/5462) - WebGL vector support ([@GaborFarkas](https://github.com/GaborFarkas))
* [#6168](https://github.com/openlayers/ol3/pull/6168) - Update mocha to version 3.2.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#5589](https://github.com/openlayers/ol3/pull/5589) - Wmts tilematrixlimits ([@thhomas](https://github.com/thhomas))
* [#6155](https://github.com/openlayers/ol3/pull/6155) - Set GeometryLayout correctly when reading GPX ([@romanzoller](https://github.com/romanzoller))
* [#6161](https://github.com/openlayers/ol3/pull/6161) - Update async to version 2.1.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#6153](https://github.com/openlayers/ol3/pull/6153) - Remove legacy licenses folder ([@romanzoller](https://github.com/romanzoller))
* [#6154](https://github.com/openlayers/ol3/pull/6154) - Update mocha-phantomjs-core to version 2.1.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#6146](https://github.com/openlayers/ol3/pull/6146) - Merge ol.style.Circle and RegularShape together ([@tchandelle](https://github.com/tchandelle))
* [#6139](https://github.com/openlayers/ol3/pull/6139) - Match equivalent projections from WMTS caps ([@bartvde](https://github.com/bartvde))
* [#6138](https://github.com/openlayers/ol3/pull/6138) - Update clean-css to version 3.4.21 🚀 ([@openlayers](https://github.com/openlayers))
* [#6132](https://github.com/openlayers/ol3/pull/6132) - Add getter for color property to ol.style.Icon ([@tohu12](https://github.com/tohu12))
* [#6127](https://github.com/openlayers/ol3/pull/6127) - Format WKT Z, M and ZM ([@omarkljung](https://github.com/omarkljung))
* [#6136](https://github.com/openlayers/ol3/pull/6136) - Update eslint to version 3.10.2 🚀 ([@openlayers](https://github.com/openlayers))
* [#6133](https://github.com/openlayers/ol3/pull/6133) - Doc clarification ol.MapBrowserEvent#pixel, ol.MapBrowserEvent#coordinate, ol.Map#getEventCoordinate ([@KlausBenndorf](https://github.com/KlausBenndorf))
* [#6134](https://github.com/openlayers/ol3/pull/6134) - Add setter methods for fill, image, stroke and text styles ([@dnlkoch](https://github.com/dnlkoch))
* [#6129](https://github.com/openlayers/ol3/pull/6129) - Update pbf to version 3.0.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#6121](https://github.com/openlayers/ol3/pull/6121) - Hint change means view change ([@tschaub](https://github.com/tschaub))
* [#6120](https://github.com/openlayers/ol3/pull/6120) - Set interacting hint during trackpad scroll ([@tschaub](https://github.com/tschaub))
* [#6128](https://github.com/openlayers/ol3/pull/6128) - Update pbf to version 3.0.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#6124](https://github.com/openlayers/ol3/pull/6124) - Allow up to 16 decimals for alpha channel when parsing rgba strings to colors ([@marcjansen](https://github.com/marcjansen))
* [#6117](https://github.com/openlayers/ol3/pull/6117) - Update handlebars to version 4.0.6 🚀 ([@openlayers](https://github.com/openlayers))
* [#6113](https://github.com/openlayers/ol3/pull/6113) - Smooth trackpad zooming ([@tschaub](https://github.com/tschaub))
* [#6105](https://github.com/openlayers/ol3/pull/6105) - Move vector tile loader functions into vector tile module ([@tschaub](https://github.com/tschaub))
* [#6114](https://github.com/openlayers/ol3/pull/6114) - Updated linter config and curly conditional blocks ([@tschaub](https://github.com/tschaub))
* [#6106](https://github.com/openlayers/ol3/pull/6106) - Add type annotations for vector tiles ([@tschaub](https://github.com/tschaub))
* [#6107](https://github.com/openlayers/ol3/pull/6107) - Reset hint first and notify of change when cancelling animations ([@tschaub](https://github.com/tschaub))
* [#6112](https://github.com/openlayers/ol3/pull/6112) - Update eslint to version 3.10.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#6110](https://github.com/openlayers/ol3/pull/6110) - Update coveralls to version 2.11.15 🚀 ([@openlayers](https://github.com/openlayers))
* [#6077](https://github.com/openlayers/ol3/pull/6077) - Optionally enable hidpi support for Bing ([@bartvde](https://github.com/bartvde))
* [#6103](https://github.com/openlayers/ol3/pull/6103) - Properly complete multiple parallel animations ([@tschaub](https://github.com/tschaub))
* [#6101](https://github.com/openlayers/ol3/pull/6101) - Avoid starting new zoom animation while already animating ([@tschaub](https://github.com/tschaub))
* [#6099](https://github.com/openlayers/ol3/pull/6099) - Modify interaction tests : check for change events ([@tchandelle](https://github.com/tchandelle))
* [#6069](https://github.com/openlayers/ol3/pull/6069) - If there is no features option, all features will be translated. ([@tchandelle](https://github.com/tchandelle))
* [#6097](https://github.com/openlayers/ol3/pull/6097) - API index page : Fix link anchor to static members ([@tchandelle](https://github.com/tchandelle))
* [#6095](https://github.com/openlayers/ol3/pull/6095) - LineString Arrows example: rotate with the view ([@tchandelle](https://github.com/tchandelle))
* [#6093](https://github.com/openlayers/ol3/pull/6093) - Update mustache to version 2.3.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#6079](https://github.com/openlayers/ol3/pull/6079) - Add view animation ([@tschaub](https://github.com/tschaub))
* [#6081](https://github.com/openlayers/ol3/pull/6081) - Update metalsmith-layouts to version 1.7.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#6074](https://github.com/openlayers/ol3/pull/6074) - Fix typo on style name on Modify Features Test example ([@tchandelle](https://github.com/tchandelle))
* [#6073](https://github.com/openlayers/ol3/pull/6073) - Fix link to errors doc ([@tchandelle](https://github.com/tchandelle))
* [#6072](https://github.com/openlayers/ol3/pull/6072) - Update metalsmith to version 2.3.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#6068](https://github.com/openlayers/ol3/pull/6068) - Fix GeoJSON writeGeometry tests ([@ahocevar](https://github.com/ahocevar))
* [#6067](https://github.com/openlayers/ol3/pull/6067) - Do not draw circle when pointer not moved ([@ahocevar](https://github.com/ahocevar))
* [#6064](https://github.com/openlayers/ol3/pull/6064) - Make vertex candidate selection work better on rotated views ([@ahocevar](https://github.com/ahocevar))
* [#6054](https://github.com/openlayers/ol3/pull/6054) - Update eslint to version 3.9.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#6058](https://github.com/openlayers/ol3/pull/6058) - Update fs-extra to version 1.0.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#6053](https://github.com/openlayers/ol3/pull/6053) - Update glob to version 7.1.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#6045](https://github.com/openlayers/ol3/pull/6045) - Add an example using Mapbox Terrain-RGB tiles ([@tschaub](https://github.com/tschaub))
* [#6042](https://github.com/openlayers/ol3/pull/6042) - Set constants of KML format even if a default style is provided ([@oterral](https://github.com/oterral))

View File

@@ -53,7 +53,7 @@ The 3.5.0 release includes features and fixes from a whopping 129 pull requests
}); });
``` ```
See http://openlayers.org/en/master/examples/vector-layer.html for a real example. See https://openlayers.org/en/master/examples/vector-layer.html for a real example.
Note that you no longer need to set a `projection` on the source! Note that you no longer need to set a `projection` on the source!
@@ -75,7 +75,7 @@ The 3.5.0 release includes features and fixes from a whopping 129 pull requests
The above code uses jQuery to send an Ajax request, but you can obviously use any Ajax library. The above code uses jQuery to send an Ajax request, but you can obviously use any Ajax library.
See http://openlayers.org/en/master/examples/igc.html for a real example. See https://openlayers.org/en/master/examples/igc.html for a real example.
* Note about KML * Note about KML
@@ -133,9 +133,9 @@ The 3.5.0 release includes features and fixes from a whopping 129 pull requests
}); });
``` ```
See http://openlayers.org/en/master/examples/vector-osm.html for a real example. See https://openlayers.org/en/master/examples/vector-osm.html for a real example.
* The experimental `ol.loadingstrategy.createTile` function has been renamed to `ol.loadingstrategy.tile`. The signature of the function hasn't changed. See http://openlayers.org/en/master/examples/vector-osm.html for an example. * The experimental `ol.loadingstrategy.createTile` function has been renamed to `ol.loadingstrategy.tile`. The signature of the function hasn't changed. See https://openlayers.org/en/master/examples/vector-osm.html for an example.
### Change to `ol.style.Icon` ### Change to `ol.style.Icon`

View File

@@ -66,16 +66,16 @@
<textarea class="hidden" name="css">{{ css.source }}</textarea> <textarea class="hidden" name="css">{{ css.source }}</textarea>
<textarea class="hidden" name="html">{{ contents }}</textarea> <textarea class="hidden" name="html">{{ contents }}</textarea>
<input type="hidden" name="wrap" value="l"> <input type="hidden" name="wrap" value="l">
<input type="hidden" name="resources" value="http://openlayers.org/en/v{{ olVersion }}/css/ol.css,http://openlayers.org/en/v{{ olVersion }}/build/ol.js{{ extraResources }}"> <input type="hidden" name="resources" value="https://openlayers.org/en/v{{ olVersion }}/css/ol.css,https://openlayers.org/en/v{{ olVersion }}/build/ol.js{{ extraResources }}">
</form> </form>
<pre><code id="example-source" class="language-markup">&lt;!DOCTYPE html&gt; <pre><code id="example-source" class="language-markup">&lt;!DOCTYPE html&gt;
&lt;html&gt; &lt;html&gt;
&lt;head&gt; &lt;head&gt;
&lt;title&gt;{{ title }}&lt;/title&gt; &lt;title&gt;{{ title }}&lt;/title&gt;
&lt;link rel="stylesheet" href="http://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css"&gt; &lt;link rel="stylesheet" href="https://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css"&gt;
&lt;!-- The line below is only needed for old environments like Internet Explorer and Android 4.x --&gt; &lt;!-- The line below is only needed for old environments like Internet Explorer and Android 4.x --&gt;
&lt;script src="http://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"&gt;&lt;/script&gt; &lt;script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"&gt;&lt;/script&gt;
&lt;script src="http://openlayers.org/en/v{{ olVersion }}/build/ol.js"&gt;&lt;/script&gt;{{#if extraHead.remote}} &lt;script src="https://openlayers.org/en/v{{ olVersion }}/build/ol.js"&gt;&lt;/script&gt;{{#if extraHead.remote}}
{{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}} {{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}}
&lt;style&gt; &lt;style&gt;
{{ indent css.source spaces=6 }} &lt;/style&gt;{{/if}} {{ indent css.source spaces=6 }} &lt;/style&gt;{{/if}}

View File

@@ -15,11 +15,11 @@
</tr><tr> </tr><tr>
<th>Controls</th><th>Interactions</th><th>Sources and formats</th> <th>Controls</th><th>Interactions</th><th>Sources and formats</th>
</tr><tr> </tr><tr>
<td>[Map default controls](ol.control.html#defaults)<br> <td>[Map default controls](ol.control.html#.defaults)<br>
[All controls](ol.control.html) [All controls](ol.control.html)
</td> </td>
<td> <td>
[Map default interactions](ol.interaction.html#defaults)<br> [Map default interactions](ol.interaction.html#.defaults)<br>
Interactions for [vector features](ol.Feature.html) Interactions for [vector features](ol.Feature.html)
<ul><li>[ol.interaction.Select](ol.interaction.Select.html)</li> <ul><li>[ol.interaction.Select](ol.interaction.Select.html)</li>
<li>[ol.interaction.Draw](ol.interaction.Draw.html)</li> <li>[ol.interaction.Draw](ol.interaction.Draw.html)</li>
@@ -32,9 +32,9 @@ Interactions for [vector features](ol.Feature.html)
<br>[Formats](ol.format.Feature.html) for reading/writing vector data <br>[Formats](ol.format.Feature.html) for reading/writing vector data
<br>[ol.format.WMSCapabilities](ol.format.WMSCapabilities.html)</td></tr> <br>[ol.format.WMSCapabilities](ol.format.WMSCapabilities.html)</td></tr>
<tr><th>Projections</th><th>Observable objects</th><th>Other components</th></tr> <tr><th>Projections</th><th>Observable objects</th><th>Other components</th></tr>
<tr><td><p>All coordinates and extents need to be provided in view projection (default: EPSG:3857). To transform, use [ol.proj.transform()](ol.proj.html#transform) and [ol.proj.transformExtent()](ol.proj.html#transformExtent).</p> <tr><td><p>All coordinates and extents need to be provided in view projection (default: EPSG:3857). To transform, use [ol.proj.transform()](ol.proj.html#.transform) and [ol.proj.transformExtent()](ol.proj.html#.transformExtent).</p>
[ol.proj](ol.proj.html)</td> [ol.proj](ol.proj.html)</td>
<td><p>Changes to all [ol.Objects](ol.Object.html) can observed by calling the [object.on('propertychange')](ol.Object.html#on) method. Listeners receive an [ol.ObjectEvent](ol.ObjectEvent.html) with information on the changed property and old value.</p> <td><p>Changes to all [ol.Objects](ol.Object.html) can observed by calling the [object.on('propertychange')](ol.Object.html#on) method. Listeners receive an [ol.Object.Event](ol.Object.Event.html) with information on the changed property and old value.</p>
<td>[ol.DeviceOrientation](ol.DeviceOrientation.html)<br> <td>[ol.DeviceOrientation](ol.DeviceOrientation.html)<br>
[ol.Geolocation](ol.Geolocation.html)<br> [ol.Geolocation](ol.Geolocation.html)<br>
[ol.Overlay](ol.Overlay.html)<br></td> [ol.Overlay](ol.Overlay.html)<br></td>

View File

@@ -47,7 +47,7 @@ exports.handlers = {
if (!cls.fires) { if (!cls.fires) {
cls.fires = []; cls.fires = [];
} }
event = 'ol.ObjectEvent#event:change:' + name; event = 'ol.Object.Event#event:change:' + name;
if (cls.fires.indexOf(event) == -1) { if (cls.fires.indexOf(event) == -1) {
cls.fires.push(event); cls.fires.push(event);
} }

View File

@@ -45,9 +45,11 @@
body { body {
padding-top: 50px; padding-top: 50px;
} }
.nameContainer .name, .prettyprint.source .pln { .nameContainer .anchor {
padding-top: 50px; padding-top: 50px;
margin-top: -50px; margin-top: -50px;
width: 0px;
height: 0px;
} }
a { a {
position: relative; position: relative;
@@ -294,6 +296,7 @@ span.type-signature.static {
color: gray; color: gray;
} }
.main .nameContainer h4 { .main .nameContainer h4 {
margin-top: 0px;
margin-right: 150px; margin-right: 150px;
line-height: 1.3; line-height: 1.3;
} }

View File

@@ -11,7 +11,9 @@ if (data.type && data.type.names) {
?> ?>
<dt class="<?js= (data.stability && data.stability !== 'stable') ? 'unstable' : '' ?>"> <dt class="<?js= (data.stability && data.stability !== 'stable') ? 'unstable' : '' ?>">
<div class="nameContainer"> <div class="nameContainer">
<h4 class="name" id="<?js= id ?>"> <div class="anchor" id="<?js= id ?>">
</div>
<h4 class="name">
<?js= data.attribs + (data.scope === 'static' ? longname : name) + typeSignature ?> <?js= data.attribs + (data.scope === 'static' ? longname : name) + typeSignature ?>
<?js= this.partial('stability.tmpl', data) ?> <?js= this.partial('stability.tmpl', data) ?>
</h4> </h4>

View File

@@ -5,7 +5,9 @@ var self = this;
<dt class="<?js= (data.stability && data.stability !== 'stable') ? 'unstable' : '' ?>"> <dt class="<?js= (data.stability && data.stability !== 'stable') ? 'unstable' : '' ?>">
<div class="nameContainer<?js if (data.inherited) { ?> inherited<?js } ?>"> <div class="nameContainer<?js if (data.inherited) { ?> inherited<?js } ?>">
<?js if (data.stability || kind !== 'class') { ?> <?js if (data.stability || kind !== 'class') { ?>
<h4 class="name" id="<?js= id ?>"> <div class="anchor" id="<?js= id ?>">
</div>
<h4 class="name">
<?js= data.attribs + (kind === 'class' ? 'new ' : '') + (data.scope === 'static' ? longname : name) + (kind !== 'event' ? data.signature : '') ?> <?js= data.attribs + (kind === 'class' ? 'new ' : '') + (data.scope === 'static' ? longname : name) + (kind !== 'event' ? data.signature : '') ?>
<?js if (data.inherited || data.inherits) { ?> <?js if (data.inherited || data.inherits) { ?>
<span class="inherited"><?js= this.linkto(data.inherits, 'inherited') ?></span> <span class="inherited"><?js= this.linkto(data.inherits, 'inherited') ?></span>

View File

@@ -8,7 +8,7 @@
<th>Name</th> <th>Name</th>
<th>Type</th> <th>Type</th>
<th>Settable</th> <th>Settable</th>
<th><a href="ol.ObjectEvent.html">ol.ObjectEvent</a> type</th> <th><a href="ol.Object.Event.html">ol.Object.Event</a> type</th>
<th class="last">Description</th> <th class="last">Description</th>
</tr> </tr>
</thead> </thead>

View File

@@ -137,10 +137,6 @@ Invalid `units`. `'degrees'`, `'imperial'`, `'nautical'`, `'metric'` or `'us'` r
Invalid geometry layout. Must be `XY`, `XYZ`, `XYM` or `XYZM`. Invalid geometry layout. Must be `XY`, `XYZ`, `XYM` or `XYZM`.
### 35
Unknown GeoJSON object type. Expected `"Feature"` or `"FeatureCollection"`.
### 36 ### 36
Unknown SRS type. Expected `"name"` or `"EPSG"`. Unknown SRS type. Expected `"name"` or `"EPSG"`.
@@ -165,10 +161,6 @@ Expected `feature` to have a geometry.
Expected an `ol.style.Style` or an array of `ol.style.Style`. Expected an `ol.style.Style` or an array of `ol.style.Style`.
### 42
Expected an `ol.Feature`, but got an `ol.RenderFeature`.
### 43 ### 43
Expected `layers` to be an array or an `ol.Collection`. Expected `layers` to be an array or an `ol.Collection`.

View File

@@ -77,7 +77,7 @@ var map = new ol.Map({
var swissProjection = new ol.proj.Projection({ var swissProjection = new ol.proj.Projection({
code: 'EPSG:21781', code: 'EPSG:21781',
// The extent is used to determine zoom level 0. Recommended values for a // The extent is used to determine zoom level 0. Recommended values for a
// projection's validity extent can be found at http://epsg.io/. // projection's validity extent can be found at https://epsg.io/.
extent: [485869.5728, 76443.1884, 837076.5648, 299941.7864], extent: [485869.5728, 76443.1884, 837076.5648, 299941.7864],
units: 'm' units: 'm'
}); });
@@ -94,7 +94,7 @@ var map = new ol.Map({
``` ```
We recommend to lookup parameters of your projection (like the validity extent) We recommend to lookup parameters of your projection (like the validity extent)
over at [epsg.io](http://epsg.io/). over at [epsg.io](https://epsg.io/).
## Why is my map centered on the gulf of guinea (or africa, the ocean, null-island)? ## Why is my map centered on the gulf of guinea (or africa, the ocean, null-island)?

View File

@@ -9,7 +9,7 @@ If you're eager to get your first OpenLayers 3 map on a page, dive into the [qui
For a more in-depth overview of OpenLayers 3 core concepts, check out the [tutorials](tutorials/). For a more in-depth overview of OpenLayers 3 core concepts, check out the [tutorials](tutorials/).
Make sure to also check out the [OpenLayers 3 workshop](/workshop/en/). Make sure to also check out the [OpenLayers 3 workshop](/workshop/).
Find additional reference material in the [API docs](../apidoc). Find additional reference material in the [API docs](../apidoc).

View File

@@ -13,14 +13,14 @@ Below you'll find a complete working example. Create a new file, copy in the co
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<link rel="stylesheet" href="http://openlayers.org/en/{{ latest }}/css/ol.css" type="text/css"> <link rel="stylesheet" href="https://openlayers.org/en/{{ latest }}/css/ol.css" type="text/css">
<style> <style>
.map { .map {
height: 400px; height: 400px;
width: 100%; width: 100%;
} }
</style> </style>
<script src="http://openlayers.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script> <script src="https://openlayers.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
<title>OpenLayers 3 example</title> <title>OpenLayers 3 example</title>
</head> </head>
<body> <body>
@@ -55,7 +55,7 @@ To include a map a web page you will need 3 things:
### Include OpenLayers ### Include OpenLayers
```xml ```xml
<script src="http://openlayers.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script> <script src="https://openlayers.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
``` ```
The first part is to include the JavaScript library. For the purpose of this tutorial, here we simply point to the openlayers.org website to get the whole library. In a production environment, we would build a custom version of the library including only the module needed for our application. The first part is to include the JavaScript library. For the purpose of this tutorial, here we simply point to the openlayers.org website to get the whole library. In a production environment, we would build a custom version of the library including only the module needed for our application.
@@ -63,7 +63,7 @@ The first part is to include the JavaScript library. For the purpose of this tut
**Optional:** If the application is intended to run on old platforms like Internet Explorer or Android 4.x, another script needs to be included before OpenLayers: **Optional:** If the application is intended to run on old platforms like Internet Explorer or Android 4.x, another script needs to be included before OpenLayers:
```xml ```xml
<script src="http://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList"></script> <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList"></script>
``` ```

View File

@@ -95,7 +95,7 @@ var map = new ol.Map({
}); });
``` ```
Note that this JavaScript code corresponds to OpenLayers 3's [`simple`](http://openlayers.org/en/master/examples/simple.html) example. Note that this JavaScript code corresponds to OpenLayers 3's [`simple`](https://openlayers.org/en/master/examples/simple.html) example.
You are now ready to create your first OpenLayers 3 build. Use the following command to create the build: You are now ready to create your first OpenLayers 3 build. Use the following command to create the build:
@@ -180,7 +180,7 @@ Note that `build.js` currently requires you to enter an output file and will wri
## A more complicated example ## A more complicated example
Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openlayers.org/en/master/examples/heatmap-earthquakes.html). The build configuration file looks like this: Now let's try a more complicated example: [`heatmaps-earthquakes`](https://openlayers.org/en/master/examples/heatmap-earthquakes.html). The build configuration file looks like this:
```json ```json
{ {

View File

@@ -34,7 +34,7 @@ The library is intended for use on both desktop/laptop and mobile devices.
OL3 uses a similar object hierarchy to the Closure library. There is a top-level `ol` namespace (basically, `var ol = {};`). Subdivisions of this are: OL3 uses a similar object hierarchy to the Closure library. There is a top-level `ol` namespace (basically, `var ol = {};`). Subdivisions of this are:
* further namespaces, such as `ol.layer`; these have a lower-case initial * further namespaces, such as `ol.layer`; these have a lower-case initial
* simple objects containing static properties and methods, such as `ol.animation`; these also have a lower-case initial * simple objects containing static properties and methods, such as `ol.easing`; these also have a lower-case initial
* types, which have an upper-case initial. These are mainly 'classes', which here means a constructor function with prototypal inheritance, such as `ol.Map` or `ol.layer.Vector` (the Vector class within the layer namespace). There are however other, simpler, types, such as `ol.Extent`, which is an array. * types, which have an upper-case initial. These are mainly 'classes', which here means a constructor function with prototypal inheritance, such as `ol.Map` or `ol.layer.Vector` (the Vector class within the layer namespace). There are however other, simpler, types, such as `ol.Extent`, which is an array.
Class namespaces, such as `ol.layer` have a base class type with the same name, such as `ol.layer.Layer`. These are mainly abstract classes, from which the other subclasses inherit. Class namespaces, such as `ol.layer` have a base class type with the same name, such as `ol.layer.Layer`. These are mainly abstract classes, from which the other subclasses inherit.

View File

@@ -10,7 +10,7 @@ Transformation of the map projections of the image happens directly in a web bro
The view in any Proj4js supported coordinate reference system is possible and previously incompatible layers can now be combined and overlaid. The view in any Proj4js supported coordinate reference system is possible and previously incompatible layers can now be combined and overlaid.
# Usage # Usage
The API usage is very simple. Just specify proper projection (using [EPSG](http://epsg.io) code) on `ol.View`: The API usage is very simple. Just specify proper projection (using [EPSG](https://epsg.io) code) on `ol.View`:
``` javascript ``` javascript
var map = new ol.Map({ var map = new ol.Map({
target: 'map', target: 'map',
@@ -35,14 +35,14 @@ var map = new ol.Map({
If a source (based on `ol.source.TileImage` or `ol.source.Image`) has a projection different from the current `ol.View`s projection then the reprojection happens automatically under the hood. If a source (based on `ol.source.TileImage` or `ol.source.Image`) has a projection different from the current `ol.View`s projection then the reprojection happens automatically under the hood.
### Examples ### Examples
- [Raster reprojection demo](http://openlayers.org/en/master/examples/reprojection.html) - [Raster reprojection demo](https://openlayers.org/en/master/examples/reprojection.html)
- [OpenStreetMap to WGS84 reprojection](http://openlayers.org/en/master/examples/reprojection-wgs84.html) - [OpenStreetMap to WGS84 reprojection](https://openlayers.org/en/master/examples/reprojection-wgs84.html)
- [Reprojection with EPSG.io database search](http://openlayers.org/en/master/examples/reprojection-by-code.html) - [Reprojection with EPSG.io database search](https://openlayers.org/en/master/examples/reprojection-by-code.html)
- [Image reprojection](http://openlayers.org/en/master/examples/reprojection-image.html) - [Image reprojection](https://openlayers.org/en/master/examples/reprojection-image.html)
### Custom projection ### Custom projection
The easiest way to use a custom projection is to add the [Proj4js](http://proj4js.org/) library to your project and then define the projection using a proj4 definition string. The easiest way to use a custom projection is to add the [Proj4js](http://proj4js.org/) library to your project and then define the projection using a proj4 definition string.
Following example shows definition of a [British National Grid](http://epsg.io/27700): Following example shows definition of a [British National Grid](https://epsg.io/27700):
``` html ``` 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.3.14/proj4.js"></script>
@@ -122,7 +122,7 @@ Although this is mathematically correct behavior of the inverse transformation,
A possible general solution would be to calculate the forward transformation for every vertex as well - but this would significantly decrease performance (especially for computationally expensive transformations). A possible general solution would be to calculate the forward transformation for every vertex as well - but this would significantly decrease performance (especially for computationally expensive transformations).
Therefore a recommended workaround is to define a proper visibility extent on the `ol.layer.Tile` in the view projection. Therefore a recommended workaround is to define a proper visibility extent on the `ol.layer.Tile` in the view projection.
Setting such a limit is demonstrated in the [reprojection demo example](http://openlayers.org/en/master/examples/reprojection.html). Setting such a limit is demonstrated in the [reprojection demo example](https://openlayers.org/en/master/examples/reprojection.html).
### Resolution calculation ### Resolution calculation
When determining source tiles to load, the ideal source resolution needs to be calculated. When determining source tiles to load, the ideal source resolution needs to be calculated.

View File

@@ -7,6 +7,9 @@
"d3": false, "d3": false,
"jsPDF": false, "jsPDF": false,
"jsts": false, "jsts": false,
"topolis": false,
"toastr": false,
"saveAs": false,
"topojson": false, "topojson": false,
"turf": false "turf": false
}, },

View File

@@ -3,17 +3,17 @@ layout: example.html
title: View Animation title: View Animation
shortdesc: Demonstrates animated pan, zoom, and rotation. shortdesc: Demonstrates animated pan, zoom, and rotation.
docs: > docs: >
This example shows how to use the beforeRender function on the Map to run one This example shows how to use the <code>view.animate()</code> method to run
or more animations. one or more animations.
tags: "animation" tags: "animation"
--- ---
<div id="map" class="map"></div> <div id="map" class="map"></div>
<button id="rotate-left" title="Rotate clockwise"></button> <button id="rotate-left" title="Rotate clockwise"></button>
<button id="rotate-right" title="Rotate counterclockwise"></button> <button id="rotate-right" title="Rotate counterclockwise"></button>
<button id="rotate-around-rome">Rotate around Rome</button>
<button id="pan-to-london">Pan to London</button> <button id="pan-to-london">Pan to London</button>
<button id="elastic-to-moscow">Elastic to Moscow</button> <button id="elastic-to-moscow">Elastic to Moscow</button>
<button id="bounce-to-istanbul">Bounce to Istanbul</button> <button id="bounce-to-istanbul">Bounce to Istanbul</button>
<button id="spin-to-rome">Spin to Rome</button> <button id="spin-to-rome">Spin to Rome</button>
<button id="fly-to-bern">Fly to Bern</button> <button id="fly-to-bern">Fly to Bern</button>
<button id="spiral-to-madrid">Spiral to Madrid</button> <button id="rotate-around-rome">Rotate around Rome</button>
<button id="tour">Take a tour</button>

View File

@@ -1,13 +1,35 @@
goog.require('ol.Map'); goog.require('ol.Map');
goog.require('ol.View'); goog.require('ol.View');
goog.require('ol.animation');
goog.require('ol.control');
goog.require('ol.layer.Tile'); goog.require('ol.layer.Tile');
goog.require('ol.proj'); goog.require('ol.proj');
goog.require('ol.source.OSM'); goog.require('ol.source.OSM');
var london = ol.proj.fromLonLat([-0.12755, 51.507222]);
var moscow = ol.proj.fromLonLat([37.6178, 55.7517]);
var istanbul = ol.proj.fromLonLat([28.9744, 41.0128]);
var rome = ol.proj.fromLonLat([12.5, 41.9]);
var bern = ol.proj.fromLonLat([7.4458, 46.95]);
// from https://github.com/DmitryBaranovskiy/raphael var view = new ol.View({
center: istanbul,
zoom: 6
});
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
preload: 4,
source: new ol.source.OSM()
})
],
// Improve user experience by loading tiles while animating. Will make
// animations stutter on mobile or slow devices.
loadTilesWhileAnimating: true,
view: view
});
// A bounce easing method (from https://github.com/DmitryBaranovskiy/raphael).
function bounce(t) { function bounce(t) {
var s = 7.5625, p = 2.75, l; var s = 7.5625, p = 2.75, l;
if (t < (1 / p)) { if (t < (1 / p)) {
@@ -29,159 +51,116 @@ function bounce(t) {
return l; return l;
} }
// from https://github.com/DmitryBaranovskiy/raphael // An elastic easing method (from https://github.com/DmitryBaranovskiy/raphael).
function elastic(t) { function elastic(t) {
return Math.pow(2, -10 * t) * Math.sin((t - 0.075) * (2 * Math.PI) / 0.3) + 1; return Math.pow(2, -10 * t) * Math.sin((t - 0.075) * (2 * Math.PI) / 0.3) + 1;
} }
var london = ol.proj.fromLonLat([-0.12755, 51.507222]); function onClick(id, callback) {
var moscow = ol.proj.fromLonLat([37.6178, 55.7517]); document.getElementById(id).addEventListener('click', callback);
var istanbul = ol.proj.fromLonLat([28.9744, 41.0128]); }
var rome = ol.proj.fromLonLat([12.5, 41.9]);
var bern = ol.proj.fromLonLat([7.4458, 46.95]);
var madrid = ol.proj.fromLonLat([-3.683333, 40.4]);
var view = new ol.View({ onClick('rotate-left', function() {
// the view's initial state view.animate({
center: istanbul, rotation: view.getRotation() + Math.PI / 2
zoom: 6 });
}); });
var map = new ol.Map({ onClick('rotate-right', function() {
layers: [ view.animate({
new ol.layer.Tile({ rotation: view.getRotation() - Math.PI / 2
preload: 4, });
source: new ol.source.OSM()
})
],
// Improve user experience by loading tiles while animating. Will make
// animations stutter on mobile or slow devices.
loadTilesWhileAnimating: true,
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
collapsible: false
})
}),
view: view
}); });
var rotateLeft = document.getElementById('rotate-left'); onClick('rotate-around-rome', function() {
rotateLeft.addEventListener('click', function() { view.animate({
var rotateLeft = ol.animation.rotate({ rotation: view.getRotation() + 2 * Math.PI,
duration: 2000, anchor: rome
rotation: -4 * Math.PI
}); });
map.beforeRender(rotateLeft); });
}, false);
var rotateRight = document.getElementById('rotate-right');
rotateRight.addEventListener('click', function() {
var rotateRight = ol.animation.rotate({
duration: 2000,
rotation: 4 * Math.PI
});
map.beforeRender(rotateRight);
}, false);
var rotateAroundRome = document.getElementById('rotate-around-rome'); onClick('pan-to-london', function() {
rotateAroundRome.addEventListener('click', function() { view.animate({
var currentRotation = view.getRotation(); center: london,
var rotateAroundRome = ol.animation.rotate({ duration: 2000
anchor: rome,
duration: 1000,
rotation: currentRotation
}); });
map.beforeRender(rotateAroundRome); });
view.rotate(currentRotation + (Math.PI / 2), rome);
}, false);
var panToLondon = document.getElementById('pan-to-london'); onClick('elastic-to-moscow', function() {
panToLondon.addEventListener('click', function() { view.animate({
var pan = ol.animation.pan({ center: moscow,
duration: 2000, duration: 2000,
source: /** @type {ol.Coordinate} */ (view.getCenter()) easing: elastic
}); });
map.beforeRender(pan); });
view.setCenter(london);
}, false);
var elasticToMoscow = document.getElementById('elastic-to-moscow'); onClick('bounce-to-istanbul', function() {
elasticToMoscow.addEventListener('click', function() { view.animate({
var pan = ol.animation.pan({ center: istanbul,
duration: 2000, duration: 2000,
easing: elastic, easing: bounce
source: /** @type {ol.Coordinate} */ (view.getCenter())
}); });
map.beforeRender(pan); });
view.setCenter(moscow);
}, false);
var bounceToIstanbul = document.getElementById('bounce-to-istanbul'); onClick('spin-to-rome', function() {
bounceToIstanbul.addEventListener('click', function() { view.animate({
var pan = ol.animation.pan({ center: rome,
duration: 2000,
easing: bounce,
source: /** @type {ol.Coordinate} */ (view.getCenter())
});
map.beforeRender(pan);
view.setCenter(istanbul);
}, false);
var spinToRome = document.getElementById('spin-to-rome');
spinToRome.addEventListener('click', function() {
var duration = 2000;
var start = +new Date();
var pan = ol.animation.pan({
duration: duration,
source: /** @type {ol.Coordinate} */ (view.getCenter()),
start: start
});
var rotate = ol.animation.rotate({
duration: duration,
rotation: 2 * Math.PI, rotation: 2 * Math.PI,
start: start duration: 2000
}); });
map.beforeRender(pan, rotate); });
view.setCenter(rome);
}, false);
var flyToBern = document.getElementById('fly-to-bern'); function flyTo(location, done) {
flyToBern.addEventListener('click', function() {
var duration = 2000; var duration = 2000;
var start = +new Date(); var zoom = view.getZoom();
var pan = ol.animation.pan({ var parts = 2;
duration: duration, var called = false;
source: /** @type {ol.Coordinate} */ (view.getCenter()), function callback(complete) {
start: start --parts;
}); if (called) {
var bounce = ol.animation.bounce({ return;
duration: duration, }
resolution: 4 * view.getResolution(), if (parts === 0 || !complete) {
start: start called = true;
}); done(complete);
map.beforeRender(pan, bounce); }
view.setCenter(bern); }
}, false); view.animate({
center: location,
duration: duration
}, callback);
view.animate({
zoom: zoom - 1,
duration: duration / 2
}, {
zoom: zoom,
duration: duration / 2
}, callback);
}
var spiralToMadrid = document.getElementById('spiral-to-madrid'); onClick('fly-to-bern', function() {
spiralToMadrid.addEventListener('click', function() { flyTo(bern, function() {});
var duration = 2000; });
var start = +new Date();
var pan = ol.animation.pan({ function tour() {
duration: duration, var locations = [london, bern, rome, moscow, istanbul];
source: /** @type {ol.Coordinate} */ (view.getCenter()), var index = -1;
start: start function next(more) {
}); if (more) {
var bounce = ol.animation.bounce({ ++index;
duration: duration, if (index < locations.length) {
resolution: 2 * view.getResolution(), var delay = index === 0 ? 0 : 750;
start: start setTimeout(function() {
}); flyTo(locations[index], next);
var rotate = ol.animation.rotate({ }, delay);
duration: duration, } else {
rotation: -4 * Math.PI, alert('Tour complete');
start: start }
}); } else {
map.beforeRender(pan, bounce, rotate); alert('Tour cancelled');
view.setCenter(madrid); }
}, false); }
next(true);
}
onClick('tour', tour);

View File

@@ -5,7 +5,7 @@ goog.require('ol.layer.Image');
goog.require('ol.source.OSM'); goog.require('ol.source.OSM');
goog.require('ol.source.ImageArcGISRest'); goog.require('ol.source.ImageArcGISRest');
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' + var url = 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
'Specialty/ESRI_StateCityHighway_USA/MapServer'; 'Specialty/ESRI_StateCityHighway_USA/MapServer';
var layers = [ var layers = [

View File

@@ -4,7 +4,7 @@ goog.require('ol.layer.Tile');
goog.require('ol.source.OSM'); goog.require('ol.source.OSM');
goog.require('ol.source.TileArcGISRest'); goog.require('ol.source.TileArcGISRest');
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' + var url = 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
'Specialty/ESRI_StateCityHighway_USA/MapServer'; 'Specialty/ESRI_StateCityHighway_USA/MapServer';
var layers = [ var layers = [

View File

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

View File

@@ -18,7 +18,7 @@ for (i = 0, ii = styles.length; i < ii; ++i) {
visible: false, visible: false,
preload: Infinity, preload: Infinity,
source: new ol.source.BingMaps({ source: new ol.source.BingMaps({
key: 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: styles[i] imagerySet: styles[i]
// use maxZoom 19 to see stretched tiles instead of the BingMaps // use maxZoom 19 to see stretched tiles instead of the BingMaps
// "no photos at this zoom level" tiles // "no photos at this zoom level" tiles

View File

@@ -1,6 +1,8 @@
goog.require('ol.Map'); goog.require('ol.Map');
goog.require('ol.View'); goog.require('ol.View');
goog.require('ol.extent');
goog.require('ol.format.GeoJSON'); goog.require('ol.format.GeoJSON');
goog.require('ol.has');
goog.require('ol.layer.Vector'); goog.require('ol.layer.Vector');
goog.require('ol.proj'); goog.require('ol.proj');
goog.require('ol.source.Vector'); goog.require('ol.source.Vector');
@@ -8,14 +10,22 @@ goog.require('ol.style.Fill');
goog.require('ol.style.Stroke'); goog.require('ol.style.Stroke');
goog.require('ol.style.Style'); goog.require('ol.style.Style');
// Will contain ol.Style instances key by country. var canvas = document.createElement('canvas');
var styleLookup = {}; var context = canvas.getContext('2d');
// Gradient and pattern are in canvas pixel space, so we adjust for the
// renderer's pixel ratio
var pixelRatio = ol.has.DEVICE_PIXEL_RATIO;
// Generate a rainbow gradient // Generate a rainbow gradient
var gradient = (function() { function gradient(feature, resolution) {
var canvas = document.createElement('canvas'); var extent = feature.getGeometry().getExtent();
var context = canvas.getContext('2d'); // Gradient starts on the left edge of each feature, and ends on the right.
var grad = context.createLinearGradient(0,0,1000,0); // Coordinate origin is the top-left corner of the extent of the geometry, so
// we just divide the geometry's extent width by resolution and multiply with
// pixelRatio to match the renderer's pixel coordinate system.
var grad = context.createLinearGradient(0, 0,
ol.extent.getWidth(extent) / resolution * pixelRatio, 0);
grad.addColorStop(0, 'red'); grad.addColorStop(0, 'red');
grad.addColorStop(1 / 6, 'orange'); grad.addColorStop(1 / 6, 'orange');
grad.addColorStop(2 / 6, 'yellow'); grad.addColorStop(2 / 6, 'yellow');
@@ -24,33 +34,35 @@ var gradient = (function() {
grad.addColorStop(5 / 6, 'blue'); grad.addColorStop(5 / 6, 'blue');
grad.addColorStop(1, 'purple'); grad.addColorStop(1, 'purple');
return grad; return grad;
}()); }
// Generate a canvasPattern with two circles // Generate a canvasPattern with two circles on white background
var pattern = (function() { var pattern = (function() {
var canvas = document.createElement('canvas'); canvas.width = 11 * pixelRatio;
var context = canvas.getContext('2d'); canvas.height = 11 * pixelRatio;
canvas.width = 11; // white background
canvas.height = 11; context.fillStyle = 'white';
context.fillRect(0, 0, canvas.width, canvas.height);
// outer circle
context.fillStyle = 'rgba(102, 0, 102, 0.5)'; context.fillStyle = 'rgba(102, 0, 102, 0.5)';
context.beginPath(); context.beginPath();
context.arc(5, 5, 4, 0, 2 * Math.PI); context.arc(5 * pixelRatio, 5 * pixelRatio, 4 * pixelRatio, 0, 2 * Math.PI);
context.fill(); context.fill();
// inner circle
context.fillStyle = 'rgb(55, 0, 170)'; context.fillStyle = 'rgb(55, 0, 170)';
context.beginPath(); context.beginPath();
context.arc(5, 5, 2, 0, 2 * Math.PI); context.arc(5 * pixelRatio, 5 * pixelRatio, 2 * pixelRatio, 0, 2 * Math.PI);
context.fill(); context.fill();
return context.createPattern(canvas, 'repeat'); return context.createPattern(canvas, 'repeat');
}()); }());
// Generate a background style that all features will reuse // Generate style for gradient or pattern fill
var backgroundStyle = new ol.style.Style({ var fill = new ol.style.Fill();
var style = new ol.style.Style({
fill: fill,
stroke: new ol.style.Stroke({ stroke: new ol.style.Stroke({
color: '#333', color: '#333',
width: 2 width: 2
}),
fill: new ol.style.Fill({
color: '#fff'
}) })
}); });
@@ -58,33 +70,14 @@ var backgroundStyle = new ol.style.Style({
* The styling function for the vector layer, will return an array of styles * The styling function for the vector layer, will return an array of styles
* which either contains the aboove gradient or pattern. * which either contains the aboove gradient or pattern.
* *
* @param {ol.Feature} feature the feature to style. * @param {ol.Feature} feature The feature to style.
* @return {Array<ol.style.Style>} the styles to use for the feature. * @param {number} resolution Resolution.
* @return {ol.style.Style} The style to use for the feature.
*/ */
var getStackedStyle = function(feature) { var getStackedStyle = function(feature, resolution) {
var id = feature.getId(); var id = feature.getId();
if (!styleLookup[id]) { fill.setColor(id > 'J' ? gradient(feature, resolution) : pattern);
var patternOrGradient; return style;
if (id > 'J') { // some shall get the gradient, others the pattern.
patternOrGradient = gradient;
} else {
patternOrGradient = pattern;
}
// Store the style in the lookup, next call will just return the stored
// style for the feature.
styleLookup[id] = [
// 1. Use the common background style
// (white fill and blackish stroke)
backgroundStyle,
// 2. On top of that, draw the pattern or gradient
new ol.style.Style({
fill: new ol.style.Fill({
color: patternOrGradient
})
})
];
}
return styleLookup[id];
}; };
// Create a vector layer that makes use of the style function above… // Create a vector layer that makes use of the style function above…

View File

@@ -4,7 +4,7 @@ goog.require('ol.layer.Tile');
goog.require('ol.source.OSM'); goog.require('ol.source.OSM');
var logoElement = document.createElement('a'); var logoElement = document.createElement('a');
logoElement.href = 'http://www.osgeo.org/'; logoElement.href = 'https://www.osgeo.org/';
logoElement.target = '_blank'; logoElement.target = '_blank';
var logoImage = document.createElement('img'); var logoImage = document.createElement('img');

View File

@@ -2,9 +2,9 @@
<Document> <Document>
<name>Skimap.org OpenSkiMap </name> <name>Skimap.org OpenSkiMap </name>
<description>Created from OpenStreetMap data. Renderer v0.5</description> <description>Created from OpenStreetMap data. Renderer v0.5</description>
<!-- <!--
Copyright (c) OpenStreetMap Contributors Copyright (c) OpenStreetMap Contributors
http://www.openstreetmap.org/ https://www.openstreetmap.org/
This work is licensed under the This work is licensed under the
Creative Commons Attribution-ShareAlike 2.0 License. Creative Commons Attribution-ShareAlike 2.0 License.
@@ -13,7 +13,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
<ScreenOverlay id="CopyrightNotice"> <ScreenOverlay id="CopyrightNotice">
<name>Copyright Notice</name> <name>Copyright Notice</name>
<description> <description>
<![CDATA[The data in this KML file is Copyright <a href="http://www.openstreetmap.org/">OpenStreetMap</a> Contributors. It is available under the <a href="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons Attribution-ShareAlike (CC-BY-SA) Version 2.0 License</a>.]]> <![CDATA[The data in this KML file is Copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> Contributors. It is available under the <a href="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons Attribution-ShareAlike (CC-BY-SA) Version 2.0 License</a>.]]>
</description> </description>
<Snippet>Copyright (c) OpenStreetMap Contributors. CC-BY-SA 2.0 License.</Snippet> <Snippet>Copyright (c) OpenStreetMap Contributors. CC-BY-SA 2.0 License.</Snippet>
<Icon> <Icon>
@@ -32,7 +32,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
<IconStyle> <IconStyle>
<scale>0.2</scale> <scale>0.2</scale>
<Icon> <Icon>
<href>http://maps.google.com/mapfiles/kml/shapes/parking_lot.png</href> <href>https://maps.google.com/mapfiles/kml/shapes/parking_lot.png</href>
</Icon> </Icon>
</IconStyle> </IconStyle>
</Style> </Style>
@@ -140,7 +140,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
<IconStyle> <IconStyle>
<scale>0.7</scale> <scale>0.7</scale>
<Icon> <Icon>
<href>http://maps.google.com/mapfiles/kml/pal2/icon21.png</href> <href>https://maps.google.com/mapfiles/kml/pal2/icon21.png</href>
</Icon> </Icon>
</IconStyle> </IconStyle>
</Style> </Style>
@@ -170,7 +170,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
<IconStyle> <IconStyle>
<scale>0.7</scale> <scale>0.7</scale>
<Icon> <Icon>
<href>http://maps.google.com/mapfiles/kml/pal2/icon30.png</href> <href>https://maps.google.com/mapfiles/kml/pal2/icon30.png</href>
</Icon> </Icon>
</IconStyle> </IconStyle>
</Style> </Style>
@@ -188,7 +188,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
<IconStyle> <IconStyle>
<scale>0.7</scale> <scale>0.7</scale>
<Icon> <Icon>
<href>http://maps.google.com/mapfiles/kml/pal2/icon28.png</href> <href>https://maps.google.com/mapfiles/kml/pal2/icon28.png</href>
</Icon> </Icon>
</IconStyle> </IconStyle>
</Style> </Style>
@@ -325,7 +325,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
<IconStyle> <IconStyle>
<scale>0.7</scale> <scale>0.7</scale>
<Icon> <Icon>
<href>http://maps.google.com/mapfiles/kml/pal2/icon40.png</href> <href>https://maps.google.com/mapfiles/kml/pal2/icon40.png</href>
</Icon> </Icon>
</IconStyle> </IconStyle>
</Style> </Style>
@@ -548,7 +548,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
<IconStyle> <IconStyle>
<scale>0.7</scale> <scale>0.7</scale>
<Icon> <Icon>
<href>http://maps.google.com/mapfiles/kml/pal3/icon38.png</href> <href>https://maps.google.com/mapfiles/kml/pal3/icon38.png</href>
</Icon> </Icon>
</IconStyle> </IconStyle>
</Style> </Style>
@@ -559,7 +559,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
<IconStyle> <IconStyle>
<scale>0.7</scale> <scale>0.7</scale>
<Icon> <Icon>
<href>http://maps.google.com/mapfiles/kml/pal3/icon38.png</href> <href>https://maps.google.com/mapfiles/kml/pal3/icon38.png</href>
</Icon> </Icon>
</IconStyle> </IconStyle>
</Style> </Style>

View File

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

View File

@@ -100,7 +100,7 @@ var map = new ol.Map({
new ol.layer.Tile({ new ol.layer.Tile({
source: new ol.source.BingMaps({ source: new ol.source.BingMaps({
imagerySet: 'Aerial', imagerySet: 'Aerial',
key: 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF' key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
}) })
}) })
], ],

View File

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

View File

@@ -99,7 +99,7 @@ var map = new ol.Map({
new ol.layer.Tile({ new ol.layer.Tile({
source: new ol.source.BingMaps({ source: new ol.source.BingMaps({
imagerySet: 'Aerial', imagerySet: 'Aerial',
key: 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF' key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
}) })
}) })
], ],

View File

@@ -5,11 +5,8 @@ shortdesc: Example of using the ol.interaction.Draw interaction.
docs: > docs: >
Example of using the Draw interaction. Select a geometry type from the Example of using the Draw interaction. Select a geometry type from the
dropdown above to start drawing. To finish drawing, click the last dropdown above to start drawing. To finish drawing, click the last
point. To activate freehand drawing for lines and polygons, hold the `Shift` point. To activate freehand drawing for lines, polygons, and circles, hold
key. Square drawing is achieved by using Circle mode with a `geometryFunction` the `Shift` key.
that creates a 4-sided regular polygon instead of a circle. Box drawing uses a
custom `geometryFunction` that takes start and end point of a line with 2
points and creates a rectangular box.
tags: "draw, edit, freehand, vector" tags: "draw, edit, freehand, vector"
--- ---
<div id="map" class="map"></div> <div id="map" class="map"></div>
@@ -20,8 +17,6 @@ tags: "draw, edit, freehand, vector"
<option value="LineString">LineString</option> <option value="LineString">LineString</option>
<option value="Polygon">Polygon</option> <option value="Polygon">Polygon</option>
<option value="Circle">Circle</option> <option value="Circle">Circle</option>
<option value="Square">Square</option>
<option value="Box">Box</option>
<option value="None">None</option> <option value="None">None</option>
</select> </select>
</form> </form>

View File

@@ -1,15 +1,10 @@
goog.require('ol.Map'); goog.require('ol.Map');
goog.require('ol.View'); goog.require('ol.View');
goog.require('ol.geom.Polygon');
goog.require('ol.interaction.Draw'); goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile'); goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector'); goog.require('ol.layer.Vector');
goog.require('ol.source.OSM'); goog.require('ol.source.OSM');
goog.require('ol.source.Vector'); goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var raster = new ol.layer.Tile({ var raster = new ol.layer.Tile({
source: new ol.source.OSM() source: new ol.source.OSM()
@@ -18,22 +13,7 @@ var raster = new ol.layer.Tile({
var source = new ol.source.Vector({wrapX: false}); var source = new ol.source.Vector({wrapX: false});
var vector = new ol.layer.Vector({ var vector = new ol.layer.Vector({
source: source, source: source
style: new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.2)'
}),
stroke: new ol.style.Stroke({
color: '#ffcc33',
width: 2
}),
image: new ol.style.Circle({
radius: 7,
fill: new ol.style.Fill({
color: '#ffcc33'
})
})
})
}); });
var map = new ol.Map({ var map = new ol.Map({
@@ -51,30 +31,9 @@ var draw; // global so we can remove it later
function addInteraction() { function addInteraction() {
var value = typeSelect.value; var value = typeSelect.value;
if (value !== 'None') { if (value !== 'None') {
var geometryFunction, maxPoints;
if (value === 'Square') {
value = 'Circle';
geometryFunction = ol.interaction.Draw.createRegularPolygon(4);
} else if (value === 'Box') {
value = 'LineString';
maxPoints = 2;
geometryFunction = function(coordinates, geometry) {
if (!geometry) {
geometry = new ol.geom.Polygon(null);
}
var start = coordinates[0];
var end = coordinates[1];
geometry.setCoordinates([
[start, [start[0], end[1]], end, [end[0], start[1]], start]
]);
return geometry;
};
}
draw = new ol.interaction.Draw({ draw = new ol.interaction.Draw({
source: source, source: source,
type: /** @type {ol.geom.GeometryType} */ (value), type: /** @type {ol.geom.GeometryType} */ (typeSelect.value)
geometryFunction: geometryFunction,
maxPoints: maxPoints
}); });
map.addInteraction(draw); map.addInteraction(draw);
} }

View File

@@ -0,0 +1,22 @@
---
layout: example.html
title: Freehand Drawing
shortdesc: Example using the ol.interaction.Draw interaction in freehand mode.
docs: >
This example demonstrates the `ol.interaction.Draw` in freehand mode. During
freehand drawing, points are added while dragging. Set `freehand: true` to
enable freehand mode. Note that freehand mode can be conditionally enabled
by using the `freehandCondition` option. For example to toggle freehand mode
with the `Shift` key, use `freehandCondition: ol.events.condition.shiftKeyOnly`.
tags: "draw, edit, freehand, vector"
---
<div id="map" class="map"></div>
<form class="form-inline">
<label>Geometry type &nbsp;</label>
<select id="type">
<option value="LineString">LineString</option>
<option value="Polygon">Polygon</option>
<option value="Circle">Circle</option>
<option value="None">None</option>
</select>
</form>

52
examples/draw-freehand.js Normal file
View File

@@ -0,0 +1,52 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
});
var source = new ol.source.Vector({wrapX: false});
var vector = new ol.layer.Vector({
source: source
});
var map = new ol.Map({
layers: [raster, vector],
target: 'map',
view: new ol.View({
center: [-11000000, 4600000],
zoom: 4
})
});
var typeSelect = document.getElementById('type');
var draw; // global so we can remove it later
function addInteraction() {
var value = typeSelect.value;
if (value !== 'None') {
draw = new ol.interaction.Draw({
source: source,
type: /** @type {ol.geom.GeometryType} */ (typeSelect.value),
freehand: true
});
map.addInteraction(draw);
}
}
/**
* Handle change event.
*/
typeSelect.onchange = function() {
map.removeInteraction(draw);
addInteraction();
};
addInteraction();

25
examples/draw-shapes.html Normal file
View File

@@ -0,0 +1,25 @@
---
layout: example.html
title: Draw Shapes
shortdesc: Using the ol.interaction.Draw to create regular shapes
docs: >
This demonstrates the use of the `geometryFunction` option for the
`ol.interaction.Draw`. Select a shape type from the dropdown above to start
drawing. To activate freehand drawing, hold the `Shift` key. Square drawing is
achieved by using `type: 'Circle'` type with a `geometryFunction` that creates
a 4-sided regular polygon instead of a circle. Box drawing uses `type: 'Circle'`
with a `geometryFunction` that creates a box-shaped polygon instead of a
circle. Star drawing uses a custom geometry function that coverts a circle
into a start using the center and radius provided by the draw interaction.
tags: "draw, edit, freehand, vector"
---
<div id="map" class="map"></div>
<form class="form-inline">
<label>Shape type &nbsp;</label>
<select id="type">
<option value="Square">Square</option>
<option value="Box">Box</option>
<option value="Star">Star</option>
<option value="None">None</option>
</select>
</form>

86
examples/draw-shapes.js Normal file
View File

@@ -0,0 +1,86 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.Polygon');
goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
});
var source = new ol.source.Vector({wrapX: false});
var vector = new ol.layer.Vector({
source: source
});
var map = new ol.Map({
layers: [raster, vector],
target: 'map',
view: new ol.View({
center: [-11000000, 4600000],
zoom: 4
})
});
var typeSelect = document.getElementById('type');
var draw; // global so we can remove it later
function addInteraction() {
var value = typeSelect.value;
if (value !== 'None') {
var geometryFunction;
if (value === 'Square') {
value = 'Circle';
geometryFunction = ol.interaction.Draw.createRegularPolygon(4);
} else if (value === 'Box') {
value = 'Circle';
geometryFunction = ol.interaction.Draw.createBox();
} else if (value === 'Star') {
value = 'Circle';
geometryFunction = function(coordinates, geometry) {
if (!geometry) {
geometry = new ol.geom.Polygon(null);
}
var center = coordinates[0];
var last = coordinates[1];
var dx = center[0] - last[0];
var dy = center[1] - last[1];
var radius = Math.sqrt(dx * dx + dy * dy);
var rotation = Math.atan2(dy, dx);
var newCoordinates = [];
var numPoints = 12;
for (var i = 0; i < numPoints; ++i) {
var angle = rotation + i * 2 * Math.PI / numPoints;
var fraction = i % 2 === 0 ? 1 : 0.5;
var offsetX = radius * fraction * Math.cos(angle);
var offsetY = radius * fraction * Math.sin(angle);
newCoordinates.push([center[0] + offsetX, center[1] + offsetY]);
}
newCoordinates.push(newCoordinates[0].slice());
geometry.setCoordinates([newCoordinates]);
return geometry;
};
}
draw = new ol.interaction.Draw({
source: source,
type: /** @type {ol.geom.GeometryType} */ (value),
geometryFunction: geometryFunction
});
map.addInteraction(draw);
}
}
/**
* Handle change event.
*/
typeSelect.onchange = function() {
map.removeInteraction(draw);
addInteraction();
};
addInteraction();

View File

@@ -9,7 +9,7 @@ goog.require('ol.source.TileWMS');
var layers = [ var layers = [
new ol.layer.Tile({ new ol.layer.Tile({
source: new ol.source.TileWMS({ source: new ol.source.TileWMS({
url: 'http://demo.boundlessgeo.com/geoserver/wms', url: 'https://ahocevar.com/geoserver/wms',
params: { params: {
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR' 'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
} }

View File

@@ -3,12 +3,12 @@ layout: example.html
title: Map Export title: Map Export
shortdesc: Example of exporting a map as a PNG image. shortdesc: Example of exporting a map as a PNG image.
docs: > docs: >
Example of exporting a map as a PNG image. Example of exporting a map as a PNG image. This example requires a browser
that supports <a href="https://developer.mozilla.org/de/docs/Web/API/HTMLCanvasElement/toBlob#Browser_compatibility">
<code>canvas.toBlob()</code></a>.
tags: "export, png, openstreetmap" tags: "export, png, openstreetmap"
resources:
- https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.3/FileSaver.min.js
--- ---
<div id="map" class="map"></div> <div id="map" class="map"></div>
<div id="no-download" class="alert alert-danger" style="display: none"> <a id="export-png" class="btn btn-default"><i class="fa fa-download"></i> Download PNG</a>
This example requires a browser that supports the
<a href="http://caniuse.com/#feat=download">link download</a> attribute.
</div>
<a id="export-png" class="btn btn-default" download="map.png"><i class="fa fa-download"></i> Download PNG</a>

View File

@@ -1,3 +1,5 @@
// NOCOMPILE
// this example uses FileSaver.js for which we don't have an externs file.
goog.require('ol.Map'); goog.require('ol.Map');
goog.require('ol.View'); goog.require('ol.View');
goog.require('ol.control'); goog.require('ol.control');
@@ -31,20 +33,12 @@ var map = new ol.Map({
}) })
}); });
var exportPNGElement = document.getElementById('export-png'); document.getElementById('export-png').addEventListener('click', function() {
map.once('postcompose', function(event) {
if ('download' in exportPNGElement) { var canvas = event.context.canvas;
exportPNGElement.addEventListener('click', function() { canvas.toBlob(function(blob) {
map.once('postcompose', function(event) { saveAs(blob, 'map.png');
var canvas = event.context.canvas;
exportPNGElement.href = canvas.toDataURL('image/png');
}); });
map.renderSync(); });
}, false); map.renderSync();
} else { });
var info = document.getElementById('no-download');
/**
* display error message
*/
info.style.display = '';
}

View File

@@ -7,6 +7,8 @@ docs: >
animate a (marker) feature along a line. In this example an encoded polyline animate a (marker) feature along a line. In this example an encoded polyline
is being used. is being used.
tags: "animation, feature, postcompose, polyline" tags: "animation, feature, postcompose, polyline"
cloak:
As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5: Your Bing Maps Key from http://www.bingmapsportal.com/ here
--- ---
<div id="map" class="map"></div> <div id="map" class="map"></div>
<label for="speed"> <label for="speed">

View File

@@ -140,7 +140,7 @@ var map = new ol.Map({
new ol.layer.Tile({ new ol.layer.Tile({
source: new ol.source.BingMaps({ source: new ol.source.BingMaps({
imagerySet: 'AerialWithLabels', imagerySet: 'AerialWithLabels',
key: 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF' key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
}) })
}), }),
vectorLayer vectorLayer

View File

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

View File

@@ -18,7 +18,7 @@ var map = new ol.Map({
layers: [ layers: [
new ol.layer.Tile({ new ol.layer.Tile({
source: new ol.source.BingMaps({ source: new ol.source.BingMaps({
key: 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial' imagerySet: 'Aerial'
}) })
}) })

View File

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

View File

@@ -18,7 +18,7 @@ var map = new ol.Map({
layers: [ layers: [
new ol.layer.Tile({ new ol.layer.Tile({
source: new ol.source.BingMaps({ source: new ol.source.BingMaps({
key: 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial' imagerySet: 'Aerial'
}) })
}) })

View File

@@ -44,7 +44,6 @@ tags: "fullscreen, geolocation, orientation, mobile"
<button id="geolocate">Geolocate Me!</button> <button id="geolocate">Geolocate Me!</button>
<button id="simulate">Simulate</button> <button id="simulate">Simulate</button>
</div> </div>
<script src="http://code.jquery.com/jquery-2.2.3.min.js" type="text/javascript"></script>
<script src="./resources/common.js" type="text/javascript"></script> <script src="./resources/common.js" type="text/javascript"></script>
<script src="loader.js?id=geolocation-orientation" type="text/javascript"></script> <script src="loader.js?id=geolocation-orientation" type="text/javascript"></script>
</body> </body>

View File

@@ -130,26 +130,6 @@ function addPosition(position, heading, m, speed) {
} }
} }
var previousM = 0;
// change center and rotation before render
map.beforeRender(function(map, frameState) {
if (frameState !== null) {
// use sampling period to get a smooth transition
var m = frameState.time - deltaMean * 1.5;
m = Math.max(m, previousM);
previousM = m;
// interpolate position along positions LineString
var c = positions.getCoordinateAtM(m, true);
var view = frameState.viewState;
if (c) {
view.center = getCenterWithHeading(c, -c[2], view.resolution);
view.rotation = -c[2];
marker.setPosition(c);
}
}
return true; // Force animation to continue
});
// recenters the view by putting the given coordinates at 3/4 from the top or // recenters the view by putting the given coordinates at 3/4 from the top or
// the screen // the screen
function getCenterWithHeading(position, rotation, resolution) { function getCenterWithHeading(position, rotation, resolution) {
@@ -162,9 +142,19 @@ function getCenterWithHeading(position, rotation, resolution) {
]; ];
} }
// postcompose callback var previousM = 0;
function render() { function updateView() {
map.render(); // use sampling period to get a smooth transition
var m = Date.now() - deltaMean * 1.5;
m = Math.max(m, previousM);
previousM = m;
// interpolate position along positions LineString
var c = positions.getCoordinateAtM(m, true);
if (c) {
view.setCenter(getCenterWithHeading(c, -c[2], view.getResolution()));
view.setRotation(-c[2]);
marker.setPosition(c);
}
} }
// geolocate device // geolocate device
@@ -172,7 +162,7 @@ var geolocateBtn = document.getElementById('geolocate');
geolocateBtn.addEventListener('click', function() { geolocateBtn.addEventListener('click', function() {
geolocation.setTracking(true); // Start position tracking geolocation.setTracking(true); // Start position tracking
map.on('postcompose', render); map.on('postcompose', updateView);
map.render(); map.render();
disableButtons(); disableButtons();
@@ -214,7 +204,7 @@ simulateBtn.addEventListener('click', function() {
} }
geolocate(); geolocate();
map.on('postcompose', render); map.on('postcompose', updateView);
map.render(); map.render();
disableButtons(); disableButtons();

View File

@@ -5,7 +5,7 @@ goog.require('ol.source.ImageWMS');
var wmsSource = new ol.source.ImageWMS({ var wmsSource = new ol.source.ImageWMS({
url: 'http://demo.boundlessgeo.com/geoserver/wms', url: 'https://ahocevar.com/geoserver/wms',
params: {'LAYERS': 'ne:ne'}, params: {'LAYERS': 'ne:ne'},
serverType: 'geoserver', serverType: 'geoserver',
crossOrigin: 'anonymous' crossOrigin: 'anonymous'

View File

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

View File

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

View File

@@ -13,7 +13,7 @@ goog.require('ol.style.Style');
var raster = new ol.layer.Tile({ var raster = new ol.layer.Tile({
source: new ol.source.BingMaps({ source: new ol.source.BingMaps({
imagerySet: 'Aerial', imagerySet: 'Aerial',
key: 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF' key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
}) })
}); });

View File

@@ -3,7 +3,7 @@ layout: example.html
title: IGC Data title: IGC Data
shortdesc: Example of tracks recorded from multiple paraglider flights on the same day, read from an IGC file. shortdesc: Example of tracks recorded from multiple paraglider flights on the same day, read from an IGC file.
docs: > docs: >
<p>The five tracks contain a total of 49,707 unique coordinates. Zoom in to see more detail. The background layer is from <a href="http://www.opencyclemap.org/">OpenCycleMap</a>.</p> <p>The five tracks contain a total of 49,707 unique coordinates. Zoom in to see more detail. The background layer is from <a href="https://www.opencyclemap.org/">OpenCycleMap</a>.</p>
tags: "complex-geometry, closest-feature, igc, opencyclemap" tags: "complex-geometry, closest-feature, igc, opencyclemap"
--- ---
<div id="map" class="map"></div> <div id="map" class="map"></div>

View File

@@ -85,10 +85,10 @@ var map = new ol.Map({
new ol.layer.Tile({ new ol.layer.Tile({
source: new ol.source.OSM({ source: new ol.source.OSM({
attributions: [ attributions: [
'All maps © <a href="http://www.opencyclemap.org/">OpenCycleMap</a>', 'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>',
ol.source.OSM.ATTRIBUTION ol.source.OSM.ATTRIBUTION
], ],
url: 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png' url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png'
}) })
}), }),
new ol.layer.Vector({ new ol.layer.Vector({

View File

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

View File

@@ -4,7 +4,7 @@ goog.require('ol.layer.Tile');
goog.require('ol.proj'); goog.require('ol.proj');
goog.require('ol.source.BingMaps'); goog.require('ol.source.BingMaps');
var key = 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF'; var key = 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5';
var imagery = new ol.layer.Tile({ var imagery = new ol.layer.Tile({
source: new ol.source.BingMaps({key: key, imagerySet: 'Aerial'}) source: new ol.source.BingMaps({key: key, imagerySet: 'Aerial'})

View File

@@ -78,7 +78,7 @@ Progress.prototype.hide = function() {
var progress = new Progress(document.getElementById('progress')); var progress = new Progress(document.getElementById('progress'));
var source = new ol.source.ImageWMS({ var source = new ol.source.ImageWMS({
url: 'http://demo.boundlessgeo.com/geoserver/wms', url: 'https://ahocevar.com/geoserver/wms',
params: {'LAYERS': 'topp:states'}, params: {'LAYERS': 'topp:states'},
serverType: 'geoserver' serverType: 'geoserver'
}); });

View File

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

View File

@@ -12,7 +12,7 @@ var projection = ol.proj.get('EPSG:3857');
var raster = new ol.layer.Tile({ var raster = new ol.layer.Tile({
source: new ol.source.BingMaps({ source: new ol.source.BingMaps({
imagerySet: 'Aerial', imagerySet: 'Aerial',
key: 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF' key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5'
}) })
}); });

View File

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

View File

@@ -4,7 +4,7 @@ goog.require('ol.layer.Tile');
goog.require('ol.proj'); goog.require('ol.proj');
goog.require('ol.source.BingMaps'); goog.require('ol.source.BingMaps');
var key = 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF'; var key = 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5';
var roads = new ol.layer.Tile({ var roads = new ol.layer.Tile({
source: new ol.source.BingMaps({key: key, imagerySet: 'Road'}) source: new ol.source.BingMaps({key: key, imagerySet: 'Road'})

View File

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

View File

@@ -10,7 +10,7 @@ var osm = new ol.layer.Tile({
}); });
var bing = new ol.layer.Tile({ var bing = new ol.layer.Tile({
source: new ol.source.BingMaps({ source: new ol.source.BingMaps({
key: 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial' imagerySet: 'Aerial'
}) })
}); });

View File

@@ -38,7 +38,7 @@ var styleFunction = function(feature) {
image: new ol.style.Icon({ image: new ol.style.Icon({
src: 'data/arrow.png', src: 'data/arrow.png',
anchor: [0.75, 0.5], anchor: [0.75, 0.5],
rotateWithView: false, rotateWithView: true,
rotation: -rotation rotation: -rotation
}) })
})); }));

View File

@@ -3,7 +3,7 @@ layout: example.html
title: Localized OpenStreetMap title: Localized OpenStreetMap
shortdesc: Example of a localized OpenStreetMap map with a custom tile server and a custom attribution. shortdesc: Example of a localized OpenStreetMap map with a custom tile server and a custom attribution.
docs: > docs: >
<p>The base layer is <a href="http://www.opencyclemap.org/">OpenCycleMap</a> with an overlay from <a href="http://www.openseamap.org/">OpenSeaMap</a>. <p>The base layer is <a href="https://www.opencyclemap.org/">OpenCycleMap</a> with an overlay from <a href="http://www.openseamap.org/">OpenSeaMap</a>.
tags: "localized-openstreetmap, openseamap, openstreetmap" tags: "localized-openstreetmap, openseamap, openstreetmap"
--- ---
<div id="map" class="map"></div> <div id="map" class="map"></div>

View File

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

View File

@@ -47,7 +47,7 @@ var map = new ol.Map({
preload: Infinity, preload: Infinity,
source: new ol.source.VectorTile({ source: new ol.source.VectorTile({
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' + attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
'© <a href="http://www.openstreetmap.org/copyright">' + '© <a href="https://www.openstreetmap.org/copyright">' +
'OpenStreetMap contributors</a>', 'OpenStreetMap contributors</a>',
format: new ol.format.MVT(), format: new ol.format.MVT(),
tileGrid: new ol.tilegrid.TileGrid({ tileGrid: new ol.tilegrid.TileGrid({

View File

@@ -20,7 +20,7 @@ var map = new ol.Map({
new ol.layer.VectorTile({ new ol.layer.VectorTile({
source: new ol.source.VectorTile({ source: new ol.source.VectorTile({
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' + attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
'© <a href="http://www.openstreetmap.org/copyright">' + '© <a href="https://www.openstreetmap.org/copyright">' +
'OpenStreetMap contributors</a>', 'OpenStreetMap contributors</a>',
format: new ol.format.MVT(), format: new ol.format.MVT(),
tileGrid: ol.tilegrid.createXYZ({maxZoom: 22}), tileGrid: ol.tilegrid.createXYZ({maxZoom: 22}),

View File

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

View File

@@ -14,7 +14,7 @@ var map = new ol.Map({
layers: [ layers: [
new ol.layer.Tile({ new ol.layer.Tile({
source: new ol.source.BingMaps({ source: new ol.source.BingMaps({
key: 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Road' imagerySet: 'Road'
}) })
}) })

View File

@@ -29,7 +29,7 @@ var styleFunction = (function() {
color: 'rgba(0, 0, 255, 0.1)' color: 'rgba(0, 0, 255, 0.1)'
}) })
}); });
styles['MultiLinestring'] = new ol.style.Style({ styles['MultiLineString'] = new ol.style.Style({
stroke: new ol.style.Stroke({ stroke: new ol.style.Stroke({
color: 'green', color: 'green',
width: 3 width: 3

View File

@@ -42,7 +42,7 @@ var map = new ol.Map({
attributions: attribution, attributions: attribution,
format: format, format: format,
tileGrid: tileGrid, tileGrid: tileGrid,
url: 'https://vector.mapzen.com/osm/water/{z}/{x}/{y}.topojson?api_key=' + key url: 'https://tile.mapzen.com/mapzen/vector/v1/water/{z}/{x}/{y}.topojson?api_key=' + key
}), }),
style: new ol.style.Style({ style: new ol.style.Style({
fill: new ol.style.Fill({ fill: new ol.style.Fill({
@@ -55,7 +55,7 @@ var map = new ol.Map({
attributions: attribution, attributions: attribution,
format: format, format: format,
tileGrid: tileGrid, tileGrid: tileGrid,
url: 'https://vector.mapzen.com/osm/roads/{z}/{x}/{y}.topojson?api_key=' + key url: 'https://tile.mapzen.com/mapzen/vector/v1/roads/{z}/{x}/{y}.topojson?api_key=' + key
}), }),
style: function(feature) { style: function(feature) {
var kind = feature.get('kind'); var kind = feature.get('kind');
@@ -89,7 +89,7 @@ var map = new ol.Map({
attributions: attribution, attributions: attribution,
format: format, format: format,
tileGrid: tileGrid, tileGrid: tileGrid,
url: 'https://vector.mapzen.com/osm/buildings/{z}/{x}/{y}.topojson?api_key=' + key url: 'https://tile.mapzen.com/mapzen/vector/v1/buildings/{z}/{x}/{y}.topojson?api_key=' + key
}), }),
style: function(f, resolution) { style: function(f, resolution) {
return (resolution < 10) ? buildingStyle : null; return (resolution < 10) ? buildingStyle : null;

View File

@@ -14,7 +14,7 @@ var overviewMapControl = new ol.control.OverviewMap({
layers: [ layers: [
new ol.layer.Tile({ new ol.layer.Tile({
source: new ol.source.OSM({ source: new ol.source.OSM({
'url': 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png' 'url': 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png'
}) })
}) })
], ],

11
examples/pinch-zoom.html Normal file
View File

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

25
examples/pinch-zoom.js Normal file
View File

@@ -0,0 +1,25 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.interaction');
goog.require('ol.interaction.PinchZoom');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
var map = new ol.Map({
interactions: ol.interaction.defaults({pinchZoom: false}).extend([
new ol.interaction.PinchZoom({
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

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

View File

@@ -14,7 +14,7 @@ var map1 = new ol.Map({
new ol.layer.Tile({ new ol.layer.Tile({
preload: Infinity, preload: Infinity,
source: new ol.source.BingMaps({ source: new ol.source.BingMaps({
key: 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial' imagerySet: 'Aerial'
}) })
}) })
@@ -28,7 +28,7 @@ var map2 = new ol.Map({
new ol.layer.Tile({ new ol.layer.Tile({
preload: 0, // default value preload: 0, // default value
source: new ol.source.BingMaps({ source: new ol.source.BingMaps({
key: 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'AerialWithLabels' imagerySet: 'AerialWithLabels'
}) })
}) })

View File

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

View File

@@ -50,7 +50,7 @@ function summarize(value, counts) {
* Use aerial imagery as the input data for the raster source. * Use aerial imagery as the input data for the raster source.
*/ */
var bing = new ol.source.BingMaps({ var bing = new ol.source.BingMaps({
key: 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF', key: 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5',
imagerySet: 'Aerial' imagerySet: 'Aerial'
}); });

View File

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

View File

@@ -72,7 +72,7 @@ function next4Edges(edge) {
]; ];
} }
var key = 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF'; var key = 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5';
var imagery = new ol.layer.Tile({ var imagery = new ol.layer.Tile({
source: new ol.source.BingMaps({key: key, imagerySet: 'Aerial'}) source: new ol.source.BingMaps({key: key, imagerySet: 'Aerial'})

View File

@@ -5,10 +5,10 @@ shortdesc: Demonstrates client-side raster reprojection of OSM to arbitrary proj
docs: > docs: >
This example shows client-side raster reprojection capabilities from This example shows client-side raster reprojection capabilities from
OSM (EPSG:3857) to arbitrary projection by searching OSM (EPSG:3857) to arbitrary projection by searching
in <a href="http://epsg.io/">EPSG.io</a> database. in <a href="https://epsg.io/">EPSG.io</a> database.
tags: "reprojection, projection, proj4js, epsg.io" tags: "reprojection, projection, proj4js, epsg.io"
resources: resources:
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js - https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js
--- ---
<div id="map" class="map"></div> <div id="map" class="map"></div>
<form class="form-inline"> <form class="form-inline">

View File

@@ -63,7 +63,7 @@ function setProjection(code, name, proj4def, bbox) {
function search(query) { function search(query) {
resultSpan.innerHTML = 'Searching ...'; resultSpan.innerHTML = 'Searching ...';
fetch('http://epsg.io/?format=json&q=' + query).then(function(response) { fetch('https://epsg.io/?format=json&q=' + query).then(function(response) {
return response.json(); return response.json();
}).then(function(json) { }).then(function(json) {
var results = json['results']; var results = json['results'];

View File

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

View File

@@ -21,7 +21,7 @@ var map = new ol.Map({
}), }),
new ol.layer.Image({ new ol.layer.Image({
source: new ol.source.ImageStatic({ source: new ol.source.ImageStatic({
url: 'http://upload.wikimedia.org/wikipedia/commons/thumb/1/18/' + url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/18/' +
'British_National_Grid.svg/2000px-British_National_Grid.svg.png', 'British_National_Grid.svg/2000px-British_National_Grid.svg.png',
crossOrigin: '', crossOrigin: '',
projection: 'EPSG:27700', projection: 'EPSG:27700',

View File

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

View File

@@ -69,7 +69,7 @@ layers['osm'] = new ol.layer.Tile({
layers['wms4326'] = new ol.layer.Tile({ layers['wms4326'] = new ol.layer.Tile({
source: new ol.source.TileWMS({ source: new ol.source.TileWMS({
url: 'http://demo.boundlessgeo.com/geoserver/wms', url: 'https://ahocevar.com/geoserver/wms',
crossOrigin: '', crossOrigin: '',
params: { params: {
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR' 'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
@@ -93,7 +93,7 @@ layers['wms21781'] = new ol.layer.Tile({
}); });
var parser = new ol.format.WMTSCapabilities(); var parser = new ol.format.WMTSCapabilities();
var url = 'http://map1.vis.earthdata.nasa.gov/wmts-arctic/' + var url = 'https://map1.vis.earthdata.nasa.gov/wmts-arctic/' +
'wmts.cgi?SERVICE=WMTS&request=GetCapabilities'; 'wmts.cgi?SERVICE=WMTS&request=GetCapabilities';
fetch(url).then(function(response) { fetch(url).then(function(response) {
return response.text(); return response.text();
@@ -129,7 +129,7 @@ for (var i = 0, ii = resolutions.length; i < ii; ++i) {
layers['states'] = new ol.layer.Tile({ layers['states'] = new ol.layer.Tile({
source: new ol.source.TileWMS({ source: new ol.source.TileWMS({
url: 'http://demo.boundlessgeo.com/geoserver/wms', url: 'https://ahocevar.com/geoserver/wms',
crossOrigin: '', crossOrigin: '',
params: {'LAYERS': 'topp:states', 'TILED': true}, params: {'LAYERS': 'topp:states', 'TILED': true},
serverType: 'geoserver', serverType: 'geoserver',

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. 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" tags: "reprojection, projection, openstreetmap, nad83, tile, scaleline"
resources: resources:
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js - https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js
--- ---
<div id="map" class="map"></div> <div id="map" class="map"></div>

9
examples/sea-level.css Normal file
View File

@@ -0,0 +1,9 @@
#level {
display: inline-block;
width: 150px;
vertical-align: text-bottom;
}
a.location {
cursor: pointer;
}

26
examples/sea-level.html Normal file
View File

@@ -0,0 +1,26 @@
---
layout: example.html
title: Sea Level
shortdesc: Render sea level at different elevations
docs: >
<p>
This example uses a <code>ol.source.Raster</code> with
<a href="https://www.mapbox.com/blog/terrain-rgb/">Mapbox Terrain-RGB tiles</a>
to "flood" areas below the elevation shown on the sea level slider.
</p>
tags: "raster, pixel operation, flood"
cloak:
pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg: Your Mapbox access token from http://mapbox.com/ here
---
<div id="map" class="map"></div>
<label>
Sea level
<input id="level" type="range" min="0" max="100" value="1"/>
+<span id="output"></span> m
</label>
<br>
Go to
<a class="location" data-center="-122.3267,37.8377" data-zoom="11">San Francisco</a>,
<a class="location" data-center="-73.9338,40.6861" data-zoom="11">New York</a>,
<a class="location" data-center="72.9481,18.9929" data-zoom="11">Mumbai</a>, or
<a class="location" data-center="120.831,31.160" data-zoom="9">Shanghai</a>

78
examples/sea-level.js Normal file
View File

@@ -0,0 +1,78 @@
// NOCOMPILE
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Image');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.Raster');
goog.require('ol.source.XYZ');
function flood(pixels, data) {
var pixel = pixels[0];
if (pixel[3]) {
var height = -10000 + ((pixel[0] * 256 * 256 + pixel[1] * 256 + pixel[2]) * 0.1);
if (height <= data.level) {
pixel[0] = 145;
pixel[1] = 175;
pixel[2] = 186;
pixel[3] = 255;
} else {
pixel[3] = 0;
}
}
return pixel;
}
var key = 'pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg';
var elevation = new ol.source.XYZ({
url: 'https://api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}.pngraw?access_token=' + key,
crossOrigin: 'anonymous'
});
var raster = new ol.source.Raster({
sources: [elevation],
operation: flood
});
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.XYZ({
url: 'https://api.mapbox.com/styles/v1/tschaub/ciutc102t00c62js5fqd47kqw/tiles/256/{z}/{x}/{y}?access_token=' + key
})
}),
new ol.layer.Image({
opacity: 0.6,
source: raster
})
],
view: new ol.View({
center: ol.proj.fromLonLat([-122.3267, 37.8377]),
zoom: 11
})
});
var control = document.getElementById('level');
var output = document.getElementById('output');
control.addEventListener('input', function() {
output.innerText = control.value;
raster.changed();
});
output.innerText = control.value;
raster.on('beforeoperations', function(event) {
event.data.level = control.value;
});
var locations = document.getElementsByClassName('location');
for (var i = 0, ii = locations.length; i < ii; ++i) {
locations[i].addEventListener('click', relocate);
}
function relocate(event) {
var data = event.target.dataset;
var view = map.getView();
view.setCenter(ol.proj.fromLonLat(data.center.split(',').map(Number)));
view.setZoom(Number(data.zoom));
}

View File

@@ -18,5 +18,13 @@ tags: "select, vector"
<option value="altclick">Alt+Click</option> <option value="altclick">Alt+Click</option>
<option value="none">None</option> <option value="none">None</option>
</select> </select>
<span id="status">&nbsp;0 selected features</span> <span id="status">&nbsp;0 selected features</span>
<br />
<label>Hit tolerance for selecting features </label>
<select id="hitTolerance" class="form-control">
<option value="0" selected>0 Pixels</option>
<option value="5">5 Pixels</option>
<option value="10">10 Pixels</option>
</select>
<canvas id="circle" style="vertical-align: middle"/>
</form> </form>

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