Compare commits

..

198 Commits

Author SHA1 Message Date
Bart van den Eijnden
5d64762bcb Merge pull request #4562 from openlayers/release-v3.12.0
Release v3.12.0
2015-12-15 11:10:24 +01:00
Bart van den Eijnden
7c98e922c3 Update package version to 3.12.0 2015-12-15 10:57:53 +01:00
Bart van den Eijnden
41c81dec88 Changelog for v3.12.0 2015-12-15 10:57:30 +01:00
Bart van den Eijnden
887e90af1e Merge pull request #4559 from bartvde/kml-ff-test
Fix up failing KML test in Firefox
2015-12-15 10:45:42 +01:00
Bart van den Eijnden
69c44e50df Merge pull request #4561 from bartvde/ie-featureloader-test
Exclude feature loader MVT test from IE9
2015-12-15 10:40:58 +01:00
Bart van den Eijnden
bd4c1f8da6 Fix up failing KML test in Firefox 2015-12-15 10:34:47 +01:00
Bart van den Eijnden
95443d0c88 Exclude feature loader MVT test from IE9 2015-12-15 10:30:20 +01:00
Andreas Hocevar
9b1416da29 Merge pull request #4552 from ahocevar/fix-proj-compiler-issue
Make sure compiled code calls ol.VectorTile#setProjection
2015-12-13 13:31:47 +01:00
Petr Sloup
48c8f9ea84 Merge pull request #4551 from klokantech/rasterreproj-wrapx
Handle tile coordinate wrapping when reprojecting raster tiles
2015-12-11 16:45:28 +01:00
Petr Sloup
9f5d85f2c6 Handle tile coordinate wrapping when reprojecting raster tiles 2015-12-11 16:35:23 +01:00
Andreas Hocevar
c4237c7858 Merge pull request #4544 from openlayers/greenkeeper-vector-tile-1.2.0
Update vector-tile to version 1.2.0 🚀
2015-12-11 15:36:08 +01:00
Andreas Hocevar
fbb59d29b9 Make sure compiled code calls ol.VectorTile#setProjection 2015-12-11 15:20:21 +01:00
Bart van den Eijnden
554aaf1574 Merge pull request #4537 from bartvde/issue-4312
Allow specifying non default DPI on ol.source.TileArcGISRest
2015-12-11 13:42:26 +01:00
Andreas Hocevar
2ebcadfcd5 Merge pull request #4548 from ahocevar/vectortile-docs
Improve vector tile related docs
2015-12-11 12:16:35 +01:00
Andreas Hocevar
d9bb3adbe8 Improve vector tile related docs 2015-12-11 12:01:24 +01:00
Tobias Sauerwein
070a6b11f0 Merge pull request #4549 from tsauerwein/multiline-example
Update vector label example
2015-12-11 10:25:57 +01:00
tsauerwein
43e1c86b6e Update vector label example 2015-12-11 10:14:02 +01:00
Bart van den Eijnden
b0b202f112 Merge pull request #4512 from flightaware/label-newlines
Support for multi-line labels (improved)
2015-12-11 09:38:07 +01:00
Marc Jansen
2fdf7f508d Merge pull request #4546 from openlayers/greenkeeper-coveralls-2.11.6
Update coveralls to version 2.11.6 🚀
2015-12-11 07:54:57 +01:00
greenkeeperio-bot
e14197c060 chore(package): update coveralls to version 2.11.6
http://greenkeeper.io/
2015-12-10 18:12:22 -07:00
greenkeeperio-bot
814fd858d8 chore(package): update vector-tile to version 1.2.0
http://greenkeeper.io/
2015-12-10 12:16:18 -07:00
Philip Clifton
97995cf20b Add newline support for text 2015-12-10 11:24:39 -06:00
Frédéric Junod
8fc85198b0 Merge pull request #4539 from fredj/examples_index
Ignore index.html in example list
2015-12-10 10:47:56 +01:00
Frederic Junod
2b64a7af7b Ignore index.html in example list
Fixes #3685
2015-12-10 10:18:23 +01:00
Frédéric Junod
fc2c9176a6 Merge pull request #4536 from fredj/tilequeue_listen_in_enqueue
Register the change callback when the tile is enqueued
2015-12-10 09:08:31 +01:00
Frederic Junod
7192644c07 Register the change callback when the tile is enqueued 2015-12-09 17:15:47 +01:00
Bart van den Eijnden
992870e2d2 Allow specifying non default DPI on ol.source.TileArcGISRest 2015-12-09 15:27:20 +01:00
Frederic Junod
ad3c6713da Return if the element is added to the ol.structs.PriorityQueue 2015-12-09 15:27:07 +01:00
Andreas Hocevar
3fef07f9e9 Merge pull request #4528 from ahocevar/simplify-tile-featureloader
Remove redundant code from ol.featureloader.tile
2015-12-09 14:12:17 +01:00
Andreas Hocevar
a5abd8df23 Merge pull request #4535 from ahocevar/osm-example-style
Do not use an array for a single style
2015-12-09 10:50:31 +01:00
Andreas Hocevar
73158b8c71 Do not use an array for a single style 2015-12-09 10:10:41 +01:00
Frédéric Junod
4f85cbec54 Merge pull request #4532 from fredj/dimensions_nonull
Mark olx.source.WMTSOptions#dimensions as not null
2015-12-09 08:59:06 +01:00
Andreas Hocevar
8f4c6a5bbf Remove redundant code from ol.featureloader.tile 2015-12-08 18:30:25 +01:00
Frederic Junod
5b7227a0bf Mark olx.source.WMTSOptions#dimensions as not null 2015-12-08 17:46:49 +01:00
Frédéric Junod
f387bb75bf Merge pull request #4530 from fredj/goog.isNull
Remove use of goog.isNull
2015-12-08 16:43:20 +01:00
Frédéric Junod
e27bfc4fa6 Merge pull request #4529 from fredj/coding_style
Update coding style rules
2015-12-08 16:23:48 +01:00
Frederic Junod
aa2838cdcd Remove use of goog.isNull 2015-12-08 16:05:38 +01:00
Frederic Junod
be16ba01ca Update coding style rules 2015-12-08 14:52:06 +01:00
Andreas Hocevar
3413f6d138 Merge pull request #4518 from ahocevar/osm-vector-tiles
Add support for OSM vector tiles
2015-12-08 11:01:49 +01:00
Andreas Hocevar
954a5077cf Merge pull request #4524 from ahocevar/custom-symbols
Add example for rendering custom point symbols
2015-12-07 22:22:20 +01:00
Andreas Hocevar
0050f00703 Add example for rendering custom point symbols 2015-12-07 21:41:42 +01:00
Andreas Hocevar
867bcce1cc Merge pull request #4523 from ahocevar/render-to-context
Allow rendering geometries to an arbitrary canvas
2015-12-07 19:13:47 +01:00
Andreas Hocevar
257abb63d7 Allow rendering geometries to an arbitrary canvas 2015-12-07 17:27:04 +01:00
Andreas Hocevar
ba93698c20 Merge pull request #4525 from ahocevar/test-render-retina
Make render tests work on more devices
2015-12-07 11:32:13 +01:00
Andreas Hocevar
35064a45f7 Merge pull request #4515 from ahocevar/icon-canvas
Accept HTMLCanvasElement for an icon's img
2015-12-07 11:26:02 +01:00
Andreas Hocevar
a940cdd6a7 Add support for OSM vector tiles 2015-12-07 11:15:25 +01:00
Andreas Hocevar
e978133b85 Make render tests work on more devices
By setting a device pixel ratio of 1.0 and increasing the tolerance for raster
reprojection tests, the render tests now also run from the console on OSX
devices with retina display.
2015-12-06 17:59:49 +01:00
Andreas Hocevar
0b4c0ee41c Merge pull request #4521 from ahocevar/imagestyle-docs
Fix imagestyle docs
2015-12-06 11:43:13 +01:00
Andreas Hocevar
5a1588a2dc Fix imagestyle docs 2015-12-06 11:33:40 +01:00
Andreas Hocevar
abb680d28f Accept HTMLCanvasElement for an icon's img 2015-12-04 14:14:01 +01:00
Frédéric Junod
8fcedb03a4 Merge pull request #4508 from fredj/rm_unused_underscore
Remove unused files
2015-12-04 13:44:56 +01:00
Frédéric Junod
7ecb6700fb Merge pull request #4487 from fredj/css_cleanup
Remove fallback css color
2015-12-04 13:44:41 +01:00
Frédéric Junod
4892a2f039 Merge pull request #4502 from fredj/optionsFromCapabilities_jsdoc
Improve ol.source.WMTS.optionsFromCapabilities jsdoc layout
2015-12-04 13:44:27 +01:00
Frédéric Junod
9363a6a340 Merge pull request #4511 from fredj/cleanup
Minor code cleanup
2015-12-02 16:05:42 +01:00
Frederic Junod
6e58be72bb Remove unused goog.require 2015-12-02 14:08:34 +01:00
Frederic Junod
6530fbe6c3 Remove '*.pyc' from .{git,npm}ignore
Not needed since the removal of pake (see #95)
2015-12-02 14:07:37 +01:00
Bart van den Eijnden
612aa3493b Merge pull request #4510 from GeoCat/master
Adding a check just in case the projection is not defined/supported
2015-12-02 11:54:27 +01:00
María Arias de Reyna
609e94a58a Adding a check just in case the projection is not defined/supported on current app. It will just ignore it, as if there was no containerSrs defined. 2015-12-02 11:44:24 +01:00
Frédéric Junod
652638e902 Merge pull request #4505 from fredj/rm_goog_object_getKeys
Remove use of goog.object.getKeys
2015-12-02 09:13:29 +01:00
Frederic Junod
7149113ab6 Remove unused files 2015-12-01 15:50:51 +01:00
Andreas Hocevar
2215f49617 Merge pull request #4472 from ahocevar/layer-filter
Do not ignore layer filter for unmanaged layers
2015-12-01 12:01:58 +01:00
Andreas Hocevar
40fec9ca35 Mention behaviour change in upgrade notes 2015-11-30 17:53:19 +01:00
Éric Lemoine
279eae1dba Do not ignore layer filter for unmanaged layers
PR #3883 made `forEachFeatureAtPixel` ignore unmanaged layers. This commit reverts that change.
2015-11-30 17:53:19 +01:00
Frederic Junod
cf1b1822b8 Remove use of goog.object.getKeys 2015-11-30 17:34:53 +01:00
Frédéric Junod
952a282756 Merge pull request #4476 from fredj/rm_goog.functions.constant
Remove use of goog.functions.constant
2015-11-30 16:22:47 +01:00
Frederic Junod
51b62fb188 Improve ol.source.WMTS.optionsFromCapabilities jsdoc layout 2015-11-30 12:39:24 +01:00
Frédéric Junod
5a123d0840 Merge pull request #4484 from fredj/rm_goog.dom.createDom
Remove use of goog.dom.createDom
2015-11-25 13:31:56 +01:00
Frederic Junod
a186254e14 Remove use of goog.dom.createDom 2015-11-25 12:40:45 +01:00
Frédéric Junod
d96d82939a Merge pull request #4486 from fredj/DragZoom_vector_doc
Remove note about DragZoom and vector support
2015-11-24 17:23:55 +01:00
Frederic Junod
1ebdba13a6 Remove note about DragZoom and vector support 2015-11-24 17:04:05 +01:00
Frederic Junod
f6326fcc99 Simplify css color notation 2015-11-24 17:01:22 +01:00
Frederic Junod
c8e35afecb Remove fallback css color
All browsers supports CSS3 color: http://caniuse.com/#feat=css3-colors
2015-11-24 16:42:38 +01:00
Frédéric Junod
a2e3f28060 Merge pull request #4483 from fredj/rm_goog.object.containsKey
Remove use of goog.object.containsKey
2015-11-24 16:25:40 +01:00
Bart van den Eijnden
ef54dddbbc Merge pull request #4475 from bartvde/ie-test-failures
Fix up failing tests in Internet Explorer
2015-11-24 14:53:24 +01:00
Bart van den Eijnden
46b7f80fef Skip tests for ol.format.MVT in IE9 2015-11-24 14:43:40 +01:00
Andreas Hocevar
890b515e44 Conditionally skip ol.source.Raster tests 2015-11-24 14:43:40 +01:00
Bart van den Eijnden
7174f65da3 Make test pass on Firefox on OSX as well 2015-11-24 14:43:40 +01:00
Bart van den Eijnden
fb52d472d2 Make regularshape tests pass on Safari on OSX
The threshold needed to be even higher for Safari on OSX.
2015-11-24 14:42:50 +01:00
Bart van den Eijnden
5f0ea2c2c7 Make the rendering tests pass in IE11
For 2 test cases, the thresholds were also too low for Chrome on OSX.
2015-11-24 14:35:18 +01:00
Frédéric Junod
f0048a5611 Merge pull request #4485 from fredj/overlay_dom_simplify
Use appendChild instead of goog.dom.append
2015-11-24 14:10:53 +01:00
Frederic Junod
a9cd2cd278 Use appendChild instead of goog.dom.append 2015-11-24 13:45:54 +01:00
Frederic Junod
8d72589743 Remove use of goog.object.containsKey 2015-11-24 10:17:01 +01:00
Frédéric Junod
90e224bd96 Merge pull request #4481 from fredj/cleanup
Remove blur workaround in ol.control.Attribution
2015-11-24 08:37:46 +01:00
Frederic Junod
290a83e2ed Remove blur workaround in ol.control.Attribution
leftover from #3954
2015-11-23 16:18:36 +01:00
Frédéric Junod
44a3595d77 Merge pull request #4479 from fredj/export_interaction_getMap
Export ol.interaction.Interaction#getMap function
2015-11-23 15:54:14 +01:00
Frederic Junod
6525bda9fd Export ol.interaction.Interaction#getMap function 2015-11-23 15:35:36 +01:00
Frédéric Junod
1b36050621 Merge pull request #4478 from fredj/apidoc
Fix olx.control.FullScreenOptions#label apidoc
2015-11-23 14:56:40 +01:00
Frederic Junod
7cc2a070e8 Fix olx.control.FullScreenOptions#label apidoc 2015-11-23 14:43:23 +01:00
Bart van den Eijnden
230f24208b Fix up EsriJSON format tests in IE9 2015-11-23 14:03:18 +01:00
Frédéric Junod
0ecf981673 Merge pull request #4477 from fredj/use_ol.nullFunction
Replace goog.nullFunction with ol.nullFunction
2015-11-23 12:19:19 +01:00
Frederic Junod
cacf2629fd Replace goog.nullFunction with ol.nullFunction 2015-11-23 11:18:34 +01:00
Frederic Junod
2c935dc4e0 Remove use of goog.functions.constant 2015-11-23 11:09:09 +01:00
Bart van den Eijnden
a2d7f56933 Fix up ol.source.TileWMS tests in IE 2015-11-23 10:38:19 +01:00
Bart van den Eijnden
b338c77726 Fix up ol.source.TileArcGISRest tests in IE 2015-11-23 10:23:54 +01:00
Bart van den Eijnden
40e9f0eaf2 Fix up ol.format.GPX tests in IE 2015-11-23 10:05:17 +01:00
Frédéric Junod
a2011b035d Merge pull request #4474 from fredj/rm_goog.dom
Remove use of goog.dom.createElement and goog.dom.createTextNode
2015-11-23 09:54:00 +01:00
Frederic Junod
e34c18a26e Remove use of goog.dom.createTextNode 2015-11-23 09:23:58 +01:00
Frederic Junod
1092f6b2a2 Remove use of goog.dom.createElement 2015-11-23 09:22:39 +01:00
Tim Schaub
6897e3cc52 Merge pull request #4469 from bjornharrtell/jsts_0.17
Upgrade to JSTS 0.17.0 in example
2015-11-21 12:22:12 -07:00
Björn Harrtell
2242224a0f Upgrade to JSTS 0.17.0 in example 2015-11-21 16:33:26 +01:00
Andreas Hocevar
f63963403b Merge pull request #4465 from openlayers/greenkeeper-handlebars-4.0.5
Update handlebars to version 4.0.5 🚀
2015-11-20 09:27:06 +01:00
greenkeeperio-bot
498e3aa3ee chore(package): update handlebars to version 4.0.5
http://greenkeeper.io/
2015-11-19 22:07:30 -07:00
Tim Schaub
b0c14cfe05 Merge pull request #4464 from openlayers/v3.11.x
Merge in changes from the 3.11.2 release.
2015-11-19 13:08:17 -07:00
Frédéric Junod
0259977fa9 Merge pull request #4463 from fredj/rm_goog.array.sort
Remove use of goog.array.sort
2015-11-19 20:24:08 +01:00
Tim Schaub
eb5607544c Update package version to 3.11.2 2015-11-19 11:32:41 -07:00
Tim Schaub
4999c792f1 Changelog for v3.11.2 2015-11-19 11:28:02 -07:00
Andreas Hocevar
5af338f92b Fix select interaction regression caused by #4391 2015-11-19 10:53:57 -07:00
Frederic Junod
071aad4815 Check ol.source.UrlTile#urls property for null value
Fixes #4446
2015-11-19 10:53:12 -07:00
Andreas Hocevar
a43cca7720 Allow '' for crossOrigin (as Anonymous alias)
This fixes a regression introduced by the goog.isDef removal.

From the HTML 5 spec: "The empty string is also a valid keyword, and
maps to the Anonymous state"
2015-11-19 10:48:35 -07:00
Andreas Hocevar
aa260f800e Merge pull request #4450 from ahocevar/fix-select
Fix select interaction regression caused by #4391
2015-11-19 18:20:04 +01:00
Frederic Junod
a4fb2501d8 Remove use of goog.array.sort
Fixes #4160
2015-11-19 16:53:11 +01:00
Frédéric Junod
627abaf1a7 Merge pull request #4458 from fredj/lint
Remove extra space in type annotation
2015-11-19 12:00:49 +01:00
Frederic Junod
5ead77bcd1 Remove extra space in type annotation 2015-11-19 10:03:42 +01:00
Tim Schaub
9ffed70ffd Merge pull request #4420 from openlayers/strapless
Remove Bootstrap and jQuery from example snippets.
2015-11-18 11:20:39 -07:00
Tim Schaub
cbfd533d49 Revert to jQuery for editing with Esri and IE 9 2015-11-18 10:21:00 -07:00
Tim Schaub
d3ff8d7fb0 More consistent markup 2015-11-18 10:06:35 -07:00
Tim Schaub
19fe73e78e Doc typos 2015-11-18 09:56:16 -07:00
Tim Schaub
72a0f70e7a Update simple title 2015-11-18 09:56:16 -07:00
Tim Schaub
645a0ce2d4 Update flight animation example 2015-11-18 09:56:16 -07:00
Tim Schaub
d19bf0970b Rename strapless template 2015-11-18 09:56:15 -07:00
Tim Schaub
10eb041199 Remove old example template 2015-11-18 09:56:15 -07:00
Tim Schaub
99ca4047dd Convert forgotten examples to strapless template 2015-11-18 09:56:15 -07:00
Tim Schaub
d838214f96 Convert X-Z examples to strapless template 2015-11-18 09:56:15 -07:00
Tim Schaub
c463321643 Convert WMTS examples to strapless template 2015-11-18 09:56:15 -07:00
Tim Schaub
a94a00de1d Convert WMS examples to strapless template 2015-11-18 09:56:15 -07:00
Tim Schaub
9a35c08300 Convert WKT example to strapless template 2015-11-18 09:56:15 -07:00
Tim Schaub
8bd97532df Convert V examples to strapless template 2015-11-18 09:56:15 -07:00
Tim Schaub
baed03d50d Convert S-T examples to strapless template 2015-11-18 09:56:15 -07:00
Tim Schaub
c984bedd09 Convert R examples to strapless template 2015-11-18 09:56:14 -07:00
Tim Schaub
e6343ca272 Convert M-P examples to strapless template 2015-11-18 09:56:14 -07:00
Tim Schaub
f88681951a Convert L examples to use strapless template 2015-11-18 09:56:14 -07:00
Tim Schaub
87fcca91bd Convert K examples to strapless template 2015-11-18 09:56:14 -07:00
Tim Schaub
6fd6b794ef Use fetch instead of $.ajax in JSTS example 2015-11-18 09:56:14 -07:00
Tim Schaub
2fff18fd0c Use cdn.polyfill.io for polyfills 2015-11-18 09:56:14 -07:00
Tim Schaub
91a772a952 Convert H-I examples to strapless template 2015-11-18 09:56:14 -07:00
Tim Schaub
88ec3b9f6c Convert F-G examples to strapless template 2015-11-18 09:56:14 -07:00
Tim Schaub
2e8f4806d2 Give the docs some breathing room 2015-11-18 09:56:14 -07:00
Tim Schaub
b8cf2b213b Make the titles more like titles 2015-11-18 09:56:14 -07:00
Tim Schaub
3035bbdfd3 Convert D-E examples to strapless template 2015-11-18 09:56:14 -07:00
Tim Schaub
c3165252f8 Move title above map 2015-11-18 09:56:13 -07:00
Tim Schaub
5a511c7591 Remove "// NOCOMPILE" lines from examples 2015-11-18 09:56:13 -07:00
Tim Schaub
48be3ee572 Simplify the simple example 2015-11-18 09:56:13 -07:00
Tim Schaub
734712bf9c Convert A-C examples to strapless template 2015-11-18 09:56:13 -07:00
Tim Schaub
a2f84b144f Avoid including bootstrap.min.css twice 2015-11-18 09:56:13 -07:00
Tim Schaub
74f2b4cb74 Intentional indentation and newlines 2015-11-18 09:56:13 -07:00
Tim Schaub
58d22350d8 New template that removes Bootstrap and jQuery from code snippet 2015-11-18 09:56:13 -07:00
Tim Schaub
b69e453061 Merge pull request #4442 from tschaub/new-jsdoc
Use jsdoc@3.4.0.
2015-11-18 09:27:21 -07:00
Andreas Hocevar
a8cd6b735f Fix select interaction regression caused by #4391 2015-11-18 11:57:18 +01:00
Bart van den Eijnden
51d5182592 Merge pull request #4449 from bartvde/issue-4445
Change the label of the full screen button to be more intuitive
2015-11-18 11:53:04 +01:00
Frédéric Junod
6240162ecf Merge pull request #4448 from fredj/ol.source.UrlTile_urls
Check ol.source.UrlTile#urls property for null value
2015-11-18 11:47:56 +01:00
Bart van den Eijnden
5c592731f3 Change the label of the full screen button to be more intuitive (closes #4445) 2015-11-18 11:42:27 +01:00
Frederic Junod
aef097e348 Check ol.source.UrlTile#urls property for null value
Fixes #4446
2015-11-18 11:30:14 +01:00
Petr Sloup
77ca38aa10 Merge pull request #4440 from klokantech/rasterreproj_tutorial
Raster reprojection tutorial
2015-11-18 09:40:40 +01:00
Petr Sloup
0b23eae429 Language fixes for raster reprojection tutorial 2015-11-18 09:27:35 +01:00
Petr Sloup
b92565a096 Add raster reprojection tutorial 2015-11-18 09:27:35 +01:00
Tim Schaub
3dcc2843ae Write directly to stdout in publish script 2015-11-17 18:06:29 -07:00
Tim Schaub
34dd7b76b1 Use jsdoc@3.4.0 2015-11-17 18:04:16 -07:00
Andreas Hocevar
b435723b8c Merge pull request #4439 from ahocevar/crossorigin-regression
Allow '' for crossOrigin (as Anonymous alias)
2015-11-17 16:39:34 +01:00
Andreas Hocevar
749dacc749 Allow '' for crossOrigin (as Anonymous alias)
This fixes a regression introduced by the goog.isDef removal.

From the HTML 5 spec: "The empty string is also a valid keyword, and
maps to the Anonymous state"
2015-11-17 12:55:48 +01:00
Frédéric Junod
fd44295b17 Merge pull request #4429 from fredj/object_change_evt
Dispatch a change event only if the value changes
2015-11-17 12:51:26 +01:00
Frédéric Junod
17e69f9326 Merge pull request #4435 from fredj/rm_cast
Remove unnecessary cast
2015-11-17 11:07:31 +01:00
Frédéric Junod
b44d1f4fec Merge pull request #4434 from fredj/lint
Remove unused local variables
2015-11-17 11:07:12 +01:00
Frederic Junod
10ed2997d8 Remove unnecessary cast
See 4977f3607b
2015-11-17 10:41:09 +01:00
Frederic Junod
bfd33becbc Remove unused local variables 2015-11-17 10:20:40 +01:00
Frédéric Junod
50c28cdd60 Merge pull request #4433 from fredj/lint
Remove unused local variables
2015-11-17 10:15:11 +01:00
Frederic Junod
764875147a Remove unused local variables 2015-11-17 09:57:56 +01:00
Tobias Sauerwein
440a8bdea7 Merge pull request #4140 from tsauerwein/animation-flights
Add flight animation example
2015-11-17 09:49:44 +01:00
tsauerwein
faf9e467e4 Use map.render() in examples 2015-11-17 09:26:28 +01:00
tsauerwein
072a347a54 Add flight animation example 2015-11-17 09:26:28 +01:00
Andreas Hocevar
eee205c688 Merge pull request #4428 from ahocevar/imagewms-imagesize-regression-test
Add imageSize regression test for ol.source.ImageWMS
2015-11-16 23:08:47 +01:00
Andreas Hocevar
f0dbedd39d Add imageSize regression test for ol.source.ImageWMS 2015-11-16 22:20:35 +01:00
Andreas Hocevar
f4ad1214e7 Merge pull request #4426 from ahocevar/nicer-staticimage
Improve ol.source.StaticImage
2015-11-16 22:15:48 +01:00
Frederic Junod
ca575bd35d Dispatch a change event only if the value is different 2015-11-16 16:48:00 +01:00
Andreas Hocevar
fabda7c4b2 Improve ol.source.StaticImage
Brings back the imgSize property, and puts all image load handler
code in a single listener.
2015-11-16 11:55:10 +01:00
Frédéric Junod
18c41bfc19 Merge pull request #4425 from fredj/duration_eq_0
Test number property with !== undefined
2015-11-16 09:53:32 +01:00
Frederic Junod
dfbe7447c9 Test number property with !== undefined
Fixes #4424
2015-11-16 09:39:35 +01:00
Tim Schaub
5e0b0e69a5 Merge pull request #4423 from openlayers/greenkeeper-mocha-2.3.4
Update mocha to version 2.3.4 🚀
2015-11-15 15:15:28 -07:00
greenkeeperio-bot
6280ed2201 chore(package): update mocha to version 2.3.4
http://greenkeeper.io/
2015-11-15 13:39:37 -07:00
Tim Schaub
44cfb190f3 Merge pull request #4416 from openlayers/greenkeeper-clean-css-3.4.8
Update clean-css to version 3.4.8 🚀
2015-11-13 09:22:54 -07:00
Andreas Hocevar
f86a7455c4 Merge pull request #4415 from ahocevar/fix-imagesize
Scale StaticImage image to imageExtent
2015-11-13 13:15:46 +01:00
greenkeeperio-bot
69c332b023 chore(package): update clean-css to version 3.4.8
http://greenkeeper.io/
2015-11-13 05:06:22 -07:00
Andreas Hocevar
6280b35035 Scale StaticImage image to imageExtent
The imageSize property was only used to determine the scale. It's usage was
never documented nor tested nor shown in an example, so I removed it because I
considered its presence a bug.
2015-11-13 12:23:31 +01:00
Andreas Hocevar
4a97e26bd9 Merge pull request #4414 from ahocevar/imageurlfunction-bye-bye
Remove ol.ImageUrlFunction
2015-11-13 11:40:43 +01:00
Andreas Hocevar
152dc6e5d0 Remove ol.ImageUrlFunction
This was only used in ol.source.ImageMapGuide, and added unnecessary
overhead there.
2015-11-13 11:27:44 +01:00
Éric Lemoine
f5a148e6b3 Merge pull request #4389 from elemoine/dynamic-params
Smooth transitions on parameter changes
2015-11-13 08:41:42 +01:00
Tim Schaub
a8a796f922 Merge pull request #4410 from openlayers/v3.11.x
Merge in changes from the 3.11.1 release.
2015-11-12 16:53:41 -07:00
Tim Schaub
41a232de60 Merge pull request #4401 from tschaub/style
Allow style function to return a style.
2015-11-12 10:21:19 -07:00
Éric Lemoine
c3c8c4fa73 Add an wmts-dimensions example 2015-11-12 14:47:02 +01:00
Éric Lemoine
0f70a21ba6 Implement getKeyParams in ol.source.WMTS 2015-11-12 14:40:36 +01:00
Éric Lemoine
132861e175 Use interim tiles when changing dynamic parameters 2015-11-12 14:40:35 +01:00
Bart van den Eijnden
bd1febeb41 Merge pull request #4404 from oterral/writstyles
Set correctly the opt_this parameter when writing a KML document
2015-11-12 13:25:31 +01:00
oterral
f588fcf7b0 Set correctly the opt_this parameter when writing a KML document 2015-11-12 11:54:06 +01:00
Tim Schaub
99a902a311 Get rid of extra style arrays in examples 2015-11-11 18:24:08 -07:00
Tim Schaub
e8c99e4e63 Allow style function to return a style 2015-11-11 17:21:24 -07:00
Tim Schaub
afba132c13 Merge pull request #4397 from openlayers/greenkeeper-glob-6.0.1
Update glob to version 6.0.1 🚀
2015-11-11 15:56:29 -07:00
Tim Schaub
8a7907e4cf Merge pull request #4362 from tamarmot/rotate_reset_north
Rotate control now takes optional resetNorth function.
2015-11-11 15:54:22 -07:00
greenkeeperio-bot
a52187a276 chore(package): update glob to version 6.0.1
http://greenkeeper.io/
2015-11-11 12:48:38 -07:00
Tamar Cohen
4a163b54f3 Rotate control now takes optional resetNorth function 2015-11-02 10:06:59 -08:00
331 changed files with 8656 additions and 2692 deletions

1
.gitignore vendored
View File

@@ -1,4 +1,3 @@
*.pyc
/build/
/node_modules/
/dist/

View File

@@ -1,2 +1 @@
*.pyc
/build/

View File

@@ -106,6 +106,13 @@ style of the existing OpenLayers 3 code, which includes:
* Use `array.length = 0` instead of `goog.array.clear`.
* Use `v !== undefined` instead of `goog.isDef(v)` and `v === null` instead of
`goog.isNull(v)`.
* Use ECMAScript 5.1 functions instead of the `goog` equivalents. For example,
use `Object.keys(obj)` instead of `goog.object.getKeys(obj)`, `arr.forEach(f)`
instead of `goog.array.forEach(arr, f)`, etc ...
* Use bracket notation instead of `goog.object.set` and `goog.object.get` (with
two arguments).

View File

@@ -1,5 +1,18 @@
## Upgrade notes
### v3.12.0
#### `ol.Map#forEachFeatureAtPixel` changes
The optional `layerFilter` function is now also called for unmanaged layers. To get the same behaviour as before, wrap your layer filter code in an if block like this:
```js
function layerFilter(layer) {
if (map.getLayers().getArray().indexOf(layer) !== -1) {
// existing layer filter code
}
}
```
### v3.11.0
#### `ol.format.KML` changes

11
changelog/v3.11.2.md Normal file
View File

@@ -0,0 +1,11 @@
# v3.11.2
## Summary
The v3.11.2 release is a patch release that addresses a few regressions in the v3.11.1 release. See the [v3.11.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.11.0) for details on upgrading from v3.10.
## Fixes
* [#4450](https://github.com/openlayers/ol3/pull/4450) - Fix select interaction regression caused by #4391 ([@ahocevar](https://github.com/ahocevar))
* [#4448](https://github.com/openlayers/ol3/pull/4448) - Check ol.source.UrlTile#urls property for null value ([@fredj](https://github.com/fredj))
* [#4439](https://github.com/openlayers/ol3/pull/4439) - Allow '' for crossOrigin (as Anonymous alias) ([@ahocevar](https://github.com/ahocevar))

96
changelog/v3.12.0.md Normal file
View File

@@ -0,0 +1,96 @@
# v3.12.0
## Summary
The v3.12.0 release includes features and fixes from 71 pull requests since the v3.11.2 release. New features and improvements include:
* Tile coordinate wrapping for raster reprojection.
* Support for multi-line labels.
* Allow rendering geometries to an arbitrary canvas (useful for vector legends).
## Upgrade notes
#### `ol.Map#forEachFeatureAtPixel` changes
The optional `layerFilter` function is now also called for unmanaged layers. To get the same behaviour as before, wrap your layer filter code in an if block like this:
```js
function layerFilter(layer) {
if (map.getLayers().getArray().indexOf(layer) !== -1) {
// existing layer filter code
}
}
```
## Full list of changes
* [#4559](https://github.com/openlayers/ol3/pull/4559) - Fix up failing KML test in Firefox ([@bartvde](https://github.com/bartvde))
* [#4561](https://github.com/openlayers/ol3/pull/4561) - Exclude feature loader MVT test from IE9 ([@bartvde](https://github.com/bartvde))
* [#4552](https://github.com/openlayers/ol3/pull/4552) - Make sure compiled code calls ol.VectorTile#setProjection ([@ahocevar](https://github.com/ahocevar))
* [#4551](https://github.com/openlayers/ol3/pull/4551) - Handle tile coordinate wrapping when reprojecting raster tiles ([@klokantech](https://github.com/klokantech))
* [#4544](https://github.com/openlayers/ol3/pull/4544) - Update vector-tile to version 1.2.0 🚀 ([@openlayers](https://github.com/openlayers))
* [#4537](https://github.com/openlayers/ol3/pull/4537) - Allow specifying non default DPI on ol.source.TileArcGISRest ([@bartvde](https://github.com/bartvde))
* [#4548](https://github.com/openlayers/ol3/pull/4548) - Improve vector tile related docs ([@ahocevar](https://github.com/ahocevar))
* [#4549](https://github.com/openlayers/ol3/pull/4549) - Update vector label example ([@tsauerwein](https://github.com/tsauerwein))
* [#4512](https://github.com/openlayers/ol3/pull/4512) - Support for multi-line labels (improved) ([@flightaware](https://github.com/flightaware))
* [#4546](https://github.com/openlayers/ol3/pull/4546) - Update coveralls to version 2.11.6 🚀 ([@openlayers](https://github.com/openlayers))
* [#4539](https://github.com/openlayers/ol3/pull/4539) - Ignore index.html in example list ([@fredj](https://github.com/fredj))
* [#4536](https://github.com/openlayers/ol3/pull/4536) - Register the change callback when the tile is enqueued ([@fredj](https://github.com/fredj))
* [#4528](https://github.com/openlayers/ol3/pull/4528) - Remove redundant code from ol.featureloader.tile ([@ahocevar](https://github.com/ahocevar))
* [#4535](https://github.com/openlayers/ol3/pull/4535) - Do not use an array for a single style ([@ahocevar](https://github.com/ahocevar))
* [#4532](https://github.com/openlayers/ol3/pull/4532) - Mark olx.source.WMTSOptions#dimensions as not null ([@fredj](https://github.com/fredj))
* [#4530](https://github.com/openlayers/ol3/pull/4530) - Remove use of goog.isNull ([@fredj](https://github.com/fredj))
* [#4529](https://github.com/openlayers/ol3/pull/4529) - Update coding style rules ([@fredj](https://github.com/fredj))
* [#4518](https://github.com/openlayers/ol3/pull/4518) - Add support for OSM vector tiles ([@ahocevar](https://github.com/ahocevar))
* [#4524](https://github.com/openlayers/ol3/pull/4524) - Add example for rendering custom point symbols ([@ahocevar](https://github.com/ahocevar))
* [#4523](https://github.com/openlayers/ol3/pull/4523) - Allow rendering geometries to an arbitrary canvas ([@ahocevar](https://github.com/ahocevar))
* [#4525](https://github.com/openlayers/ol3/pull/4525) - Make render tests work on more devices ([@ahocevar](https://github.com/ahocevar))
* [#4515](https://github.com/openlayers/ol3/pull/4515) - Accept HTMLCanvasElement for an icon's img ([@ahocevar](https://github.com/ahocevar))
* [#4521](https://github.com/openlayers/ol3/pull/4521) - Fix imagestyle docs ([@ahocevar](https://github.com/ahocevar))
* [#4508](https://github.com/openlayers/ol3/pull/4508) - Remove unused files ([@fredj](https://github.com/fredj))
* [#4487](https://github.com/openlayers/ol3/pull/4487) - Remove fallback css color ([@fredj](https://github.com/fredj))
* [#4502](https://github.com/openlayers/ol3/pull/4502) - Improve ol.source.WMTS.optionsFromCapabilities jsdoc layout ([@fredj](https://github.com/fredj))
* [#4511](https://github.com/openlayers/ol3/pull/4511) - Minor code cleanup ([@fredj](https://github.com/fredj))
* [#4510](https://github.com/openlayers/ol3/pull/4510) - Adding a check just in case the projection is not defined/supported ([@GeoCat](https://github.com/GeoCat))
* [#4505](https://github.com/openlayers/ol3/pull/4505) - Remove use of goog.object.getKeys ([@fredj](https://github.com/fredj))
* [#4472](https://github.com/openlayers/ol3/pull/4472) - Do not ignore layer filter for unmanaged layers ([@ahocevar](https://github.com/ahocevar))
* [#4476](https://github.com/openlayers/ol3/pull/4476) - Remove use of goog.functions.constant ([@fredj](https://github.com/fredj))
* [#4484](https://github.com/openlayers/ol3/pull/4484) - Remove use of goog.dom.createDom ([@fredj](https://github.com/fredj))
* [#4486](https://github.com/openlayers/ol3/pull/4486) - Remove note about DragZoom and vector support ([@fredj](https://github.com/fredj))
* [#4483](https://github.com/openlayers/ol3/pull/4483) - Remove use of goog.object.containsKey ([@fredj](https://github.com/fredj))
* [#4475](https://github.com/openlayers/ol3/pull/4475) - Fix up failing tests in Internet Explorer ([@bartvde](https://github.com/bartvde))
* [#4485](https://github.com/openlayers/ol3/pull/4485) - Use appendChild instead of goog.dom.append ([@fredj](https://github.com/fredj))
* [#4481](https://github.com/openlayers/ol3/pull/4481) - Remove blur workaround in ol.control.Attribution ([@fredj](https://github.com/fredj))
* [#4479](https://github.com/openlayers/ol3/pull/4479) - Export ol.interaction.Interaction#getMap function ([@fredj](https://github.com/fredj))
* [#4478](https://github.com/openlayers/ol3/pull/4478) - Fix olx.control.FullScreenOptions#label apidoc ([@fredj](https://github.com/fredj))
* [#4477](https://github.com/openlayers/ol3/pull/4477) - Replace goog.nullFunction with ol.nullFunction ([@fredj](https://github.com/fredj))
* [#4474](https://github.com/openlayers/ol3/pull/4474) - Remove use of goog.dom.createElement and goog.dom.createTextNode ([@fredj](https://github.com/fredj))
* [#4469](https://github.com/openlayers/ol3/pull/4469) - Upgrade to JSTS 0.17.0 in example ([@bjornharrtell](https://github.com/bjornharrtell))
* [#4465](https://github.com/openlayers/ol3/pull/4465) - Update handlebars to version 4.0.5 🚀 ([@openlayers](https://github.com/openlayers))
* [#4464](https://github.com/openlayers/ol3/pull/4464) - Merge in changes from the 3.11.2 release. ([@openlayers](https://github.com/openlayers))
* [#4463](https://github.com/openlayers/ol3/pull/4463) - Remove use of goog.array.sort ([@fredj](https://github.com/fredj))
* [#4450](https://github.com/openlayers/ol3/pull/4450) - Fix select interaction regression caused by #4391 ([@ahocevar](https://github.com/ahocevar))
* [#4458](https://github.com/openlayers/ol3/pull/4458) - Remove extra space in type annotation ([@fredj](https://github.com/fredj))
* [#4420](https://github.com/openlayers/ol3/pull/4420) - Remove Bootstrap and jQuery from example snippets. ([@openlayers](https://github.com/openlayers))
* [#4442](https://github.com/openlayers/ol3/pull/4442) - Use jsdoc@3.4.0. ([@tschaub](https://github.com/tschaub))
* [#4449](https://github.com/openlayers/ol3/pull/4449) - Change the label of the full screen button to be more intuitive ([@bartvde](https://github.com/bartvde))
* [#4448](https://github.com/openlayers/ol3/pull/4448) - Check ol.source.UrlTile#urls property for null value ([@fredj](https://github.com/fredj))
* [#4440](https://github.com/openlayers/ol3/pull/4440) - Raster reprojection tutorial ([@klokantech](https://github.com/klokantech))
* [#4439](https://github.com/openlayers/ol3/pull/4439) - Allow '' for crossOrigin (as Anonymous alias) ([@ahocevar](https://github.com/ahocevar))
* [#4429](https://github.com/openlayers/ol3/pull/4429) - Dispatch a change event only if the value changes ([@fredj](https://github.com/fredj))
* [#4435](https://github.com/openlayers/ol3/pull/4435) - Remove unnecessary cast ([@fredj](https://github.com/fredj))
* [#4434](https://github.com/openlayers/ol3/pull/4434) - Remove unused local variables ([@fredj](https://github.com/fredj))
* [#4433](https://github.com/openlayers/ol3/pull/4433) - Remove unused local variables ([@fredj](https://github.com/fredj))
* [#4140](https://github.com/openlayers/ol3/pull/4140) - Add flight animation example ([@tsauerwein](https://github.com/tsauerwein))
* [#4428](https://github.com/openlayers/ol3/pull/4428) - Add imageSize regression test for ol.source.ImageWMS ([@ahocevar](https://github.com/ahocevar))
* [#4426](https://github.com/openlayers/ol3/pull/4426) - Improve ol.source.StaticImage ([@ahocevar](https://github.com/ahocevar))
* [#4425](https://github.com/openlayers/ol3/pull/4425) - Test number property with !== undefined ([@fredj](https://github.com/fredj))
* [#4423](https://github.com/openlayers/ol3/pull/4423) - Update mocha to version 2.3.4 🚀 ([@openlayers](https://github.com/openlayers))
* [#4416](https://github.com/openlayers/ol3/pull/4416) - Update clean-css to version 3.4.8 🚀 ([@openlayers](https://github.com/openlayers))
* [#4415](https://github.com/openlayers/ol3/pull/4415) - Scale StaticImage image to imageExtent ([@ahocevar](https://github.com/ahocevar))
* [#4414](https://github.com/openlayers/ol3/pull/4414) - Remove ol.ImageUrlFunction ([@ahocevar](https://github.com/ahocevar))
* [#4389](https://github.com/openlayers/ol3/pull/4389) - Smooth transitions on parameter changes ([@elemoine](https://github.com/elemoine))
* [#4410](https://github.com/openlayers/ol3/pull/4410) - Merge in changes from the 3.11.1 release. ([@openlayers](https://github.com/openlayers))
* [#4401](https://github.com/openlayers/ol3/pull/4401) - Allow style function to return a style. ([@tschaub](https://github.com/tschaub))
* [#4404](https://github.com/openlayers/ol3/pull/4404) - Set correctly the opt_this parameter when writing a KML document ([@oterral](https://github.com/oterral))
* [#4397](https://github.com/openlayers/ol3/pull/4397) - Update glob to version 6.0.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#4362](https://github.com/openlayers/ol3/pull/4362) - Rotate control now takes optional resetNorth function. ([@tamarmot](https://github.com/tamarmot))

View File

@@ -1,8 +1,8 @@
<!doctype html>
<html lang="en">
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" type="text/css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" type="text/css">
@@ -11,6 +11,7 @@
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
{{{ extraHead.local }}}
{{{ css.tag }}}
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch"></script>
<script src="./resources/zeroclipboard/ZeroClipboard.min.js"></script>
<title>{{ title }}</title>
</head>
@@ -24,14 +25,17 @@
<div class="container-fluid">
{{{ contents }}}
<div class="row-fluid">
<div class="span12">
<h4 id="title">{{ title }}</h4>
{{{ contents }}}
</div>
</div>
<div class="row-fluid">
<div class="span12">
<p id="shortdesc">{{ shortdesc }}</p>
<div id="docs">{{ md docs }}</div>
<div id="tags">{{ tags }}</div>
<div id="api-links">Related API documentation: {{{ js.apiHtml }}}</div>
</div>
</div>
@@ -41,47 +45,33 @@
<a id="copy-button"><i class="fa fa-clipboard"></i> Copy</a>
<a id="jsfiddle-button"><i class="fa fa-jsfiddle"></i> Edit</a>
</div>
<form method="POST" id="jsfiddle-form" target="_blank" action="http://jsfiddle.net/api/post/jquery/1.11.0/">
<form method="POST" id="jsfiddle-form" target="_blank" action="http://jsfiddle.net/api/post/library/pure/">
<textarea class="hidden" name="js">{{ js.source }}</textarea>
<textarea class="hidden" name="css">{{ css.source }}</textarea>
<textarea class="hidden" name="html">{{ contents }}</textarea>
<input type="hidden" name="wrap" value="l">
<input type="hidden" name="resources" value="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css,https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js,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="http://openlayers.org/en/v{{ olVersion }}/css/ol.css,http://openlayers.org/en/v{{ olVersion }}/build/ol.js{{ extraResources }}">
</form>
<pre><code id="example-source" class="language-markup">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;{{ title }}&lt;/title&gt;
&lt;script src="https://code.jquery.com/jquery-1.11.2.min.js"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"&gt;
&lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="http://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css"&gt;
&lt;script src="http://openlayers.org/en/v{{ olVersion }}/build/ol.js"&gt;&lt;/script&gt;
{{ extraHead.remote }}
{{#if css.source}}
&lt;script src="http://openlayers.org/en/v{{ olVersion }}/build/ol.js"&gt;&lt;/script&gt;{{#if extraHead.remote}}
{{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}}
&lt;style&gt;
{{ css.source }}
&lt;/style&gt;
{{/if}}
{{ indent css.source spaces=6 }} &lt;/style&gt;{{/if}}
&lt;/head&gt;
&lt;body&gt;
&lt;div class="container-fluid"&gt;
{{ contents }}
&lt;/div&gt;
&lt;script&gt;
{{ js.source }}
&lt;/script&gt;
{{ indent contents spaces=4 }} &lt;script&gt;
{{ indent js.source spaces=6 }} &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
</div>
</div>
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="./resources/common.js"></script>
<script src="./resources/prism/prism.min.js"></script>
{{{ js.tag }}}
</body>
</html>

View File

@@ -16,6 +16,4 @@ To enable this, examples have the following, not needed in application code:
* html files load `resources/common.js` and some scripts use `common.getRendererFromQueryString()` to set the map renderer; application code would not need these
* in addition, examples use Twitter Bootstrap and jQuery; this is of course not a requirement - you may use whichever presentation/helper libraries you wish
At the bottom of each example generated in the `build/examples` folder, a modified version of its source code is shown. That modified version can be run standalone and is usually used as starting point for users to extend examples into their own application.

View File

@@ -16,7 +16,7 @@
]
},
"plugins": [
"node_modules/jsdoc-fork/plugins/markdown",
"node_modules/jsdoc/plugins/markdown",
"config/jsdoc/api/plugins/inheritdoc",
"config/jsdoc/api/plugins/typedefs",
"config/jsdoc/api/plugins/events",

View File

@@ -11,6 +11,7 @@
[ol.layer.Tile](ol.layer.Tile.html)<br>
[ol.layer.Image](ol.layer.Image.html)<br>
[ol.layer.Vector](ol.layer.Vector.html)</td>
[ol.layer.VectorTile](ol.layer.VectorTile.html)</td>
</tr><tr>
<th>Controls</th><th>Interactions</th><th>Sources and formats</th>
</tr><tr>
@@ -27,6 +28,7 @@ Interactions for [vector features](ol.Feature.html)
<td>[Tile sources](ol.source.Tile.html) for [ol.layer.Tile](ol.layer.Tile.html)
<br>[Image sources](ol.source.Image.html) for [ol.layer.Image](ol.layer.Image.html)
<br>[Vector sources](ol.source.Vector.html) for [ol.layer.Vector](ol.layer.Vector.html)
<br>[Vector tile sources](ol.source.VectorTile.html) for [ol.layer.VectorTile](ol.layer.VectorTile.html)
<br>[Formats](ol.format.Feature.html) for reading/writing vector data
<br>[ol.format.WMSCapabilities](ol.format.WMSCapabilities.html)</td></tr>
<tr><th>Projections</th><th>Observable objects</th><th>Other components</th></tr>

View File

@@ -16,7 +16,7 @@ exports.defineTags = function(dictionary) {
doclet.stability = level;
} else {
var errorText = util.format('Invalid stability level (%s) in %s line %s', tag.text, doclet.meta.filename, doclet.meta.lineno);
require('jsdoc-fork/lib/jsdoc/util/error').handle( new Error(errorText) );
require('jsdoc/lib/jsdoc/util/error').handle( new Error(errorText) );
}
}
});

View File

@@ -1,10 +1,10 @@
/*global env: true */
var template = require('jsdoc-fork/lib/jsdoc/template'),
fs = require('jsdoc-fork/lib/jsdoc/fs'),
path = require('jsdoc-fork/lib/jsdoc/path'),
var template = require('jsdoc/lib/jsdoc/template'),
fs = require('jsdoc/lib/jsdoc/fs'),
path = require('jsdoc/lib/jsdoc/path'),
taffy = require('taffydb').taffy,
handle = require('jsdoc-fork/lib/jsdoc/util/error').handle,
helper = require('jsdoc-fork/lib/jsdoc/util/templateHelper'),
handle = require('jsdoc/lib/jsdoc/util/error').handle,
helper = require('jsdoc/lib/jsdoc/util/templateHelper'),
_ = require('underscore'),
htmlsafe = helper.htmlsafe,
linkto = helper.linkto,
@@ -350,8 +350,8 @@ exports.publish = function(taffyData, opts, tutorials) {
var staticFileScanner;
if (conf['default'].staticFiles) {
staticFilePaths = conf['default'].staticFiles.paths || [];
staticFileFilter = new (require('jsdoc-fork/lib/jsdoc/src/filter')).Filter(conf['default'].staticFiles);
staticFileScanner = new (require('jsdoc-fork/lib/jsdoc/src/scanner')).Scanner();
staticFileFilter = new (require('jsdoc/lib/jsdoc/src/filter')).Filter(conf['default'].staticFiles);
staticFileScanner = new (require('jsdoc/lib/jsdoc/src/scanner')).Scanner();
staticFilePaths.forEach(function(filePath) {
var extraStaticFiles = staticFileScanner.scan([filePath], 10, staticFileFilter);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -6,8 +6,6 @@ var assert = require('assert');
var fs = require('fs');
var path = require('path');
var Promise = require('bluebird');
/**
* Publish hook for the JSDoc template. Writes to JSON stdout.
@@ -171,8 +169,6 @@ exports.publish = function(data, opts) {
return (symbol.name in augments || symbol.virtual);
});
return new Promise(function(resolve, reject) {
process.stdout.write(
JSON.stringify({
symbols: symbols,
@@ -180,8 +176,6 @@ exports.publish = function(data, opts) {
typedefs: typedefs,
externs: externs,
base: base
}, null, 2), resolve);
});
}, null, 2));
};

View File

@@ -11,7 +11,6 @@
}
.ol-scale-line {
background: #95b9e6;
background: rgba(0,60,136,0.3);
border-radius: 4px;
bottom: 8px;
@@ -20,9 +19,9 @@
position: absolute;
}
.ol-scale-line-inner {
border: 1px solid #eeeeee;
border: 1px solid #eee;
border-top: none;
color: #eeeeee;
color: #eee;
font-size: 10px;
text-align: center;
margin: 1px;
@@ -47,7 +46,6 @@
.ol-control {
position: absolute;
background-color: #eee;
background-color: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
@@ -95,7 +93,6 @@
height: 1.375em;
width: 1.375em;
line-height: .4em;
background-color: #7b98bc;
background-color: rgba(0,60,136,0.5);
border: none;
border-radius: 2px;
@@ -122,7 +119,6 @@
.ol-control button:hover,
.ol-control button:focus {
text-decoration: none;
background-color: #4c6079;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom .ol-zoom-in {

View File

@@ -10,3 +10,4 @@ layout: doc.hbs
* [Create Custom Builds](custom-builds.html)
* [Bundle Application and OpenLayers using Browserify](browserify.html)
* [Compile Application and OpenLayers together](closure.html)
* [Raster Reprojection](raster-reprojection.html)

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -0,0 +1,132 @@
---
title: Raster Reprojection
layout: doc.hbs
---
# Raster Reprojection
OpenLayers 3 has an ability to display raster data from WMS, WMTS, static images and many other sources in a different coordinate system than delivered from the server.
Transformation of the map projections of the image happens directly in a web browser.
The view in any Proj4js supported coordinate reference system is possible and previously incompatible layers can now be combined and overlaid.
# Usage
The API usage is very simple. Just specify proper projection (using [EPSG](http://epsg.io) code) on `ol.View`:
``` javascript
var map = new ol.Map({
target: 'map',
view: new ol.View({
projection: 'EPSG:3857', //HERE IS THE VIEW PROJECTION
center: [0, 0],
zoom: 2
}),
layers: [
new ol.layer.Tile({
source: new ol.source.TileWMS({
projection: 'EPSG:4326', //HERE IS THE DATA SOURCE PROJECTION
url: 'http://demo.boundlessgeo.com/geoserver/wms',
params: {
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
}
})
})
]
});
```
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
- [Raster reprojection demo](http://openlayers.org/en/master/examples/reprojection.html)
- [OpenStreetMap to WGS84 reprojection](http://openlayers.org/en/master/examples/reprojection-wgs84.html)
- [Reprojection with EPSG.io database search](http://openlayers.org/en/master/examples/reprojection-by-code.html)
- [Image reprojection](http://openlayers.org/en/master/examples/reprojection-image.html)
### 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.
Following example shows definition of a [British National Grid](http://epsg.io/27700):
``` html
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.12/proj4.js"></script>
```
``` javascript
proj4.defs('EPSG:27700', '+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 ' +
'+x_0=400000 +y_0=-100000 +ellps=airy ' +
'+towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 ' +
'+units=m +no_defs');
var proj27700 = ol.proj.get('EPSG:27700');
proj27700.setExtent([0, 0, 700000, 1300000]);
```
### Change of the view projection
To switch the projection used to display the map you have to set a new `ol.View` with selected projection on the `ol.Map`:
``` javascript
map.setView(new ol.View({
projection: 'EPSG:27700',
center: [400000, 650000],
zoom: 4
}));
```
## TileGrid and Extents
When reprojection is needed, new tiles (in the target projection) are under the hood created from the original source tiles.
The TileGrid of the reprojected tiles is by default internally constructed using `ol.tilegrid.getForProjection(projection)`.
The projection should have extent defined (see above) for this to work properly.
Alternatively, a custom target TileGrid can be constructed manually and set on the source instance using `ol.source.TileImage#setTileGridForProjection(projection, tilegrid)`.
This TileGrid will then be used when reprojecting to the specified projection instead of creating the default one.
In certain cases, this can be used to optimize performance (by tweaking tile sizes) or visual quality (by specifying resolutions).
# How it works
The reprojection process is based on triangles -- the target raster is divided into a limited number of triangles with vertices transformed using `ol.proj` capabilities ([proj4js](http://proj4js.org/) is usually utilized to define custom transformations).
The reprojection of pixels inside the triangle is approximated with an affine transformation (with rendering hardware-accelerated by the canvas 2d context):
<img src="raster-reprojection-resources/how-it-works.jpg" alt="How it works" width="600" />
This way we can support a wide range of projections from proj4js (or even custom transformation functions) on almost any hardware (with canvas 2d support) with a relatively small number of actual transformation calculations.
The precision of the reprojection is then limited by the number of triangles.
The reprojection process preserves transparency on the raster data supplied from the source (png or gif) and the gaps and no-data pixels generated by reprojection are automatically transparent.
###Dynamic triangulation
The above image above shows a noticeable error (especially on the edges) when the original image (left; EPSG:27700) is transformed with only a limited number of triangles (right; EPSG:3857).
The error can be minimized by increasing the number of triangles used.
Since some transformations require a more detail triangulation network, the dynamic triangulation process automatically measures reprojection error and iteratively subdivides to meet a specific error threshold:
<img src="raster-reprojection-resources/iterative-triangulation.png" alt="Iterative triangulation" width="600" />
For debugging, rendering of the reprojection edges can be enabled by `ol.source.TileImage#setRenderReprojectionEdges(true)`.
# Advanced
### Disabling reprojection
In case you are creating a custom build of OpenLayers and do not need the reprojection code, you can reduce the build size by setting `ol.ENABLE_RASTER_REPROJECTION` to `false`, which completely disables the reprojection support.
See [Custom builds](custom-builds.html#defines) tutorial on how to do this.
### Triangulation precision threshold
The default [triangulation error threshold](#dynamic-triangulation) in pixels is given by `ol.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD` (0.5 pixel).
In case a different threshold needs to be defined for different sources, the `reprojectionErrorThreshold` option can be passed when constructing the tile image source.
###Limiting visibility of reprojected map by extent
The reprojection algorithm uses inverse transformation (from *view projection* to *data projection*).
For certain coordinate systems this can result in a "double occurrence" of the source data on a map.
For example, when reprojecting a map of Switzerland from EPSG:21781 to EPSG:3857, it is displayed twice: once at the proper place in Europe, but also in the Pacific Ocean near New Zealand, on the opposite side of the globe.
<img src="raster-reprojection-resources/double-occurrence.jpg" alt="Double occurrence of a reprojected map" width="600" />
Although this is mathematically correct behavior of the inverse transformation, visibility of the layer on multiple places is not expected by users.
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.
Setting such a limit is demonstrated in the [reprojection demo example](http://openlayers.org/en/master/examples/reprojection.html).
### Resolution calculation
When determining source tiles to load, the ideal source resolution needs to be calculated.
The `ol.reproj.calculateSourceResolution(sourceProj, targetProj, targetCenter, targetResolution)` function calculates the ideal value in order to achieve pixel mapping as close as possible to 1:1 during reprojection, which is then used to select proper zoom level from the source.
It is, however, generally not practical to use the same source zoom level for the whole target zoom level -- different projections can have significantly different resolutions in different parts of the world (e.g. polar regions in EPSG:3857 vs EPSG:4326) and enforcing a single resolution for the whole zoom level would result in some tiles being scaled up/down, possibly requiring a huge number of source tiles to be loaded.
Therefore, the resolution mapping is calculated separately for each reprojected tile (in the middle of the tile extent).

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Accessibility example
title: Accessible Map
shortdesc: Example of an accessible map.
docs: >
This page's `map` element has its `tabindex` attribute set to `"0"`, that makes it focusable. To focus the map element you can either navigate to it using the "tab" key or use the skip link. When the `map` element is focused the + and - keys can be used to zoom in and out and the arrow keys can be used to pan.
@@ -10,11 +10,7 @@ docs: >
tags: "accessibility, tabindex"
---
<div class="row-fluid">
<div class="span12">
<a class="skiplink" href="#map">Go to map</a>
<div id="map" class="map" tabindex="0"></div>
<button id="zoom-out">Zoom out</button>
<button id="zoom-in">Zoom in</button>
</div>
</div>

View File

@@ -1,19 +1,13 @@
---
layout: example.html
title: Animation example
title: View Animation
shortdesc: Demonstrates animated pan, zoom, and rotation.
docs: >
This example shows how to use the beforeRender function on the Map to run one
or more animations.
tags: "animation"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<button id="rotate-left" title="Rotate clockwise"></button>
<button id="rotate-right" title="Rotate counterclockwise"></button>
<button id="rotate-around-rome">Rotate around Rome</button>
@@ -23,5 +17,3 @@ tags: "animation"
<button id="spin-to-rome">Spin to Rome</button>
<button id="fly-to-bern">Fly to Bern</button>
<button id="spiral-to-madrid">Spiral to Madrid</button>
</div>
</div>

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Tiled ArcGIS MapServer example
title: Tiled ArcGIS MapServer
shortdesc: Example of a tiled ArcGIS layer.
docs: >
This example shows how to use an ArcGIS REST MapService as tiles.
@@ -9,8 +9,4 @@ docs: >
<code>ol.source.XYZ</code> instead.
tags: arcgis, tile, tilelayer"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Attributions example
title: Attributions
shortdesc: Example of a attributions visibily change on map resize, to collapse them on small maps.
docs: >
When the map gets too small because of a resize, the attribution will be collapsed.
@@ -8,8 +8,4 @@ docs: >
of the map gets smaller than 600 pixels.
tags: "attributions, openstreetmap"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Bing Maps example
title: Bing Maps
shortdesc: Example of a Bing Maps layer.
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>
@@ -8,8 +8,6 @@ tags: "bing, bing-maps"
cloak:
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<select id="layer-select">
<option value="Aerial">Aerial</option>
@@ -18,5 +16,3 @@ cloak:
<option value="collinsBart">Collins Bart</option>
<option value="ordnanceSurvey">Ordnance Survey</option>
</select>
</div>
</div>

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Blend modes example
title: Blend Modes
shortdesc: Shows how to change the canvas compositing / blending mode in post- and precompose eventhandlers.
docs: >
<p>This example shows how to change the canvas compositing / blending mode in
@@ -20,13 +20,7 @@ docs: >
checkboxes.</p>
tags: "blendmode, blend-mode, blend mode, blendingmode, blending-mode, blending mode, composition, compositing, canvas, vector"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<form class="form-horizontal">
<label>
<select id="blend-mode" class="form-control">
@@ -72,5 +66,3 @@ tags: "blendmode, blend-mode, blend mode, blendingmode, blending-mode, blending
Blue circle affected
</label>
</form>
</div>
</div>

View File

@@ -1,20 +1,12 @@
---
layout: example.html
title: Box selection example
title: Box Selection
shortdesc: Using a DragBox interaction to select features.
docs: >
<p>This example shows how to use a <code>DragBox</code> interaction to select features. Selected features are added
to the feature overlay of a select interaction (<code>ol.interaction.Select</code>) for highlighting.</p>
<p>Use <code>Ctrl+drag</code> (<code>Meta+drag</code> on Mac) to draw boxes.</p>
<p>Use <code>Ctrl+Drag</code> (<code>Command+Drag</code> on Mac) to draw boxes.</p>
tags: "DragBox, feature, selection, box"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
<div class="span4 offset4 pull-right">
<div id="info" class="alert alert-success">
&nbsp;
</div>
</div>
</div>
<div id="info">No countries selected</div>

View File

@@ -1,4 +1,3 @@
.tooltip-inner {
white-space: nowrap;
}

View File

@@ -1,13 +1,13 @@
---
layout: example.html
title: Custom tooltips example
title: Custom Tooltips
shortdesc: This example shows how to customize the buttons tooltips with Bootstrap.
docs: >
This example shows how to customize the buttons tooltips with <a href="http://getbootstrap.com/javascript/#tooltips">Bootstrap</a>.
tags: "custom, tooltip"
resources:
- https://code.jquery.com/jquery-1.11.2.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Canvas tiles example
title: Canvas Tiles
shortdesc: Renders tiles with coordinates for debugging.
docs: >
The black grid tiles are generated on the client with an HTML5 canvas. The
@@ -10,8 +10,4 @@ docs: >
`-y - 1`.
tags: "layers, openstreetmap, canvas"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Advanced View Positioning example
title: Advanced View Positioning
shortdesc: This example demonstrates how a map's view can be adjusted so a geometry or coordinate is positioned at a specific pixel location.
docs: >
This example demonstrates how a map's view can be
@@ -10,11 +10,10 @@ docs: >
is used to fit a geometry in the view with the same padding. The
view's <code>centerOn</code> method is used to position a coordinate (Lausanne)
at a specific pixel location (the center of the black box).
<p>Use <code>Alt</code>+<code>Shift</code>+drag to rotate the map.</p>
<p>Use <code>Alt+Shift+Drag</code> to rotate the map.</p>
tags: "center, rotation, openstreetmap"
---
<div class="row-fluid">
<div class="span12 mapcontainer">
<div class="mapcontainer">
<div id="map" class="map"></div>
<div class="padding-top"></div>
<div class="padding-left"></div>
@@ -22,13 +21,8 @@ tags: "center, rotation, openstreetmap"
<div class="padding-bottom"></div>
<div class="center"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<button id="zoomtoswitzerlandbest">Zoom to Switzerland</button> (best fit),<br/>
<button id="zoomtoswitzerlandconstrained">Zoom to Switzerland</button> (respect resolution constraint).<br/>
<button id="zoomtoswitzerlandnearest">Zoom to Switzerland</button> (nearest),<br/>
<button id="zoomtolausanne">Zoom to Lausanne</button> (with min resolution),<br/>
<button id="centerlausanne">Center on Lausanne</button>
</div>
</div>

View File

@@ -1,13 +1,9 @@
---
layout: example.html
title: Clustering example
title: Clustered Features
shortdesc: Example of using <code>ol.source.Cluster</code>.
docs: >
This example shows how to do clustering on point features.
tags: "cluster, vector"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -38,7 +38,7 @@ var clusters = new ol.layer.Vector({
var size = feature.get('features').length;
var style = styleCache[size];
if (!style) {
style = [new ol.style.Style({
style = new ol.style.Style({
image: new ol.style.Circle({
radius: 10,
stroke: new ol.style.Stroke({
@@ -54,7 +54,7 @@ var clusters = new ol.layer.Vector({
color: '#fff'
})
})
})];
});
styleCache[size] = style;
}
return style;

View File

@@ -1,13 +1,11 @@
---
layout: example.html
title: Manipulating colors with a raster source
title: Color Manipulation
shortdesc: Demonstrates color manipulation with a raster source.
docs: >
A raster source allows arbitrary manipulation of pixel values. In this example, RGB values on the input tile source are adjusted in a pixel-wise operation before being rendered with a second raster source. The raster operation takes pixels in in RGB space, converts them to HCL color space, adjusts the values based on the controls above, and then converts them back to RGB space for rendering.
tags: "color, hue, lightness, chroma"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<table class="controls">
<tr>
@@ -26,5 +24,3 @@ tags: "color, hue, lightness, chroma"
<td><input id="lightness" type="range" min="0" max="100" value="100"/></td>
</tr>
</table>
</div>
</div>

View File

@@ -1,13 +1,9 @@
---
layout: example.html
title: Custom control example
title: Custom Controls
shortdesc: Shows how to create custom controls.
docs: >
This example creates a "rotate to north" button.
tags: "custom, control"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -75,7 +75,7 @@ var map = new ol.Map({
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 2,
zoom: 3,
rotation: 1
})
});

View File

@@ -1,14 +1,10 @@
---
layout: example.html
title: Custom interaction example
title: Custom Interactions
shortdesc: Example of a custom interaction.
docs: >
This example demonstrates creating a custom interaction by subclassing `ol.interaction.Pointer`.
Note that the built in interaction `ol.interaction.Translate` might be a better option for moving features.
tags: "drag, feature, vector, editing, custom, interaction"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -19,8 +19,7 @@ goog.require('ol.style.Style');
/**
* Define a namespace for the application.
*/
window.app = {};
var app = window.app;
var app = {};

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: d3 integration example
title: d3 Integration
shortdesc: Example of using ol3 and d3 together.
docs: >
<p>The example loads TopoJSON geometries and uses d3 (<code>d3.geo.path</code>) to render these geometries to a canvas element that is then used as the image of an ol3 image layer.</p>
@@ -9,8 +9,4 @@ resources:
- http://d3js.org/d3.v3.min.js
- http://d3js.org/topojson.v1.min.js
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

1
examples/d3.js vendored
View File

@@ -1,5 +1,4 @@
// NOCOMPILE
// this example uses d3 for which we don't have an externs file.
goog.require('ol');
goog.require('ol.Map');
goog.require('ol.View');

File diff suppressed because one or more lines are too long

View File

@@ -1,23 +1,19 @@
---
layout: example.html
title: Device-Orientation example
title: Device Orientation
shortdesc: Listen to DeviceOrientation events.
docs: >
This example shows how to track changes in device orientation.
tags: "orientation, openstreetmap"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<div class="span12">
<h4 id="title">Device orientation example</h4>
<label class="checkbox" for="track">
<input id="track" type="checkbox"/>track changes
<label>
track changes
<input id="track" type="checkbox"/>
</label>
<p>&alpha; : <code id="alpha"></code></p>
<p>&beta; : <code id="beta"></code></p>
<p>&gamma; : <code id="gamma"></code></p>
<p>heading : <code id="heading"></code></p>
</div>
</div>
</div>
<p>
α : <code id="alpha"></code>&nbsp;&nbsp;
β : <code id="beta"></code>&nbsp;&nbsp;
γ : <code id="gamma"></code>&nbsp;&nbsp;
heading : <code id="heading"></code>
</p>

View File

@@ -1,21 +1,12 @@
---
layout: example.html
title: Drag-and-Drop image vector example
shortdesc: 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.
title: Drag-and-Drop Image Vector
shortdesc: Example of using the drag-and-drop interaction with a ol.source.ImageVector.
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"
cloak:
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<div class="span4 offset4 pull-right">
<div id="info" class="alert alert-success">
&nbsp;
</div>
</div>
</div>
</div>
<div id="info">&nbsp;</div>

View File

@@ -19,7 +19,7 @@ goog.require('ol.style.Style');
var defaultStyle = {
'Point': [new ol.style.Style({
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: 'rgba(255,255,0,0.5)'
@@ -30,14 +30,14 @@ var defaultStyle = {
width: 1
})
})
})],
'LineString': [new ol.style.Style({
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#f00',
width: 3
})
})],
'Polygon': [new ol.style.Style({
}),
'Polygon': new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(0,255,255,0.5)'
}),
@@ -45,8 +45,8 @@ var defaultStyle = {
color: '#0ff',
width: 1
})
})],
'MultiPoint': [new ol.style.Style({
}),
'MultiPoint': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: 'rgba(255,0,255,0.5)'
@@ -57,14 +57,14 @@ var defaultStyle = {
width: 1
})
})
})],
'MultiLineString': [new ol.style.Style({
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#0f0',
width: 3
})
})],
'MultiPolygon': [new ol.style.Style({
}),
'MultiPolygon': new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(0,0,255,0.5)'
}),
@@ -72,7 +72,7 @@ var defaultStyle = {
color: '#00f',
width: 1
})
})]
})
};
var styleFunction = function(feature, resolution) {

View File

@@ -1,21 +1,12 @@
---
layout: example.html
title: Drag-and-Drop example
shortdesc: 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.
title: Drag-and-Drop
shortdesc: Example of using the drag-and-drop interaction.
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"
cloak:
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<div class="span4 offset4 pull-right">
<div id="info" class="alert alert-success">
&nbsp;
</div>
</div>
</div>
</div>
<div id="info">&nbsp;</div>

View File

@@ -18,7 +18,7 @@ goog.require('ol.style.Style');
var defaultStyle = {
'Point': [new ol.style.Style({
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: 'rgba(255,255,0,0.5)'
@@ -29,14 +29,14 @@ var defaultStyle = {
width: 1
})
})
})],
'LineString': [new ol.style.Style({
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#f00',
width: 3
})
})],
'Polygon': [new ol.style.Style({
}),
'Polygon': new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(0,255,255,0.5)'
}),
@@ -44,8 +44,8 @@ var defaultStyle = {
color: '#0ff',
width: 1
})
})],
'MultiPoint': [new ol.style.Style({
}),
'MultiPoint': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: 'rgba(255,0,255,0.5)'
@@ -56,14 +56,14 @@ var defaultStyle = {
width: 1
})
})
})],
'MultiLineString': [new ol.style.Style({
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#0f0',
width: 3
})
})],
'MultiPolygon': [new ol.style.Style({
}),
'MultiPolygon': new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(0,0,255,0.5)'
}),
@@ -71,7 +71,7 @@ var defaultStyle = {
color: '#00f',
width: 1
})
})]
})
};
var styleFunction = function(feature, resolution) {

View File

@@ -1,13 +1,9 @@
---
layout: example.html
title: Drag rotate and zoom example
title: Drag, Rotate, and Zoom
shortdesc: A single interaction to drag, rotate, and zoom.
docs: >
<p><code>Shift</code> + Drag to rotate and zoom the map around its center.</p>
<p><code>Shift+Drag</code> to rotate and zoom the map around its center.</p>
tags: "drag, rotate, zoom, interaction"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -1,15 +1,12 @@
---
layout: example.html
title: Draw and modify features example
title: Draw and Modify Features
shortdesc: Example of using the ol.interaction.Draw interaction together with the ol.interaction.Modify interaction.
docs: >
Example of using the ol.interaction.Draw interaction together with the ol.interaction.Modify interaction.
tags: "draw, edit, modify, vector, featureoverlay"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
<form class="form-inline">
<label>Geometry type &nbsp;</label>
<select id="type">
@@ -18,4 +15,3 @@ tags: "draw, edit, modify, vector, featureoverlay"
<option value="Polygon">Polygon</option>
</select>
</form>
</div>

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Draw features example
title: Draw Features
shortdesc: Example of using the ol.interaction.Draw interaction.
docs: >
Example of using the Draw interaction. Select a geometry type from the
@@ -12,20 +12,16 @@ docs: >
points and creates a rectangular box.
tags: "draw, edit, freehand, vector"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<form class="form-inline">
<label>Geometry type &nbsp;</label>
<select id="type">
<option value="None">None</option>
<option value="Point">Point</option>
<option value="LineString">LineString</option>
<option value="Polygon">Polygon</option>
<option value="Circle">Circle</option>
<option value="Square">Square</option>
<option value="Box">Box</option>
<option value="None">None</option>
</select>
</form>
</div>
</div>

View File

@@ -1,13 +1,9 @@
---
layout: example.html
title: Dynamic data example
title: Dynamic Data
shortdesc: Example of dynamic data.
docs: >
Example of dynamic data.
tags: "dynamic-data"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -9,8 +9,4 @@ docs: >
<p>To achieve this, we make heavy use of style functions and <code>ol.style.Style#geometry</code>.</p>
tags: "KML, vector, style, geometry, cluster"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -84,7 +84,7 @@ function styleFunction(feature, resolution) {
var style;
var size = feature.get('features').length;
if (size > 1) {
style = [new ol.style.Style({
style = new ol.style.Style({
image: new ol.style.Circle({
radius: feature.get('radius'),
fill: new ol.style.Fill({
@@ -96,10 +96,10 @@ function styleFunction(feature, resolution) {
fill: textFill,
stroke: textStroke
})
})];
});
} else {
var originalFeature = feature.get('features')[0];
style = [createEarthquakeStyle(originalFeature)];
style = createEarthquakeStyle(originalFeature);
}
return style;
}

View File

@@ -0,0 +1,9 @@
---
layout: example.html
title: Earthquakes with custom symbols
shortdesc: Demonstrates the use of `ol.render.toCanvas` to create custom icon symbols.
docs: >
This example parses a KML file and renders the features as a vector layer. The layer is given a <code>style</code> that renders earthquake locations with a custom lightning symbol and a size relative to their magnitude.
tags: "KML, vector, style, canvas, symbol"
---
<div id="map" class="map"></div>

View File

@@ -0,0 +1,71 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.format.KML');
goog.require('ol.geom.Polygon');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.render');
goog.require('ol.source.Stamen');
goog.require('ol.source.Vector');
goog.require('ol.style.Fill');
goog.require('ol.style.Icon');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var styleCache = {};
var styleFunction = function(feature, resolution) {
// 2012_Earthquakes_Mag5.kml stores the magnitude of each earthquake in a
// standards-violating <magnitude> tag in each Placemark. We extract it from
// the Placemark's name instead.
var name = feature.get('name');
var magnitude = parseFloat(name.substr(2));
var size = parseInt(10 + 40 * (magnitude - 5), 10);
var style = styleCache[size];
if (!style) {
var canvas =
/** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
var render = ol.render.toContext(
/** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')),
{size: [size + 2, size + 2], pixelRatio: size / 10});
render.setFillStrokeStyle(
new ol.style.Fill({ color: 'rgba(255, 153, 0, 0.4)' }),
new ol.style.Stroke({ color: 'rgba(255, 204, 0, 0.2)', width: 1 }));
render.drawPolygonGeometry(new ol.geom.Polygon(
[[[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]]]));
style = new ol.style.Style({
image: new ol.style.Icon({
img: canvas,
imgSize: [canvas.width, canvas.height],
rotation: 1.2
})
});
styleCache[size] = style;
}
return style;
};
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
url: 'data/kml/2012_Earthquakes_Mag5.kml',
format: new ol.format.KML({
extractStyles: false
})
}),
style: styleFunction
});
var raster = new ol.layer.Tile({
source: new ol.source.Stamen({
layer: 'toner'
})
});
var map = new ol.Map({
layers: [raster, vector],
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 2
})
});

View File

@@ -1,13 +1,9 @@
---
layout: example.html
title: EPSG:4326 example
title: EPSG:4326
shortdesc: Example of a map in EPSG:4326.
docs: >
This example shows how to create a map in EPSG:4326.
tags: "epsg4326"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -1,18 +1,14 @@
---
layout: example.html
title: Export map example
title: Map Export
shortdesc: Example of exporting a map as a PNG image.
docs: >
Example of exporting a map as a PNG image.
tags: "export, png, openstreetmap"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<div id="no-download" class="alert alert-danger" style="display: none">
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> Export PNG</a>
</div>
</div>
<a id="export-png" class="btn btn-default" download="map.png"><i class="fa fa-download"></i> Download PNG</a>

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Feature animation example
title: Custom Animation
shortdesc: Demonstrates how to animate features.
docs: >
This example shows how to use <b>postcompose</b> and <b>vectorContext</b> to
@@ -8,8 +8,4 @@ docs: >
is added to the layer.
tags: "animation, vector, feature, flash"
---
<div class="row">
<div class="span8">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -83,7 +83,7 @@ function flash(feature) {
return;
}
// tell OL3 to continue postcompose animation
frameState.animate = true;
map.render();
}
listenerKey = map.on('postcompose', animate);
}

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Animate a feature movement
title: Marker Animation
shortdesc: Demonstrates how to move a feature along a line.
docs: >
This example shows how to use <b>postcompose</b> and <b>vectorContext</b> to
@@ -8,17 +8,9 @@ docs: >
is being used.
tags: "animation, feature, postcompose, polyline"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<label for="speed">
speed:&nbsp;
<input id="speed" type="range" min="10" max="999" step="10" value="60">
</label>
<button id="start-animation">Start Animation</button>
</div>
</div>

View File

@@ -115,9 +115,9 @@ var vectorLayer = new ol.layer.Vector({
style: function(feature, resolution) {
// hide geoMarker if animation is active
if (animating && feature.get('type') === 'geoMarker') {
return [];
return null;
}
return [styles[feature.get('type')]];
return styles[feature.get('type')];
}
});

View File

@@ -0,0 +1,17 @@
---
layout: example.html
title: Flight Animation
shortdesc: Demonstrates how to animate flights with ´postcompose´.
docs: >
This example shows how to use <b>postcompose</b> and <b>vectorContext</b> to
animate flights. A great circle arc between two airports is calculated using
<a href="https://github.com/springmeyer/arc.js">arc.js</a> and then the flight
paths are animated with <b>postcompose</b>. The flight data is provided by
<a href="http://openflights.org/data.html">OpenFlights</a> (a simplified data
set from the <a href="https://www.mapbox.com/mapbox.js/example/v1.0.0/animating-flight-paths/">
Mapbox.js documentation</a> is used).
tags: "animation, vector, feature, flights, arc"
resources:
- https://api.mapbox.com/mapbox.js/plugins/arc.js/v0.1.0/arc.js
---
<div id="map" class="map"></div>

View File

@@ -0,0 +1,129 @@
// NOCOMPILE
goog.require('ol.Attribution');
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.LineString');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.proj');
goog.require('ol.source.Stamen');
goog.require('ol.source.Vector');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.Stamen({
layer: 'toner'
})
})
],
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 2
})
});
var defaultStroke = new ol.style.Stroke({
color: '#EAE911',
width: 2
});
var defaultStyle = new ol.style.Style({
stroke: defaultStroke
});
var pointsPerMs = 0.1;
var animateFlights = function(event) {
var vectorContext = event.vectorContext;
var frameState = event.frameState;
vectorContext.setFillStrokeStyle(null, defaultStroke);
var features = flightsSource.getFeatures();
for (var i = 0; i < features.length; i++) {
var feature = features[i];
if (!feature.get('finished')) {
// only draw the lines for which the animation has not
// finished yet
var coords = feature.getGeometry().getCoordinates();
var elapsedTime = frameState.time - feature.get('start');
var elapsedPoints = elapsedTime * pointsPerMs;
if (elapsedPoints >= coords.length) {
feature.set('finished', true);
}
var maxIndex = Math.min(elapsedPoints, coords.length);
var currentLine = new ol.geom.LineString(coords.slice(0, maxIndex));
// directly draw the line with the vector context
vectorContext.drawLineStringGeometry(currentLine, feature);
}
}
// tell OL3 to continue the postcompose animation
map.render();
};
var addLater = function(feature, timeout) {
window.setTimeout(function() {
feature.set('start', new Date().getTime());
flightsSource.addFeature(feature);
}, timeout);
};
var flightsSource = new ol.source.Vector({
wrapX: false,
attributions: [new ol.Attribution({
html: 'Flight data by ' +
'<a href="http://openflights.org/data.html">OpenFlights</a>,'
})],
loader: function(extent, resolution, projection) {
var url = 'data/openflights/flights.json';
fetch(url).then(function(response) {
return response.json();
}).then(function(json) {
var flightsData = json.flights;
for (var i = 0; i < flightsData.length; i++) {
var flight = flightsData[i];
var from = flight[0];
var to = flight[1];
// create an arc circle between the two locations
var arcGenerator = new arc.GreatCircle(
{x: from[1], y: from[0]},
{x: to[1], y: to[0]});
var arcLine = arcGenerator.Arc(100, {offset: 10});
if (arcLine.geometries.length === 1) {
var line = new ol.geom.LineString(arcLine.geometries[0].coords);
line.transform(ol.proj.get('EPSG:4326'), ol.proj.get('EPSG:3857'));
var feature = new ol.Feature({
geometry: line,
finished: false
});
// add the feature with a delay so that the animation
// for all features does not start at the same time
addLater(feature, i * 50);
}
}
map.on('postcompose', animateFlights);
});
}
});
var flightsLayer = new ol.layer.Vector({
source: flightsSource,
style: function(feature, resolution) {
// if the animation is still active for a feature, do not
// render the feature with the layer style
if (feature.get('finished')) {
return defaultStyle;
} else {
return null;
}
}
});
map.addLayer(flightsLayer);

View File

@@ -1,18 +1,14 @@
---
layout: example.html
title: Fractal Example
title: Fractal Rendering
shortdesc: Example of a fractal.
docs: >
Example of a fractal.
This example demonstrates how features with many vertices can be efficiently rendered.
tags: "fractal, vector"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<label for="depth">
depth:&nbsp;
<input id="depth" type="range" min="0" max="9" step="1" value="5">
&nbsp;(<span id="count">#</span> points)
</label>
</div>
</div>

View File

@@ -1,16 +1,12 @@
---
layout: example.html
title: Full screen drag rotate and zoom example
title: Full Screen Drag, Rotate, and Zoom
shortdesc: Example of drag rotate and zoom control with full screen effect.
docs: >
<p>Hold down <code>Shift</code> + drag to rotate and zoom. Click the button in the top right corner to go full screen. Then do the <code>Shift</code> + drag thing again.</p>
<p>Hold down <code>Shift+Drag</code> to rotate and zoom. Click the button in the top right corner to go full screen. Then do the <code>Shift+Drag</code> thing again.</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"
cloak:
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Full screen control example
title: Full Screen Control
shortdesc: Example of a full screen control.
docs: >
<p>Click the control in the top right corner to go full screen. Click it again to exit full screen.</p>
@@ -9,8 +9,4 @@ tags: "full-screen, bing, bing-maps"
cloak:
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -1,13 +1,9 @@
---
layout: example.html
title: GeoJSON example
title: GeoJSON
shortdesc: Example of GeoJSON features.
docs: >
Example of GeoJSON features.
tags: "geojson, vector, openstreetmap"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -21,25 +21,25 @@ var image = new ol.style.Circle({
});
var styles = {
'Point': [new ol.style.Style({
'Point': new ol.style.Style({
image: image
})],
'LineString': [new ol.style.Style({
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'green',
width: 1
})
})],
'MultiLineString': [new ol.style.Style({
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'green',
width: 1
})
})],
'MultiPoint': [new ol.style.Style({
}),
'MultiPoint': new ol.style.Style({
image: image
})],
'MultiPolygon': [new ol.style.Style({
}),
'MultiPolygon': new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'yellow',
width: 1
@@ -47,8 +47,8 @@ var styles = {
fill: new ol.style.Fill({
color: 'rgba(255, 255, 0, 0.1)'
})
})],
'Polygon': [new ol.style.Style({
}),
'Polygon': new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'blue',
lineDash: [4],
@@ -57,8 +57,8 @@ var styles = {
fill: new ol.style.Fill({
color: 'rgba(0, 0, 255, 0.1)'
})
})],
'GeometryCollection': [new ol.style.Style({
}),
'GeometryCollection': new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'magenta',
width: 2
@@ -73,8 +73,8 @@ var styles = {
color: 'magenta'
})
})
})],
'Circle': [new ol.style.Style({
}),
'Circle': new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'red',
width: 2
@@ -82,7 +82,7 @@ var styles = {
fill: new ol.style.Fill({
color: 'rgba(255,0,0,0.2)'
})
})]
})
};
var styleFunction = function(feature, resolution) {

View File

@@ -1,24 +1,21 @@
---
layout: example.html
title: Geolocation example
shortdesc: Example of a geolocation map.
title: Geolocation
shortdesc: Using geolocation to control a map view.
docs: >
Example of a geolocation map.
This example uses the Geolocation API to control the view.
tags: "geolocation, openstreetmap"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<div class="span4 pull-right">
<div id="info" class="alert alert-danger" style="display: none;"></div>
</div>
<label class="checkbox" for="track">
<input id="track" type="checkbox"/>track position
<div id="info" style="display: none;"></div>
<label for="track">
track position
<input id="track" type="checkbox"/>
</label>
<p>position accuracy : <code id="accuracy"></code></p>
<p>altitude : <code id="altitude"></code></p>
<p>altitude accuracy : <code id="altitudeAccuracy"></code></p>
<p>heading : <code id="heading"></code></p>
<p>speed : <code id="speed"></code></p>
</div>
</div>
<p>
position accuracy : <code id="accuracy"></code>&nbsp;&nbsp;
altitude : <code id="altitude"></code>&nbsp;&nbsp;
altitude accuracy : <code id="altitudeAccuracy"></code>&nbsp;&nbsp;
heading : <code id="heading"></code>&nbsp;&nbsp;
speed : <code id="speed"></code>
</p>

View File

@@ -1,20 +1,10 @@
---
layout: example.html
title: GetFeatureInfo example (image layer)
shortdesc: This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS image layer.
title: WMS GetFeatureInfo (Image Layer)
shortdesc: Using an image WMS source with GetFeatureInfo requests
docs: >
<p>Additionally <code>map.forEachLayerAtPixel</code> is used to change the mouse pointer when hovering a non-transparent pixel on the map.</p>
This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS image layer. Additionally <code>map.forEachLayerAtPixel</code> is used to change the mouse pointer when hovering a non-transparent pixel on the map.
tags: "getfeatureinfo, forEachLayerAtPixel"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span4 offset4 iframe-info">
<div id="info" class="alert alert-success">
&nbsp;
</div>
</div>
</div>
<div id="info">&nbsp;</div>

View File

@@ -8,7 +8,7 @@ var wmsSource = new ol.source.ImageWMS({
url: 'http://demo.boundlessgeo.com/geoserver/wms',
params: {'LAYERS': 'ne:ne'},
serverType: 'geoserver',
crossOrigin: ''
crossOrigin: 'anonymous'
});
var wmsLayer = new ol.layer.Image({

View File

@@ -1,20 +1,10 @@
---
layout: example.html
title: WMS GetFeatureInfo example (tile layer)
shortdesc: This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS tile layer.
title: WMS GetFeatureInfo (Tile Layer)
shortdesc: Issuing GetFeatureInfo requests with a WMS tiled source
docs: >
<p>Additionally <code>map.forEachLayerAtPixel</code> is used to change the mouse pointer when hovering a non-transparent pixel on the map.</p>
This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS tile layer. Additionally <code>map.forEachLayerAtPixel</code> is used to change the mouse pointer when hovering a non-transparent pixel on the map.
tags: "getfeatureinfo, forEachLayerAtPixel"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span4 offset4 iframe-info">
<div id="info" class="alert alert-success">
&nbsp;
</div>
</div>
</div>
<div id="info">&nbsp;</div>

View File

@@ -8,7 +8,7 @@ var wmsSource = new ol.source.TileWMS({
url: 'http://demo.boundlessgeo.com/geoserver/wms',
params: {'LAYERS': 'ne:ne'},
serverType: 'geoserver',
crossOrigin: ''
crossOrigin: 'anonymous'
});
var wmsLayer = new ol.layer.Tile({

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: GPX example
title: GPX Data
shortdesc: Example of using the GPX source.
docs: >
Example of using the GPX source.
@@ -8,13 +8,5 @@ tags: "GPX"
cloak:
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<div class="span4 offset4 pull-right">
<div id="info" class="alert alert-success">
&nbsp;
</div>
</div>
</div>
</div>
<div id="info">&nbsp;</div>

View File

@@ -21,7 +21,7 @@ var raster = new ol.layer.Tile({
});
var style = {
'Point': [new ol.style.Style({
'Point': new ol.style.Style({
image: new ol.style.Circle({
fill: new ol.style.Fill({
color: 'rgba(255,255,0,0.4)'
@@ -32,19 +32,19 @@ var style = {
width: 1
})
})
})],
'LineString': [new ol.style.Style({
}),
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#f00',
width: 3
})
})],
'MultiLineString': [new ol.style.Style({
}),
'MultiLineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#0f0',
width: 3
})
})]
})
};
var vector = new ol.layer.Vector({

View File

@@ -1,13 +1,9 @@
---
layout: example.html
title: Graticule example
title: Map Graticule
shortdesc: This example shows how to add a graticule overlay to a map.
docs: >
This example shows how to add a graticule overlay to a map.
tags: "graticule"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -1,21 +1,15 @@
---
layout: example.html
title: Earthquakes heatmap
title: Earthquakes Heatmap
shortdesc: Demonstrates the use of a heatmap layer.
docs: >
This example parses a KML file and renders the features as a <code>ol.layer.Heatmap</code> layer.
tags: "heatmap, kml, vector, style"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
<div class="span4">
<form>
<label>radius size</label>
<input id="radius" type="range" min="1" max="50" step="1" value="5"/>
<label>blur size</label>
<input id="blur" type="range" min="1" max="50" step="1" value="15"/>
</form>
</div>
</div>

View File

@@ -0,0 +1,9 @@
---
layout: example.html
title: Icon Pixel Operations
shortdesc: Canvas pixel operations on a point icon.
docs: >
Example using an icon to symbolize a point. Click on the icon to select it, and it will be rendered using its negative image.
tags: "vector, style, icon, marker, canvas, select"
---
<div id="map" class="map"></div>

71
examples/icon-negative.js Normal file
View File

@@ -0,0 +1,71 @@
goog.require('ol.Feature');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.geom.Point');
goog.require('ol.interaction.Select');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.Stamen');
goog.require('ol.source.Vector');
goog.require('ol.style.Icon');
goog.require('ol.style.Style');
function createStyle(src, img) {
return new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 0.96],
src: src,
img: img,
imgSize: img ? [img.width, img.height] : undefined
}))
});
}
var iconFeature = new ol.Feature(new ol.geom.Point([0, 0]));
iconFeature.set('style', createStyle('data/icon.png', undefined));
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.Stamen({ layer: 'watercolor' })
}),
new ol.layer.Vector({
style: function(feature) { return feature.get('style'); },
source: new ol.source.Vector({ features: [iconFeature] })
})
],
target: document.getElementById('map'),
view: new ol.View({
center: [0, 0],
zoom: 3
})
});
var selectStyle = {};
var select = new ol.interaction.Select({
style: function(feature, resolution) {
var image = feature.get('style').getImage().getImage();
if (!selectStyle[image.src]) {
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
canvas.width = image.width;
canvas.height = image.height;
context.drawImage(image, 0, 0, image.width, image.height);
var imageData = context.getImageData(0, 0, canvas.width, canvas.height);
var data = imageData.data;
for (var i = 0, ii = data.length; i < ii; i = i + (i % 4 == 2 ? 2 : 1)) {
data[i] = 255 - data[i];
}
context.putImageData(imageData, 0, 0);
selectStyle[image.src] = createStyle(undefined, canvas);
}
return selectStyle[image.src];
}
});
map.addInteraction(select);
map.on('pointermove', function(evt) {
map.getTargetElement().style.cursor =
map.hasFeatureAtPixel(evt.pixel) ? 'pointer' : '';
});

View File

@@ -1,18 +1,10 @@
---
layout: example.html
title: Icon sprites with WebGL example
title: Icon Sprites with WebGL
shortdesc: Icon sprite with WebGL
docs: >
<p>In this example a sprite image is used for the icon styles. Using a sprite is required to get good performance with WebGL.</p>
tags: "webgl, icon, sprite, vector, point"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<div class="span2 offset2 pull-right">
<div id="info" class="alert alert-success">
&nbsp;
</div>
</div>
</div>
</div>
<div id="info">&nbsp;</div>

View File

@@ -1,13 +1,13 @@
---
layout: example.html
title: Vector Icon Example
title: Icon Symbolizer
shortdesc: Example using an icon to symbolize a point.
docs: >
Example using an icon to symbolize a point.
tags: "vector, style, icon, marker, popup"
resources:
- https://code.jquery.com/jquery-1.11.2.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"><div id="popup"></div></div>
</div>
</div>

View File

@@ -1,19 +1,11 @@
---
layout: example.html
title: IGC example
title: IGC Data
shortdesc: Example of tracks recorded from multiple paraglider flights on the same day, read from an IGC file.
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>
tags: "complex-geometry, closest-feature, igc, opencyclemap"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<input id="time" type="range" value="0" steps="1" />
<div class="span4 offset4 pull-right">
<div id="info" class="alert alert-success">
&nbsp;
</div>
</div>
</div>
</div>
<div id="info">&nbsp;</div>

View File

@@ -27,17 +27,17 @@ var colors = {
var styleCache = {};
var styleFunction = function(feature, resolution) {
var color = colors[feature.get('PLT')];
var styleArray = styleCache[color];
if (!styleArray) {
styleArray = [new ol.style.Style({
var style = styleCache[color];
if (!style) {
style = new ol.style.Style({
stroke: new ol.style.Stroke({
color: color,
width: 3
})
})];
styleCache[color] = styleArray;
});
styleCache[color] = style;
}
return styleArray;
return style;
};
var vectorSource = new ol.source.Vector();

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Image Filter Example
title: Image Filters
shortdesc: Apply a filter to imagery
docs: >
<p>Layer rendering can be manipulated in <code>precompose</code> and <code>postcompose</code> event listeners.
@@ -10,11 +10,7 @@ tags: "filter, image manipulation"
cloak:
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<select id="kernel" name="kernel">
<option>none</option>
<option selected>sharpen</option>

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Image load events example
title: Image Load Events
shortdesc: Example using image load events.
docs: >
<p>Image sources fire events related to image loading. You can
@@ -10,9 +10,7 @@ docs: >
renders an image loading progress bar at the bottom of the map.</p>
tags: "image, events, loading"
---
<div class="row-fluid">
<div class="span12 wrapper">
<div class="wrapper">
<div id="map" class="map"></div>
<div id="progress"></div>
</div>
</div>

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Image vector layer example
title: Image Vector Layer
shortdesc: Example of an image vector layer.
docs: >
<p>This example uses a <code>ol.source.ImageVector</code> source. That source gets vector features from the
@@ -8,13 +8,5 @@ docs: >
is then used as the image of an image layer.</p>
tags: "vector, image"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<div class="span4 pull-right">
<div id="info" class="alert alert-success">
&nbsp;
</div>
</div>
</div>
</div>
<div id="info">&nbsp;</div>

View File

@@ -1,19 +1,13 @@
---
layout: example.html
title: JSTS Example
title: JSTS Integration
shortdesc: Example on how to use JSTS with OpenLayers 3.
docs: >
Example showing the integration of <a href="https://github.com/bjornharrtell/jsts">JSTS</a>
with OpenLayers 3.
tags: "vector, jsts, buffer"
resources:
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/lib/0.16.0/javascript.util.min.js
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/lib/0.16.0/jsts.min.js
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/lib/0.17.0/javascript.util.min.js
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/lib/0.17.0/jsts.min.js
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -12,10 +12,11 @@ goog.require('ol.source.Vector');
var source = new ol.source.Vector();
$.ajax('data/geojson/roads-seoul.geojson').then(function(response) {
fetch('data/geojson/roads-seoul.geojson').then(function(response) {
return response.json();
}).then(function(json) {
var format = new ol.format.GeoJSON();
var features = format.readFeatures(response,
{featureProjection: 'EPSG:3857'});
var features = format.readFeatures(json, {featureProjection: 'EPSG:3857'});
var parser = new jsts.io.olParser();

View File

@@ -5,9 +5,9 @@ shortdesc: Demonstrates the use of a Shape symbolizer to render earthquake locat
docs: >
This example parses a KML file and renders the features as a vector layer. The layer is given a <code>style</code> that renders earthquake locations with a size relative to their magnitude.
tags: "KML, vector, style, tooltip"
resources:
- https://code.jquery.com/jquery-1.11.2.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"><div id="info"></div></div>
</div>
</div>

View File

@@ -21,7 +21,7 @@ var styleFunction = function(feature, resolution) {
var radius = 5 + 20 * (magnitude - 5);
var style = styleCache[radius];
if (!style) {
style = [new ol.style.Style({
style = new ol.style.Style({
image: new ol.style.Circle({
radius: radius,
fill: new ol.style.Fill({
@@ -32,7 +32,7 @@ var styleFunction = function(feature, resolution) {
width: 1
})
})
})];
});
styleCache[radius] = style;
}
return style;

View File

@@ -6,9 +6,9 @@ docs: >
This example parses a KML file and renders the features as a vector layer. The layer is given a <code>ol.style.Style</code> that fills timezones
yellow with an opacity calculated based on the current offset to local noon.
tags: "KML, vector, style"
resources:
- https://code.jquery.com/jquery-1.11.2.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"><div id="info"></div></div>
</div>
</div>

View File

@@ -35,14 +35,14 @@ var styleFunction = function(feature, resolution) {
delta = 24 - delta;
}
var opacity = 0.75 * (1 - delta / 12);
return [new ol.style.Style({
return new ol.style.Style({
fill: new ol.style.Fill({
color: [0xff, 0xff, 0x33, opacity]
}),
stroke: new ol.style.Stroke({
color: '#ffffff'
})
})];
});
};
var vector = new ol.layer.Vector({

View File

@@ -1,20 +1,12 @@
---
layout: example.html
title: KML example
shortdesc: Example of using the KML source.
title: KML
shortdesc: Rendering KML with a vector source.
docs: >
Example of using the KML source.
This example uses the <code>ol.format.KML</code> to parse KML for rendering with a vector source.
tags: "KML"
cloak:
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<div class="span4 offset4 pull-right">
<div id="info" class="alert alert-success">
&nbsp;
</div>
</div>
</div>
</div>
<div id="info">&nbsp;</div>

View File

@@ -1,16 +1,12 @@
---
layout: example.html
title: Layer WebGL clipping example
title: Layer Clipping with WebGL
shortdesc: Layer WebGL clipping example.
docs: >
This example shows how to use the <code>precompose</code> and <code>postcompose</code> rendering hooks to clip layers using WebGL.
tags: "clipping, webgl, openstreetmap"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div id="no-webgl" class="alert alert-danger" style="display: none">
This example requires a browser that supports <a href="http://get.webgl.org/">WebGL</a>.
</div>

View File

@@ -0,0 +1,3 @@
#map {
background: transparent;
}

View File

@@ -1,13 +1,9 @@
---
layout: example.html
title: Layer clipping example
title: Layer Clipping
shortdesc: Layer clipping example
docs: >
Layer clipping example
tags: "clipping, openstreetmap"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -8,15 +8,9 @@ docs: >
to limit rendering based on an extent.
tags: "extent, tilejson"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="btn-group">
<button type="button" class="btn btn-default" id="northwest">northwest</button>
<button type="button" class="btn btn-default" id="northeast">northeast</button>
<button type="button" class="btn btn-default" id="southeast">southeast</button>
<button type="button" class="btn btn-default" id="southwest">southwest</button>
<button type="button" class="btn btn-default" id="world">world</button>
</div>

View File

@@ -1,16 +1,15 @@
---
layout: example.html
title: Layer group example
title: Layer Groups
shortdesc: Example of a map with layer group.
docs: >
Example of a map with layer group.
tags: "tilejson, input, bind, group, layergroup"
resources:
- https://code.jquery.com/jquery-1.11.2.min.js
---
<div class="row-fluid">
<div class="span6">
<div id="map" class="map"></div>
</div>
<div id="layertree" class="span6">
<div id="layertree">
<h5>Click on layer nodes below to change their properties.</h5>
<ul>
<li><span>OpenAerial layer</span>
@@ -53,4 +52,3 @@ tags: "tilejson, input, bind, group, layergroup"
</li>
</ul>
</div>
</div>

View File

@@ -1,6 +1,6 @@
---
layout: example.html
title: Layer Spy Example
title: Layer Spy
shortdesc: View a portion of one layer over another
docs: >
<p>Layer rendering can be manipulated in <code>precompose</code> and <code>postcompose</code> event listeners.
@@ -12,8 +12,4 @@ tags: "spy, image manipulation"
cloak:
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -14,9 +14,11 @@ var imagery = new ol.layer.Tile({
source: new ol.source.BingMaps({key: key, imagerySet: 'Aerial'})
});
var container = document.getElementById('map');
var map = new ol.Map({
layers: [roads, imagery],
target: 'map',
target: container,
view: new ol.View({
center: ol.proj.fromLonLat([-109, 46.5]),
zoom: 6
@@ -24,22 +26,27 @@ var map = new ol.Map({
});
var radius = 75;
$(document).keydown(function(evt) {
document.addEventListener('keydown', function(evt) {
if (evt.which === 38) {
radius = Math.min(radius + 5, 150);
map.render();
evt.preventDefault();
} else if (evt.which === 40) {
radius = Math.max(radius - 5, 25);
map.render();
evt.preventDefault();
}
});
// get the pixel position with every move
var mousePosition = null;
$(map.getViewport()).on('mousemove', function(evt) {
mousePosition = map.getEventPixel(evt.originalEvent);
container.addEventListener('mousemove', function(event) {
mousePosition = map.getEventPixel(event);
map.render();
}).on('mouseout', function() {
});
container.addEventListener('mouseout', function() {
mousePosition = null;
map.render();
});

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