Compare commits

...

955 Commits

Author SHA1 Message Date
Tim Schaub
c8bc177ac0 Merge pull request #3658 from openlayers/release-v3.5.0
Release v3.5.0.
2015-05-04 22:43:55 -06:00
Tim Schaub
57002ec80a Update package version to 3.5.0 2015-05-04 22:36:58 -06:00
Tim Schaub
208b42d15b Changelog for 3.5.0 2015-05-04 22:36:17 -06:00
Éric Lemoine
27ac8a5a23 Merge pull request #3646 from elemoine/generate-requires
Use graceful-fs in place of fs
2015-04-29 13:50:11 +02:00
Éric Lemoine
6a16920378 Use graceful-fs in place of fs
Change generate-requires.js to use the graceful-fs module instead of fs. This is to avoid EMFILE errors on OSX because the maximum number of file descriptors have been reached.
2015-04-29 13:27:25 +02:00
Éric Lemoine
5ea80f5feb Merge pull request #3645 from elemoine/test-coverage
Fix test-coverage.js script
2015-04-29 13:25:47 +02:00
Éric Lemoine
790bd644c4 Merge pull request #3640 from elemoine/makefile
Make make fail on requires and whitespace errors
2015-04-29 12:13:04 +02:00
Éric Lemoine
dabc04697f Merge pull request #3644 from t27/master
added altclick select to selectfeatures example
2015-04-29 12:04:57 +02:00
Éric Lemoine
e40a51574b Fix test-coverage.js script
Fix test-coverage by only replacing the last occurence of `/src/` when deriving the instrumented file path from the original file path.
2015-04-29 12:00:06 +02:00
tarang
bf91c1792b added altclick select to selectfeatures example 2015-04-29 15:12:51 +05:30
Éric Lemoine
b4434725a5 Make check-whitespace.py exit 1 on whitespace errors 2015-04-29 09:12:13 +02:00
Éric Lemoine
6d1baec34a Add missing goog.require 2015-04-29 09:10:18 +02:00
Éric Lemoine
507335ea69 Make check-requires.py exit 1 on missing/unused requires 2015-04-29 09:10:04 +02:00
Éric Lemoine
04dea3c6ff Merge pull request #3612 from elemoine/wmtsgeturls
Add ol.source.WMTS#getUrls and getRequestEncoding
2015-04-28 17:39:12 +02:00
Éric Lemoine
3a03e9f76a Add ol.source.WMTS#getRequestEncoding 2015-04-27 16:40:01 +02:00
Éric Lemoine
2a2fea379e Add ol.source.WMTS#getUrls 2015-04-27 16:40:01 +02:00
Andreas Hocevar
1d6530ce9c Merge pull request #3616 from ahocevar/freehand-drawing
Add support for freehand drawing to the Draw interaction
2015-04-27 11:27:10 +02:00
Andreas Hocevar
ed7e5ddef7 Improve the draw-features example description 2015-04-27 11:10:16 +02:00
Frédéric Junod
574c5a02c8 Merge pull request #3634 from fredj/kill-unused-local-var
Remove unused local variable
2015-04-27 10:21:03 +02:00
Frederic Junod
4b5f8cd60e Remove unused local variable 2015-04-27 09:56:01 +02:00
Tobias Sauerwein
8e4063d905 Merge pull request #3629 from tsauerwein/snap-xyz
Problems with XYZ coordinates in snap interaction
2015-04-27 08:53:34 +02:00
Éric Lemoine
234db95e3d Merge pull request #3633 from elemoine/editorconfig
Add a Makefile section to .editorconfig
2015-04-27 07:48:38 +02:00
Éric Lemoine
07c4312f4a Merge pull request #3632 from elemoine/indexjs
Make host-examples target copy index.js
2015-04-27 07:35:03 +02:00
Éric Lemoine
079733040f Add a Makefile section to .editorconfig
make requires tabs.
2015-04-26 22:21:37 +02:00
Éric Lemoine
db7b9bbd87 Merge pull request #3631 from bjornharrtell/modify-constructor-test
Restore Modify interaction constructor test
2015-04-26 21:56:34 +02:00
Éric Lemoine
0f2c3bd45f Make host-examples target copy index.js 2015-04-26 21:51:37 +02:00
Björn Harrtell
11d378f36e Restore Modify interaction constructor test 2015-04-26 21:42:55 +02:00
Éric Lemoine
e60d3b75b2 Merge pull request #3630 from bjornharrtell/modify-test
Initial tests for Modify interaction vertex creation
2015-04-26 21:37:26 +02:00
Björn Harrtell
ce3f7665c0 Initial tests for Modify interaction 2015-04-26 21:23:32 +02:00
Éric Lemoine
c025f63019 Merge pull request #3527 from elemoine/makefile
Replace pake with make?
2015-04-26 21:12:09 +02:00
Éric Lemoine
553403d86e Remove build.cmd, build.py and pake.py 2015-04-26 20:42:44 +02:00
Éric Lemoine
3fdd1f2135 Update bin/loader_hosted_examples.js 2015-04-26 20:42:02 +02:00
Éric Lemoine
190eda1b1f Update test_rendering/index.html 2015-04-26 20:38:42 +02:00
Éric Lemoine
f0bdd26b26 Update test_rendering/README.md 2015-04-26 20:37:58 +02:00
Éric Lemoine
2e9f0f4890 Update test/index.html 2015-04-26 20:37:42 +02:00
Éric Lemoine
7988cc7fe9 Update test/README.md 2015-04-26 20:36:14 +02:00
Éric Lemoine
5522f05333 Update CONTRIBUTING.md 2015-04-26 20:21:32 +02:00
Éric Lemoine
4c2c21a5d6 Add Makefile 2015-04-26 20:20:59 +02:00
Marc Jansen
a6cddce92f Merge pull request #3624 from marcjansen/one-sentence
Add a one sentence summary for several exportable symbols
2015-04-25 20:08:39 +02:00
Bart van den Eijnden
dd0b2b33a1 Merge pull request #3623 from bartvde/format_options
ol3 overwrites WMS format_options instead of extending them.
2015-04-24 22:17:46 +02:00
tsauerwein
77f16c7fd6 Fix XYZ coordinates in snap interaction 2015-04-24 09:26:31 +02:00
Marc Jansen
96f0374b2f Add basic docs for mapbrowserevent 2015-04-23 20:49:36 +02:00
Marc Jansen
b70a39b59d Add basic docs for zoomslidercontrol 2015-04-23 20:27:41 +02:00
Marc Jansen
63a4a0c1d9 Add basic docs for scalelinecontrol 2015-04-23 20:27:28 +02:00
Marc Jansen
346ead1b55 Add basic docs for rotatecontrol 2015-04-23 20:27:15 +02:00
Marc Jansen
0d5fcf6411 Add basic docs for overviewmapcontrol 2015-04-23 20:27:01 +02:00
Marc Jansen
d8622c6511 Add basic docs for mousepositioncontrol 2015-04-23 20:26:49 +02:00
Marc Jansen
a433f1abbe Add basic docs for attributioncontrol 2015-04-23 20:26:37 +02:00
Bart van den Eijnden
f0bef58ba3 Do not overwrite FORMAT_OPTIONS if it is present already 2015-04-23 20:03:33 +02:00
Marc Jansen
cbc0ae730a Add basic docs for events.condition.* 2015-04-23 14:58:18 +02:00
Marc Jansen
52ad0bc62f Add basic docs for wktformat 2015-04-23 13:31:50 +02:00
Marc Jansen
4fc7672089 Add basic docs for wfsformat 2015-04-23 13:31:39 +02:00
Marc Jansen
4c6289278b Add basic docs for kmlformat 2015-04-23 13:31:26 +02:00
Pierre GIRAUD
70b0406c50 Merge pull request #3621 from openlayers/pgiraud-patch-1
Fix typo in documentation comment
2015-04-23 11:55:39 +02:00
Pierre GIRAUD
84d22266d6 Fix typo in documentation comment 2015-04-23 11:20:28 +02:00
Bart van den Eijnden
a2f0015b2e Merge pull request #3614 from bartvde/gml-wfs-fix
GML2 parser does not parse all features
2015-04-23 08:36:38 +02:00
Bart van den Eijnden
c74293335c Make sure ol.format.GML2 is usable for WFS 1.0 requests as well 2015-04-23 08:24:59 +02:00
Marc Jansen
9d4db1806a Merge pull request #3619 from marcjansen/one-sentence-geom
Add a one sentence summary for ol.geom.* exportable symbols
2015-04-23 00:11:03 +02:00
Tim Schaub
99818e63aa Merge pull request #3618 from tschaub/breaking-whitespace
Replace non-breaking space (U+00A0) with regular space (U+0020).
2015-04-22 15:50:56 -06:00
Marc Jansen
77a06433be Add basic docs for geom.simplegeometry 2015-04-22 21:10:00 +02:00
Marc Jansen
1252867f69 Add basic docs for geom.polygon 2015-04-22 21:09:59 +02:00
Marc Jansen
5c19415577 Add basic docs for geom.point 2015-04-22 21:09:59 +02:00
Marc Jansen
4f5982b9d0 Add basic docs for geom.multipolygon 2015-04-22 21:09:59 +02:00
Marc Jansen
f0c235d352 Add basic docs for geom.multipoint 2015-04-22 21:01:07 +02:00
Marc Jansen
4e448dddd6 Add basic docs for geom.multilinestring 2015-04-22 21:00:54 +02:00
Marc Jansen
144c262a9e Add basic docs for geom.linestring 2015-04-22 21:00:41 +02:00
Marc Jansen
6b1bccfcdd Add basic docs for geom.linearring 2015-04-22 21:00:29 +02:00
Marc Jansen
7e7c03820a Add basic docs for geom.geometrycollection 2015-04-22 21:00:16 +02:00
Marc Jansen
6637bf0f21 Add basic docs for geom.geometry 2015-04-22 21:00:05 +02:00
Marc Jansen
aef73c981f Add basic docs for geom.circle 2015-04-22 20:59:52 +02:00
Tim Schaub
46e780d1ca Merge pull request #3617 from tschaub/has-area
Add ol.size.hasArea.
2015-04-22 10:49:49 -06:00
Tim Schaub
c31ae25892 Replace non-breaking space (U+00A0) with regular space (U+0020) 2015-04-22 10:41:10 -06:00
Tim Schaub
1f07dfc343 Add ol.size.hasArea 2015-04-22 10:01:31 -06:00
Andreas Hocevar
ed424eded8 Add support for freehand drawing to the Draw interaction 2015-04-22 17:45:55 +02:00
Frédéric Junod
046ff764df Merge pull request #3597 from fredj/apidoc-code-link
Remove dead link in api doc
2015-04-22 16:25:15 +02:00
Marc Jansen
82ed962625 Merge pull request #3613 from marcjansen/one-sentence-interactions
Add a one sentence summary for ol.interaction* exportable symbols
2015-04-22 15:03:35 +02:00
Marc Jansen
4ea8cb7a19 Add basic docs for snapinteraction 2015-04-22 14:22:34 +02:00
Marc Jansen
a784157344 Add basic docs for selectinteraction 2015-04-22 14:22:34 +02:00
Marc Jansen
340d4805af Add basic docs for pointerinteraction 2015-04-22 14:22:34 +02:00
Marc Jansen
5a6c95b13c Add basic docs for mousewheelzoominteraction 2015-04-22 14:22:33 +02:00
Marc Jansen
73b103a19c Add basic docs for modifyinteraction 2015-04-22 14:20:06 +02:00
Marc Jansen
f756246efc Add basic docs for keyboardzoominteraction 2015-04-22 14:19:50 +02:00
Marc Jansen
98c6a24861 Add basic docs for keyboardpaninteraction 2015-04-22 14:19:30 +02:00
Marc Jansen
1917193ea9 Add basic docs for interaction 2015-04-22 14:19:17 +02:00
Marc Jansen
750a644396 Add basic docs for drawinteraction 2015-04-22 14:18:50 +02:00
Marc Jansen
6da863d627 Add basic docs for draganddropinteraction 2015-04-22 14:18:29 +02:00
Marc Jansen
134d8e6c18 Add basic docs for doubleclickzoominteraction 2015-04-22 14:18:01 +02:00
Bart van den Eijnden
75e642738f Merge pull request #3611 from bartvde/issue-3611
Improve error handling in Esri JSON format
2015-04-22 13:16:08 +02:00
Bart van den Eijnden
3b8e272a11 Better error handling in the ArcGIS REST vector examples 2015-04-22 12:01:28 +02:00
Tobias Sauerwein
2a95049ac4 Merge pull request #3560 from tsauerwein/permalink-example
Add an example showing how to create a permalink
2015-04-22 09:24:06 +02:00
Andreas Hocevar
90b736c62e Merge pull request #3571 from ahocevar/vector-wrapx
Add wrapX support for vector layers (canvas renderer only)
2015-04-22 09:21:02 +02:00
Andreas Hocevar
513677fecd Render map replay group on the correct world instead of wrapping it
By using the frameState's focus, we can adjust extent and transform and
render it for the world of interest instead of wrapping it and rendering
for every visible world.
2015-04-22 09:11:19 +02:00
tsauerwein
b8ec2e28b5 Add permalink example 2015-04-22 09:00:18 +02:00
Andreas Hocevar
23ed120361 Clarify when we make feature overlays wrap the x-axis 2015-04-21 09:56:03 +02:00
Andreas Hocevar
40feabc3c8 Do not require an extent for global projections 2015-04-21 09:11:06 +02:00
Bart van den Eijnden
3e8d1213bb Merge pull request #3605 from bartvde/issue-3605
vector-esri-edit.html uses non api method
2015-04-21 08:41:37 +02:00
Andreas Hocevar
4f8dca92ba Ensure functions are always called with the same number of args 2015-04-21 08:21:31 +02:00
Tim Schaub
5630b0c1f2 Merge pull request #3602 from tschaub/names
Rename ol.feature.FeatureStyleFunction to ol.FeatureStyleFunction.
2015-04-20 14:56:06 -06:00
Tim Schaub
3d662f1c4c Add upgrade notes 2015-04-20 14:15:36 -06:00
Tim Schaub
f0c0c28f04 Rename ol.feature.FeatureStyleFunction to ol.FeatureStyleFunction 2015-04-20 13:47:34 -06:00
Bart van den Eijnden
dab6567aec Make sure vector-esri-edit example works hosted 2015-04-20 21:06:15 +02:00
Bart van den Eijnden
8ddf162279 Merge pull request #3604 from bartvde/browserify-tutorial
Add charset so that zoom out button shows correctly
2015-04-20 19:11:51 +02:00
Bart van den Eijnden
83f1234d7a Add charset so that zoom out button shows correctly 2015-04-20 18:45:00 +02:00
Éric Lemoine
a07809cbbf Merge pull request #3603 from elemoine/upgrade-notes
Reformat upgrade-notes.md
2015-04-20 17:53:59 +02:00
Éric Lemoine
252f8cbd9e Reformat upgrade-notes.md 2015-04-20 16:55:36 +02:00
Éric Lemoine
ab066e1914 Merge pull request #3599 from probins/vector
Improve docs for source.Vector options
2015-04-20 16:20:23 +02:00
Tim Schaub
230e1944c2 Merge pull request #3598 from tschaub/clean
Remove unnecessary entry in `.gitignore`.
2015-04-20 08:16:39 -06:00
Peter Robins
30b52ef213 Improve docs for source.Vector options 2015-04-20 13:31:27 +00:00
Frederic Junod
00ce2f0f58 Remove dead link in api doc
Fixes #3596
2015-04-20 15:07:39 +02:00
Tim Schaub
e2eba46d32 All build artifacts should be generated in the build directory 2015-04-20 07:02:38 -06:00
Frédéric Junod
98240b0bea Merge pull request #3595 from probins/loader
Add featureloader.jsdoc
2015-04-20 14:53:16 +02:00
Peter Robins
c8106e11b6 Add featureloader.jsdoc 2015-04-20 12:40:38 +00:00
Frédéric Junod
fc02d715d7 Merge pull request #3593 from fredj/ignore-build-examples
Add /examples/index.js to .gitignore
2015-04-20 14:36:26 +02:00
Frederic Junod
b4d64523e9 Add /examples/index.js to .gitignore
The file is created by tasks/build-examples.js
2015-04-20 14:13:50 +02:00
Frédéric Junod
43984b24dd Merge pull request #3592 from probins/binding
Remove reference to binding in Collection docs
2015-04-20 12:46:25 +02:00
Frédéric Junod
522358614b Merge pull request #3591 from fredj/fixes-3589
Only draw the layer if visible and inside the resolution range
2015-04-20 12:45:23 +02:00
Peter Robins
0ed5984371 Remove reference to binding in Collection docs 2015-04-20 10:27:30 +00:00
Frederic Junod
8fd2fae0cb Only draw the layer if visible and inside the resolution range 2015-04-20 12:15:34 +02:00
Frederic Junod
c31a9ee71e Use getRendererFromQueryString() in wms-image examples 2015-04-20 12:13:55 +02:00
Frédéric Junod
cb4fd37be4 Merge pull request #3528 from fredj/layer-group-leak
Fix memory leak when removing layers from ol.layer.Group
2015-04-20 09:51:29 +02:00
Frederic Junod
dc0be1228c Add more ol.layer.Group tests 2015-04-20 09:20:19 +02:00
Frederic Junod
486a329cb4 Fix memory leak when removing layers from ol.layer.Group
Fixes #3479
2015-04-20 09:20:19 +02:00
Frédéric Junod
8b95ea4fbc Merge pull request #3549 from fredj/keyboard_pan_duration
Move ol.*_DURATION const to a constructor option
2015-04-20 09:03:53 +02:00
Tim Schaub
1e5a621d3d Merge pull request #3587 from tschaub/intersects
Handle left/right segment intersections for top/bottom spans.
2015-04-19 10:37:03 -06:00
Tim Schaub
a67218bd7d Merge pull request #3516 from tschaub/unbinary
Remove ol.format.BinaryFeature.
2015-04-19 10:04:53 -06:00
Tim Schaub
42d8d499bd Merge pull request #3586 from probins/dragdrop
Simplify dragAndDropInteraction in examples.
2015-04-19 10:03:25 -06:00
Tim Schaub
941f53ec80 Handle left/right segment intersections for top/bottom spans
The ol.extent.intersectsSegment function was not correctly handling segments that span from above to below an extent while intersecting the sides.
2015-04-19 09:43:06 -06:00
Peter Robins
22f22b2877 Simplify dragAndDropInteraction in examples 2015-04-19 13:26:25 +00:00
Bart van den Eijnden
ed76bdb095 Merge pull request #3555 from bartvde/esri-json
Esri JSON support
2015-04-19 10:32:38 +02:00
Andreas Hocevar
8fd4e2c7c5 Improve docs, comments and code readability 2015-04-19 08:52:37 +02:00
Andreas Hocevar
6a2aa833b4 Improve tests for ol.renderer.canvas.VectorLayer 2015-04-19 08:52:26 +02:00
Frederic Junod
288392c8a7 Remove externs/vbarray.js 2015-04-18 17:10:24 -06:00
Frederic Junod
b1d59366dc Remove ol.format.FormatType.BINARY 2015-04-18 17:10:15 -06:00
Tim Schaub
6a564597fb Update types accepted when reading features 2015-04-18 17:07:34 -06:00
Tim Schaub
4260368b3b Remove untested and unused binary feature format code 2015-04-18 17:05:23 -06:00
Andreas Hocevar
9a58151caa Do not wrapX for editing 2015-04-18 19:10:54 +02:00
Andreas Hocevar
d5e5628fe1 Add some tests 2015-04-18 19:10:54 +02:00
Andreas Hocevar
b51aaa5055 Wrap the x-axis for the map's replay group 2015-04-18 19:10:53 +02:00
Andreas Hocevar
45cc660c48 Use x of the real world in forEachFeatureAtCoordinate 2015-04-18 19:10:53 +02:00
Andreas Hocevar
a90a012e5d Replay vector batches for each world 2015-04-18 19:10:53 +02:00
Marc Jansen
a948ed410e Merge pull request #3583 from marcjansen/one-sentence-proj-layer
Add a one sentence summary for ol.proj.* and ol.layer.* exportable symbols
2015-04-18 18:14:12 +02:00
Tim Schaub
62e7f69be4 Merge pull request #3581 from tschaub/doc-links
Always show links to related API documentation.
2015-04-18 08:47:01 -06:00
Tim Schaub
7ca20665a5 Merge pull request #3582 from tschaub/index-requires
Index what the examples require.
2015-04-18 08:41:46 -06:00
Marc Jansen
a278c65e61 Add basic docs for layer.Vector 2015-04-18 09:07:41 +02:00
Marc Jansen
041abdb6a1 Add basic docs for layer.Tile 2015-04-18 09:07:34 +02:00
Marc Jansen
b457b26743 Add basic docs for layer.Group 2015-04-18 09:07:13 +02:00
Marc Jansen
b46505a09b Add basic docs for layer.Base 2015-04-18 09:07:05 +02:00
Marc Jansen
18bb32e409 Add basic docs for layer.Image 2015-04-18 09:01:15 +02:00
Marc Jansen
192639a876 Add basic docs for layer.Heatmap 2015-04-18 09:00:51 +02:00
Marc Jansen
0360e8bce8 Add unit 'us-ft' to API docs 2015-04-18 08:26:26 +02:00
Tim Schaub
2dd3fbf307 Renaming and docs for clarity 2015-04-17 16:09:43 -06:00
Tim Schaub
bc1bde6a86 Index what the examples require 2015-04-17 16:03:55 -06:00
Tim Schaub
e65800ca63 Always show links to related API documentation
This is based on the assumptions that

 * our examples always goog.require something ol.* (otherwise why have the example)
 * our examples only goog.require exportable symbols or "namespaces" for exportable symbols (e.g. ol.control for the defaults function)
 * we have an API doc page for each exportable symbol and each "namespace" that has exportable symbols (e.g. ol.Map.html and ol.control.html)

It may be that this assumption proves to be wrong, but it would be nice to avoid the extra network traffic and layout shifting when examples load.
2015-04-17 15:41:38 -06:00
Marc Jansen
f07b14c436 Merge pull request #3580 from marcjansen/one-sentence-source
Add a one sentence summary for ol.source.* exportable symbols
2015-04-17 23:01:12 +02:00
Marc Jansen
0ea3645ae9 Merge pull request #3551 from marcjansen/examples-link-to-api-docs
Automatically add links to API-docs in examples
2015-04-17 22:52:19 +02:00
Marc Jansen
99e39fe06e Add basic documentation to @api symbols 2015-04-17 22:38:29 +02:00
Bart van den Eijnden
8f0d6a6382 No need to quote object properties in tests 2015-04-17 21:56:40 +02:00
Tim Schaub
857baaa7e6 Merge pull request #3575 from nd0ut/master
Check proj equivalence by code.
2015-04-17 13:55:29 -06:00
Marc Jansen
0fcd312812 Check if API-docs point to existing resources 2015-04-17 21:54:15 +02:00
Marc Jansen
fedceb9a05 Automatically add links to API-docs in examples
When we create the examples, we know exactly which specific `ol.…` symbols
we `goog.require(…)`. We can create links to the API documentation of these
symbols automatically.
2015-04-17 21:50:50 +02:00
Tim Schaub
eff48c026a Merge pull request #3579 from tschaub/ssl
Use HTTPS were available.
2015-04-17 11:10:14 -06:00
Tim Schaub
ad95efd795 Use HTTP for {a-c}.tile.opencyclemap.org
While the resource is available via HTTPS, it currently generates NET::ERR_CERT_COMMON_NAME_INVALID.
2015-04-17 10:40:59 -06:00
Bart van den Eijnden
32120f6cfb Move examples to examples directory 2015-04-17 18:39:05 +02:00
Bart van den Eijnden
560a45847f No quotes needed around object keys 2015-04-17 18:36:17 +02:00
Bart van den Eijnden
4901d9a48f Primitive types are not nullable by default 2015-04-17 18:36:17 +02:00
Bart van den Eijnden
6c4f2a4ce3 Document convert rings function and use GeometryType enums 2015-04-17 18:36:16 +02:00
Bart van den Eijnden
a438ffb280 Add full support for XYM and XYZM layouts 2015-04-17 18:36:16 +02:00
Bart van den Eijnden
db8c6ef1b4 Write support for Esri JSON 2015-04-17 18:36:16 +02:00
Bart van den Eijnden
93c524baa0 Esri JSON read support 2015-04-17 18:36:16 +02:00
Tim Schaub
3b1c33ded5 Remove unused ol.IS_HTTPS 2015-04-17 10:30:31 -06:00
Tim Schaub
b22f3c6829 Use HTTPS where available 2015-04-17 10:30:31 -06:00
Tim Schaub
0dfc2ce44f Avoid protocol relative URLs
These fail to load in contexts where the "file protocol" is used (e.g. PhantomJS).
2015-04-17 10:30:31 -06:00
Tim Schaub
bba326fdf4 Merge pull request #3558 from tschaub/built-examples
Example sources in examples dir and built examples in build/examples.
2015-04-17 10:17:41 -06:00
Tim Schaub
13e40fb98c Merge pull request #3550 from tschaub/fewer-differences
Reduce differences between the rendering test runner and the standard test runner.
2015-04-17 10:16:00 -06:00
Tim Schaub
14b7edb140 Keep the examples simple
Please write blog posts, create tutorials, or develop workshops that show off cool ways to develop applications that use OL3.  The examples should be kept very simple.  This download functionality is neat, but it's really a gratuitous use of non-map related functionality.  While it does demonstrate the use of `format.writeFeatures()`, this is buried in too much additional code that is not accessible (buried in resources/common.js) and not really related to mapping things.  If we want to have examples that demonstrate how formats can be used to serialize features, a simple textarea would suffice as the target.
2015-04-17 09:55:44 -06:00
Tim Schaub
c5cf709c55 The common.js script makes a "common" object available 2015-04-17 09:49:53 -06:00
Tim Schaub
eff14b06e0 Refactor common example script and run the linter on it 2015-04-17 09:43:46 -06:00
Tim Schaub
f2600977ae Avoid words with contentious alternative spellings 2015-04-17 09:43:37 -06:00
Tim Schaub
4e8b10ae1c Use --ssl-protocol=any in PhantomJS with a page that uses HTTPS
The `check-examples` target fails on Travis without this option.  We get "SSL handshake failed" when loading resources via HTTPS with whatever the default SSL protocol is.

In addition, as a precaution, the --ignore-ssl-errors option is set to true in case anybody adds a resource with an invalid certificate.  This option does not get around SSL handshake errors.
2015-04-17 09:18:39 -06:00
Tim Schaub
7c8eaae6a1 Remove jQuery from mobile fullscreen example 2015-04-17 06:22:39 -06:00
Tim Schaub
f712123e93 Remove jQuery use from IGC example 2015-04-17 06:22:39 -06:00
Tim Schaub
c385a1b7dd Remove jQuery use from earthquake heatmap example 2015-04-17 06:22:39 -06:00
Tim Schaub
2f160d29c7 Remove jQuery use from geolocation example 2015-04-17 06:22:39 -06:00
Tim Schaub
c3362c1685 Remove jQuery use from geolocation orientation example 2015-04-17 06:22:39 -06:00
Tim Schaub
0121a12293 Remove jQuery use from device orientation example 2015-04-17 06:22:39 -06:00
Tim Schaub
d2062d241d Remove jQuery use from Bing example 2015-04-17 06:22:39 -06:00
Tim Schaub
daccfd25c9 Remove jQuery use from accessible example 2015-04-17 06:22:39 -06:00
Tim Schaub
c8adf22438 Use DOM methods instead of jQuery in common example script 2015-04-17 06:22:38 -06:00
Tim Schaub
84f3bea766 Upgrade Metalsmith to get new concurrency option 2015-04-17 06:22:38 -06:00
Tim Schaub
89f5e711e6 Example sources in the examples dir 2015-04-17 06:22:38 -06:00
Tim Schaub
8fd2e9f79f Untangle resources and put built examples in the build dir 2015-04-17 06:22:38 -06:00
Tim Schaub
0faace215b Compiled examples go in build/compiled-examples 2015-04-17 06:22:37 -06:00
Tim Schaub
7b2391cc2e Remove unused EXAMPLES_JSON 2015-04-17 06:22:37 -06:00
Tim Schaub
4131f41740 Remove unused EXAMPLES_COMBINED and build-examples target
This was discussed as part of #1118 but never completed (see https://github.com/openlayers/ol3/pull/1118#discussion_r6894016).
2015-04-17 06:22:37 -06:00
Tim Schaub
fd42db8404 Correct docs about what the ci target runs
We stopped using the `build-examples` target with 3f1ae87eee.
2015-04-17 06:22:37 -06:00
nd0ut
12e817e408 Check projections equivalence also by their code
Method ol.proj.equivalent used only reference equality check ===
That doesn't work for basic checks of two strongly equal projections
For example, `EPSG:4326` and `EPSG:4326`
In this case method searches similar proj in ol.proj.transforms_ mapping
And it finds it if proj is default and not custom
But in case of custom proj `EPSG:3413` it doesn't find it
2015-04-17 14:36:37 +03:00
Éric Lemoine
b039a7528c Merge pull request #3576 from elemoine/vectorapi
Add KML options related note the upgrade notes
2015-04-17 10:04:23 +02:00
Éric Lemoine
3998f8d4f5 Add KML options related note the upgrade notes 2015-04-17 09:53:22 +02:00
Bart van den Eijnden
4306ecbb8d Merge pull request #3573 from gberaudo/interaction_dispatch_order
Modify draw interaction dispatch order
2015-04-16 19:05:41 +02:00
Guillaume Beraudo
a7e4e20edc Update changelog 2015-04-16 18:11:15 +02:00
Guillaume Beraudo
c0c7b71af6 Add draw interaction test case 2015-04-16 17:44:45 +02:00
Andreas Hocevar
14d546c300 Merge pull request #3572 from ahocevar/null-tilesize
Do not return a null tileSize
2015-04-16 17:30:02 +02:00
Guillaume Beraudo
a468e8025a Modify draw interaction dispatch order
When finishing drawing, this PR dispatches the `drawend` event before adding
the feature to the source or collection.

This change allows user code to finish configuring the feature (setting style,
properties, ...).

It is useful since inserting a feature, or later on modifying it, may trigger
processing which only makes sense if the feature is ready. For example,
ol3-cesium will recreate a 3D counterpart.
2015-04-16 16:51:54 +02:00
Andreas Hocevar
4cad17f839 Do not return a null tileSize 2015-04-16 15:32:35 +02:00
Éric Lemoine
c7bd5a7521 Merge pull request #3570 from gberaudo/required_api
Add missing @api
2015-04-16 11:42:38 +02:00
Frédéric Junod
1662500988 Merge pull request #3569 from fredj/bootstrap-link
Fix link to Bootstrap documentation
2015-04-16 11:13:29 +02:00
Guillaume Beraudo
65614d74f8 Add missing @api
These types are referenced in the externs but were not declared.
Found by ol3-cesium.
2015-04-16 11:09:41 +02:00
Frederic Junod
9b462dde0a Fix link to Bootstrap documentation 2015-04-16 10:30:28 +02:00
Andreas Hocevar
ab9846ff24 Merge pull request #3559 from ahocevar/tile-width-height
Add support for non-square tiles
2015-04-16 09:26:27 +02:00
Frédéric Junod
075579688e Merge pull request #3568 from fredj/extractStyles
Move extractStyles option to ol.format.KML
2015-04-16 09:17:18 +02:00
Andreas Hocevar
70452f4fa7 Add rendering tests 2015-04-16 09:15:34 +02:00
Frederic Junod
a81f414065 Move extractStyles option to ol.format.KML 2015-04-16 09:05:07 +02:00
Frédéric Junod
646a7bb96e Merge pull request #3562 from fredj/css-cleanup
Simplify .ol-zoomslider and .ol-overviewmap CSS
2015-04-16 07:40:58 +02:00
Frédéric Junod
31cebc7c8a Merge pull request #3565 from fredj/fix-3564
Move extractStyles option to ol.format.KML
2015-04-15 17:41:25 +02:00
Frederic Junod
0bd368ce06 Move extractStyles option to ol.format.KML
Fixes #3564
2015-04-15 17:19:02 +02:00
Frederic Junod
5bc875e075 Simplify .ol-zoomslider and .ol-overviewmap CSS
The .ol-control class already defines the position and background values.
2015-04-15 11:02:43 +02:00
Frédéric Junod
ce1659bc14 Merge pull request #3523 from fredj/update-proj4js
Update proj4 version to 2.3.6
2015-04-15 09:11:59 +02:00
Andreas Hocevar
f2e94daf54 Update proj4js version in example 2015-04-15 08:58:21 +02:00
Frederic Junod
7909e7b079 Update proj4 version to 2.3.6 2015-04-15 08:58:07 +02:00
Frederic Junod
dd8a4c355b Add more proj4js integration tests 2015-04-15 08:58:07 +02:00
Andreas Hocevar
509a661fda Reference ol.size.toSize() 2015-04-15 08:40:20 +02:00
Andreas Hocevar
ddf5e48830 Make ol.size.toSize exportable and optimize it 2015-04-15 08:28:31 +02:00
Andreas Hocevar
9c415ac9da Use simple tile sizes for Bing maps by default 2015-04-15 08:12:17 +02:00
Andreas Hocevar
0d53edfa21 Get rid of ol.tilegrid.DEFAULT_TILE_SIZE 2015-04-14 23:16:29 +02:00
Andreas Hocevar
2b75341068 Add support for non-square tiles 2015-04-14 22:54:57 +02:00
Éric Lemoine
7439054d33 Merge pull request #3556 from klokantech/tileutfgrid-fix
Minor TileUTFGrid error fix
2015-04-14 17:56:27 +02:00
Frédéric Junod
8b0179b91f Merge pull request #3557 from fredj/fastclick
Update FastClick externs to version 1.0.6
2015-04-14 16:57:00 +02:00
Frederic Junod
8882e85cb4 Update FastClick externs to version 1.0.6 2015-04-14 16:20:48 +02:00
Petr Sloup
f1f0b37bdc Stronger type checking to continue only if data is defined 2015-04-14 14:15:47 +02:00
Marc Jansen
12022122a6 Merge pull request #3517 from marcjansen/basic-tests
Add tests for previously untested classes
2015-04-14 10:04:25 +02:00
Frederic Junod
6c33f84798 Move ol.DRAGROTATE_ANIMATION_DURATION const to a constructor option 2015-04-14 09:05:52 +02:00
Frederic Junod
a94a87323d Move ol.DRAGROTATEANDZOOM_ANIMATION_DURATION const to a constructor option 2015-04-14 08:57:27 +02:00
Marc Jansen
eca09cba1d Add basic test for ol.tilegrid.Zoomify 2015-04-13 21:13:27 +02:00
Marc Jansen
b5c9f5e8b3 Add basic test for ol.Overlay 2015-04-13 21:13:27 +02:00
Marc Jansen
33788ddfd9 Add basic test for ol.layer.Heatmap 2015-04-13 21:13:27 +02:00
Marc Jansen
e283d6f54a Add basic test for ol.interaction.Snap 2015-04-13 21:13:27 +02:00
Marc Jansen
3e4d6f0b02 Add basic test for ol.interaction.DragRotateAndZoom 2015-04-13 21:13:27 +02:00
Marc Jansen
2609023a40 Add basic test for ol.interaction.DragAndDrop 2015-04-13 21:13:27 +02:00
Marc Jansen
6d53a91e3a Add tests for ol.ImageUrlFunction 2015-04-13 21:13:27 +02:00
Marc Jansen
bfefc0666b Add basic test for ol.Geolocation 2015-04-13 21:13:27 +02:00
Marc Jansen
05f3f6852d Add basic test for ol.format.BinaryFeature 2015-04-13 21:13:27 +02:00
Marc Jansen
248d3071a3 Add basic test for ol.DeviceOrientation 2015-04-13 21:13:27 +02:00
Marc Jansen
481869bea6 Add basic test for ol.control.ZoomToExtent 2015-04-13 21:13:27 +02:00
Marc Jansen
d14daa1938 Add basic test for ol.control.ScaleLine 2015-04-13 21:13:27 +02:00
Marc Jansen
479e723f0e Add basic test for ol.control.MousePosition 2015-04-13 21:13:27 +02:00
Marc Jansen
29124a3dad Add basic test for ol.control.FullScreen 2015-04-13 21:13:27 +02:00
Marc Jansen
a26f2a78eb Add basic test for ol.binary.Buffer 2015-04-13 21:13:26 +02:00
Tim Schaub
401ab6e829 Keep custom test logic in one place 2015-04-13 08:45:27 -06:00
Tim Schaub
129ed0a6c5 Append directly to the document body 2015-04-13 08:40:40 -06:00
Frederic Junod
1daf4628b7 Move ol.ROTATE_ANIMATION_DURATION const to a constructor option 2015-04-13 15:05:35 +02:00
Frederic Junod
2fcdc48d20 Move ol.DRAGZOOM_ANIMATION_DURATION const to a constructor option 2015-04-13 14:59:39 +02:00
Frederic Junod
3eb22559d6 Move ol.ZOOMSLIDER_ANIMATION_DURATION const to a constructor option 2015-04-13 14:54:23 +02:00
Frederic Junod
3b4bc0be25 Move ol.KEYBOARD_PAN_DURATION const to a constructor option 2015-04-13 14:54:23 +02:00
Tim Schaub
5dfa9e0a67 Merge pull request #3548 from tschaub/slimer-error
Write the error stack instead of the error itself.
2015-04-13 06:49:28 -06:00
Tim Schaub
b9198f1f7b Write the stack instead of an error 2015-04-13 06:32:36 -06:00
Tim Schaub
c6eed0e19a Merge pull request #3542 from tschaub/examples
Generate example index and rebuild examples on source changes.
2015-04-13 06:13:12 -06:00
Bart van den Eijnden
ee67a9d2d4 Merge pull request #3530 from bartvde/issue-3530
external resources not correctly in inline source of example
2015-04-13 12:53:46 +02:00
Éric Lemoine
e636119c93 Merge pull request #3448 from elemoine/webgl-image-retina
Fix WebGL image layer rendering on retina displays
2015-04-13 11:16:53 +02:00
Tim Schaub
ec40d6afff Merge pull request #3544 from tschaub/fixed
Update comments about remaining GeoJSON work.
2015-04-12 23:04:43 -06:00
Tim Schaub
ec4a6aab3a Clarify comment and link to issue 2015-04-12 22:17:11 -06:00
Tim Schaub
9d8ec2c8d0 Write options allow control over GeoJSON coordinate order
See be0c9f3c8a.
2015-04-12 22:13:28 -06:00
Tim Schaub
a85de86ec2 Make build.py call tasks/build-examples.js 2015-04-12 17:11:05 -06:00
Tim Schaub
8ddec98075 Rebuild examples when the sources change 2015-04-12 15:42:55 -06:00
Tim Schaub
aaba58ceb0 Generate index.js when building examples 2015-04-12 15:42:48 -06:00
Tobias Sauerwein
81f36f5e76 Merge pull request #3531 from mantonovic/master
Fix PointerEventHandler exception with Overlay containing SVG and IE9
2015-04-10 16:50:57 +02:00
Milan P. Antonovic
400e81431d PointerEventHandler exception with Overlay containing SVG
Using an ol.Overlay as marker I put inside an SVG graphic element. As soon I move the mouse over the SVG the error appear.
In IE9 the SVG Element does not have the contains function so it throws the exception, on the contrary using goog.dom.contains it handles the cross-browser issues.

https://groups.google.com/forum/#!topic/ol3-dev/DBi2HCTqulU
2015-04-10 14:33:16 +02:00
Bart van den Eijnden
092ea0f9a1 Fix external resources in example code snippet 2015-04-10 09:22:01 +02:00
Frédéric Junod
0541fc31d8 Merge pull request #3521 from fredj/layergroup-cleanup
Remove goog.isDefAndNotNull test on ol.layer.Group#getLayers result
2015-04-08 15:38:28 +02:00
Frederic Junod
0fce3d5ec9 Remove goog.isDefAndNotNull test on ol.layer.Group#getLayers result
The return type of the function is {!ol.Collection.<ol.layer.Base>}
2015-04-08 12:16:39 +02:00
Éric Lemoine
b5a0ca0589 Merge pull request #3481 from elemoine/vectorapi
Proposal for a simpler vector API
2015-04-08 10:46:19 +02:00
Éric Lemoine
6a2498aa41 Add release notes for the new Vector API 2015-04-08 10:22:57 +02:00
Éric Lemoine
c40f84d4a7 Add test for ol.source.Vector#loadFeatures 2015-04-08 10:22:56 +02:00
Éric Lemoine
ce83fbdbe3 Rename rBush_ to featuresRtree_ in ol.source.Vector 2015-04-08 10:22:56 +02:00
Éric Lemoine
c3658de75a Make addFeature(s) ignore features with same id 2015-04-08 10:22:56 +02:00
Éric Lemoine
bb0ee1e6e9 Make ol.source.TileVector inherit from ol.source.Vector 2015-04-08 10:22:56 +02:00
Éric Lemoine
bdb326c310 Port vector examples to new vector API 2015-04-08 10:22:56 +02:00
Éric Lemoine
09b90c8424 Add loader and strategy to ol.source.Vector 2015-04-08 10:22:56 +02:00
Éric Lemoine
e86fd4afd4 Get rid of disliked vector classes 2015-04-07 17:36:57 +02:00
Tim Schaub
5a7d1f3ba1 Merge pull request #3472 from tschaub/unbound
Remove the experimental bindTo method from ol.Object.
2015-04-07 09:29:53 -06:00
Éric Lemoine
4f05872767 Merge pull request #3505 from elemoine/custom-builds
Add a Create Custom Builds tutorial
2015-04-07 17:26:50 +02:00
Frédéric Junod
596551502c Merge pull request #3513 from fredj/layergroup-cleanup
Remove layerGroup.setLayers(null) test
2015-04-07 17:26:12 +02:00
Tim Schaub
c3d5a2e9c4 Add upgrade notes regarding bindTo 2015-04-07 09:13:33 -06:00
Frederic Junod
a77c4ec6c5 Remove layerGroup.setLayers(null) test
Since 96f7d6323a, the `layers` parameter to `ol.layer.Group#setLayers` can't be `null`.
2015-04-07 17:08:12 +02:00
Éric Lemoine
b6b9f25b04 Add a Create Custom Builds tutorial 2015-04-07 16:55:38 +02:00
Tim Schaub
e5c6915761 Update documentation 2015-04-07 08:35:48 -06:00
Tim Schaub
814fb078cf Rework examples to new API 2015-04-07 08:35:48 -06:00
Tim Schaub
e1079ab9a3 Improve overview map handling of map and view changes 2015-04-07 08:35:48 -06:00
Tim Schaub
0189e11931 Remove unconditionally exported methods 2015-04-07 08:35:47 -06:00
Tim Schaub
f42c0cb0aa Remove 2-way binding from objects 2015-04-07 08:35:47 -06:00
Éric Lemoine
600b76e9a2 Merge pull request #3511 from elemoine/googprovide
Add goog.provide's
2015-04-07 15:20:14 +02:00
Éric Lemoine
765fc4c279 Add a type alias to goog.vec.Number
This addition is related to the definition of olx.FrameState in olx.js. Without this alias and corresponding goog.provide in src/ol/vec/mat4.js we get this error when compiling an OpenLayers application:

ERR! compile node_modules/openlayers/externs/olx.js:6853: ERROR - Bad type annotation. Unknown type goog.vec.Mat4.Number
ERR! compile  *     coordinateToPixelMatrix: goog.vec.Mat4.Number,

Currently, the Closure Library does not have a goog.provide for goog.vec.Mat4.Number. If it did have this goog.provide then we wouldn't have the error.

This commit works around the issue by creating our own type alias (ol.vec.Mat4.Number) and adding a goog.provide for that type alias.
2015-04-07 14:10:46 +02:00
Éric Lemoine
e45c44fa01 Add missing goog.provide's 2015-04-07 13:49:36 +02:00
Pierre GIRAUD
5843654650 Merge pull request #3509 from pgiraud/geometry_changed_null
Dispatch change event even when geometry is set to null
2015-04-07 12:39:48 +02:00
Pierre GIRAUD
99e8787c63 Merge pull request #3510 from pgiraud/change_event_test
Use sinon.spy to ensure change event is dispatched
2015-04-07 12:35:01 +02:00
Pierre GIRAUD
d27d59f445 Use sinon.spy to ensure change event is dispatched 2015-04-07 12:21:01 +02:00
Éric Lemoine
9ce3bc7f3d Fix WebGL image layer rendering on retina displays
This commit takes the device pixel ratio into account when calculating the matrix used to apply the image to the output canvas.
2015-04-07 12:13:16 +02:00
Pierre GIRAUD
5eb13660d3 Dispatch change event even when geometry is set to null 2015-04-07 12:12:07 +02:00
Tim Schaub
0789604e88 Merge pull request #3504 from tschaub/build-examples
Rework build-examples.js task.
2015-04-06 11:27:00 -06:00
Tim Schaub
ab7b6d95dc Demonstrating markdown use in docs 2015-04-06 11:14:22 -06:00
Tim Schaub
121a83f19e Explicitly helper use instead of implicitly converting from markdown 2015-04-06 11:13:45 -06:00
Tim Schaub
3b96071096 Metadata names 2015-04-06 11:13:45 -06:00
Tim Schaub
30c04cf8ab Maintain resource list order (principle of least surprise) 2015-04-06 11:13:45 -06:00
Tim Schaub
75fcec15ec Simplify plugin
The augmentExamples just adds metadata to the example markup files.  If we also want to support example markdown files, we can use the metalsmith-markdown plugin before this one.
2015-04-06 11:13:32 -06:00
Tim Schaub
43ed76cda0 Unquoted strings for readability 2015-04-06 09:18:32 -06:00
Tim Schaub
9f1e0f001a Proper lists for example resources 2015-04-06 09:18:32 -06:00
Tim Schaub
6d318dce78 Rework plugin 2015-04-06 09:18:28 -06:00
Tobias Sauerwein
c36c67779e Merge pull request #3470 from tsauerwein/rendering-tests
Add rendering tests
2015-04-06 13:49:51 +02:00
tsauerwein
f99196c466 Fix failing test 2015-04-06 13:36:43 +02:00
tsauerwein
c0a23dc818 Add first rendering tests 2015-04-06 13:36:35 +02:00
Tobias Sauerwein
91b12c1d34 Merge pull request #3413 from tsauerwein/ext-browserify
Add support for generic external modules with Browserify
2015-04-06 13:25:45 +02:00
Tim Schaub
c265676f67 Avoid reading css and js files twice 2015-04-06 04:21:12 -06:00
Tim Schaub
cdc4283cbf Use global metadata for ol version 2015-04-06 04:10:17 -06:00
Tim Schaub
8afb5698f1 Allow script to be run from anywhere 2015-04-06 04:09:46 -06:00
Tim Schaub
80048bd290 Merge pull request #3503 from tschaub/vector-source
Use vector source instead of feature overlay in snap example.
2015-04-06 03:23:51 -06:00
Éric Lemoine
17d1cff110 Merge pull request #3495 from bjornharrtell/tutorial-basic
Initial basic project setup tutorial
2015-04-05 17:53:27 +02:00
Tim Schaub
274b70bde3 Use vector source in snap example 2015-04-05 16:55:42 +02:00
Björn Harrtell
421db6783f Browserify tutorial 2015-04-05 13:08:46 +02:00
Tim Schaub
228491344d Merge pull request #3488 from tschaub/doc
Add docs for exportable symbols.
2015-04-04 23:37:17 +02:00
Éric Lemoine
1c471cca6c Merge pull request #3441 from elemoine/compile-application
Add a "Compile Application and OpenLayers 3 Together" tutorial
2015-04-04 23:33:00 +02:00
Éric Lemoine
8cbd991001 Merge pull request #3499 from elemoine/closure-util-update
Update to closure-util 1.4.0
2015-04-04 23:32:44 +02:00
Éric Lemoine
58895f73ac Fix compile error in image-filter example 2015-04-04 23:20:49 +02:00
Éric Lemoine
4130e7803a Update compile config used to build individual examples 2015-04-04 23:18:57 +02:00
Éric Lemoine
2892e36d29 Update to closure-util 1.4.0 2015-04-04 22:46:07 +02:00
Éric Lemoine
953b8ff86f Update the tutorials index 2015-04-04 22:44:29 +02:00
Éric Lemoine
6705a34358 Add "closure" tutorial
Tutorial describing how to compile application and OpenLayers together.
2015-04-04 22:43:42 +02:00
Tim Schaub
50f71655e5 Style docs 2015-04-04 17:38:03 +02:00
Tim Schaub
02c4c8b360 Tile grid docs 2015-04-04 17:38:02 +02:00
Tim Schaub
e2b37a74a5 WebGL context docs 2015-04-04 17:38:02 +02:00
Tim Schaub
4f428d7cd5 View docs 2015-04-04 17:38:02 +02:00
Tim Schaub
29c3bc066d Overlay docs 2015-04-04 17:36:48 +02:00
Tim Schaub
b735504564 Map docs 2015-04-04 17:36:48 +02:00
Tim Schaub
1174baa24e Image and image tile docs 2015-04-04 17:36:48 +02:00
Tim Schaub
6c960215bb Graticule docs 2015-04-04 17:36:47 +02:00
Tim Schaub
3ef5329bd9 Geolocation docs 2015-04-04 17:36:47 +02:00
Tim Schaub
c6a330e886 Feature overlay docs 2015-04-04 17:36:47 +02:00
Tim Schaub
16c6ccf40c Feature docs 2015-04-04 17:36:47 +02:00
Tim Schaub
044ea054b1 Extent docs 2015-04-04 17:36:47 +02:00
Tim Schaub
619da529ec Easing docs 2015-04-04 17:36:47 +02:00
Tim Schaub
7f34941be3 Device orientation docs 2015-04-04 17:36:47 +02:00
Tim Schaub
d09c4afefb Coordinate docs 2015-04-04 17:36:47 +02:00
Tim Schaub
fdabcd8219 Collection docs 2015-04-04 17:36:47 +02:00
Tim Schaub
1a10686299 Attribution docs 2015-04-04 17:36:46 +02:00
Tim Schaub
4463e173e6 Animation docs 2015-04-04 17:36:46 +02:00
tsauerwein
8e0c21eb58 Add test-suite using SlimerJS 2015-04-04 17:30:38 +02:00
Éric Lemoine
3267dbf92e Merge pull request #3494 from gberaudo/api_vector_context
Mark VectorContext @api
2015-04-04 17:04:25 +02:00
Bart van den Eijnden
f10cbba36f Merge pull request #3409 from bartvde/issue-3409
AssertionError in WMTS.optionsFromCapabilities.
2015-04-04 16:34:39 +02:00
Tobias Sauerwein
28a13e3b26 Merge pull request #3493 from tsauerwein/image-static-load
Add image loading events to ol.source.ImageStatic
2015-04-04 15:33:32 +02:00
Guillaume Beraudo
1553b88b9d Mark VectorContext @api
VectorContext type must be present in Ol3 externs to compile ol3-cesium.
Previously, the `IVectorContext` interface was exported to the externs.
2015-04-04 15:19:56 +02:00
tsauerwein
7c83581566 Add image loading events to ImageStatic 2015-04-04 15:18:35 +02:00
Tim Schaub
5eb7e5848e Merge pull request #3490 from tschaub/editorconfig
Add .editorconfig and instructions on its use.
2015-04-04 14:36:53 +02:00
Tim Schaub
0c9cb6f86d Merge pull request #3489 from gberaudo/abstract_vector_context
Use an abstract base class instead of IVectorContext.
2015-04-04 14:27:12 +02:00
Tim Schaub
29596ced00 Add .editorconfig and instructions on its use 2015-04-04 14:17:31 +02:00
Guillaume Beraudo
0e32456108 Use an abstract base class instead of IVectorContext
By having the abstract methods in the base class, subclasses can simply
override the methods they actually provide.
Additionally, this change fixes a regression in webgl canvas immediate.
2015-04-04 13:47:53 +02:00
Bart van den Eijnden
5e71fe4964 Make ol.source.WMTS work with ArcGIS WMTS 2015-04-04 13:42:06 +02:00
Tobias Sauerwein
a19c58e490 Merge pull request #3483 from tsauerwein/rotation-docs
Clarify view.setRotation docs
2015-04-04 11:40:52 +02:00
Andreas Hocevar
927a1cb722 Merge pull request #3485 from malaretv/build-handle-sigint
build.py graceful interrupt
2015-04-04 10:53:32 +02:00
vmalaret
422304cbca build.py graceful interrupt 2015-04-04 10:25:54 +02:00
Bart van den Eijnden
b3c251fb0d Merge pull request #3484 from bartvde/copy-example-css
Make sure we copy the example css if it exists
2015-04-04 10:23:06 +02:00
Bart van den Eijnden
39dd4dd56c Make sure we copy the example css if it exists 2015-04-04 10:04:35 +02:00
tsauerwein
b911d740d8 Clarify rotation docs 2015-04-04 09:41:29 +02:00
tsauerwein
921fd3ed3b Support generic ext. modules with browserify 2015-04-04 09:17:11 +02:00
Andreas Hocevar
d678e9e9a3 Merge pull request #3462 from ahocevar/gml-base-noapi
Remove ol.format.GMLBase from the API
2015-04-04 09:09:44 +02:00
Marc Jansen
e4d1d60a73 Merge pull request #3445 from marcjansen/faq
Start a FAQ document.
2015-04-03 21:12:26 +02:00
Marc Jansen
b8cf41a8c9 Merge pull request #3468 from marcjansen/coveralls-executable
Use the coveralls executable.
2015-04-03 21:09:42 +02:00
Tim Schaub
05c1e973a3 Merge pull request #3415 from malaretv/stable-only-off
Stable Only unchecked by default.
2015-04-03 20:08:16 +02:00
Éric Lemoine
7c0977de45 Merge pull request #3420 from elemoine/leaks
Unregister viewport size listener on setTarget(null)
2015-04-03 20:07:20 +02:00
Andreas Hocevar
da9de6ef1b Merge pull request #3456 from klokan/newmenu
Updated menu on the JSDOC template (non-responsive)
2015-04-02 20:55:59 +02:00
Andreas Hocevar
3bd408ed4d Merge pull request #3475 from openlayers/template-examples
Template examples
2015-04-02 20:54:48 +02:00
Tobias Sauerwein
8c2700b3c8 Merge pull request #3455 from tsauerwein/webgl-loaded-icon
Fix pre-loaded icons images for WebGL
2015-04-02 20:29:29 +02:00
Andreas Hocevar
cd266f35ab Add verbatim template and throw error on invalid front-matter 2015-04-02 20:28:32 +02:00
Marc Jansen
8e86fca453 Merge pull request #3473 from marcjansen/rotate-test
Add more tests for ol.coordinate.
2015-04-02 20:19:30 +02:00
Tim Schaub
6a105f9bcf Newlines 2015-04-02 19:23:02 +02:00
tsauerwein
ed1d9cc8fc Add imgSize to Icon options 2015-04-02 19:18:38 +02:00
Marc Jansen
3245fa43ae Add more tests for ol.coordinate. 2015-04-02 19:16:05 +02:00
Andreas Hocevar
2ef0e0db23 Templetize tileutfgrid example 2015-04-02 19:10:20 +02:00
Tim Schaub
664a287c94 Tissot's indicatrices 2015-04-02 19:10:20 +02:00
Bart van den Eijnden
3aa03e925c Port over the tilejson example 2015-04-02 19:10:19 +02:00
Björn Harrtell
9880a860a3 Converted examples 2015-04-02 19:10:19 +02:00
Tim Schaub
b9074342a6 TopoJSON example content 2015-04-02 19:10:19 +02:00
Bart van den Eijnden
e39a4561f6 Use the original geolocation-orientation example 2015-04-02 19:10:18 +02:00
Bart van den Eijnden
d10b83e8e1 Port teleport, load-events, tile-vector examples 2015-04-02 19:10:18 +02:00
Andreas Hocevar
2c2a0eaa78 Templetize examples starting with letter v 2015-04-02 19:10:18 +02:00
Bart van den Eijnden
5b57c7d4b8 Port over the measure, min-max-resolution, modify-features, modify-test, mouse-position and moveend examples 2015-04-02 19:10:17 +02:00
Andreas Hocevar
de13706df9 Templetize examples starting with letter w 2015-04-02 19:10:17 +02:00
Bart van den Eijnden
440832146e Port over lazy-source, line-arrows, localized-openstreetmap, mapguide-untiled and mapquest examples 2015-04-02 19:10:16 +02:00
Bart van den Eijnden
c75c704e9f Port over layer-clipping-webgl, layer-clipping, layer-extent, layer-group, layer-spy, layer-swipe examples 2015-04-02 19:10:16 +02:00
Marc Jansen
e3face3d9d Position the rotate control lower than usual
This way it does not overlap with the fullscreen control.
2015-04-02 19:10:16 +02:00
Andreas Hocevar
bf1985d712 Fix doctype 2015-04-02 19:10:16 +02:00
Bart van den Eijnden
b92d7cdf13 Port over image-filter, image-load-events, image-vector-layer, kml-earthquakes, kml-timezones and kml examples 2015-04-02 19:10:15 +02:00
Bart van den Eijnden
5cfb4910df Port over graticule, heatmap-earthquakes, hue-saturation, icon-sprite-webgl, icon, igc examples 2015-04-02 19:10:15 +02:00
Bart van den Eijnden
2ccdd87942 Port over the geolocation, getfeatureinfo-image, getfeature-info-tile, gpx examples 2015-04-02 19:10:15 +02:00
Bart van den Eijnden
2ebefc4466 Port over the full-screen, geojson and geolocation-orientation examples 2015-04-02 19:10:15 +02:00
Andreas Hocevar
78ce9de4af Better error reporting 2015-04-02 19:10:14 +02:00
Andreas Hocevar
b698f1ede8 Templetize examples starting with letters x-z 2015-04-02 19:10:14 +02:00
Bart van den Eijnden
d0d61e68c7 Port over epsg-4326, export-map, fractal and full-screen-drag-rotate-and-zoom examples 2015-04-02 19:10:14 +02:00
Bart van den Eijnden
0882754b49 Add bootstrap js to the example template 2015-04-02 19:10:14 +02:00
Bart van den Eijnden
e1ee36f46d Port over drag-rotate-and-zoom, draw-and-modify-features, draw-features, dynamic-data and earthquake-clusters examples 2015-04-02 19:10:13 +02:00
Andreas Hocevar
95c127d235 More documentation improvements 2015-04-02 19:10:13 +02:00
Andreas Hocevar
4cce0f4936 Move documentation to the right place 2015-04-02 19:10:13 +02:00
Bart van den Eijnden
b1e35f7fdd Port over canvas-tiles, center, cluster, d3, device-orientation, drag-and-drop-image-vector, drag-and-drop and drag-features example 2015-04-02 19:10:13 +02:00
Bart van den Eijnden
4ebceab51a Remove extra double quote when writing resources 2015-04-02 19:10:12 +02:00
Andreas Hocevar
6cc806f164 Add documentation for build-examples.js 2015-04-02 19:10:12 +02:00
Andreas Hocevar
bc617e8135 Add support for additonal js and css resources 2015-04-02 19:10:12 +02:00
Andreas Hocevar
0077626c93 Only create style block if there is css for the example 2015-04-02 19:10:11 +02:00
Bart van den Eijnden
f277082708 Port over box-selection, brightness-contrast and button-title examples 2015-04-02 19:10:11 +02:00
Bart van den Eijnden
7d453bc69e Port over the bind-input and bing-maps examples 2015-04-02 19:10:11 +02:00
Bart van den Eijnden
943cac755b Port over the animation, arcgis-tiled and attributions examples 2015-04-02 19:10:10 +02:00
Andreas Hocevar
8d87bd30f0 Fix typo in template 2015-04-02 19:10:10 +02:00
Bart van den Eijnden
dd3350c948 Use template for accessible.html example 2015-04-02 19:10:10 +02:00
Andreas Hocevar
821f31fa18 Use template for custom-controls.html example 2015-04-02 19:10:09 +02:00
Andreas Hocevar
e40ab58d10 Use template for simple.html example 2015-04-02 19:10:09 +02:00
Andreas Hocevar
ff1ee78ddd Build and parse examples from examples_src/ 2015-04-02 19:10:09 +02:00
Andreas Hocevar
2e9869057e Hide shortdesc in examples 2015-04-02 19:10:03 +02:00
Andreas Hocevar
1d940898b5 Add Task and template for building examples 2015-04-02 19:10:02 +02:00
Marc Jansen
1940f33c43 Add a FAQ document. 2015-04-02 17:20:07 +02:00
Tim Schaub
de9ad900c8 Merge pull request #3464 from tschaub/stable
Mark more of the API stable.
2015-04-02 16:44:06 +02:00
Tim Schaub
44ad7ce30a Update doc on using @api annotation 2015-04-02 16:23:54 +02:00
Tim Schaub
5bb7535207 Remove @api annotation from abstract method 2015-04-02 16:23:54 +02:00
Tim Schaub
587c06f565 Stable intersectsExtent method for geometries 2015-04-02 16:23:54 +02:00
Tim Schaub
6134a8bf7a Use @api annotations where geom methods are implemented 2015-04-02 16:23:53 +02:00
Tim Schaub
5c87efccdb Stable WMTS constructor and options 2015-04-02 16:23:53 +02:00
Tim Schaub
cedc78972d Mark tile load events as stable 2015-04-02 16:23:53 +02:00
Tim Schaub
5fe6f07969 Make the source.getFeaturesInExtent() method exportable 2015-04-02 16:23:53 +02:00
Tim Schaub
d79abe7448 Stable geometry methods 2015-04-02 16:23:53 +02:00
Tim Schaub
419483face Stable GeoJSON read/write methods 2015-04-02 16:23:53 +02:00
Tim Schaub
0b2c097686 Stable format read/write options 2015-04-02 16:23:53 +02:00
Tim Schaub
7ee8866f35 End the getResolutionForExtent experiment 2015-04-02 16:23:53 +02:00
Tim Schaub
21263f9184 Stable view methods 2015-04-02 16:23:42 +02:00
Tim Schaub
65f18e3caf Merge pull request #3469 from malaretv/readme
Update README.
2015-04-02 14:43:19 +02:00
Victor Malaret
d4ddb60e8b Update README
Adds basic quickstart, usage, issues, and community info to readme
2015-04-02 13:54:29 +02:00
Marc Jansen
1125e45856 Merge pull request #3467 from openlayers/coveralls-badge
Update the coveralls badge.
2015-04-02 13:44:54 +02:00
Marc Jansen
bca661ee57 Update the coveralls badge. 2015-04-02 13:21:35 +02:00
Marc Jansen
127e626315 Use the coveralls executable. 2015-04-02 13:15:55 +02:00
Marc Jansen
72a4b31e86 Merge pull request #3466 from marcjansen/show-coverage
Include coveralls code-coverage badge in README.
2015-04-02 12:58:15 +02:00
Marc Jansen
6aef9fe67a Include coveralls code-coverage badge in README. 2015-04-02 12:54:05 +02:00
Tim Schaub
89dc3a254b Stable object methods and events 2015-04-02 12:12:36 +02:00
Marc Jansen
d824996b97 Merge pull request #3457 from marcjansen/test-coverage
Integrate istanbul for test coverage
2015-04-02 12:04:26 +02:00
Tim Schaub
11ac778b29 Mark propertychange as stable 2015-04-02 12:04:01 +02:00
Tim Schaub
d541ae49d0 Mark moveend as stable 2015-04-02 12:03:21 +02:00
Tim Schaub
56a942e9cf Stable map browser events 2015-04-02 11:57:43 +02:00
Marc Jansen
8c8bd50a4a Add test-coverage target to build.py.
As suggested by @tsauerwein.
2015-04-02 11:49:32 +02:00
Andreas Hocevar
84b6114f02 Remove ol.format.GMLBase from the API
There is no need to have this exportable; the api annotation was probably
a leftover from the GML -> GMLBase renaming.
2015-04-02 10:52:58 +02:00
Marc Jansen
245aec8eba Fix typos in doc-comments. 2015-04-02 09:45:25 +02:00
Marc Jansen
17ea9ecef5 Run the istanbul code-coverage via node script. 2015-04-02 09:16:43 +02:00
Éric Lemoine
5293cdc780 Merge pull request #3446 from elemoine/updatewhileinteracting
Add updateWhileInteracting to olx.layer.VectorOptions
2015-04-02 09:14:53 +02:00
Marc Jansen
6a9c8f36f7 Refactor tasks/test.js to be more modular.
This way the main functionality of the script can be reused in the
tasks/test-coverage.js script, which has to run the testsuite as well.
2015-04-02 09:13:17 +02:00
Bart van den Eijnden
7c9795ba35 Integrate istanbul for test coverage 2015-04-02 08:57:53 +02:00
Petr Pridal
f47009447b Retina ol logo 35px (70px) for the JSDOC template 2015-04-02 08:43:26 +02:00
Petr Pridal
4427d0ba42 Updated menu on the JSDOC template (non-responsive) 2015-04-01 19:42:57 +02:00
Éric Lemoine
6d55e4aa99 Merge pull request #3438 from gberaudo/parser_documentation
Parser documentation and XML readme
2015-04-01 14:16:03 +02:00
Bart van den Eijnden
15a3bcac13 Merge pull request #3449 from gberaudo/fix_replay_assert
Fix assertion message
2015-04-01 11:42:30 +02:00
Guillaume Beraudo
7765d7304c Fix assertion message 2015-04-01 11:29:28 +02:00
vmalaret
4daf08ec1d Rename flag to 'stableonly' 2015-04-01 09:26:17 +02:00
Éric Lemoine
42c4ae9ced Add updateWhileInteracting to olx.layer.VectorOptions 2015-04-01 08:27:29 +02:00
Andreas Hocevar
62ce9b44c8 Merge pull request #3440 from ahocevar/gentle-introduction-to-projections
Add fromLonLat and toLonLat convenience functions
2015-03-31 20:46:51 +02:00
Andreas Hocevar
5579dc53a2 Add fromLonLat and toLonLat convenience functions 2015-03-31 19:27:35 +02:00
Guillaume Beraudo
aa63f1ad6a Add some documentation to ol.xml. 2015-03-31 19:25:44 +02:00
Guillaume Beraudo
2ba2162416 Add a readme about XML parser and format
The readme content is the result of the merge of two wiki pages.
2015-03-31 19:25:41 +02:00
Éric Lemoine
fc9563ad65 Merge pull request #3423 from gberaudo/parse_extrude_and_altitudeMode
Parse extrude and altitude mode
2015-03-31 18:29:34 +02:00
Frédéric Junod
4619cac9ce Merge pull request #3431 from fredj/cleanup
Better typing
2015-03-31 17:38:00 +02:00
Guillaume Beraudo
f25302f8b7 Parse KML extrude and altitudeMode from multi geometries
Handle MultiPoint, MultiLineString, MultiPolygon.
LinearRing properties are not handled.

An 'extrude' boolean array property is set in the geometry properties.
An 'altitudeMode' string array property is set in the geometry properties.
2015-03-31 17:21:12 +02:00
Andreas Hocevar
5a7cce86a5 Merge pull request #3436 from ahocevar/contributing-readme
Mention readme.md files as help for contributors
2015-03-31 16:36:09 +02:00
Andreas Hocevar
c5b5a9a311 Mention readme.md files as help for contributors 2015-03-31 16:04:35 +02:00
Frédéric Junod
1fc59df766 Merge pull request #3433 from fredj/missing-provide
Add missing goog.provide/goog.require ol.source.TileEvent
2015-03-31 15:48:54 +02:00
Guillaume Beraudo
5bd63f7e2c Parse KML extrude and altitudeMode of simple geometries
Point, LineString and Polygon are handled.
LinearRing properties are not handled.

An 'extrude' boolean property is set in the geometry properties.
An 'altitudeMode' string property is set in the geometry properties.
2015-03-31 15:30:58 +02:00
Guillaume Beraudo
ea8ee16f49 Fix return type of ol.xml.pushParseAndPop 2015-03-31 15:28:20 +02:00
Guillaume Beraudo
567a9d7a5a Make ol.geom.Geometry inherit from ol.Object
This will allow storing per-geometry properties.
2015-03-31 15:28:20 +02:00
Frederic Junod
4bfe49723e Add missing goog.provide/goog.require ol.source.TileEvent 2015-03-31 15:06:36 +02:00
Frederic Junod
d138b2d1d5 Better typing 2015-03-31 14:32:23 +02:00
Éric Lemoine
c993964d27 Merge pull request #3422 from elemoine/multi-filter
Fix Select behavior when multi is false
2015-03-31 14:16:32 +02:00
Marc Jansen
e5f6bae49b Merge pull request #3428 from marcjansen/reorder-assertions
Reorder assertions and variable declarations.
2015-03-31 10:31:34 +02:00
Marc Jansen
2077211e67 Reorder assertions and variable declarations. 2015-03-31 10:19:04 +02:00
Frédéric Junod
afa2238ccd Merge pull request #3414 from fredj/require-atlas-manager
Add missing ol.style.AtlasManager goog.require
2015-03-31 10:14:58 +02:00
Pierre GIRAUD
68d57be3a8 Merge pull request #3429 from pgiraud/selectfilterfunction_provide
Adding missing provide for SelectFilterFunction
2015-03-31 09:46:09 +02:00
Pierre GIRAUD
4b453f5be6 Adding missing provide for SelectFilterFunction 2015-03-31 09:36:25 +02:00
Bart van den Eijnden
c975f303cf Merge pull request #3426 from bartvde/assert-messages
Add assertion messages for all assertion statements
2015-03-30 23:52:47 +02:00
Bart van den Eijnden
47ce127a10 Add assert messages for all assertions up until ol.renderer.vector. 2015-03-30 22:55:23 +02:00
Marc Jansen
fb9ba22c30 Add message to assertions. 2015-03-30 22:53:03 +02:00
Éric Lemoine
2c40d74a15 Merge pull request #3425 from elemoine/olol
Fix typo in ol.js
2015-03-30 21:29:09 +02:00
Tim Schaub
6ba2f35df6 Merge pull request #3424 from tschaub/fewer-exports
Remove `@api` annotation from `ol.WEBGL_MAX_TEXTURE_SIZE`.
2015-03-30 21:21:22 +02:00
Éric Lemoine
28d00c9676 Fix typo in ol.js 2015-03-30 21:02:40 +02:00
Tim Schaub
255e1de3a4 Remove @api annotation from ol.WEBGL_MAX_TEXTURE_SIZE 2015-03-30 20:57:41 +02:00
Éric Lemoine
9022530bf9 Fix Select behavior when multi is false
This commit addresses https://github.com/openlayers/ol3/pull/3402#issuecomment-87701660.
2015-03-30 18:32:36 +02:00
Éric Lemoine
f1d7e2ec85 Unregister tile change listeners
When the tile queue loads a tile it registers a "change" listener on that tile. But currently that listener is not unregistered, unless the tile cache containing that tile fills up and "dipose" is called on that tile.

This commit makes handleTileChange deregister the "change" listener on the tile, if the tile is now in "loaded" state.
2015-03-30 16:54:09 +02:00
Éric Lemoine
10e30d1ab5 Merge pull request #3419 from elemoine/describeonly
Remove describe.only
2015-03-30 16:51:38 +02:00
Éric Lemoine
192c9d697e Unregister the viewport listener on setTarget(null)
This commit unregisters the viewport resize listener when setTarget(null) is called, and registers it when setTarget(target) is called, and when we don't have that listener registered yet.

This prevents memory leaks where references to map objects are retained because of these viewport resize listeners.
2015-03-30 16:50:58 +02:00
Éric Lemoine
f6461afdac Remove describe.only 2015-03-30 16:34:50 +02:00
Andreas Hocevar
9add762f63 Merge pull request #3417 from fperucic/ol.interaction.Snap-extentFix
ol.interaction.Snap extent fix
2015-03-30 16:08:57 +02:00
Fran Peručić
6343c0420d fix: prevent indexed extent from beeing overwitten
when using ol.source.Vector with snap, indexedFeaturesExtents_ is updated whenever source calls geometry#getExtent
2015-03-30 15:13:09 +02:00
Fran Peručić
60dbe93f7f fix: set pendingFeatures_ as object on init 2015-03-30 15:01:23 +02:00
Éric Lemoine
7c55639632 Merge pull request #3410 from gberaudo/ol_object_unset
Add ol.Object.unset() method
2015-03-30 13:45:58 +02:00
Éric Lemoine
91d14a35bb Merge pull request #3402 from elemoine/selectfilter
Add "filter" option to Select interaction
2015-03-30 13:45:46 +02:00
Éric Lemoine
f90308b504 Tests for the Select interaction's filter option 2015-03-30 13:35:00 +02:00
Guillaume Beraudo
6e7221ca28 Add ol.Object.unset() method
Allow deleting a property.
2015-03-30 13:30:10 +02:00
Éric Lemoine
2f417bbb28 Add empty lines for better code readability 2015-03-30 13:07:50 +02:00
acanimal
1f0c21ac60 Add "filter" option to Select interaction 2015-03-30 13:07:02 +02:00
Frédéric Junod
b9a35a9c2e Merge pull request #3416 from fredj/cleanup
Remove unnecessary typecasts in examples
2015-03-30 11:33:00 +02:00
Frederic Junod
778ccd3999 Remove unnecessary typecasts in examples 2015-03-30 11:00:15 +02:00
Andreas Hocevar
360c34dfbe Merge pull request #3411 from fperucic/ol.interaction.Snap-fix
Listen for a 'change:geometry' event
2015-03-30 10:42:36 +02:00
vmalaret
3576f8b793 Stable Only unchecked by default in docs.
Having it on by default makes it difficult
for new users to find commonly used functionality.
2015-03-30 10:37:50 +02:00
Bart van den Eijnden
589e85941a Bump copyright year to 2015 2015-03-30 10:05:21 +02:00
Frederic Junod
632205d902 Add missing ol.style.AtlasManager goog.require 2015-03-30 09:27:13 +02:00
Fran Peručić
4168cda453 add: listen for 'change:geometry'
Geometry index won't be updated correctly if feature geometry is changed using `feature.setGeometry(new_geometry)`
ol.interaction.Snap should listen for a 'change:geometry' event on ol.Feature
2015-03-29 18:55:08 +02:00
Fran Peručić
4b85f5737c replaced ol.Collection with Array 2015-03-29 10:57:44 +02:00
Andreas Hocevar
254039a6ab Merge pull request #3109 from fperucic/snap-feature
Snap feature
2015-03-27 14:45:57 +01:00
Alexandre Dubé
d740640321 Fix type of source and features 2015-03-27 09:07:34 -04:00
Andreas Hocevar
056c3ad23e Add consistency for pointer event handlers
Now all are private static functions.
2015-03-27 08:58:28 -04:00
Alexandre Dubé
b34d7ce6cc Fix - support ol.Collection only as features 2015-03-27 08:58:21 -04:00
Bart van den Eijnden
98c510a729 Merge pull request #3407 from bartvde/340-changelog-update
Add v3.4.0 empty section to upgrade notes
2015-03-27 13:56:31 +01:00
Bart van den Eijnden
9984a8bec7 Add v3.4.0 empty section to upgrade notes 2015-03-27 13:42:12 +01:00
Fran Peručić
42d2adb1cf fix: repeating sort function + js annotation
Sort function is now bind to this, and it uses a pixelCoordinate_ member.
ol.interaction.Snap.handleEvent is removed
js annotations are modified
2015-03-27 12:48:52 +01:00
Bart van den Eijnden
626d1da0e7 Merge pull request #3406 from bartvde/release-v3.4.0
Release v3.4.0
2015-03-27 10:22:38 +01:00
Bart van den Eijnden
96c670cebf Update package version to 3.4.0 2015-03-27 10:08:50 +01:00
Bart van den Eijnden
42366c3d00 Changelog for v3.4.0 2015-03-27 10:08:30 +01:00
Fran Peručić
ebc18b4f68 fix: updateing geometry index
More than one features can be be changed while handlingDownUpSequence
exampe: ol.interaction.Modify supports simultaneous editing of multiple features

When a geometry changes old indexed segments are searched by the feature extend and removed. New ones are added.
Old feature extent sholud be used when removing the old indexed segments.
2015-03-26 23:49:29 +01:00
Fran Peručić
299647a957 remove unnecessary flag dragging_ 2015-03-26 22:36:38 +01:00
Alexandre Dubé
1a5d7b85d2 Add/remove features in setMap 2015-03-26 15:19:33 -04:00
Alexandre Dubé
5bffa99e83 Trivial - reorder methods & comment 2015-03-26 14:48:44 -04:00
Alexandre Dubé
49a3f0a0b7 Update geometry index inside Snap interaction 2015-03-26 12:24:54 -04:00
Bart van den Eijnden
d698e2fcee Merge pull request #3383 from bartvde/xmleql-performance
GML3 tests time out in unit tests
2015-03-26 17:10:25 +01:00
Bart van den Eijnden
7d5ede6728 Restore the previous error messages 2015-03-26 16:48:22 +01:00
Bart van den Eijnden
616a0b161e Speed up xmleql performance 2015-03-26 16:03:28 +01:00
Tim Schaub
6e878468ae Merge pull request #3401 from tschaub/geojson-orientation
Allow GeoJSON to be serialized according to the right-hand rule.
2015-03-26 08:44:57 -06:00
Frédéric Junod
9b23572d4e Merge pull request #3403 from fredj/unused-require
Remove unused goog.require
2015-03-26 14:08:24 +01:00
Alexandre Dubé
d1c3dc51ad Fix Drag interaction, works with modify now 2015-03-26 08:36:24 -04:00
Frederic Junod
c0c3057498 Remove unused goog.require 2015-03-26 11:54:37 +01:00
Andreas Hocevar
34851d8ecb Merge pull request #3362 from ahocevar/constructor-proj4js
Configure proj4 options and transforms upon construction
2015-03-26 11:21:52 +01:00
Andreas Hocevar
362c9b6851 Clarification of the purpose of ol.proj.addProjection 2015-03-26 10:52:19 +01:00
Andreas Hocevar
a920cd94d9 Create ol.proj.Projection instances with additional properties 2015-03-26 10:50:52 +01:00
Andreas Hocevar
338901774b Configure proj4 options and transforms upon construction 2015-03-26 10:39:26 +01:00
Frédéric Junod
2c04e4c071 Merge pull request #3394 from fredj/fullscreen-css-name
Fix fullscreen pseudo CSS class name
2015-03-26 09:00:57 +01:00
Tim Schaub
be0c9f3c8a Allow orienting coordinates when serializing GeoJSON 2015-03-25 18:32:31 -06:00
Tim Schaub
5d590bcf95 Allow access to right-hand oriented multi-polygon coordinates 2015-03-25 16:57:29 -06:00
Tim Schaub
7572f27cf9 Allow access to right-hand oriented polygon coordinates 2015-03-25 16:57:29 -06:00
Tim Schaub
ce36947bdb Allow orienting with the right-hand rule 2015-03-25 16:57:25 -06:00
Tim Schaub
5f6ceff3a7 Use ol.geom.flat.orient namespace 2015-03-25 16:33:17 -06:00
Alexandre Dubé
d92917ac89 Fix Snap -> Interaction
This commit changes ol.Snap -> ol.interaction.Snap, which extends
ol.interaction.Pointer.  The 'pointerdown', 'pointermove' and
'pointerup' map browser events are hanlded to edit the pixel and
coordinate properties to make them 'snap' to the closest feature.
2015-03-25 15:10:41 -04:00
Andreas Hocevar
7d20e2a317 Merge pull request #3399 from ahocevar/tilegrid-widths-docs
Clarify when widths need to be configured on a tile grid
2015-03-25 17:18:27 +01:00
Andreas Hocevar
0d507dcbb0 Clarify when widths need to be configured on a tile grid 2015-03-25 16:52:45 +01:00
Andreas Hocevar
c600a92516 Merge pull request #3398 from ahocevar/safe-wrapx
Make sure that the return value of wrapX() is stable
2015-03-25 16:21:53 +01:00
Andreas Hocevar
1df8cba753 Make sure that the return value of wrapX() is stable 2015-03-25 15:59:59 +01:00
Frédéric Junod
bb87b8e7ce Merge pull request #3396 from fredj/sort-compareFn
Move the compare function out of ol.interaction.Modify.handleDownEvent_
2015-03-25 14:57:50 +01:00
Frederic Junod
6a770f03b8 Move the compare function out of ol.interaction.Modify.handleDownEvent_ 2015-03-25 14:41:40 +01:00
Andreas Hocevar
683097d62a Merge pull request #3395 from fperucic/inteaction.modify-fix
ol.Interaction.Modify fixes
2015-03-25 14:16:37 +01:00
Andreas Hocevar
e58a470e69 Merge pull request #3387 from ahocevar/wmts-wrapx
Add wrapX option for ol.source.WMTS
2015-03-25 14:01:04 +01:00
Fran Peručić
56067d1cda Prevent unnecessary function calls
handlePointerMove_ doesn't need to be called when dragging.
handleDragEvent_ takes care of the event in that case.

in handleDragEvent_, createOrUpdateVertexFeature_ doesn't need to be called for each dragged segment. it can be called only once with current vertex.

fixes made to pass the build
2015-03-25 11:19:24 +01:00
Frederic Junod
40f4d5256b Fix fullscreen pseudo CSS class name
Change from `:full-screen` to `:fullscreen`.
See https://fullscreen.spec.whatwg.org/#:fullscreen-pseudo-class
2015-03-25 11:14:52 +01:00
Fran Peručić
279d1829bb fix: ol.interaction.Select conflict
Prevent vertexFeature_ from ol.interaction.Modify from being selected by ol.interaction.Select.
The bug occurs when an delete attempt fails. ex: clicikng on the first or last node of LineString,
or clicking a line segment between two nodes.
2015-03-25 10:52:29 +01:00
Fran Peručić
eb6d61e6d1 fix: modifying the closed LineString
This commit fixes the bug that occurs when trying to modify
a closed LineString by clicking on the starting/ending node.

Such a closed line is added to the modify-test example.
2015-03-25 10:44:35 +01:00
Fran Peručić
7dff739bce Deleting a duplicate node
Fix a bug in ol.interaction.Modify when trying to delete nodes
on a geometry that has duplicate nodes. A bug occurs when
clicking on the duplicate node.
2015-03-25 10:34:36 +01:00
Frédéric Junod
8beeee8a95 Merge pull request #3393 from fredj/cleanup
Remove unused define
2015-03-25 08:54:27 +01:00
Andreas Hocevar
ebb40c8046 Clean up docs and consistently work with resolutions 2015-03-24 19:03:33 +01:00
Andreas Hocevar
4822ca273f Give tile grids a width 2015-03-24 19:03:09 +01:00
Tobias Sauerwein
563d51b389 Merge pull request #3392 from tsauerwein/fullscreen-class
Fix switching class name of full-screen control
2015-03-24 18:26:20 +01:00
Andreas Hocevar
57d9b87fb3 Add wrapX option for ol.source.WMTS 2015-03-24 17:13:07 +01:00
Frederic Junod
4c36e05f27 Remove unused define
Should have been removed in #40
2015-03-24 17:10:27 +01:00
tsauerwein
eb7dde6d0f Fix class name of full-screen control 2015-03-24 17:07:55 +01:00
Frédéric Junod
1d04eabeda Merge pull request #3391 from fredj/cleanup
Minor code cleanup
2015-03-24 14:57:51 +01:00
Frédéric Junod
5c6c45fc92 Merge pull request #3388 from fredj/polyline-layout
Add new geometry layout option for polyline format
2015-03-24 14:44:06 +01:00
Frederic Junod
b7c4e4f297 Remove console.debug from selectinteraction tests 2015-03-24 14:42:30 +01:00
Frederic Junod
6a8b236d82 Remove unnecessary newlines 2015-03-24 14:41:40 +01:00
Frederic Junod
e669b20ed5 Add new geometry layout option for polyline format
To be able to choose the geometry layout of the feature geometries created by
the format reader.

Default is `ol.geom.GeometryLayout.XY`
2015-03-24 11:39:18 +01:00
Éric Lemoine
ae2c9144e1 Merge pull request #3385 from elemoine/getzforresolution
Fix ol.tilegrid.TileGrid#getZForResolution
2015-03-23 18:31:42 +01:00
Andreas Hocevar
45e9695239 Merge pull request #3377 from ahocevar/attribution-wrapx
Support wrapX for attributions
2015-03-23 18:05:13 +01:00
Éric Lemoine
79748c6f0c Fix ol.tilegrid.TileGrid#getZForResolution
This fixes a bug in ol.tilegrid.TileGrid#getZForResolution where this function doesn't take minZoom and maxZoom into account when selecting a zoom level for a resolution.

Fixes #2780.
2015-03-23 18:04:13 +01:00
Andreas Hocevar
d9c04cd925 Support wrapX for attributions 2015-03-23 16:55:50 +01:00
Andreas Hocevar
7df00242f0 Merge pull request #3382 from ahocevar/github-source-links
Create github source links
2015-03-23 16:47:47 +01:00
Andreas Hocevar
4862a8c897 Create github source links 2015-03-23 16:08:36 +01:00
Andreas Hocevar
8813eb0112 Merge pull request #3376 from ahocevar/wms-tile-wrapx
Add ol.source.Tile support for wrapping around the x-axis
2015-03-23 14:37:12 +01:00
Andreas Hocevar
b75f7f9e3b Merge pull request #3378 from ahocevar/questions
Clarify where to ask questions
2015-03-23 14:24:14 +01:00
Andreas Hocevar
9b4cb96502 Clarify where to ask questions 2015-03-23 14:14:34 +01:00
Frédéric Junod
c71db17c1d Merge pull request #3380 from fredj/more-geojson-tests
Test the GeoJSON layout
2015-03-23 13:29:13 +01:00
Frederic Junod
bfd9ec1ef1 Test the GeoJSON layout 2015-03-23 12:47:34 +01:00
Andreas Hocevar
3e18b85206 Add ol.source.Tile support for wrapping around the x-axis 2015-03-22 14:27:19 +01:00
Frédéric Junod
c707c5e9db Merge pull request #3360 from fredj/dispose-imagetile
Don't unlisten image twice when disposing an ol.ImageTile
2015-03-18 11:46:09 +01:00
Frederic Junod
f474e7ccd9 Don't unlisten image twice when disposing an ol.ImageTile
Fixes #3325
2015-03-18 10:33:41 +01:00
Andreas Hocevar
752cf78e50 Merge pull request #3361 from ahocevar/test-listen-localhost
Listen on localhost to avoid phantomjs browsing 0.0.0.0
2015-03-18 09:54:08 +01:00
Andreas Hocevar
52ee1b1630 Merge pull request #3365 from ahocevar/pointresolution-docs
Better docs for #getPointResolution
2015-03-18 09:53:29 +01:00
Andreas Hocevar
d8f624bf44 Better docs for #getPointResolution 2015-03-18 09:26:02 +01:00
Andreas Hocevar
7916f36f7a Merge pull request #3363 from bill-chadwick/master
New ol.proj features
2015-03-18 00:22:34 +01:00
bill-chadwick
3efea3ddfc Update to ol.proj
Add support for custom getPointResolution
and setting the 'global' boolean
2015-03-17 23:08:11 +00:00
Andreas Hocevar
9462c2148d Listen on localhost to avoid phantomjs browsing 0.0.0.0 2015-03-17 14:39:00 +01:00
Bart van den Eijnden
8061b69495 Merge pull request #3305 from bartvde/image-load-events
Add image loading events to image sources (r=@ahocevar,@elemoine)
2015-03-17 13:07:37 +01:00
Bart van den Eijnden
4569858882 Add image loading events to image sources 2015-03-17 12:56:39 +01:00
Frédéric Junod
3a7b9751d7 Merge pull request #3343 from fredj/line-arrows
Line arrows example
2015-03-16 14:30:08 +01:00
Frédéric Junod
d3f246518b Merge pull request #3354 from fredj/geojson-write-options
Mark ol.format.GeoJSON#writeFeature(s) option param optional
2015-03-16 11:31:59 +01:00
Frederic Junod
b9aba8babd Add optional this param to the callback function 2015-03-16 11:25:51 +01:00
Frederic Junod
023816f43b Add new line-arrows example 2015-03-16 10:43:33 +01:00
Frederic Junod
4b13627fd7 Add new ol.geom.LineString#forEachSegment function 2015-03-16 10:43:33 +01:00
Frédéric Junod
dd23403315 Merge pull request #3346 from fredj/geojson-feature-properties
Set the 'properties' member to null if the feature has not properties
2015-03-16 10:21:05 +01:00
Frederic Junod
3a7d1ebd16 Mark ol.format.GeoJSON#writeGeometry option param optional 2015-03-16 09:25:50 +01:00
Frederic Junod
180a75d714 Mark ol.format.GeoJSON#writeFeature option param optional 2015-03-16 09:20:57 +01:00
Frederic Junod
0997a171a0 Mark ol.format.GeoJSON#writeFeatures option param optional 2015-03-16 09:18:52 +01:00
Frederic Junod
96883e0b69 Set the 'properties' member to null if the feature has not properties 2015-03-12 15:58:16 +01:00
Frédéric Junod
da94ee5754 Merge pull request #3344 from fredj/cleanup
Minor code cleanup
2015-03-12 13:24:02 +01:00
Frederic Junod
5a350fb978 Remove unused goog.require 2015-03-12 12:25:38 +01:00
Frederic Junod
d87da4b3c8 Better 'rotation' option documentation 2015-03-12 12:17:25 +01:00
Éric Lemoine
80fa7e5ba1 Merge pull request #3237 from Morgul/ccase-circle-drawing
Add circles to Draw interaction.
2015-03-11 17:08:10 +01:00
Christopher S. Case
1fb932f7bb Removed lurking console.log 2015-03-11 10:09:58 -05:00
Frédéric Junod
b26bea8e88 Merge pull request #2691 from fredj/will-change
Add will-change CSS properties
2015-03-11 12:15:44 +01:00
Frederic Junod
1a80c0ef01 Add will-change CSS property to ol-overlay-container elements 2015-03-11 11:08:14 +01:00
Frederic Junod
dcba9f2ff4 Add a 'ol-overlay-container' CSS class to the overlay element 2015-03-11 11:08:14 +01:00
Frederic Junod
064cd5695a Add will-change CSS property to scale line and rotate controls 2015-03-11 11:08:14 +01:00
Frédéric Junod
b6adeea4f4 Merge pull request #3336 from fredj/getTargetElement
Use ol.Map#getTargetElement function
2015-03-09 17:15:20 +01:00
Frédéric Junod
49a807fa56 Merge pull request #3335 from fredj/rbush
Update rbush to version 1.3.5
2015-03-09 17:14:51 +01:00
Frederic Junod
7dcef882c2 Use ol.Map#getTargetElement function 2015-03-09 16:21:03 +01:00
Frederic Junod
b6b8ae265c Update rbush to version 1.3.5 2015-03-09 16:03:09 +01:00
Frédéric Junod
9951c88343 Merge pull request #3322 from fredj/drawinteraction-map.isDef
Remove unneeded map.isDef call
2015-03-09 09:01:05 +01:00
Andreas Hocevar
c9715d32b0 Merge pull request #3327 from ahocevar/dist-css
Add css to dist directory
2015-03-07 21:55:25 +01:00
Andreas Hocevar
47f32a30b8 Merge pull request #3324 from ahocevar/select-event-interface
Add interface definition for ol.SelectEvent
2015-03-06 12:41:05 +01:00
Andreas Hocevar
d8150c5155 Add interface definition for ol.SelectEvent 2015-03-06 11:31:30 +01:00
Andreas Hocevar
1b640870b1 Add css to dist directory 2015-03-06 11:20:01 +01:00
Frederic Junod
0d979e37b8 Remove unneeded map.isDef call 2015-03-05 18:12:23 +01:00
Frederic Junod
daf81b9c26 Remove unused goog.require 2015-03-05 18:11:19 +01:00
Frédéric Junod
4b1accb149 Merge pull request #3315 from fredj/tissot-desc
Fix Tissot indicatrix example description
2015-03-05 13:55:06 +01:00
Frederic Junod
b79174d6a3 Fix Tissot indicatrix example description
Fixes #3314
2015-03-05 12:36:37 +01:00
Andreas Hocevar
41fe72fab5 Merge pull request #3312 from ahocevar/arcgis-hidpi
Fix HiDPI support for ArcGIS REST
2015-03-04 22:33:21 +01:00
Andreas Hocevar
8f1726ae39 Fix HiDPI support for ArcGIS REST 2015-03-04 22:11:16 +01:00
Bart van den Eijnden
3867c0e45a Merge pull request #2910 from bartvde/issue-2910
Support multiple featureTpes in GML parser
2015-03-04 18:59:05 +01:00
Bart van den Eijnden
15ab515ceb Add docs to explain how to use featureNS in the case of multiple feature namespaces 2015-03-04 18:33:56 +01:00
Éric Lemoine
aad727ad14 Merge pull request #3309 from bjornharrtell/select-multi-fix
Fix select event always reporting as multi select
2015-03-04 18:04:15 +01:00
Bart van den Eijnden
b698fe9968 Support multiple featureTypes with a different featureNS 2015-03-04 15:27:05 +01:00
Andreas Hocevar
b782e0be98 Merge pull request #3307 from ahocevar/scaleline-units
Handle all non-degree units in ol.control.ScaleLine
2015-03-04 11:20:05 +01:00
Bart van den Eijnden
b05ead4056 Allow multiple featureTypes through ol.format.WFS as well 2015-03-04 10:24:42 +01:00
Bart van den Eijnden
d0180f35e0 Support multiple featureTypes as well in autoconfigure mode 2015-03-04 10:20:36 +01:00
Bart van den Eijnden
3a7905f2fd Support multiple feature types in GML format 2015-03-04 10:16:25 +01:00
Björn Harrtell
49c2af165a Fix select event always reporting as multi select 2015-03-04 08:48:08 +01:00
Andreas Hocevar
7527eddbaf Merge pull request #3308 from ahocevar/release-v3.3.0
Release v3.3.0
2015-03-03 22:28:30 +01:00
Andreas Hocevar
6854833fbd Update package version to 3.3.0 2015-03-03 22:27:25 +01:00
Andreas Hocevar
c8b90adfef Changelog for v3.3.0 2015-03-03 22:27:15 +01:00
Andreas Hocevar
d33a45dfa2 Merge pull request #3263 from cwgrant/master
Support ArcGIS Rest Services
2015-03-03 21:40:33 +01:00
Andreas Hocevar
1cec149681 Merge pull request #3295 from sarametz/wmts-getcap
Add RESTful to WMTS GetCapabilities optionsFromCapabilities
2015-03-03 21:13:00 +01:00
Andreas Hocevar
2e3d0d57d5 Handle all non-degree units in ol.control.ScaleLine 2015-03-03 21:06:12 +01:00
Frédéric Junod
a629be0e2e Merge pull request #3304 from fredj/scaleline-padding
Remove scale line inner padding
2015-03-03 17:46:29 +01:00
Frederic Junod
6c32b280f5 Remove scale line inner padding
Fixes #3291
2015-03-03 17:06:41 +01:00
Éric Lemoine
787ab91eef Merge pull request #3296 from elemoine/changes
Add upgrade-notes.md file
2015-03-03 14:28:30 +01:00
Andreas Hocevar
5b539a75bb Merge pull request #3303 from ahocevar/us-ft
Add constant for us-ft units
2015-03-03 14:01:02 +01:00
Andreas Hocevar
a6f80ef4b8 Add constant for us-ft units 2015-03-03 13:51:23 +01:00
Andreas Hocevar
de42334b19 Merge pull request #3018 from bjornharrtell/selectevent
Add SelectEvent to interaction
2015-03-03 12:56:42 +01:00
Björn Harrtell
e4b1d6e1de Add SelectEvent to Select interaction
Fixes
2015-03-03 12:22:01 +01:00
Sara Metz
cadc346de2 Added RESTful to valid requestEncoding values 2015-03-03 12:45:24 +13:00
Andreas Hocevar
927a0a4627 Merge pull request #3301 from bjornharrtell/select-tests
Select interaction unit tests
2015-03-02 21:12:15 +01:00
Björn Harrtell
d9cf8df052 Select interaction unit tests 2015-03-02 19:52:48 +01:00
Bart van den Eijnden
2ff3682eff Update README.MD with stackoverflow 2015-03-02 15:27:03 +01:00
Frédéric Junod
8836dd6e70 Merge pull request #3298 from fredj/source-object
Make ol.source.Source inherit from ol.Object
2015-03-02 15:07:33 +01:00
Frederic Junod
6ab0ed2df7 Make ol.source.Source inherit from ol.Object 2015-03-02 14:48:17 +01:00
Frédéric Junod
8dd3e7ebff Merge pull request #3297 from fredj/wmts-getter
Add getters to ol.source.WMTS
2015-03-02 11:11:12 +01:00
Éric Lemoine
7f71876dad Add upgrade-notes.md file
This file includes upgrade notes for changes to the library that require changes to application code. This file is used by the release manager to fill the "Upgrade notes" section in the v3.x.y.md changelog file.
2015-03-02 10:37:42 +01:00
Frederic Junod
54bea174ff Add new ol.source.WMTS#getMatrixSet api function 2015-03-02 09:51:11 +01:00
Frederic Junod
9d37090e6b Add new ol.source.WMTS#getFormat api function 2015-03-02 09:40:08 +01:00
Frederic Junod
b42a214252 Add new ol.source.WMTS#getVersion api function 2015-03-02 09:40:08 +01:00
Frederic Junod
61d2506970 Add new ol.source.WMTS#getStyle api function 2015-03-02 09:40:08 +01:00
Frederic Junod
3bfbd47fdb Add new ol.source.WMTS#getLayer api function 2015-03-02 09:40:08 +01:00
Éric Lemoine
4f5cc22ba0 Merge pull request #3281 from adube/fix-ie-mousemove-condition
Fix mouseMove event type comparison for IE10-11, pointermove
2015-03-02 09:15:15 +01:00
Andreas Hocevar
a7205d8aec Merge pull request #3293 from ahocevar/icon-opacity
Add missing opacity option for ol.style.IconOptions
2015-03-01 17:11:02 +01:00
Andreas Hocevar
6d0fb4d74e Add missing opacity option for ol.style.IconOptions 2015-03-01 12:07:19 +01:00
Alexandre Dubé
d1185da6b1 Replace mouseMove event condition by pointerMove
The original browser event was used to catch the mousemove event,
but in IE the 'pointermove' event is returned instead. So, instead
of using the original event, we use the map browser event, which
is always 'pointermove'.
2015-02-27 12:14:13 -05:00
Frédéric Junod
6c4b30fa02 Merge pull request #3284 from fredj/jsdoc
Fix jsdoc type for arrays of listening keys
2015-02-26 12:26:17 +01:00
Frederic Junod
e2f8c01c42 Fix jsdoc type for arrays of listening keys 2015-02-26 11:45:15 +01:00
Éric Lemoine
ad7616abb2 Merge pull request #3278 from elemoine/draweventtype
Add goog.provide for ol.DrawEventType
2015-02-26 10:46:12 +01:00
Éric Lemoine
56b08adef7 Add goog.provide for ol.DrawEventType 2015-02-25 21:59:57 +01:00
Éric Lemoine
70162d7889 Merge pull request #3272 from acanimal/3267
Added getter function to return the wrapped source within the cluster
2015-02-25 21:55:04 +01:00
Frédéric Junod
4c1be5967d Merge pull request #3275 from fredj/heatmap-properties
Add ol.layer.Heatmap#blur getter and setter
2015-02-25 17:29:48 +01:00
Frederic Junod
d12cdc336c Create the circle only when the blur and radius are set 2015-02-25 09:16:42 +01:00
Frederic Junod
232f4975c4 Add ol.layer.Heatmap#blur getter and setter 2015-02-25 08:57:04 +01:00
Éric Lemoine
45547eefbe Merge pull request #3142 from sarametz/wmts-getcap
WMTS Get Cap document with updated WMTS.optionsFromCapabilities function
2015-02-25 08:29:40 +01:00
acanimal
086202cfdd Added short description on getSource() method 2015-02-25 07:54:14 +01:00
Frédéric Junod
3079924a3d Merge pull request #3271 from fredj/jsdoc-fixes
[wip] Fix misplaced comment blocks
2015-02-25 07:13:19 +01:00
Tim Schaub
7e812959e7 Merge pull request #3273 from tschaub/unused-function
Remove unused createGetTileIfLoadedFunction function.
2015-02-24 15:35:38 -08:00
Tim Schaub
22aeb3612e Remove unused createGetTileIfLoadedFunction function 2015-02-24 15:06:10 -08:00
Sara Metz
6894bc8444 Add ability to get wmts source from capabilities
Added functionality to create a wmts tilegrid and wmts source from the
capabilities object created from ol.format.WMTSCapabilities.read().
Added tests for these functions and an example.

Also altered the REST url template replacement to be case insensitive
and added tests for this. This is because the spec uses both style
and Style and both of these are used by existing WMTS services.
2015-02-25 09:21:45 +13:00
Frederic Junod
1620a11181 Fix misplaced comment blocks
Found while testing the new google-closure release (v20150126)

The code still compiles with the older (default) version.
2015-02-24 17:13:35 +01:00
Éric Lemoine
18ec8a487f Merge pull request #3270 from elemoine/dragpan-false
Make ol.Overlay autoPan default to false
2015-02-24 15:42:57 +01:00
Éric Lemoine
329edc4ec6 Make ol.Overlay autoPan default to false 2015-02-24 15:14:10 +01:00
Tobias Sauerwein
7a5ad336c6 Merge pull request #3268 from tsauerwein/fix-example-autoPan
Fix autoPan in examples with ol.Overlay on hover
2015-02-24 09:48:22 +01:00
tsauerwein
054dc81485 Disable autoPan in examples
To avoid that the map is panned when showing
overlays on hover.
2015-02-24 09:33:40 +01:00
cwgrant
f63a856741 Add support for ArcGIS Rest Services
Adding a data source to support ArcGIS Map Server and Image Server.
Functionality is similar to the ArcGIS93Rest Layer in OpenLayers 2.
2015-02-23 22:49:29 -05:00
acanimal
eb8a1845a5 Added getter function to return the wrapped source withint the cluster 2015-02-23 22:07:35 +01:00
Tobias Sauerwein
5897cf55aa Merge pull request #3256 from tsauerwein/overlay-panIntoView
Add autoPan option to ol.Overlay
2015-02-23 17:23:00 +01:00
tsauerwein
e46e0f85fb Add autoPan option to ol.Overlay 2015-02-23 17:01:52 +01:00
Tobias Sauerwein
3fbc6fa361 Merge pull request #3261 from adube/fix-extent-foreachcorner
Fix forEachCorner extent, add TopLeft
2015-02-20 16:01:37 +01:00
Alexandre Dubé
e1336e1891 Fix forEachCorner extent, add TopLeft 2015-02-20 08:30:39 -05:00
Frédéric Junod
c30373963e Merge pull request #3260 from fredj/unused-require
Remove unused goog.require
2015-02-20 07:39:56 +01:00
Frederic Junod
96cb3d314f Remove unused goog.require 2015-02-20 07:32:55 +01:00
Tim Schaub
733167c612 Merge pull request #3246 from tschaub/tile-cache
Avoid creating unnecessary images in tile layers.
2015-02-19 10:33:31 -07:00
Frédéric Junod
84cc48a7bf Merge pull request #3254 from fredj/regular-stroke
Use lineCap, lineJoin and miterLimit stroke properties in RegularShape
2015-02-19 13:26:52 +01:00
Frederic Junod
c3d9946924 Use lineCap, lineJoin and miterLimit stroke properties 2015-02-19 12:33:16 +01:00
Frederic Junod
5e712ac88c Use correct renderOptions type 2015-02-19 12:12:00 +01:00
Tim Schaub
9e94308cdc Merge pull request #3252 from tschaub/global-spy
Avoid leaking global listenerSpy.
2015-02-19 00:09:59 -07:00
Tim Schaub
b8e3deb756 Merge pull request #3248 from tschaub/tile-events
Add tile loading events to image tile sources.
2015-02-18 16:16:24 -07:00
Tim Schaub
3e3104bbb1 Avoid leaking global listenerSpy 2015-02-18 16:05:33 -07:00
Tim Schaub
56c5cef3f8 Example style 2015-02-18 15:45:20 -07:00
Tim Schaub
199fcb05e3 Unregister image listeners when disposing of a tile 2015-02-18 15:45:14 -07:00
Christopher S. Case
15a4b7f4a6 Changed default radius to 0, instead of 1000.
(This was debugging code.)
2015-02-18 09:50:10 -06:00
Christopher S. Case
b2ce4c19e1 added unit tests. 2015-02-18 09:50:10 -06:00
Christopher S. Case
1074c9d44a Updated example for circle drawing. 2015-02-18 09:50:10 -06:00
Christopher S. Case
ae8321ab30 Added circle drawing to draw interaction. 2015-02-18 09:50:02 -06:00
Tim Schaub
c42af7919e Example docs 2015-02-17 11:22:44 -07:00
Tim Schaub
77d8d48b57 Progress bar for tile loading 2015-02-17 11:22:39 -07:00
Tim Schaub
5cbae8c8f5 Add tile loading events to image tile sources 2015-02-17 11:09:30 -07:00
Tim Schaub
bf35b40b11 Fire change event every time state changes 2015-02-17 11:09:16 -07:00
Tim Schaub
e5432f7cb5 Avoid creating unnecessary images during rendering 2015-02-16 15:11:16 -07:00
Tim Schaub
2cf1fe5552 Create tile cache for all tile sources 2015-02-16 12:22:15 -07:00
Tim Schaub
eb1a46cf7d Merge pull request #3240 from openlayers/v3.2.x
Changes from the v3.2.x branch.
2015-02-14 09:22:47 -07:00
Tim Schaub
d5f18dc120 Merge pull request #3239 from openlayers/release-v3.2.1
Release v3.2.1.
2015-02-13 11:12:45 -07:00
Tim Schaub
0ddae22661 Update package version to 3.2.1 2015-02-13 10:52:02 -07:00
Tim Schaub
fb2506672c Changelog for v3.2.1 2015-02-13 10:51:31 -07:00
Tim Schaub
391ff4eeab Merge pull request #3236 from tschaub/select-fix
Select the uppermost feature.
2015-02-13 09:29:20 -07:00
Frederic Junod
4686dfc0bb Select the uppermost feature 2015-02-13 09:12:26 -07:00
Tim Schaub
a924cc4d11 Merge pull request #3233 from stweil/master
Four small fixes.
2015-02-12 12:39:23 -07:00
Stefan Weil
5c99b6349c Add missing var declaration for local variable flippedFlatPoints
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-02-12 17:53:53 +01:00
Stefan Weil
829569c6b5 Fix typo in documentation of function getInfo
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-02-12 17:53:53 +01:00
Stefan Weil
e6d342dc96 Replace wrong comma in JavaScript code by semicolon
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-02-12 17:53:53 +01:00
Stefan Weil
8bfa1c45e7 examples: Remove wrong semicolon in css code
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-02-12 17:53:53 +01:00
Tim Schaub
bfcceac68f Merge pull request #3232 from stweil/master
Fix typos found by codespell.
2015-02-12 09:02:03 -07:00
Stefan Weil
e812f2435e Fix typos found by codespell
Most of them are in comments, some in strings.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-02-12 16:39:55 +01:00
Frédéric Junod
c4ddc62ab4 Merge pull request #3231 from fredj/heatmap-radius
Make ol.layer.Heatmap#radius configurable
2015-02-12 16:36:56 +01:00
Frederic Junod
f117550694 Add a radius input to the heatmap-earthquakes example 2015-02-12 14:41:22 +01:00
Frederic Junod
dfda3e37a4 Add ol.layer.Heatmap#radius getter and setter 2015-02-12 14:16:48 +01:00
Frederic Junod
b5206cb354 Make ol.layer.Heatmap.createCircle_ an instance function 2015-02-12 13:45:44 +01:00
Tim Schaub
90ba1140ac Merge pull request #3225 from tschaub/attributions
Respect attributions passed to TileJSON source.
2015-02-11 10:36:27 -07:00
Tim Schaub
9cea85be80 Merge pull request #3223 from tschaub/tilesize-change
Resize the canvas when the tile size changes.
2015-02-11 10:18:27 -07:00
Tim Schaub
e79211e0c1 Respect attributions passed to TileJSON source 2015-02-11 10:15:29 -07:00
Bart van den Eijnden
ad23a9c9cd Merge pull request #3224 from bartvde/mapquest-getname
Provide the ability to get the layer name from a MapQuest source
2015-02-11 15:56:50 +01:00
Bart van den Eijnden
eafa5419c3 Provide the ability to get the layer name from a MapQuest source 2015-02-11 15:46:02 +01:00
Bart van den Eijnden
b529f0f0a0 Merge pull request #3222 from bartvde/geodesic-measure
Add geodesic option for measure
2015-02-11 13:34:32 +01:00
Bart van den Eijnden
c5c24f209a Add geodesic option for measure 2015-02-11 13:24:23 +01:00
bill-chadwick
0381689fb6 Resize the canvas when the tile size changes 2015-02-10 14:00:23 -07:00
Frédéric Junod
89954ca5fc Merge pull request #3221 from fredj/hectic-select
Select the uppermost feature
2015-02-10 14:03:18 +01:00
Frederic Junod
13f265b4e1 Select the uppermost feature 2015-02-10 09:59:09 +01:00
Tim Schaub
776ffa925f Merge pull request #3211 from photostu/master
Bing https logo fix.
2015-02-08 20:18:19 -07:00
Tim Schaub
ada6b5640a Merge pull request #3215 from tschaub/rendering
Allow reuse of layer rendering code without creating a map.
2015-02-08 17:24:16 -07:00
Tim Schaub
33c197cf16 Layer renderers should not require a map renderer 2015-02-08 07:25:10 -07:00
Tim Schaub
e0f250483d Layer renderers don't need access to the map 2015-02-07 16:56:10 -07:00
Tim Schaub
c4ee8518e1 Use frame state for size 2015-02-07 16:52:48 -07:00
Tim Schaub
d4b7bb7c57 Use frame state for pixel to coord conversion 2015-02-07 16:52:34 -07:00
Tim Schaub
a460cb3983 Fire change instead of calling render on map 2015-02-07 16:46:30 -07:00
Tim Schaub
7f18033171 Make layer renderers observable and re-render on change 2015-02-07 16:42:36 -07:00
Tim Schaub
693ec7706e createLayerRenderer must be implemented by subclass 2015-02-07 16:30:28 -07:00
Tim Schaub
9081682286 Use provided frame state instead of map for pixel to coord conversion 2015-02-07 16:12:39 -07:00
Éric Lemoine
e97f017dda Merge pull request #3213 from openlayers/release-v3.2.0
Release v3.2.0
2015-02-06 11:14:26 +01:00
Éric Lemoine
22b27cdb02 Update package version to 3.2.0 2015-02-06 11:12:59 +01:00
Éric Lemoine
480c276d93 Changelog for v3.2.0 2015-02-06 11:12:59 +01:00
photostu
9247dc9f41 bing logo https
fix syntax to please Travis
2015-02-05 11:21:13 -05:00
Éric Lemoine
480f352cc6 Merge pull request #3171 from oterral/kml_link
KML: Parsing of NetworkLink tag
2015-02-05 16:41:36 +01:00
photostu
4080e729df bing https logo fix
If https is missing from bing logo uri, replace
2015-02-05 10:34:33 -05:00
oterral
c1fd95305c Add tests for parsing of NetworkLink tags 2015-02-05 16:21:51 +01:00
oterral
0a6a3f5d65 Add parsing of NetworkLink tag 2015-02-05 16:21:45 +01:00
Frédéric Junod
456def67de Merge pull request #3209 from fredj/coding-style
Coding style fixes
2015-02-05 14:53:59 +01:00
Bart van den Eijnden
f9a8239443 Merge pull request #3208 from bartvde/setImageLoadFunction
Add setters and getters for imageLoadFunction
2015-02-05 12:37:02 +01:00
Frederic Junod
a0a4369c24 Fix ol.format.GPX.TRKSEG_NODE_FACTORY_ type definition 2015-02-05 10:56:44 +01:00
Frederic Junod
078d3fb007 Add missing goog.require 2015-02-05 10:56:44 +01:00
Frederic Junod
65c2f7de5f Remove unused goog.require 2015-02-05 10:56:44 +01:00
Frederic Junod
8ec90a2045 Remove unnecessary newlines 2015-02-05 10:56:44 +01:00
Frédéric Junod
0906bf09ed Merge pull request #3019 from bjornharrtell/selectmulti
Add option to allow Select interaction logic to select overlapping features
2015-02-05 10:55:04 +01:00
Bart van den Eijnden
ce8d57b534 Add setters and getters for imageLoadFunction 2015-02-05 10:53:21 +01:00
Pierre GIRAUD
b8a0d6b702 Merge pull request #3206 from pgiraud/measure_tooltip
Add tooltip to show measure + help message while drawing
2015-02-05 09:48:32 +01:00
Pierre GIRAUD
4ba500925f Changing draw interaction styling 2015-02-05 09:39:17 +01:00
Pierre GIRAUD
c63c358d08 Add tooltip to show measure + help message while drawing 2015-02-04 17:48:28 +01:00
Björn Harrtell
162c47eb3e Option to enable selection of overlapping features 2015-02-04 16:15:41 +01:00
Frédéric Junod
f117cddb34 Merge pull request #3205 from fredj/use-ol.extent.createOrUpdateFromCoordinate
Use ol.extent.createOrUpdateFromCoordinate
2015-02-04 14:55:49 +01:00
Frederic Junod
f6b47f086b Use ol.extent.createOrUpdateFromCoordinate
Instead of ol.extent.boundingExtent
2015-02-04 14:14:50 +01:00
Éric Lemoine
2d3e5d2bac Merge pull request #3026 from htulipe/wmts-getcap
Add support of reading WMTS Get Cap document
2015-02-04 13:32:32 +01:00
Bart van den Eijnden
8f6cb00ea6 Merge pull request #3201 from bartvde/fast_clear
Pass on opt_fast to parent clear function in ol.source.ServerVector (r=@elemoine,@gberaudo)
2015-02-04 08:53:51 +01:00
Bart van den Eijnden
80f7b726f9 Pass on opt_fast to parent clear function in ol.source.ServerVector 2015-02-04 08:45:09 +01:00
Frédéric Junod
f75cec5c8e Merge pull request #3199 from fredj/jsdoc-fixes
Minor jsdoc fixes
2015-02-03 16:14:39 +01:00
Frederic Junod
89f21f5d50 Remove square brackets from type 2015-02-03 15:52:19 +01:00
Frederic Junod
f9723aa310 Add missing goog.require 2015-02-03 15:52:19 +01:00
Hadrien Tulipe
87644a1a46 Add support of WMTS Get Cap read
This commit fixe #2721. It still lacks the possibility to create layer from the GetCap document. It also lacks the reading of TMS limits.
2015-02-03 14:46:29 +01:00
Frédéric Junod
38c80e7f9b Merge pull request #3059 from fredj/memory
Cache the buffered extent value
2015-02-03 13:39:39 +01:00
Frederic Junod
0d3eb8642f Cache the buffered extent value
Assuming that the maxExtent and resolution property are immutable
2015-02-03 10:37:38 +01:00
Frédéric Junod
a7fcf05a4b Merge pull request #3196 from fredj/coding-style
Remove unnecessary newlines
2015-02-02 16:47:53 +01:00
Frederic Junod
31f61121d9 Remove unnecessary newlines 2015-02-02 14:38:39 +01:00
Bart van den Eijnden
b8d44e7f91 Merge pull request #3099 from bartvde/ogr-gml2
Fix up parsing of OGR GML with ol.format.GML
2015-02-02 13:16:12 +01:00
Bart van den Eijnden
423c8761aa Use ol.format.GMLBase.GMLNS and get rid of unneeded Object 2015-02-02 12:46:49 +01:00
Frédéric Junod
ef871f54f8 Merge pull request #3195 from fredj/coding-style
Coding style
2015-02-02 09:59:00 +01:00
Éric Lemoine
898c8fa9a2 Merge pull request #3192 from elemoine/mapquest-url
Add "url" option to ol.source.MapQuest
2015-02-02 09:26:08 +01:00
Tobias Sauerwein
350ce735f1 Merge pull request #3172 from tsauerwein/forEachLayerAtPixel
Introduce forEachLayerAtPixel
2015-02-02 09:24:43 +01:00
Frederic Junod
0f65d7778a Remove unnecessary newlines 2015-02-02 09:11:35 +01:00
Frederic Junod
12925a35b9 Use goog.isDef to check the opt_array param 2015-02-02 09:11:35 +01:00
Frédéric Junod
df32d04fdb Merge pull request #3178 from fredj/geojson-externs
GeoJSON externs fixes
2015-02-02 09:11:08 +01:00
Frédéric Junod
987b032d9d Merge pull request #3179 from fredj/disallow-undefined
Disallow undefined values for ol.layer.Base
2015-02-02 09:10:36 +01:00
Bart van den Eijnden
5d70e61753 Make FEATURE_COLLECTION_PARSERS an instance property 2015-01-30 21:00:04 +01:00
Éric Lemoine
130535c83e Merge pull request #3161 from 3x0dv5/master
Doc fix. writeFeaturesNode receives an array of Feature
2015-01-30 17:46:23 +01:00
Éric Lemoine
fcbdc6bd26 Merge pull request #3169 from oterral/kml_example
Fix default icon style in kml format
2015-01-30 17:45:31 +01:00
Éric Lemoine
df2d71ef83 Add "url" option to ol.source.MapQuest 2015-01-30 17:08:50 +01:00
tsauerwein
b390c1bdf8 Use dragging flag in examples 2015-01-30 13:53:32 +01:00
tsauerwein
f4500c8f89 Rename *AtPixel to *AtCoordinate if coordinate 2015-01-30 10:00:37 +01:00
tsauerwein
4d4bed454a Avoid pixel->coord->pixel conversion 2015-01-30 10:00:37 +01:00
tsauerwein
054227fd26 Make signature for *AtPixel methods more consistent
pixel/coordinate is the first argument.
2015-01-30 10:00:36 +01:00
tsauerwein
b7415219a6 Use forEachLayerAtPx in example 2015-01-30 10:00:36 +01:00
tsauerwein
dce4210a5b Implement forEachLayerAtPixel for webgl 2015-01-30 10:00:36 +01:00
tsauerwein
6cc5bd466d Add hasFeatureAtPixel for ImageLayer 2015-01-30 10:00:36 +01:00
tsauerwein
b4cb786f29 Implement forEachLayerAtPixel for canvas 2015-01-30 10:00:36 +01:00
tsauerwein
225f0739ec Add forEachLayerAtPixel 2015-01-30 10:00:36 +01:00
tsauerwein
7feb8b22f6 Rename forEachGeometryAtPixel 2015-01-30 10:00:36 +01:00
Tobias Sauerwein
9e7e5efd27 Merge pull request #3190 from tsauerwein/event-dragging
Introduce `dragging` flag for MapBrowserEvent
2015-01-30 09:54:52 +01:00
tsauerwein
9a841583db Remove getter for down_ 2015-01-30 09:38:47 +01:00
tsauerwein
9cc8390dfd Use dragging in examples 2015-01-30 09:16:19 +01:00
tsauerwein
f2518e4c08 Add dragging flag to MapBrowserEvent 2015-01-30 09:15:35 +01:00
Tobias Sauerwein
aa67078d74 Merge pull request #3135 from tsauerwein/control-label
Make changing the label of ZoomToExtent/FullScreen control consistent
2015-01-29 15:03:53 +01:00
Bart van den Eijnden
0243ce6612 Fix up parsing of OGR GML with ol.format.GML 2015-01-29 11:40:30 +01:00
Frédéric Junod
3abcbcf377 Merge pull request #3186 from fredj/clip-pixel-ratio
Take the pixel ratio into account when clipping the layer
2015-01-28 21:29:48 +01:00
Éric Lemoine
5c9e099628 Merge pull request #3183 from htulipe/switch-mode-fix
Allow other params than 'mode' in example page query string.
2015-01-28 16:03:25 +01:00
Frederic Junod
cb69cecf03 Take the pixel ratio into account when clipping the layer 2015-01-28 14:21:50 +01:00
Frédéric Junod
2ad93b9e86 Merge pull request #2791 from fredj/rotate-css-transition
Re enable rotation button transition
2015-01-28 09:18:50 +01:00
Frederic Junod
aa23a7bce5 Re enable rotation button transition
The opacity transition was broken with #2782
2015-01-28 09:09:01 +01:00
htulipe
f0608f6fed Allow other params than 'mode' in example query string.
Currently, if other params are present at the beginning of the query string,
the mode switcher will not work.

This situation can occur when a search criteria was entered in the examples
index page. That criteria will be passed along to the example page via a query
param.
2015-01-27 21:52:38 +01:00
Bart van den Eijnden
798399101f Merge pull request #3180 from bartvde/featureoverlay-getmap
Add a getMap function to ol.FeatureOverlay (r=@ahocevar)
2015-01-27 20:07:25 +01:00
Bart van den Eijnden
bc5f81cfa0 Add a getMap function to ol.FeatureOverlay 2015-01-27 19:54:34 +01:00
Frederic Junod
fc3c808209 Disallowed undefined 'minResolution' value 2015-01-27 18:07:42 +01:00
Frederic Junod
1d6f7e9504 Disallowed undefined 'maxResolution' value 2015-01-27 18:07:42 +01:00
Frederic Junod
60ea87fdfb Disallowed undefined 'saturation' value 2015-01-27 18:07:42 +01:00
Frederic Junod
caa8428990 Disallowed undefined 'contrast' value 2015-01-27 18:07:42 +01:00
Frederic Junod
007ad2c58f Disallowed undefined 'brightness' value 2015-01-27 18:07:42 +01:00
Frederic Junod
663f18cd29 Disallowed undefined 'opacity' value 2015-01-27 18:07:42 +01:00
Frederic Junod
e25cb30e5f Disallowed undefined 'hue' value 2015-01-27 18:07:42 +01:00
Frederic Junod
c7dbd4a303 Disallowed undefined 'visible' value 2015-01-27 18:07:42 +01:00
Frédéric Junod
43f84e798f Merge pull request #3176 from fredj/undefined-rotation
Disallowed undefined rotation value
2015-01-27 17:11:26 +01:00
Frederic Junod
d640accdc8 More precise ol.format.GeoJSON.readGeometry_ param type 2015-01-27 12:21:11 +01:00
Frederic Junod
f1c0072bd0 More precise olx.source.GeoJSONOptions#object type 2015-01-27 12:06:03 +01:00
Frederic Junod
d219a8ef22 Remove GeoJSONObject extends from GeoJSONLink
Otherwise CRS object may have a `boox` or a `crs` property
2015-01-27 11:30:24 +01:00
Frederic Junod
3fbe9265da Remove GeoJSONObject extends from GeoJSONCRS
Otherwise CRS object may have a `boox` or a `crs` property
2015-01-27 11:26:06 +01:00
Frederic Junod
ad65989d28 Move bbox property to GeoJSONObject
See http://geojson.org/geojson-spec.html#geojson-objects:
"A GeoJSON object may have a "bbox" member [...]"
2015-01-27 11:18:13 +01:00
Tobias Sauerwein
9d5f7c1eb4 Merge pull request #3177 from tsauerwein/style-polygons
Add example showing how to style polygon vertices
2015-01-27 10:18:55 +01:00
tsauerwein
48cf51a7ca Add example for polygon vertices styling 2015-01-27 10:02:28 +01:00
Frederic Junod
829a0ca224 Disallowed undefined rotation value 2015-01-27 09:26:51 +01:00
Frédéric Junod
5c9b17a3b2 Merge pull request #3174 from fredj/view-getState
Use view.getRotation or view.getResolution instead of view.getState
2015-01-26 17:14:38 +01:00
Frederic Junod
915df000ab Use view.getRotation instead of view.getState 2015-01-26 13:39:49 +01:00
Frederic Junod
247d8668d1 Use view.getResolution instead of view.getState 2015-01-26 13:39:49 +01:00
Frederic Junod
7c7a4c2b7a Use view.getRotation instead of view.getState 2015-01-26 13:39:49 +01:00
Frédéric Junod
8e161a077f Merge pull request #3170 from fredj/coding-style
Coding style
2015-01-26 13:39:02 +01:00
Frederic Junod
7885ad6ae7 Remove unnecessary newlines 2015-01-26 10:33:00 +01:00
Frederic Junod
98f7b5f186 Mark projection property as constant 2015-01-26 10:20:21 +01:00
Frederic Junod
72b2182219 Add missing projection property in olx.ViewState 2015-01-26 09:51:53 +01:00
Frederic Junod
eb7041c71d Simplify ternary operator condition 2015-01-26 09:51:53 +01:00
oterral
65fe82d188 Fix default icon style in kml format 2015-01-26 09:46:48 +01:00
Tobias Sauerwein
90a5997c22 Merge pull request #3108 from tsauerwein/webgl-point-skipFeatures
Support skipping features in the WebGL renderer
2015-01-23 08:56:39 +01:00
Frédéric Junod
fd5a3ce7b4 Merge pull request #3163 from fredj/webglmaprenderer-layerStatesArray
Use the layerStatesArray property from the frameState
2015-01-23 07:27:38 +01:00
Frederic Junod
948a1f1321 Use the layerStatesArray property from the frameState 2015-01-22 17:36:26 +01:00
Frédéric Junod
edc6746545 Merge pull request #3159 from fredj/heatmap-constr
Don't pass specific options to the parent constructor
2015-01-22 14:55:55 +01:00
3x0dv5
6ceef2b0cc Doc fix. writeFeaturesNode receives an array of Feature 2015-01-22 11:21:02 +00:00
Frederic Junod
f3bafab1e6 Don't pass specific options to the parent constructor 2015-01-22 11:30:20 +01:00
tsauerwein
316480dcda Rename argument 2015-01-22 10:24:59 +01:00
tsauerwein
a39544cce0 Implement skipping features for hasFeatureAtPixel 2015-01-22 10:24:59 +01:00
tsauerwein
cf9619f378 Implement skipping features for 1by1 hit detection 2015-01-22 10:24:59 +01:00
tsauerwein
c4ee074274 Implement skipping features for drawReplay 2015-01-22 10:24:59 +01:00
Tobias Sauerwein
1702a4ed36 Merge pull request #3066 from tsauerwein/webgl-point-hasFeatureAtPixel
Introduce hasFeatureAtPixel
2015-01-22 10:20:00 +01:00
Tobias Sauerwein
53f98dcf4e Merge pull request #3065 from tsauerwein/webgl-point-hit-detection
Add hit-detection support for WebGL
2015-01-22 10:19:37 +01:00
Éric Lemoine
f625a29978 Merge pull request #3128 from oterral/kml_default_style
Allow rendering of feature when download of icon failed
2015-01-21 15:08:02 +01:00
Éric Lemoine
21144f161a Add more tests fr ol.renderer.vector 2015-01-21 14:50:48 +01:00
Frédéric Junod
b6a550f354 Merge pull request #3156 from fredj/format-getprojection
Move readProjectionFrom* functions to the base classes
2015-01-21 13:30:47 +01:00
Éric Lemoine
b27c1c82d4 Merge pull request #3107 from elemoine/imagestate
Also listen on loading images
2015-01-21 12:50:31 +01:00
Frederic Junod
077a827197 Move readProjectionFrom* functions to the base classes 2015-01-21 09:15:04 +01:00
Frédéric Junod
2970da3461 Merge pull request #3153 from fredj/geojson-externs
Add missing GeoJSONFeature#bbox property
2015-01-21 07:34:10 +01:00
Frédéric Junod
165e3fe1ff Merge pull request #3154 from fredj/coding-style
Remove unnecessary newlines
2015-01-20 17:43:51 +01:00
Frederic Junod
b53a5e28d5 Remove unnecessary newlines 2015-01-20 16:48:52 +01:00
Frederic Junod
d8984ca1aa Add missing GeoJSONFeature#bbox property
See http://geojson.org/geojson-spec.html#bounding-boxes
2015-01-20 15:17:29 +01:00
Éric Lemoine
c185bf8f30 Merge pull request #3146 from icholy/enable-reversflatgeom-tests
Enable tests for ol.geom.flat.reverse
2015-01-19 21:01:13 +01:00
Frédéric Junod
8bc72c62f6 Merge pull request #3152 from fredj/update
Update closure-library and closure-util version
2015-01-19 17:36:27 +01:00
Frederic Junod
a17bc916b1 Update closure-library version 2015-01-19 10:42:34 +01:00
Frederic Junod
c732538433 Update closure-util version 2015-01-19 10:42:33 +01:00
Ilia Choly
ee9cfef35a Enable reverseflatgeom tests 2015-01-16 13:40:47 -05:00
Éric Lemoine
970beb1741 Merge pull request #3145 from elemoine/wrapx
Add wrapX option to source.OSM and source.BingMaps
2015-01-16 17:40:13 +01:00
Éric Lemoine
11eeb6617c Add wrapX option to olx.source.BingMapsOptions 2015-01-16 17:15:59 +01:00
Éric Lemoine
d13a5dfb9f Add wrapX option to olx.source.OSMOptions 2015-01-16 17:12:00 +01:00
Éric Lemoine
4b3726fe71 Merge pull request #3139 from elemoine/control-setmap
Add ol.control.Control#setTarget
2015-01-16 11:16:30 +01:00
Bart van den Eijnden
12f3a9d454 Merge pull request #3144 from bartvde/code-guidelines
Update CONTRIBUTING style guide with recent guidelines
2015-01-16 10:57:35 +01:00
Bart van den Eijnden
4f4d12024b Update CONTRIBUTING style guide with recent guidelines 2015-01-16 10:49:44 +01:00
tsauerwein
fbb2883f6e Add Node to control label type 2015-01-16 10:14:39 +01:00
Éric Lemoine
79312c2083 Add ol.control.Control#setTarget
This commit adds a setTarget method to ol.control.Control. This function can be used in cases where the target cannot be set at control construction time. For example, with Angular, it makes sense to create the control instance in an Angular controller, and have a "control" directive insert the control into the DOM.
2015-01-16 09:27:30 +01:00
tsauerwein
7679069520 Add label option to FullScreen control 2015-01-16 09:05:51 +01:00
Frédéric Junod
1033171ff0 Merge pull request #3136 from fredj/coding-style
Use array.length = 0 instead of goog.array.clear
2015-01-16 08:08:27 +01:00
Tim Schaub
10c715ad9a Merge pull request #3140 from tschaub/array
Avoid use of goog.array.clone with arrays.
2015-01-15 13:00:02 -07:00
Tim Schaub
06dc0902c6 Avoid use of goog.array.clone with arrays 2015-01-15 12:43:12 -07:00
Frederic Junod
845957a27f Use array.length = 0 instead of goog.array.clear 2015-01-15 16:11:29 +01:00
Frédéric Junod
c23ae78978 Merge pull request #3122 from fredj/revert-2975
Revert "Use offsetX and offsetY if available"
2015-01-15 10:52:03 +01:00
tsauerwein
0d26a9aa87 Add label option to ZoomToExtent 2015-01-15 09:58:05 +01:00
Frederic Junod
0bae04331d Revert "Use offsetX and offsetY if available"
This reverts commit fabf05977a.
2015-01-15 08:56:55 +01:00
Andreas Hocevar
c726cbfcd9 Merge pull request #2385 from ahocevar/update-vectors-while-animating
Option to update vector layers while animating
2015-01-14 17:34:39 +01:00
Andreas Hocevar
b1a73da9dd Add updateWhileAnimating option
With this option, vector batches will be recreated with every frame.
For animations, this means that vector data won't be clipped to the
extent at which the animation started.
2015-01-14 16:33:05 +01:00
Frédéric Junod
dafcdfa494 Merge pull request #3129 from fredj/rbush-update
Only update the rbush item if the extent has changed
2015-01-14 13:53:41 +01:00
Frederic Junod
baf424f99c Only update the rbush item if the extent has changed 2015-01-14 13:29:28 +01:00
Andreas Hocevar
017ff47bf8 Merge pull request #3117 from ahocevar/domvector-pixelratio
Add pixelRatio support for DOM vector renderer
2015-01-14 12:55:05 +01:00
Tobias Sauerwein
110ed04a84 Merge pull request #3124 from sirtet/master
Add a space between scale -value and -unit
2015-01-14 12:41:01 +01:00
Frédéric Junod
2f5bbb37ed Merge pull request #3130 from fredj/doc
Document default value
2015-01-14 12:39:15 +01:00
Frédéric Junod
68f5ff0045 Merge pull request #3105 from fredj/geom-getextent
ol.geom.Geometry#getExtent re-factoring
2015-01-14 12:20:37 +01:00
Frederic Junod
5f55e01849 Document default value 2015-01-14 12:12:38 +01:00
Frederic Junod
f7943b9401 Set extent and extentRevision variables to private 2015-01-14 11:01:18 +01:00
Frederic Junod
8bd0a1232a Add geom.ol.geom.Geometry#computeExtent function 2015-01-14 11:01:18 +01:00
oterral
c97a29d13b Allow rendering of feature when download of icon failed 2015-01-14 09:34:03 +01:00
sirtet
66fea4dec9 Add a space between scale -value and -unit
For improved readability. Issue #3116
2015-01-13 16:16:20 +01:00
Bart van den Eijnden
35468e2bbb Merge pull request #3118 from naturalatlas/wfs-firstelementchild-bugfix
Bugfix: "Cannot read property 'firstElementChild' of null" (WFS)
2015-01-13 10:13:56 +01:00
Brian Reavis
37dac8e0cf Fixed "Cannot read property 'firstElementChild' of null" on WFS readProjectionFromNode.
Occurs when a FeatureCollection is empty.

Code style changes @bartvde

Added test case for #3118.

Attempt to make jshint happy.

Fixed tab character.

Another code style change (jshint)....
2015-01-13 01:42:03 -07:00
Andreas Hocevar
bbf074b70a Add pixelRatio support for DOM vector renderer
Adds the scaling and transforms to support pixelRatio values other than
1.
2015-01-12 22:14:52 +01:00
Éric Lemoine
5dca3e9b20 Merge pull request #3114 from elemoine/contributing
Specify node version in CONTRIBUTING.md
2015-01-12 21:13:16 +01:00
Éric Lemoine
789ddad536 Specify node version 2015-01-12 20:49:23 +01:00
Frédéric Junod
409969fa2a Merge pull request #3106 from fredj/tilelayer-constr
Don't pass specific options to the parent constructor
2015-01-12 15:31:36 +01:00
Éric Lemoine
76418bdbe5 Merge pull request #3110 from PeterDaveHello/patch-1
Use svg instead of png to get better image quality
2015-01-11 11:22:56 +01:00
Peter Dave Hello
3e2574bf49 Use svg instead of png to get better image quality 2015-01-11 14:33:36 +08:00
Éric Lemoine
12863cf3fd Merge pull request #2707 from gberaudo/source_map
Generate source map of minified ol.js
2015-01-09 13:16:18 +01:00
Éric Lemoine
2ef8302122 Add a build/ol.js.map target 2015-01-09 12:33:38 +01:00
Guillaume Beraudo
132686b4a7 Generate source map of minified ol.js
Allows automatic unminification by the browser.

A postprocessing is required to:
- fix the paths to the sources;
- add the link from the minified script to its map.

If someone knows how to do the first item in Python or nodejs, please provide a
patch. A simple shell script is:
```
\#!/bin/sh
pwd=`pwd`
sed -i "s!$pwd/build!olsource!g" 'build/ol.js.map'
sed -i "s!$pwd!olsource!g" 'build/ol.js.map'
```

The second item should always be manually handled to avoid 404 errors
in debuggers
`echo '//# sourceMappingURL=ol.js.map' >> build/ol.js`

Finally, create an alias / copy ol3 directory to /olsource in your
deployed environment.
2015-01-09 12:17:35 +01:00
Éric Lemoine
0f486e86f7 Add tests for ol.renderer.Layer#loadImage 2015-01-09 09:45:25 +01:00
tsauerwein
c85982bbe5 Remove unused variables 2015-01-09 09:21:40 +01:00
Éric Lemoine
4814983306 Also listen on loading images
This fixes a bug that occured when an image source was used by multiple maps. In that case the map that didn't load the image wouldn't register a load listener on that image and would therefore not call render to request a re-render of the map.
2015-01-09 09:07:31 +01:00
tsauerwein
d39904b66b Add @const annotation 2015-01-08 16:12:52 +01:00
tsauerwein
25612f1af2 Unify return statement
Only return the callback result if it is truthy,
otherwise return undefined.
2015-01-08 16:12:52 +01:00
tsauerwein
35c58b3b0e Use hasFeatureAtPixel in icon example 2015-01-08 16:12:52 +01:00
tsauerwein
3e5c4d0bf6 Show hasFeatureAtPixel in example 2015-01-08 16:12:52 +01:00
tsauerwein
bc71a36292 Implement hasFeatureAtPixel for webgl 2015-01-08 16:12:52 +01:00
tsauerwein
d62e910239 Implement hasFeatureAtPixel for canvas 2015-01-08 16:12:52 +01:00
tsauerwein
d0691ecc4d Add hasFeatureAtPixel function to map 2015-01-08 16:12:52 +01:00
tsauerwein
974823dbd4 Refactor createTexture 2015-01-08 15:40:03 +01:00
tsauerwein
38322d615b Use renderBuffer for hit-detection 2015-01-08 15:38:00 +01:00
tsauerwein
060c9f3bc6 Reduce number of arrays created 2015-01-08 15:38:00 +01:00
tsauerwein
6c48b2067b Make icon example work with webgl 2015-01-08 15:38:00 +01:00
tsauerwein
da7f38635b Remove hitDetectionOrigin 2015-01-08 15:38:00 +01:00
tsauerwein
461ec1d3bc Make sure hit-detection atlas is in sync
... with the atlas for the original images, so that
the offsets are the same.
2015-01-08 15:38:00 +01:00
tsauerwein
cf6dd38866 Use hit-detection images 2015-01-08 15:38:00 +01:00
tsauerwein
3ef61fa1c5 Add hit-detection support for webgl 2015-01-08 15:38:00 +01:00
tsauerwein
740420468e Add hit-detection framebuffer to context 2015-01-08 15:38:00 +01:00
Frederic Junod
b827bc126c Don't pass specific options to the parent constructor 2015-01-08 14:07:33 +01:00
Frédéric Junod
1f90aad4ad Merge pull request #3104 from fredj/vector-constr
Don't pass renderBuffer option to the parent constructor
2015-01-08 11:58:39 +01:00
Frederic Junod
91d2b3b87f Don't pass renderBuffer option to the parent constructor 2015-01-08 10:59:42 +01:00
Frédéric Junod
904fac082c Merge pull request #3096 from fredj/example-cleanup
popup example cleanup / simplification
2015-01-08 09:07:25 +01:00
Tim Schaub
b952f118ba Merge pull request #3072 from tschaub/hit-extent
Optimize canvas hit detection by rendering features in a limited extent.
2015-01-07 23:54:21 -07:00
Tim Schaub
1ee03625e9 Optimize hit detection by rendering features in a limited extent 2015-01-07 23:04:42 -07:00
Tim Schaub
3be6a84de6 Merge pull request #3101 from tschaub/object
Use bracket notation instead of goog.object functions.
2015-01-07 22:57:28 -07:00
Tim Schaub
1ff43686f5 Use bracket notation instead of goog.object.get 2015-01-07 22:31:01 -07:00
Tim Schaub
a09a76c766 Merge pull request #3079 from tschaub/sourceless-docs
Exclude source files from docs.
2015-01-07 22:20:57 -07:00
Tim Schaub
f9a92c422c Use bracket notation instead of goog.object.set 2015-01-07 21:08:24 -07:00
Tim Schaub
0a784bfc3b Allow bracket notation
We use bracket notation with string literals instead of dot notation where we don't want the compiler to do any renaming.
2015-01-07 21:06:04 -07:00
Frédéric Junod
d35ea9e4f4 Merge pull request #3100 from fredj/tilelayer-attr
Assert that ol.layer.Tile#getPreload is always set
2015-01-07 17:54:10 +01:00
Frederic Junod
55dda99cfe Assert that ol.layer.Tile#getUseInterimTilesOnError is always set 2015-01-07 16:59:44 +01:00
Frederic Junod
df51e55781 Assert that ol.layer.Tile#getPreload is always set 2015-01-07 16:48:15 +01:00
Frederic Junod
a753135e84 Remove moz-box-shadow CSS rule
Gecko 13 (Firefox 13) removed support for -moz-box-shadow. Since then,
only the unprefixed version is supported.
2015-01-06 09:26:00 +01:00
Frederic Junod
d4ff5527c9 Set the position to undefined to hide the overlay 2015-01-06 09:26:00 +01:00
Tim Schaub
06fe8288ce Merge pull request #3084 from openlayers/v3.1.x
Changes from the v3.1.x branch.
2015-01-05 10:22:14 -07:00
Tim Schaub
8e982b0763 Merge pull request #3094 from tschaub/authorless
Remove AUTHORS.md.
2015-01-04 13:00:14 -07:00
Tim Schaub
38b890a69a Removing AUTHORS.md
This was a partial, unmaintained list of the project contributors.  For a complete list of contributors, see the Git log.  E.g.

    git shortlog -s | cut -c8-
2015-01-03 22:58:06 -07:00
Bart van den Eijnden
8eb6814e4b Merge pull request #3089 from mike-mcgann/fix_test_readme_url
Fixed URL link for test README
2014-12-29 17:13:02 +01:00
Mike McGann
6b162f813f Fixed URL link for test README 2014-12-29 10:15:34 -05:00
Frédéric Junod
9a4c56d216 Merge pull request #2894 from fredj/simplify-custom-controls
Simplify CSS code in custom-controls example
2014-12-27 11:46:35 +01:00
Tim Schaub
5d2f4630f5 Merge pull request #3085 from mike-mcgann/doc-typo
Fixed documentation typo for return value of ol.proj.Projection.isGlobal().
2014-12-23 16:08:24 -05:00
Mike McGann
cc4a690676 Fixed documentation typo for return value of ol.proj.Projection.isGlobal() 2014-12-23 15:38:49 -05:00
Tim Schaub
68438c7c10 Merge pull request #3083 from tschaub/release-v3.1.1
Release v3.1.1.
2014-12-23 13:40:30 -05:00
Tim Schaub
7dd322dd6f Update package version to 3.1.1 2014-12-23 11:29:04 -05:00
Tim Schaub
676476ec64 Changelog for v3.1.1 2014-12-23 11:28:48 -05:00
Tim Schaub
8f8b7e1f17 Merge pull request #3082 from tschaub/issue-3081
Correct arguments for forEachGeometryAtPixel.
2014-12-23 11:23:01 -05:00
Tim Schaub
e62c333f32 Correct arguments for forEachGeometryAtPixel 2014-12-23 11:10:04 -05:00
Andreas Hocevar
97afb31a65 Merge pull request #3073 from ahocevar/load-tile-options
Make map's deviceOptions map options
2014-12-23 16:11:22 +01:00
Tim Schaub
4b423fca16 Exclude source files from docs 2014-12-22 17:01:01 -05:00
Andreas Hocevar
38b12d3149 Make map's deviceOptions map options
This removes the map's deviceOptions config option, and instead
introduces loadTilesWhileAnimating and loadTilesWhileInteracting map
options. By default, both are false now, to make zooming and panning
smoother on most devices.
2014-12-21 12:03:28 +01:00
Frederic Junod
a715a38d75 Simplify CSS code in custom-controls example
By using the ol-control css class and a button instead of a link.
2014-10-30 12:37:44 +01:00
689 changed files with 30964 additions and 27889 deletions

19
.editorconfig Normal file
View File

@@ -0,0 +1,19 @@
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
indent_size = 2
[*.md]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab
indent_size = 4

4
.gitignore vendored
View File

@@ -1,7 +1,5 @@
*.pyc
/build/
/examples/*.html.png
/examples/example-list.js
/examples/example-list.xml
/node_modules/
/dist/
/coverage/

View File

@@ -1,4 +1,5 @@
{
"-W030": true,
"-W083": true
"-W030": true,
"-W083": true,
"-W069": true
}

View File

@@ -1,5 +1,2 @@
*.pyc
/build/
/examples/*.html.png
/examples/example-list.js
/examples/example-list.xml

View File

@@ -1,8 +1,16 @@
env:
- DISPLAY=:99.0
before_install:
- "sudo pip install -r requirements.txt"
- "npm install -g npm && npm install"
before_script:
- "rm src/ol/renderer/webgl/*shader.js"
- "sh -e /etc/init.d/xvfb start"
script: "./build.py ci"
script: "make ci"
after_success:
- "make test-coverage"
- "cat coverage/lcov.info | ./node_modules/.bin/coveralls"

View File

@@ -1,58 +0,0 @@
OpenLayers contributors:
* Antoine Abt
* Mike Adair
* Jeff Adams
* Seb Benthall
* Bruno Binet
* Stéphane Brunner
* Howard Butler
* Bertil Chaupis
* John Cole
* Tim Coulter
* Robert Coup
* Jeff Dege
* Roald de Wit
* Schuyler Erle
* Christian López Espínola
* John Frank
* Sean Gilles
* Pierre Giraud
* Ivan Grcic
* Andreas Hocevar
* Marc Jansen
* Ian Johnson
* Frédéric Junod
* Eric Lemoine
* Philip Lindsay
* Martijn van Oosterhout
* David Overstrom
* Tom Payne
* Corey Puffault
* Peter William Robins
* Gregers Rygg
* Tim Schaub
* Christopher Schmidt
* Tobias Schwinger
* Cameron Shorter
* Pedro Simonetti
* Paul Spencer
* Paul Smith
* Glen Stampoultzis
* James Stembridge
* Erik Uzureau
* Bart van den Eijnden
* Ivan Willig
* Thomas Wood
* Bill Woodall
* Steve Woodbridge
* David Zwarg
Some portions of OpenLayers are used under the Apache 2.0 license, available
in doc/licenses/APACHE-2.0.txt.
Some portions of OpenLayers are used under the MIT license, availabie in
doc/licenses/MIT-LICENSE.txt.
Some portions of OpenLayers are Copyright 2001 Robert Penner, and are used
under the BSD license, available in doc/licenses/BSD-LICENSE.txt

View File

@@ -2,6 +2,23 @@
Thanks for your interest in contributing to OpenLayers 3.
## Asking Questions
Please ask questions about using the library on [stackoverflow using the tag 'openlayers-3'](http://stackoverflow.com/questions/tagged/openlayers-3).
When you want to get involved and discuss new features or changes, please use [the mailing list](https://groups.google.com/forum/#!forum/ol3-dev).
## Submitting Bug Reports
Please use the [GitHub issue tracker](https://github.com/openlayers/ol3/issues). Before creating a new issue, do a quick search to see if the problem has been reported already.
## Getting Familiar with the Code in the Repository
Look for `readme.md` files! Several directories contain a `readme.md` file that explains the contents of the directory and how to work with them.
## Contributing Code
Our preferred means of receiving contributions is through [pull requests](https://help.github.com/articles/using-pull-requests). Make sure
@@ -25,7 +42,7 @@ You will obviously start by
### Travis CI
The Travis CI hook is enabled on the Github repository. This means every pull request
The Travis CI hook is enabled on the Github repository. This means every pull request
is run through a full test suite to ensure it compiles and passes the tests. Failing
pull requests will not be merged.
@@ -41,16 +58,17 @@ as described below.
The minimum requirements are:
* GNU Make
* Git
* [Node.js](http://nodejs.org/)
* [Node.js](http://nodejs.org/) (0.10.x or higher)
* Python 2.6 or 2.7 with a couple of extra modules (see below)
* Java 7 (JRE and JDK)
The executables `git`, `java`, `jar`, and `python` should be in your `PATH`.
The executables `git`, `node`, `python` and `java` should be in your `PATH`.
You can check your configuration by running:
$ ./build.py checkdeps
$ make check-deps
To install the Node.js dependencies run
@@ -65,24 +83,22 @@ or
depending on your OS and Python installation.
(You can also install the Python modules in a Python virtual environment if you want to.)
## Working with the build tool
As an ol3 developer you will need to use the `build.py` Python script. This is
the script to use to run the linter, the compiler, the tests, etc. Windows users
can use `build.cmd` which is a thin wrapper around `build.py`.
As an ol3 developer you will use `make` to run build targets defined in the
`Makefile` located at the root of the repository. The `Makefile` includes
targets for running the linter, the compiler, the tests, etc.
The `build.py` script is equivalent to a Makefile. It is actually based on
[pake](https://github.com/twpayne/pake/), which is a simple implementation of
`make` in Python.
The usage of `make` is as follows:
The usage of the script is:
$ make <target>
$ ./build.py <target>
where `<target>` is the name of the build target you want to execute. For
example:
$ ./build.py test
$ make test
The main build targets are `serve`, `lint`, `build`, `test`, and `check`. The
latter is a meta-target that basically runs `lint`, `build`, and `test`.
@@ -99,7 +115,7 @@ and have therefore no chance of being merged into `master`.
To run the `check` target:
$ ./build.py check
$ make check
If you want to run the full suite of integration tests, see "Running the integration
tests" below.
@@ -108,31 +124,31 @@ tests" below.
To run the examples you first need to start the dev server:
$ ./build.py serve
$ make serve
Then, just point your browser <http://localhost:3000/examples> in your browser. For example <http://localhost:3000/examples/side-by-side.html>.
Then, just point your browser <http://localhost:3000/build/examples> in your browser. For example <http://localhost:3000/build/examples/side-by-side.html>.
Run examples against the `ol.js` standalone build:
The examples can also be run against the `ol.js` standalone lib, just like the examples
[hosted](http://openlayers.github.com/ol3/master/examples/) on GitHub. Start by
executing the `host-examples` build target:
The examples can also be run against the `ol.js` standalone build, just like
the examples [hosted](http://openlayers.org/en/master/examples/) on GitHub.
Start by executing the `host-examples` build target:
$ ./build.py host-examples
$ make host-examples
After running `host-examples` you can now open the examples index page in the browser, for example: <http://localhost/~elemoine/ol3/build/hosted/master/examples/>. (This assumes that the `hosted` directory is a web directory, served by Apache for example.)
After running `host-examples` you can now open the examples index page in the browser: <http://localhost:3000/build/hosted/master/examples/>. (This assumes that you still have the dev server running.)
Append `?mode=raw` to make the example work in full debug mode. In raw mode the OpenLayers and Closure Library scripts are loaded individually by the Closure Library's `base.js` script (which the example page loads and executes before any other script).
## Running tests
To run the tests in a browser start the dev server (`./build.py serve`) and open <http://localhost:3000/test/index.html> in the browser.
To run the tests in a browser start the dev server (`make serve`) and open <http://localhost:3000/test/index.html> in the browser.
To run the tests on the console (headless testing with PhantomJS) use the `test` target:
$ ./build.py test
$ make test
See also the test-specific [README](../blob/master/test/README.md).
See also the test-specific [README](../master/test/README.md).
## Running the integration tests
@@ -144,7 +160,7 @@ displayed in the pull request.
To run the full suite of integration tests use the `ci` target:
$ ./build.py ci
$ make ci
Running the full suite of integration tests currently takes 5-10 minutes.
@@ -157,13 +173,8 @@ Adding functionality often implies adding one or several examples. This
section provides explanations related to adding examples.
The examples are located in the `examples` directory. Adding a new example
implies creating two files in this directory, an `.html` file and a `.js` file.
See `examples/simple.html` and `examples/simple.js` for instance.
The `.html` file needs to include a script tag with
`loader.js?id=<example_name>` as its `src`. For example, if the two files for
the example are `myexample.js` and `myexample.html` then the script tag's `src`
should be set to `myexample`.
implies creating two or three files in this directory, an `.html` file, a `.js`
file, and, optionally, a `.css` file.
You can use `simple.js` and `simple.html` as templates for new examples.
@@ -201,7 +212,7 @@ Your pull request must:
It is strongly recommended that you run
$ ./build.py check
$ make check
before every commit. This will catch many problems quickly, and it is much
faster than waiting for the Travis CI integration tests to run.
@@ -221,9 +232,9 @@ Guide](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml).
This is checked using the [Closure
Linter](https://developers.google.com/closure/utilities/) in strict mode. You
can run the linter locally on your machine before committing using the `lint`
target to `build.py`:
target:
$ ./build.py lint
$ make lint
In addition to fixing problems identified by the linter, please also follow the
style of the existing OpenLayers 3 code, which includes:
@@ -239,6 +250,22 @@ style of the existing OpenLayers 3 code, which includes:
* Do not use assignments inside expressions.
* Avoid the use of `goog.array.clone` with arrays (use slice instead).
* Use `array.length = 0` instead of `goog.array.clear`.
* Use bracket notation instead of `goog.object.set` and `goog.object.get` (with
two arguments).
* Use uppercase for `@const` variables.
### Configure your editor
If possible, configure your editor to follow the coding conventions of the
library. A `.editorconfig` file is included at the root of the repository that
can be used to configure whitespace and charset handling in your editor. See
that file for a description of the conventions. The [EditorConfig](
http://editorconfig.org/#download) site links to plugins for various editors.
### Pass the integration tests run automatically by the Travis CI system
@@ -246,7 +273,7 @@ The integration tests contain a number of automated checks to ensure that the
code follows the OpenLayers 3 style and does not break tests or examples. You
can run the integration tests locally using the `ci` target:
$ ./build.py ci
$ make ci
### Address a single issue or add a single item of functionality

View File

@@ -1,5 +1,4 @@
Copyright 2005-2014 OpenLayers Contributors. All rights reserved. See
AUTHORS.md for full list.
Copyright 2005-2015 OpenLayers Contributors. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

322
Makefile Normal file
View File

@@ -0,0 +1,322 @@
OS := $(shell uname)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
SRC_GLSL := $(shell find src -type f -name '*.glsl')
SRC_SHADER_JS := $(patsubst %.glsl,%shader.js,$(SRC_GLSL))
SRC_JS := $(filter-out $(SRC_SHADER_JS),$(shell find src -name '*.js'))
SRC_JSDOC = $(shell find src -type f -name '*.jsdoc')
SPEC_JS := $(shell find test/spec -type f -name '*.js')
SPEC_RENDERING_JS := $(shell find test_rendering/spec -name '*.js')
EXAMPLES := $(shell find examples -type f)
EXAMPLES_HTML := $(filter-out examples/index.html,$(shell find examples -maxdepth 1 -type f -name '*.html'))
EXAMPLES_JS := $(patsubst %.html,%.js,$(EXAMPLES_HTML))
BUILD_EXAMPLES := $(subst examples,build/examples,$(EXAMPLES)) build/examples/index.js
BUILD_HOSTED := build/hosted/$(BRANCH)
BUILD_HOSTED_EXAMPLES := $(addprefix $(BUILD_HOSTED)/,$(EXAMPLES))
BUILD_HOSTED_EXAMPLES_JS := $(addprefix $(BUILD_HOSTED)/,$(EXAMPLES_JS))
CHECK_EXAMPLE_TIMESTAMPS = $(patsubst examples/%.html,build/timestamps/check-%-timestamp,$(EXAMPLES_HTML))
TASKS_JS := $(shell find tasks -name '*.js')
CLOSURE_LIB = $(shell node -e 'process.stdout.write(require("closure-util").getLibraryPath())')
ifeq ($(OS),Darwin)
STAT_COMPRESSED = stat -f ' compressed: %z bytes'
STAT_UNCOMPRESSED = stat -f 'uncompressed: %z bytes'
else
STAT_COMPRESSED = stat -c ' compressed: %s bytes'
STAT_UNCOMPRESSED = stat -c 'uncompressed: %s bytes'
endif
.PHONY: default
default: help
.PHONY: help
help:
@echo
@echo "The most common targets are:"
@echo
@echo "- install Install node dependencies"
@echo "- serve Start dev server for running examples and tests"
@echo "- test Run unit tests in the console"
@echo "- check Perform a number of checks on the code"
@echo "- clean Remove generated files"
@echo "- help Display this help message"
@echo
@echo "Other less frequently used targets are:"
@echo
@echo "- build Build ol.js, ol-debug.js, ol.js.map and ol.css"
@echo "- lint Check the code with the linter"
@echo "- ci Run the full continuous integration process"
@echo "- apidoc Build the API documentation using JSDoc"
@echo "- cleanall Remove all the build artefacts"
@echo "- check-deps Check if the required dependencies are installed"
@echo
.PHONY: apidoc
apidoc: build/timestamps/jsdoc-$(BRANCH)-timestamp
.PHONY: build
build: build/ol.css build/ol.js build/ol-debug.js build/ol.js.map
.PHONY: check
check: lint build/ol.js test
.PHONY: check-examples
check-examples: $(CHECK_EXAMPLE_TIMESTAMPS)
.PHONY: check-deps
check-deps: EXECUTABLES = git node python java
check-deps:
@for exe in $(EXECUTABLES) ;\
do \
which $${exe} > /dev/null && \
echo "Program $${exe} OK" || \
echo "Program $${exe} MISSING!" ;\
done ;\
.PHONY: ci
ci: lint build test test-rendering compile-examples check-examples apidoc
.PHONY: compile-examples
compile-examples: build/compiled-examples/all.combined.js
.PHONY: clean
clean:
rm -f build/timestamps/gjslint-timestamp
rm -f build/timestamps/jshint-timestamp
rm -f build/timestamps/check-*-timestamp
rm -f build/ol.css
rm -f build/ol.js
rm -f build/ol.js.map
rm -f build/ol-debug.js
rm -f build/test_requires.js
rm -f build/test_rendering_requires.js
rm -rf build/examples
rm -rf build/compiled-examples
rm -rf $(BUILD_HOSTED)
.PHONY: cleanall
cleanall:
rm -rf build
.PHONY: css
css: build/ol.css
.PHONY: examples
examples: $(BUILD_EXAMPLES)
.PHONY: install
install: build/timestamps/node-modules-timestamp
.PHONY: lint
lint: build/timestamps/gjslint-timestamp build/timestamps/jshint-timestamp \
build/timestamps/check-requires-timestamp \
build/timestamps/check-whitespace-timestamp
.PHONY: npm-install
npm-install: build/timestamps/node-modules-timestamp
.PHONY: shaders
shaders: $(SRC_SHADER_JS)
.PHONY: serve
serve: build/test_requires.js build/test_rendering_requires.js
node tasks/serve.js
.PHONY: test
test: build/timestamps/node-modules-timestamp build/test_requires.js
node tasks/test.js
.PHONY: test-coverage
test-coverage: build/timestamps/node-modules-timestamp
node tasks/test-coverage.js
.PHONY: test-rendering
test-rendering: build/timestamps/node-modules-timestamp \
build/test_rendering_requires.js
@rm -rf build/slimerjs-profile
@mkdir -p build/slimerjs-profile
@cp -r test_rendering/slimerjs-profile/* build/slimerjs-profile/
node tasks/test-rendering.js
.PHONY: host-examples
host-examples: $(BUILD_HOSTED_EXAMPLES) \
$(BUILD_HOSTED)/build/ol.js \
$(BUILD_HOSTED)/build/ol-debug.js \
$(BUILD_HOSTED)/css/ol.css \
$(BUILD_HOSTED)/examples/loader.js \
$(BUILD_HOSTED)/examples/index.js \
$(BUILD_HOSTED)/build/ol-deps.js
.PHONY: host-libraries
host-libraries: build/timestamps/node-modules-timestamp
@rm -rf $(BUILD_HOSTED)/closure-library
@mkdir -p $(BUILD_HOSTED)/closure-library
@cp -r $(CLOSURE_LIB)/* $(BUILD_HOSTED)/closure-library/
@rm -rf $(BUILD_HOSTED)/ol/ol
@mkdir -p $(BUILD_HOSTED)/ol/ol
@cp -r src/ol/* $(BUILD_HOSTED)/ol/ol/
@rm -rf $(BUILD_HOSTED)/ol.ext
@mkdir -p $(BUILD_HOSTED)/ol.ext
@cp -r build/ol.ext/* $(BUILD_HOSTED)/ol.ext/
$(BUILD_EXAMPLES): $(EXAMPLES)
@mkdir -p $(@D)
@node tasks/build-examples.js
build/timestamps/check-%-timestamp: $(BUILD_HOSTED)/examples/%.html \
$(BUILD_HOSTED)/examples/%.js \
$(filter $(BUILD_HOSTED)/examples/resources/%,$(BUILD_HOSTED_EXAMPLES)) \
$(filter $(BUILD_HOSTED)/examples/data/%,$(BUILD_HOSTED_EXAMPLES)) \
$(BUILD_HOSTED)/examples/loader.js \
$(BUILD_HOSTED)/build/ol.js \
$(BUILD_HOSTED)/css/ol.css
@mkdir -p $(@D)
./node_modules/.bin/phantomjs --ssl-protocol=any --ignore-ssl-errors=true bin/check-example.js $(addsuffix ?mode=advanced, $<)
@touch $@
build/timestamps/check-requires-timestamp: $(SRC_JS) $(EXAMPLES_JS) \
$(SRC_SHADER_JS) $(SPEC_JS) \
$(SPEC_RENDERING JS)
@mkdir -p $(@D)
@python bin/check-requires.py $(CLOSURE_LIB) $^
@touch $@
build/timestamps/check-whitespace-timestamp: $(SRC_JS) $(EXAMPLES_JS) \
$(SPEC_JS) $(SPEC_RENDERING JS) \
$(SRC_JSDOC)
@mkdir -p $(@D)
@python bin/check-whitespace.py $^
@touch $@
build/compiled-examples/all.js: $(EXAMPLES_JS)
@mkdir -p $(@D)
@python bin/combine-examples.py $^ > $@
build/compiled-examples/all.combined.js: config/examples-all.json build/compiled-examples/all.js \
$(SRC_JS) $(SRC_SHADER_JS) \
build/timestamps/node-modules-timestamp
@mkdir -p $(@D)
node tasks/build.js $< $@
build/compiled-examples/%.json: config/example.json build/examples/%.js \
build/timestamps/node-modules-timestamp
@mkdir -p $(@D)
@sed -e 's|{{id}}|$*|' $< > $@
build/compiled-examples/%.combined.js: build/compiled-examples/%.json \
$(SRC_JS) $(SRC_SHADER_JS) \
build/timestamps/node-modules-timestamp
@mkdir -p $(@D)
node tasks/build.js $< $@
build/timestamps/jsdoc-$(BRANCH)-timestamp: config/jsdoc/api/index.md \
config/jsdoc/api/conf.json $(SRC_JS) \
$(SRC_SHADER_JS) \
$(shell find config/jsdoc/api/template -type f) \
build/timestamps/node-modules-timestamp
@mkdir -p $(@D)
@rm -rf $(BUILD_HOSTED)/apidoc
./node_modules/.bin/jsdoc config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -d $(BUILD_HOSTED)/apidoc
@touch $@
build/timestamps/gjslint-timestamp: $(SRC_JS) $(SPEC_JS) $(SPEC_RENDERING_JS) \
$(EXAMPLES_JS)
@mkdir -p $(@D)
@echo "Running gjslint..."
@gjslint --jslint_error=all --custom_jsdoc_tags=event,fires,function,classdesc,api,observable --strict $?
@touch $@
$(BUILD_HOSTED_EXAMPLES_JS): $(BUILD_HOSTED)/examples/%.js: build/examples/%.js
@mkdir -p $(@D)
@python bin/split-example.py $< $(@D)
$(BUILD_HOSTED)/examples/loader.js: bin/loader_hosted_examples.js
@mkdir -p $(@D)
@cp $< $@
$(BUILD_HOSTED)/examples/%: build/examples/%
@mkdir -p $(@D)
@cp $< $@
$(BUILD_HOSTED)/build/ol.js: build/ol.js
@mkdir -p $(@D)
@cp $< $@
$(BUILD_HOSTED)/build/ol-debug.js: build/ol-debug.js
@mkdir -p $(@D)
@cp $< $@
$(BUILD_HOSTED)/css/ol.css: build/ol.css
@mkdir -p $(@D)
@cp $< $@
$(BUILD_HOSTED)/build/ol-deps.js: host-libraries
@mkdir -p $(@D)
@python $(CLOSURE_LIB)/closure/bin/build/depswriter.py \
--root_with_prefix "src ../../../ol" \
--root_with_prefix "build/ol.ext ../../../ol.ext" \
--root $(BUILD_HOSTED)/closure-library/closure/goog \
--root_with_prefix "$(BUILD_HOSTED)/closure-library/third_party ../../third_party" \
--output_file $@
build/timestamps/jshint-timestamp: $(SRC_JS) $(SPEC_JS) $(SPEC_RENDERING_JS) \
$(TASKS_JS) $(EXAMPLES_JS) \
examples/resources/common.js \
build/timestamps/node-modules-timestamp
@mkdir -p $(@D)
@echo "Running jshint..."
@./node_modules/.bin/jshint --verbose $?
@touch $@
build/timestamps/node-modules-timestamp: package.json
@mkdir -p $(@D)
npm install
@touch $@
build/ol.css: css/ol.css build/timestamps/node-modules-timestamp
@mkdir -p $(@D)
@echo "Running cleancss..."
@./node_modules/.bin/cleancss $< > $@
build/ol.js: config/ol.json $(SRC_JS) $(SRC_SHADER_JS) \
build/timestamps/node-modules-timestamp
@mkdir -p $(@D)
node tasks/build.js $< $@
@$(STAT_UNCOMPRESSED) $@
@cp $@ /tmp/
@gzip /tmp/ol.js
@$(STAT_COMPRESSED) /tmp/ol.js.gz
@rm /tmp/ol.js.gz
build/ol.js.map: config/ol.json $(SRC_JS) $(SRC_SHADER_JS) \
build/timestamps/node-modules-timestamp
@mkdir -p $(@D)
node tasks/build.js $< $@
build/ol-debug.js: config/ol-debug.json $(SRC_JS) $(SRC_SHADER_JS) \
build/timestamps/node-modules-timestamp
@mkdir -p $(@D)
node tasks/build.js $< $@
@$(STAT_UNCOMPRESSED) $@
@cp $@ /tmp/
@gzip /tmp/ol-debug.js
@$(STAT_COMPRESSED) /tmp/ol-debug.js.gz
@rm /tmp/ol-debug.js.gz
build/test_requires.js: $(SPEC_JS) $(SRC_JS)
@mkdir -p $(@D)
@node tasks/generate-requires.js $^ > $@
build/test_rendering_requires.js: $(SPEC_RENDERING_JS)
@mkdir -p $(@D)
@node tasks/generate-requires.js $^ > $@
%shader.js: %.glsl src/ol/webgl/shader.mustache bin/pyglslunit.py
@python bin/pyglslunit.py --input $< --template src/ol/webgl/shader.mustache --output $@

View File

@@ -1,11 +1,30 @@
# OpenLayers 3
[![Travis CI Status](https://secure.travis-ci.org/openlayers/ol3.png)](http://travis-ci.org/#!/openlayers/ol3)
[![Travis CI Status](https://secure.travis-ci.org/openlayers/ol3.svg)](http://travis-ci.org/#!/openlayers/ol3)
[![Coverage Status](https://coveralls.io/repos/openlayers/ol3/badge.svg?branch=master)](https://coveralls.io/r/openlayers/ol3?branch=master)
Welcome to [OpenLayers 3](http://openlayers.org/)!
[OpenLayers 3](http://openlayers.org/) is a high-performance, feature-packed library for creating interactive maps on the web.
Check out the [hosted examples](http://openlayers.org/en/master/examples/), the [workshop](http://openlayers.org/ol3-workshop/) or poke around the evolving [API docs](http://openlayers.org/en/master/apidoc/).
## Getting Started
Please don't ask questions in the github issue tracker but use [the mailing list](https://groups.google.com/forum/#!forum/ol3-dev) instead.
- Download the [latest release](https://github.com/openlayers/ol3/releases/tag/v3.4.0)
- Install with npm: `npm install openlayers`
- Clone the repo: `git clone git@github.com:openlayers/ol3.git`
## Documentation
Check out the [hosted examples](http://openlayers.org/en/master/examples/), the [workshop](http://openlayers.org/ol3-workshop/) or [API docs](http://openlayers.org/en/master/apidoc/).
## Bugs
Please use the [GitHub issue tracker](https://github.com/openlayers/ol3/issues) for all bugs and feature requests. Before creating a new issue, do a quick search to see if the problem has been reported already.
## Contributing
Please see our guide on [contributing](CONTRIBUTING.md) if you're interested in getting involved.
## Community
- Need help? Find it on [stackoverflow using the tag 'openlayers-3'](http://stackoverflow.com/questions/tagged/openlayers-3)
- Follow [@openlayers](https://twitter.com/openlayers) on Twitter
- Discuss with openlayers users on IRC in `#openlayers` at `chat.freenode`

File diff suppressed because it is too large Load Diff

193
bin/check-requires.py Normal file
View File

@@ -0,0 +1,193 @@
import os
import logging
import re
import sys
logging.basicConfig(format='%(asctime)s %(name)s: %(message)s',
level=logging.INFO)
logger = logging.getLogger('check-requires')
class Node(object):
def __init__(self):
self.present = False
self.children = {}
def _build_re(self, key):
if key == '*':
assert len(self.children) == 0
# We want to match `.doIt` but not `.SomeClass` or `.more.stuff`
return '(?=\\.[a-z]\\w*\\b(?!\\.))'
elif len(self.children) == 1:
child_key, child = next(self.children.iteritems())
child_re = child._build_re(child_key)
if child_key != '*':
child_re = '\\.' + child_re
if self.present:
return key + '(' + child_re + ')?'
else:
return key + child_re
elif self.children:
children_re = '(?:' + '|'.join(
('\\.' if k != '*' else '') + self.children[k]._build_re(k)
for k in sorted(self.children.keys())) + ')'
if self.present:
return key + children_re + '?'
else:
return key + children_re
else:
assert self.present
return key
def build_re(self, key):
return re.compile('\\b' + self._build_re(key) + '\\b')
def ifind(*paths):
"""ifind is an iterative version of os.walk, yielding all walked paths and
normalizing paths to use forward slashes."""
for path in paths:
for dirpath, dirnames, names in os.walk(path):
for name in names:
if os.sep == '/':
yield os.path.join(dirpath, name)
else:
yield '/'.join(dirpath.split(os.sep) + [name])
def _strip_comments(lines):
# FIXME this is a horribe hack, we should use a proper JavaScript parser
# here
in_multiline_comment = False
lineno = 0
for line in lines:
lineno += 1
if in_multiline_comment:
index = line.find('*/')
if index != -1:
in_multiline_comment = False
line = line[index + 2:]
if not in_multiline_comment:
line = re.sub(r'//[^\n]*', '', line)
line = re.sub(r'/\*.*?\*/', '', line)
index = line.find('/*')
if index != -1:
yield lineno, line[:index]
in_multiline_comment = True
else:
yield lineno, line
def check_requires(closure_lib, *filenames):
unused_count = 0
all_provides = set()
for filename in ifind(closure_lib):
if filename.endswith('.js'):
if not re.match(r'.*/closure/goog/', filename):
continue
# Skip goog.i18n because it contains so many modules that it causes
# the generated regular expression to exceed Python's limits
if re.match(r'.*/closure/goog/i18n/', filename):
continue
for line in open(filename, 'rU'):
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
if m:
all_provides.add(m.group(1))
for filename in sorted(filenames):
require_linenos = {}
uses = set()
lines = open(filename, 'rU').readlines()
for lineno, line in _strip_comments(lines):
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
if m:
all_provides.add(m.group(1))
continue
m = re.match(r'goog.require\(\'(.*)\'\);', line)
if m:
require_linenos[m.group(1)] = lineno
continue
ignore_linenos = require_linenos.values()
for lineno, line in enumerate(lines):
if lineno in ignore_linenos:
continue
for require in require_linenos.iterkeys():
if require in line:
uses.add(require)
for require in sorted(set(require_linenos.keys()) - uses):
logger.info('%s:%d: unused goog.require: %r' % (
filename, require_linenos[require], require))
unused_count += 1
all_provides.discard('ol')
all_provides.discard('ol.MapProperty')
root = Node()
for provide in all_provides:
node = root
for component in provide.split('.'):
if component not in node.children:
node.children[component] = Node()
node = node.children[component]
if component[0].islower():
# We've arrived at a namespace provide like `ol.foo`.
# In this case, we want to match uses like `ol.foo.doIt()` but
# not match things like `new ol.foo.SomeClass()`.
# For this purpose, we use the special wildcard key for the child.
node.children['*'] = Node()
else:
node.present = True
provide_res = [child.build_re(key)
for key, child in root.children.iteritems()]
missing_count = 0
for filename in sorted(filenames):
provides = set()
requires = set()
uses = set()
uses_linenos = {}
for lineno, line in _strip_comments(open(filename, 'rU')):
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
if m:
provides.add(m.group(1))
continue
m = re.match(r'goog.require\(\'(.*)\'\);', line)
if m:
requires.add(m.group(1))
continue
while True:
for provide_re in provide_res:
m = provide_re.search(line)
if m:
uses.add(m.group())
uses_linenos[m.group()] = lineno
line = line[:m.start()] + line[m.end():]
break
else:
break
if filename == 'src/ol/renderer/layerrenderer.js':
uses.discard('ol.renderer.Map')
m = re.match(
r'src/ol/renderer/(\w+)/\1(\w*)layerrenderer\.js\Z', filename)
if m:
uses.discard('ol.renderer.Map')
uses.discard('ol.renderer.%s.Map' % (m.group(1),))
missing_requires = uses - requires - provides
if missing_requires:
for missing_require in sorted(missing_requires):
logger.info("%s:%d missing goog.require('%s')" %
(filename, uses_linenos[missing_require],
missing_require))
missing_count += 1
return (unused_count, missing_count)
if __name__ == "__main__":
unused_count, missing_count = check_requires(*sys.argv[1:])
if unused_count > 0 or missing_count > 0:
logger.error('%d unused goog.requires, %d missing goog.requires' %
(unused_count, missing_count))
sys.exit(1)

46
bin/check-whitespace.py Normal file
View File

@@ -0,0 +1,46 @@
import logging
import re
import sys
logging.basicConfig(format='%(asctime)s %(name)s: %(message)s',
level=logging.INFO)
logger = logging.getLogger('check-whitespace')
CR_RE = re.compile(r'\r')
LEADING_WHITESPACE_RE = re.compile(r'\s+')
TRAILING_WHITESPACE_RE = re.compile(r'\s+\n\Z')
NO_NEWLINE_RE = re.compile(r'[^\n]\Z')
ALL_WHITESPACE_RE = re.compile(r'\s+\Z')
def check_whitespace(*filenames):
errors = 0
for filename in sorted(filenames):
whitespace = False
for lineno, line in enumerate(open(filename, 'rU')):
if lineno == 0 and LEADING_WHITESPACE_RE.match(line):
logger.info('%s:%d: leading whitespace', filename, lineno + 1)
errors += 1
if CR_RE.search(line):
logger.info('%s:%d: carriage return character in line',
filename, lineno + 1)
errors += 1
if TRAILING_WHITESPACE_RE.search(line):
logger.info('%s:%d: trailing whitespace', filename, lineno + 1)
errors += 1
if NO_NEWLINE_RE.search(line):
logger.info('%s:%d: no newline at end of file', filename,
lineno + 1)
errors += 1
whitespace = ALL_WHITESPACE_RE.match(line)
if whitespace:
logger.info('%s: trailing whitespace at end of file', filename)
errors += 1
return errors
if __name__ == "__main__":
errors = check_whitespace(*sys.argv[1:])
if errors > 0:
logger.error('%d whitespace errors' % (errors,))
sys.exit(1)

View File

@@ -140,7 +140,7 @@
console.log('Capturing ' + lenHtmlFiles + ' example screenshots.');
// The main interval function that is executed regularily and renders a
// The main interval function that is executed regularly and renders a
// page to a file
var interval = setInterval(function() {
if (!loadInProgress && pageindex < lenHtmlFiles) {

View File

@@ -1,269 +0,0 @@
#!/usr/bin/env python
import sys
import os
import re
import time
from xml.dom.minidom import Document
try:
import xml.etree.ElementTree as ElementTree
except ImportError:
try:
import cElementTree as ElementTree # NOQA
except ImportError:
try:
import elementtree.ElementTree as ElementTree # NOQA
except ImportError:
import lxml.etree as ElementTree # NOQA
missing_deps = False
try:
import json
except ImportError:
try:
import simplejson as json # NOQA
except ImportError, E:
missing_deps = E
try:
from BeautifulSoup import BeautifulSoup
except ImportError, E:
missing_deps = E
feedName = "example-list.xml"
feedPath = "http://openlayers.github.io/ol3/master/examples/"
def getListOfExamples(relPath):
"""
returns list of .html filenames within a given path - excludes
index.html
"""
examples = os.listdir(relPath)
examples = [example for example in examples if
example.endswith('.html') and example != "index.html"]
return examples
def getExampleHtml(path):
"""
returns html of a specific example
"""
print '.',
f = open(path)
html = f.read()
f.close()
return html
def extractById(soup, tagId, value=None):
"""
returns full contents of a particular tag id
"""
beautifulTag = soup.find(id=tagId)
if beautifulTag:
if beautifulTag.contents:
value = str(beautifulTag.renderContents()).strip()
value = value.replace('\t', '')
value = value.replace('\n', '')
return value
def getRelatedClasses(html):
"""
parses the html, and returns a list of all OpenLayers Classes
used within (ie what parts of OL the javascript uses).
"""
rawstr = r'''(?P<class>ol\..*?)\('''
return re.findall(rawstr, html)
def parseHtml(html, ids):
"""
returns dictionary of items of interest
"""
soup = BeautifulSoup(html)
d = {}
for tagId in ids:
d[tagId] = extractById(soup, tagId)
#classes should eventually be parsed from docs - not automatically created.
classes = getRelatedClasses(html)
d['classes'] = classes
return d
def getGitInfo(exampleDir, exampleName):
orig = os.getcwd()
os.chdir(exampleDir)
h = os.popen("git log -n 1 --pretty=format:'%an|%ai' " + exampleName)
os.chdir(orig)
log = h.read()
h.close()
d = {}
if log:
parts = log.split("|")
d["author"] = parts[0]
# compensate for spaces in git log time
td = parts[1].split(" ")
td.insert(1, "T")
d["date"] = "".join(td)
else:
d["author"] = ""
d["date"] = ""
return d
def createFeed(examples):
doc = Document()
atomuri = "http://www.w3.org/2005/Atom"
feed = doc.createElementNS(atomuri, "feed")
feed.setAttribute("xmlns", atomuri)
title = doc.createElementNS(atomuri, "title")
title.appendChild(doc.createTextNode("OpenLayers Examples"))
feed.appendChild(title)
link = doc.createElementNS(atomuri, "link")
link.setAttribute("rel", "self")
link.setAttribute("href", feedPath + feedName)
modtime = time.strftime("%Y-%m-%dT%I:%M:%SZ", time.gmtime())
id = doc.createElementNS(atomuri, "id")
id.appendChild(doc.createTextNode(
"%s%s#%s" % (feedPath, feedName, modtime)))
feed.appendChild(id)
updated = doc.createElementNS(atomuri, "updated")
updated.appendChild(doc.createTextNode(modtime))
feed.appendChild(updated)
examples.sort(key=lambda x: x["modified"])
for example in sorted(examples, key=lambda x: x["modified"], reverse=True):
entry = doc.createElementNS(atomuri, "entry")
title = doc.createElementNS(atomuri, "title")
title.appendChild(doc.createTextNode(example["title"] or
example["example"]))
entry.appendChild(title)
tags = doc.createElementNS(atomuri, "tags")
tags.appendChild(doc.createTextNode(example["tags"] or
example["example"]))
entry.appendChild(tags)
link = doc.createElementNS(atomuri, "link")
link.setAttribute("href", "%s%s" % (feedPath, example["example"]))
entry.appendChild(link)
summary = doc.createElementNS(atomuri, "summary")
summary.appendChild(doc.createTextNode(example["shortdesc"] or
example["example"]))
entry.appendChild(summary)
updated = doc.createElementNS(atomuri, "updated")
updated.appendChild(doc.createTextNode(example["modified"]))
entry.appendChild(updated)
author = doc.createElementNS(atomuri, "author")
name = doc.createElementNS(atomuri, "name")
name.appendChild(doc.createTextNode(example["author"]))
author.appendChild(name)
entry.appendChild(author)
id = doc.createElementNS(atomuri, "id")
id.appendChild(doc.createTextNode("%s%s#%s" % (feedPath,
example["example"],
example["modified"])))
entry.appendChild(id)
feed.appendChild(entry)
doc.appendChild(feed)
return doc
def wordIndex(examples):
"""
Create an inverted index based on words in title and shortdesc. Keys are
lower cased words. Values are dictionaries with example index keys and
count values.
"""
index = {}
unword = re.compile("\\W+")
keys = ["shortdesc", "title", "tags"]
for i in range(len(examples)):
for key in keys:
text = examples[i][key]
if text:
words = unword.split(text)
for word in words:
if word:
word = word.lower()
if word in index:
if i in index[word]:
index[word][i] += 1
else:
index[word][i] = 1
else:
index[word] = {i: 1}
return index
if __name__ == "__main__":
if missing_deps:
print """This script requires json or simplejson and BeautifulSoup.
You don't have them. \n(%s)""" % E
sys.exit()
if len(sys.argv) == 3:
inExampleDir = sys.argv[1]
outExampleDir = sys.argv[2]
else:
inExampleDir = "../examples"
outExampleDir = "../examples"
outFile = open(os.path.join(outExampleDir, "example-list.js"), "w")
print 'Reading examples from %s and writing out to %s' % (inExampleDir,
outFile.name)
exampleList = []
docIds = ['title', 'shortdesc', 'tags']
examples = getListOfExamples(inExampleDir)
modtime = time.strftime("%Y-%m-%dT%I:%M:%SZ", time.gmtime())
for example in examples:
path = os.path.join(inExampleDir, example)
html = getExampleHtml(path)
tagvalues = parseHtml(html, docIds)
tagvalues['example'] = example
# add in author/date info
d = getGitInfo(inExampleDir, example)
tagvalues["author"] = d["author"] or "anonymous"
tagvalues["modified"] = d["date"] or modtime
tagvalues['link'] = example
exampleList.append(tagvalues)
print
exampleList.sort(key=lambda x: x['example'].lower())
index = wordIndex(exampleList)
json = json.dumps({"examples": exampleList, "index": index})
# Give the json a global variable we can use in our js.
# This should be replaced or made optional.
json = 'var info=' + json + ';'
outFile.write(json)
outFile.close()
outFeedPath = os.path.join(outExampleDir, feedName)
print "writing feed to %s " % outFeedPath
atom = open(outFeedPath, 'w')
doc = createFeed(exampleList)
atom.write(doc.toxml())
atom.close()
print 'complete'

View File

@@ -6,8 +6,8 @@
* loads Closure Library's base.js, ol-deps.js, the example's "goog.require"
* script, and the example's script in "development" mode.
*
* The ol.js and ol-deps.js scripts are built by OL3's build.py script.
* They are located in the ../build/ directory, relative to this script.
* The ol.js and ol-deps.js scripts are built using ol3's Makefile. They are
* located in the ../build/ directory, relative to this script.
*
* The script must be named loader.js.
*

39
bin/split-example.py Normal file
View File

@@ -0,0 +1,39 @@
import os
import re
import sys
def split_example_file(example, dst_dir):
lines = open(example, 'rU').readlines()
target_lines = []
target_require_lines = []
found_requires = False
found_code = False
for line in lines:
m = re.match(r'goog.require\(\'(.*)\'\);', line)
if m:
found_requires = True
target_require_lines.append(line)
elif found_requires:
if found_code or line not in ('\n', '\r\n'):
found_code = True
target_lines.append(line)
target = open(
os.path.join(dst_dir, os.path.basename(example)), 'wb')
target_require = open(
os.path.join(dst_dir, os.path.basename(example)
.replace('.js', '-require.js')),
'wb')
target.writelines(target_lines)
target.close()
target_require.writelines(target_require_lines)
target_require.close()
if __name__ == '__main__':
split_example_file(*sys.argv[1:])

View File

@@ -1,2 +0,0 @@
@echo off
%SystemDrive%\Python27\python.exe build.py %*

801
build.py
View File

@@ -1,801 +0,0 @@
#!/usr/bin/env python
from cStringIO import StringIO
import glob
import gzip
import json
import multiprocessing
import os
import re
import shutil
import sys
from pake import Target
from pake import ifind, main, output, rule, target, variables, virtual, which
from Queue import Queue
from threading import Thread
class ThreadPool:
"""A basic pool of worker threads"""
class Worker(Thread):
def __init__(self, tasks):
Thread.__init__(self)
self.tasks = tasks
self.daemon = True # threads will be killed on exit
self.start()
def run(self):
while True:
# block until a task is ready to be done
function, args, kargs = self.tasks.get()
try:
function(*args, **kargs)
except:
print("ERROR")
for count, thing in enumerate(args):
print '{0}. {1}'.format(count, thing)
print(sys.exc_info()[0])
print("ERROR")
self.tasks.errors = True
self.tasks.task_done()
def __init__(self, num_threads = multiprocessing.cpu_count() + 1):
self.tasks = Queue(num_threads)
self.tasks.errors = False
# create num_threads Workers, by default the number of CPUs + 1
for _ in range(num_threads): self.Worker(self.tasks)
def add_task(self, function, *args, **kargs):
self.tasks.put((function, args, kargs))
def wait_completion(self):
# wait for the queue to be empty
self.tasks.join()
return self.tasks.errors
if sys.platform == 'win32':
win = {
'CLEANCSS': './node_modules/.bin/cleancss',
'GIT': 'git.exe',
'GJSLINT': 'gjslint.exe',
'JSDOC': './node_modules/.bin/jsdoc',
'JSHINT': './node_modules/.bin/jshint',
'PYTHON': 'python.exe',
'PHANTOMJS': './node_modules/.bin/phantomjs'
}
sys_dir = os.environ.get('SYSTEMDRIVE')
program_files = os.environ.get('PROGRAMFILES')
if not which(win['GIT']):
win['GIT'] = os.path.join(program_files, 'Git', 'cmd', 'git.exe')
if not which(win['GIT']):
win['GIT'] = os.path.join(program_files, 'Git', 'bin', 'git.exe')
if not which(win['PYTHON']):
win['PYTHON'] = os.path.join(sys_dir, 'Python27', 'python.exe')
if not which(win['GJSLINT']):
win['GJSLINT'] = os.path.join(sys_dir, 'Python27', 'Scripts', 'gjslint.exe')
if not which(win['PHANTOMJS']):
win['PHANTOMJS'] = 'phantomjs.exe'
if not which(win['PHANTOMJS']):
win['PHANTOMJS'] = os.path.join(sys_dir, 'phantomjs-1.9.7-windows', 'phantomjs.exe')
if not which(win['JSDOC']):
win['JSDOC'] = os.path.join(program_files, 'jsdoc3', 'jsdoc.cmd')
for program, path in win.iteritems():
setattr(variables, program, path)
else:
variables.CLEANCSS = './node_modules/.bin/cleancss'
variables.GIT = 'git'
variables.GJSLINT = 'gjslint'
variables.JSHINT = './node_modules/.bin/jshint'
variables.JSDOC = './node_modules/.bin/jsdoc'
variables.PYTHON = 'python'
variables.PHANTOMJS = './node_modules/.bin/phantomjs'
variables.BRANCH = output(
'%(GIT)s', 'rev-parse', '--abbrev-ref', 'HEAD').strip()
EXECUTABLES = [variables.CLEANCSS, variables.GIT, variables.GJSLINT,
variables.JSDOC, variables.JSHINT, variables.PYTHON,
variables.PHANTOMJS]
EXAMPLES = [path
for path in ifind('examples')
if path.endswith('.html')
if path != 'examples/index.html']
EXAMPLES_SRC = [path
for path in ifind('examples')
if path.endswith('.js')
if not path.endswith('.combined.js')
if path != 'examples/Jugl.js'
if path != 'examples/example-list.js']
EXAMPLES_JSON = ['build/' + example.replace('.html', '.json')
for example in EXAMPLES]
EXAMPLES_COMBINED = ['build/' + example.replace('.html', '.combined.js')
for example in EXAMPLES]
GLSL_SRC = [path
for path in ifind('src')
if path.endswith('.glsl')]
JSDOC_SRC = [path
for path in ifind('src')
if path.endswith('.jsdoc')]
SHADER_SRC = [path.replace('.glsl', 'shader.js')
for path in GLSL_SRC]
SPEC = [path
for path in ifind('test/spec')
if path.endswith('.js')]
TASKS = [path
for path in ifind('tasks')
if path.endswith('.js')]
SRC = [path
for path in ifind('src/ol')
if path.endswith('.js')
if path not in SHADER_SRC]
NPM_INSTALL = 'build/npm-install-timestamp'
def report_sizes(t):
stringio = StringIO()
gzipfile = gzip.GzipFile(t.name, 'w', 9, stringio)
with open(t.name, 'rb') as f:
shutil.copyfileobj(f, gzipfile)
gzipfile.close()
rawsize = os.stat(t.name).st_size
gzipsize = len(stringio.getvalue())
savings = '{0:.2%}'.format((rawsize - gzipsize)/float(rawsize))
t.info('uncompressed: %8d bytes', rawsize)
t.info(' compressed: %8d bytes, (saved %s)', gzipsize, savings)
virtual('default', 'build')
virtual('ci', 'lint', 'build', 'test',
'build/examples/all.combined.js', 'check-examples', 'apidoc')
virtual('build', 'build/ol.css', 'build/ol.js', 'build/ol-debug.js')
virtual('check', 'lint', 'build/ol.js', 'test')
virtual('todo', 'fixme')
@target(NPM_INSTALL, 'package.json')
def npm_install(t):
t.run('npm', 'install')
t.touch()
@target('build/ol.css', 'css/ol.css', NPM_INSTALL)
def build_ol_css(t):
t.output('%(CLEANCSS)s', 'css/ol.css')
@target('build/ol.js', SRC, SHADER_SRC, 'config/ol.json', NPM_INSTALL)
def build_ol_new_js(t):
t.run('node', 'tasks/build.js', 'config/ol.json', 'build/ol.js')
report_sizes(t)
@target('build/ol-debug.js', SRC, SHADER_SRC, 'config/ol-debug.json',
NPM_INSTALL)
def build_ol_debug_js(t):
t.run('node', 'tasks/build.js', 'config/ol-debug.json', 'build/ol-debug.js')
report_sizes(t)
for glsl_src in GLSL_SRC:
def shader_src_helper(glsl_src):
@target(glsl_src.replace('.glsl', 'shader.js'), glsl_src,
'src/ol/webgl/shader.mustache', 'bin/pyglslunit.py')
def shader_src(t):
t.run('%(PYTHON)s', 'bin/pyglslunit.py',
'--input', glsl_src,
'--template', 'src/ol/webgl/shader.mustache',
'--output', t.name)
shader_src_helper(glsl_src)
@target('build/test/requireall.js', SPEC)
def build_test_requireall_js(t):
requires = set()
for dependency in t.dependencies:
for line in open(dependency, 'rU'):
match = re.match(r'goog\.provide\(\'(.*)\'\);', line)
if match:
requires.add(match.group(1))
with open(t.name, 'wb') as f:
for require in sorted(requires):
f.write('goog.require(\'%s\');\n' % (require,))
virtual('build-examples', 'examples', 'build/examples/all.combined.js',
EXAMPLES_COMBINED)
virtual('examples', 'examples/example-list.xml', EXAMPLES_JSON)
@target('examples/example-list.xml', 'examples/example-list.js')
def examples_examples_list_xml(t):
t.touch() # already generated by bin/exampleparser.py
@target('examples/example-list.js', 'bin/exampleparser.py', EXAMPLES)
def examples_examples_list_js(t):
t.run('%(PYTHON)s', 'bin/exampleparser.py', 'examples', 'examples')
@target('build/examples/all.combined.js', 'build/examples/all.js',
SRC, SHADER_SRC, 'config/examples-all.json', NPM_INSTALL)
def build_examples_all_combined_js(t):
t.run('node', 'tasks/build.js', 'config/examples-all.json',
'build/examples/all.combined.js')
report_sizes(t)
@target('build/examples/all.js', EXAMPLES_SRC)
def build_examples_all_js(t):
t.output('%(PYTHON)s', 'bin/combine-examples.py', t.dependencies)
@rule(r'\Abuild/examples/(?P<id>.*).json\Z')
def examples_star_json(name, match):
def action(t):
# When compiling the ol3 code and the application code together it is
# better to use oli.js and olx.js files as "input" files rather than
# "externs" files. Indeed, externs prevent renaming, which is neither
# necessary nor desirable in this case.
#
# oli.js and olx.js do not provide or require namespaces (using
# "goog.provide" or "goog.require"). For that reason, if they are
# specified as input files through the "src" property, then
# closure-util will exclude them when creating the dependencies graph.
# So the compile "js" property is used instead. With that property the
# oli.js and olx.js files are passed directly to the compiler. And by
# setting "manage_closure_dependencies" to "true" the compiler will not
# exclude them from its dependencies graph.
content = json.dumps({
"exports": [],
"src": [
"src/**/*.js",
"build/ol.ext/*.js",
"examples/%(id)s.js" % match.groupdict()],
"compile": {
"js": [
"externs/olx.js",
"externs/oli.js",
],
"externs": [
"externs/bingmaps.js",
"externs/bootstrap.js",
"externs/closure-compiler.js",
"externs/example.js",
"externs/fastclick.js",
"externs/geojson.js",
"externs/jquery-1.9.js",
"externs/proj4js.js",
"externs/tilejson.js",
"externs/topojson.js",
"externs/vbarray.js"
],
"define": [
"goog.array.ASSUME_NATIVE_FUNCTIONS=true",
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false"
],
"jscomp_error": [
"accessControls",
"ambiguousFunctionDecl",
"checkDebuggerStatement",
"checkEventfulObjectDisposal",
"checkProvides",
"checkRegExp",
"checkStructDictInheritance",
"checkTypes",
"checkVars",
"const",
"constantProperty",
"deprecated",
"duplicate",
"duplicateMessage",
"es3",
"es5Strict",
"externsValidation",
"fileoverviewTags",
"globalThis",
"internetExplorerChecks",
"invalidCasts",
"misplacedTypeAnnotation",
"missingProperties",
"nonStandardJsDocs",
"strictModuleDepCheck",
"suspiciousCode",
"typeInvalidation",
"tweakValidation",
"undefinedNames",
"undefinedVars",
"uselessCode",
"violatedModuleDep",
"visibility"
],
"jscomp_off": [
"unknownDefines"
],
"extra_annotation_name": [
"api", "observable"
],
"compilation_level": "ADVANCED",
"warning_level": "VERBOSE",
"output_wrapper": "(function(){%output%})();",
"use_types_for_optimization": True,
"manage_closure_dependencies": True
}
})
with open(t.name, 'wb') as f:
f.write(content)
return Target(name, action=action,
dependencies=[__file__, NPM_INSTALL])
@rule(r'\Abuild/examples/(?P<id>.*).combined.js\Z')
def examples_star_combined_js(name, match):
def action(t):
config = 'build/examples/%(id)s.json' % match.groupdict()
t.run('node', 'tasks/build.js', config, name)
report_sizes(t)
dependencies = [SRC, SHADER_SRC,
'examples/%(id)s.js' % match.groupdict(),
'build/examples/%(id)s.json' % match.groupdict(),
NPM_INSTALL]
return Target(name, action=action, dependencies=dependencies)
@target('serve', 'examples', NPM_INSTALL)
def serve(t):
t.run('node', 'tasks/serve.js')
virtual('lint', 'build/lint-timestamp', 'build/check-requires-timestamp',
'build/check-whitespace-timestamp', 'jshint')
@target('build/lint-timestamp', SRC, EXAMPLES_SRC, SPEC, precious=True)
def build_lint_src_timestamp(t):
t.run('%(GJSLINT)s',
'--jslint_error=all',
'--custom_jsdoc_tags=event,fires,function,classdesc,api,observable',
'--strict',
t.newer(t.dependencies))
t.touch()
virtual('jshint', 'build/jshint-timestamp')
@target('build/jshint-timestamp', SRC, EXAMPLES_SRC, SPEC, TASKS,
NPM_INSTALL, precious=True)
def build_jshint_timestamp(t):
t.run(variables.JSHINT, '--verbose', t.newer(t.dependencies))
t.touch()
def _strip_comments(lines):
# FIXME this is a horribe hack, we should use a proper JavaScript parser
# here
in_multiline_comment = False
lineno = 0
for line in lines:
lineno += 1
if in_multiline_comment:
index = line.find('*/')
if index != -1:
in_multiline_comment = False
line = line[index + 2:]
if not in_multiline_comment:
line = re.sub(r'//[^\n]*', '', line)
line = re.sub(r'/\*.*?\*/', '', line)
index = line.find('/*')
if index != -1:
yield lineno, line[:index]
in_multiline_comment = True
else:
yield lineno, line
@target('build/check-requires-timestamp', SRC, EXAMPLES_SRC, SHADER_SRC, SPEC)
def build_check_requires_timestamp(t):
unused_count = 0
all_provides = set()
closure_lib_path = output('node', '-e',
'process.stdout.write(require("closure-util").getLibraryPath())')
for filename in ifind(closure_lib_path):
if filename.endswith('.js'):
if not re.match(r'.*/closure/goog/', filename):
continue
# Skip goog.i18n because it contains so many modules that it causes
# the generated regular expression to exceed Python's limits
if re.match(r'.*/closure/goog/i18n/', filename):
continue
for line in open(filename, 'rU'):
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
if m:
all_provides.add(m.group(1))
for filename in sorted(t.dependencies):
require_linenos = {}
uses = set()
lines = open(filename, 'rU').readlines()
for lineno, line in _strip_comments(lines):
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
if m:
all_provides.add(m.group(1))
continue
m = re.match(r'goog.require\(\'(.*)\'\);', line)
if m:
require_linenos[m.group(1)] = lineno
continue
ignore_linenos = require_linenos.values()
for lineno, line in enumerate(lines):
if lineno in ignore_linenos:
continue
for require in require_linenos.iterkeys():
if require in line:
uses.add(require)
for require in sorted(set(require_linenos.keys()) - uses):
t.info('%s:%d: unused goog.require: %r' % (
filename, require_linenos[require], require))
unused_count += 1
all_provides.discard('ol')
all_provides.discard('ol.MapProperty')
class Node(object):
def __init__(self):
self.present = False
self.children = {}
def _build_re(self, key):
if key == '*':
assert len(self.children) == 0
# We want to match `.doIt` but not `.SomeClass` or `.more.stuff`
return '(?=\\.[a-z]\\w*\\b(?!\\.))'
elif len(self.children) == 1:
child_key, child = next(self.children.iteritems())
child_re = child._build_re(child_key)
if child_key != '*':
child_re = '\\.' + child_re
if self.present:
return key + '(' + child_re + ')?'
else:
return key + child_re
elif self.children:
children_re = '(?:' + '|'.join(
('\\.' if k != '*' else '') + self.children[k]._build_re(k)
for k in sorted(self.children.keys())) + ')'
if self.present:
return key + children_re + '?'
else:
return key + children_re
else:
assert self.present
return key
def build_re(self, key):
return re.compile('\\b' + self._build_re(key) + '\\b')
root = Node()
for provide in all_provides:
node = root
for component in provide.split('.'):
if component not in node.children:
node.children[component] = Node()
node = node.children[component]
if component[0].islower():
# We've arrived at a namespace provide like `ol.foo`.
# In this case, we want to match uses like `ol.foo.doIt()` but
# not match things like `new ol.foo.SomeClass()`.
# For this purpose, we use the special wildcard key for the child.
node.children['*'] = Node()
else:
node.present = True
provide_res = [child.build_re(key)
for key, child in root.children.iteritems()]
missing_count = 0
for filename in sorted(t.dependencies):
provides = set()
requires = set()
uses = set()
uses_linenos = {}
for lineno, line in _strip_comments(open(filename, 'rU')):
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
if m:
provides.add(m.group(1))
continue
m = re.match(r'goog.require\(\'(.*)\'\);', line)
if m:
requires.add(m.group(1))
continue
while True:
for provide_re in provide_res:
m = provide_re.search(line)
if m:
uses.add(m.group())
uses_linenos[m.group()] = lineno
line = line[:m.start()] + line[m.end():]
break
else:
break
if filename == 'src/ol/renderer/layerrenderer.js':
uses.discard('ol.renderer.Map')
m = re.match(
r'src/ol/renderer/(\w+)/\1(\w*)layerrenderer\.js\Z', filename)
if m:
uses.discard('ol.renderer.Map')
uses.discard('ol.renderer.%s.Map' % (m.group(1),))
missing_requires = uses - requires - provides
if missing_requires:
for missing_require in sorted(missing_requires):
t.info("%s:%d missing goog.require('%s')" %
(filename, uses_linenos[missing_require], missing_require))
missing_count += 1
if unused_count or missing_count:
t.error('%d unused goog.requires, %d missing goog.requires' %
(unused_count, missing_count))
t.touch()
@target('build/check-whitespace-timestamp', SRC, EXAMPLES_SRC,
SPEC, JSDOC_SRC, precious=True)
def build_check_whitespace_timestamp(t):
CR_RE = re.compile(r'\r')
LEADING_WHITESPACE_RE = re.compile(r'\s+')
TRAILING_WHITESPACE_RE = re.compile(r'\s+\n\Z')
NO_NEWLINE_RE = re.compile(r'[^\n]\Z')
ALL_WHITESPACE_RE = re.compile(r'\s+\Z')
errors = 0
for filename in sorted(t.newer(t.dependencies)):
whitespace = False
for lineno, line in enumerate(open(filename, 'rU')):
if lineno == 0 and LEADING_WHITESPACE_RE.match(line):
t.info('%s:%d: leading whitespace', filename, lineno + 1)
errors += 1
if CR_RE.search(line):
t.info('%s:%d: carriage return character in line', filename, lineno + 1)
errors += 1
if TRAILING_WHITESPACE_RE.search(line):
t.info('%s:%d: trailing whitespace', filename, lineno + 1)
errors += 1
if NO_NEWLINE_RE.search(line):
t.info('%s:%d: no newline at end of file', filename, lineno + 1)
errors += 1
whitespace = ALL_WHITESPACE_RE.match(line)
if whitespace:
t.info('%s: trailing whitespace at end of file', filename)
errors += 1
if errors:
t.error('%d whitespace errors' % (errors,))
t.touch()
virtual('apidoc', 'build/jsdoc-%(BRANCH)s-timestamp' % vars(variables))
@target('build/jsdoc-%(BRANCH)s-timestamp' % vars(variables), 'host-resources',
SRC, SHADER_SRC, ifind('config/jsdoc/api/template'),
NPM_INSTALL)
def jsdoc_BRANCH_timestamp(t):
t.run('%(JSDOC)s', 'config/jsdoc/api/index.md',
'-c', 'config/jsdoc/api/conf.json',
'-d', 'build/hosted/%(BRANCH)s/apidoc')
t.touch()
def split_example_file(example, dst_dir):
lines = open(example, 'rU').readlines()
target_lines = []
target_require_lines = []
found_requires = False
found_code = False
for line in lines:
m = re.match(r'goog.require\(\'(.*)\'\);', line)
if m:
found_requires = True
target_require_lines.append(line)
elif found_requires:
if found_code or line not in ('\n', '\r\n'):
found_code = True
target_lines.append(line)
target = open(
os.path.join(dst_dir, os.path.basename(example)), 'wb')
target_require = open(
os.path.join(dst_dir, os.path.basename(example)
.replace('.js', '-require.js')),
'wb')
target.writelines(target_lines)
target.close()
target_require.writelines(target_require_lines)
target_require.close()
@target('host-resources', phony=True)
def host_resources(t):
resources_dir = 'build/hosted/%(BRANCH)s/resources'
t.rm_rf(resources_dir)
t.cp_r('resources', resources_dir)
@target('host-examples', 'build', 'host-resources', 'examples', phony=True)
def host_examples(t):
examples_dir = 'build/hosted/%(BRANCH)s/examples'
build_dir = 'build/hosted/%(BRANCH)s/build'
css_dir = 'build/hosted/%(BRANCH)s/css'
closure_lib_path = output('node', '-e',
'process.stdout.write(require("closure-util").getLibraryPath())')
t.rm_rf(examples_dir)
t.makedirs(examples_dir)
t.rm_rf(build_dir)
t.makedirs(build_dir)
t.rm_rf(css_dir)
t.makedirs(css_dir)
t.cp(EXAMPLES, examples_dir)
for example in [path.replace('.html', '.js') for path in EXAMPLES]:
split_example_file(example, examples_dir % vars(variables))
t.cp_r('examples/data', examples_dir + '/data')
t.cp('bin/loader_hosted_examples.js', examples_dir + '/loader.js')
t.cp('build/ol.js', 'build/ol-debug.js', build_dir)
t.cp('build/ol.css', css_dir)
t.cp('examples/index.html', 'examples/example-list.js',
'examples/example-list.xml', 'examples/Jugl.js', examples_dir)
t.rm_rf('build/hosted/%(BRANCH)s/closure-library')
t.cp_r(closure_lib_path, 'build/hosted/%(BRANCH)s/closure-library')
t.rm_rf('build/hosted/%(BRANCH)s/ol')
t.makedirs('build/hosted/%(BRANCH)s/ol')
t.cp_r('src/ol', 'build/hosted/%(BRANCH)s/ol/ol')
t.rm_rf('build/hosted/%(BRANCH)s/ol.ext')
t.cp_r('build/ol.ext', 'build/hosted/%(BRANCH)s/ol.ext')
t.run('%(PYTHON)s', closure_lib_path + '/closure/bin/build/depswriter.py',
'--root_with_prefix', 'src ../../../ol',
'--root_with_prefix', 'build/ol.ext ../../../ol.ext',
'--root', 'build/hosted/%(BRANCH)s/closure-library/closure/goog',
'--root_with_prefix', 'build/hosted/%(BRANCH)s/closure-library/'
'third_party ../../third_party',
'--output_file', 'build/hosted/%(BRANCH)s/build/ol-deps.js')
@target('check-examples', 'host-examples', phony=True)
def check_examples(t):
examples = ['build/hosted/%(BRANCH)s/' + e
for e in EXAMPLES
if not open(e.replace('.html', '.js'), 'rU').readline().startswith('// NOCOMPILE')]
all_examples = [e + '?mode=advanced' for e in examples]
# Run the examples checks in a pool of threads
pool = ThreadPool()
for example in all_examples:
pool.add_task(t.run, '%(PHANTOMJS)s', 'bin/check-example.js', example)
errors = pool.wait_completion()
if errors:
sys.exit(1)
@target('test', NPM_INSTALL, phony=True)
def test(t):
t.run('node', 'tasks/test.js')
@target('fixme', phony=True)
def find_fixme(t):
regex = re.compile('FIXME|TODO')
matches = dict()
totalcount = 0
for filename in SRC:
f = open(filename, 'r')
for lineno, line in enumerate(f):
if regex.search(line):
if (filename not in matches):
matches[filename] = list()
matches[filename].append('#%-10d %s' % (
lineno + 1, line.strip()))
totalcount += 1
f.close()
for filename in matches:
num_matches = len(matches[filename])
noun = 'matches' if num_matches > 1 else 'match'
print ' %s has %d %s:' % (filename, num_matches, noun)
for match in matches[filename]:
print ' %s' % (match,)
print
print 'A total of %d TODO/FIXME(s) were found' % (totalcount,)
@target('reallyclean')
def reallyclean(t):
"""Removes untracked files and folders from previous builds."""
# -X => only clean up files that are usually ignored e.g.
# through .gitignore
# -d => also consider directories for deletion
# -f => if git configuration variable clean.requireForce != false,
# git clean will refuse to run unless given -f or -n.
t.run('%(GIT)s', 'clean', '-X', '-d', '-f', '.')
@target('checkdeps')
def check_dependencies(t):
for exe in EXECUTABLES:
status = 'present' if which(exe) else 'MISSING'
print 'Program "%s" seems to be %s.' % (exe, status)
print 'For certain targets all above programs need to be present.'
@target('help')
def display_help(t):
print '''
build.py - The OpenLayers 3 build script.
Usage:
./build.py [options] [target] (on Unix-based machines)
<python-executable.exe> build.py [options] [target] (on Windows machines)
There is one option:
-c - Cleans up the repository from previous builds.
The most common targets are:
serve - Serves files, on port 3000.
lint - Runs gjslint on all sourcefiles to enforce specific syntax.
build - Builds singlefile versions of OpenLayers JavaScript and
CSS. This is also the default build target which runs when
no target is specified.
test - Runs the testsuite and displays the results.
check - Runs the lint-target, builds some OpenLayers files, and
then runs test. Many developers call this target often
while working on the code.
help - Shows this help.
Other less frequently used targets are:
apidoc - Builds the API-Documentation using JSDoc3.
ci - Builds all examples in various modes and usually takes a
long time to finish. This target calls the following
targets: lint, build, build-all, test, build-examples,
check-examples and apidoc. This is the target run on
Travis CI.
reallyclean - Remove untracked files from the repository.
checkdeps - Checks whether all required development software is
installed on your machine.
fixme - Will print a list of parts of the code that are marked
with either TODO or FIXME.
todo - This is an alias for the fixme-target (see above).
If no target is given, the build-target will be executed.
The above list is not complete, please see the source code for not-mentioned
and only seldomly called targets.
'''
if __name__ == '__main__':
main()

167
changelog/upgrade-notes.md Normal file
View File

@@ -0,0 +1,167 @@
## Upgrade notes
### v3.5.0
#### `ol.Object` and `bindTo`
* The following experimental methods have been removed from `ol.Object`: `bindTo`, `unbind`, and `unbindAll`. If you want to get notification about `ol.Object` property changes, you can listen for the `'propertychange'` event (e.g. `object.on('propertychange', listener)`). Two-way binding can be set up at the application level using property change listeners. See [#3472](https://github.com/openlayers/ol3/pull/3472) for details on the change.
* The experimental `ol.dom.Input` component has been removed. If you need to synchronize the state of a dom Input element with an `ol.Object`, this can be accomplished using listeners for change events. For example, you might bind the state of a checkbox type input with a layer's visibility like this:
```js
var layer = new ol.layer.Tile();
var checkbox = document.querySelector('#checkbox');
checkbox.addEventListener('change', function() {
var checked = this.checked;
if (checked !== layer.getVisible()) {
layer.setVisible(checked);
}
});
layer.on('change:visible', function() {
var visible = this.getVisible();
if (visible !== checkbox.checked) {
checkbox.checked = visible;
}
});
```
#### New Vector API
* The following experimental vector classes have been removed: `ol.source.GeoJSON`, `ol.source.GML`, `ol.source.GPX`, `ol.source.IGC`, `ol.source.KML`, `ol.source.OSMXML`, and `ol.source.TopoJSON`. You now will use `ol.source.Vector` instead.
For example, if you used `ol.source.GeoJSON` as follows:
```js
var source = new ol.source.GeoJSON({
url: 'features.json',
projection: 'EPSG:3857'
});
```
you will need to change your code to:
```js
var source = new ol.source.Vector({
url: 'features.json',
format: new ol.format.GeoJSON()
});
```
See http://openlayers.org/en/master/examples/vector-layer.html for a real example.
Note that you no longer need to set a `projection` on the source!
Previously the vector data was loaded at source construction time, and, if the data projection and the source projection were not the same, the vector data was transformed to the source projection before being inserted (as features) into the source.
The vector data is now loaded at render time, when the view projection is known. And the vector data is transformed to the view projection if the data projection and the source projection are not the same.
If you still want to "eagerly" load the source you will use something like this:
```js
var source = new ol.source.Vector();
$.ajax('features.json').then(function(response) {
var geojsonFormat = new ol.format.GeoJSON();
var features = geojsonFormat.readFeatures(response,
{featureProjection: 'EPSG:3857'});
source.addFeatures(features);
});
```
The above code uses jQuery to send an Ajax request, but you can obviously use any Ajax library.
See http://openlayers.org/en/master/examples/igc.html for a real example.
* Note about KML
If you used `ol.source.KML`'s `extractStyles` or `defaultStyle` options, you will now have to set these options on `ol.format.KML` instead. For example, if you used:
```js
var source = new ol.source.KML({
url: 'features.kml',
extractStyles: false,
projection: 'EPSG:3857'
});
```
you will now use:
```js
var source = new ol.source.Vector({
url: 'features.kml',
format: new ol.format.KML({
extractStyles: false
})
});
```
* The `ol.source.ServerVector` class has been removed. If you used it, for example as follows:
```js
var source = new ol.source.ServerVector({
format: new ol.format.GeoJSON(),
loader: function(extent, resolution, projection) {
var url = …;
$.ajax(url).then(function(response) {
source.addFeatures(source.readFeatures(response));
});
},
strategy: ol.loadingstrategy.bbox,
projection: 'EPSG:3857'
});
```
you will need to change your code to:
```js
var source = new ol.source.Vector({
loader: function(extent, resolution, projection) {
var url = …;
$.ajax(url).then(function(response) {
var format = new ol.format.GeoJSON();
var features = format.readFeatures(response,
{featureProjection: projection});
source.addFeatures(features);
});
},
strategy: ol.loadingstrategy.bbox
});
```
See http://openlayers.org/en/master/examples/vector-osm.html for a real example.
* The experimental `ol.loadingstrategy.createTile` function has been renamed to `ol.loadingstrategy.tile`. The signature of the function hasn't changed. See http://openlayers.org/en/master/examples/vector-osm.html for an example.
#### Change to `ol.style.Icon`
* When manually loading an image for `ol.style.Icon`, the image size should now be set
with the `imgSize` option and not with `size`. `size` is supposed to be used for the
size of a sub-rectangle in an image sprite.
#### Support for non-square tiles
The return value of `ol.tilegrid.TileGrid#getTileSize()` will now be an `ol.Size` array instead of a number if non-square tiles (i.e. an `ol.Size` array instead of a number as `tilsSize`) are used. To always get an `ol.Size`, the new `ol.size.toSize()` was added.
#### Change to `ol.interaction.Draw`
When finishing a draw, the `drawend` event is now dispatched before the feature is inserted to either the source or the collection. This change allows application code to finish setting up the feature.
#### Misc.
If you compile your application together with the library and use the `ol.feature.FeatureStyleFunction` type annotation (this should be extremely rare), the type is now named `ol.FeatureStyleFunction`.
### v3.4.0
There should be nothing special required when upgrading from v3.3.0 to v3.4.0.
### v3.3.0
* The `ol.events.condition.mouseMove` function was replaced by `ol.events.condition.pointerMove` (see [#3281](https://github.com/openlayers/ol3/pull/3281)). For example, if you use `ol.events.condition.mouseMove` as the condition in a `Select` interaction then you now need to use `ol.events.condition.pointerMove`:
```js
var selectInteraction = new ol.interaction.Select({
condition: ol.events.condition.pointerMove
// …
});
```

View File

@@ -112,7 +112,7 @@ The 3.1.0 release maintains a backwards-compatible API with the 3.0.0 release, s
* [#2781](https://github.com/openlayers/ol3/pull/2781) - Use a standard title attribute for the control buttons ([@fredj](https://github.com/fredj))
* [#2852](https://github.com/openlayers/ol3/pull/2852) - Add missing space between class names ([@fredj](https://github.com/fredj))
* [#2891](https://github.com/openlayers/ol3/pull/2891) - Introduce a load function for image sources ([@ahocevar](https://github.com/ahocevar))
* [#2885](https://github.com/openlayers/ol3/pull/2885) - Add wrapX option to TileJSON source ([@elemoine](https://github.com/elemoine))
* [#2885](https://github.com/openlayers/ol3/pull/2885) - Add wrapX option to TileJSON source ([@elemoine](https://github.com/elemoine))
* [#2890](https://github.com/openlayers/ol3/pull/2890) - Use correct layer property names ([@elemoine](https://github.com/elemoine))
* [#2887](https://github.com/openlayers/ol3/pull/2887) - Explicitly pass coordinate dimension before transforming. ([@tschaub](https://github.com/tschaub))
* [#2886](https://github.com/openlayers/ol3/pull/2886) - Use ternary notation ([@elemoine](https://github.com/elemoine))

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

@@ -0,0 +1,9 @@
# 3.1.0
## Summary
This is a patch release to fix an issue with the select interaction in the 3.1.0 release.
## Changes
* [#3082](https://github.com/openlayers/ol3/pull/3082) - Correct arguments for forEachGeometryAtPixel. ([@tschaub](https://github.com/tschaub))

86
changelog/v3.2.0.md Normal file
View File

@@ -0,0 +1,86 @@
# 3.2.0
## Summary
The 3.1.0 release includes 70 merged pull requests since 3.1.0. Of note, the KML format [now parses `NetworkingLink` tags](https://github.com/openlayers/ol3/pull/3171). The [measure example](http://openlayers.org/en/v3.2.0/examples/measure.html) was [reworked](https://github.com/openlayers/ol3/pull/3206) to display measurements and help messages while drawing. A WMTS GetCapabilities format was [added](https://github.com/openlayers/ol3/pull/3026). The WebGL renderer [now supports feature hit detection](https://github.com/openlayers/ol3/pull/3065) (on point features). And you can now [detect](https://github.com/openlayers/ol3/pull/3172) features/colored pixels on image and tile layers! See the full list of [changes](#changes) below.
## Upgrade notes
The 3.2.0 release maintains a backwards-compatible API with the 3.1.0 release, so upgrades should be painless. Some special considerations below.
* You should not call `view.setRotation` with `undefined`, to reset the view rotation to `0` then use `view.setRotation(0)` (see [#3176](https://github.com/openlayers/ol3/pull/3176)).
* If you use `$(map.getViewport()).on('mousemove')` to detect features when the mouse is hovered on the map, you should now rely on the `pointermove` map event type and check in the `pointermove` listener that the `dragging` event property is `false` (see [#3190](https://github.com/openlayers/ol3/pull/3190)).
## Changes
* [#3171](https://github.com/openlayers/ol3/pull/3171) - KML: Parsing of NetworkLink tag ([@oterral](https://github.com/oterral))
* [#3209](https://github.com/openlayers/ol3/pull/3209) - Coding style fixes ([@fredj](https://github.com/fredj))
* [#3208](https://github.com/openlayers/ol3/pull/3208) - Add setters and getters for imageLoadFunction ([@bartvde](https://github.com/bartvde))
* [#3019](https://github.com/openlayers/ol3/pull/3019) - Add option to allow Select interaction logic to select overlapping features ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3206](https://github.com/openlayers/ol3/pull/3206) - Add tooltip to show measure + help message while drawing ([@pgiraud](https://github.com/pgiraud))
* [#3205](https://github.com/openlayers/ol3/pull/3205) - Use ol.extent.createOrUpdateFromCoordinate ([@fredj](https://github.com/fredj))
* [#3026](https://github.com/openlayers/ol3/pull/3026) - Add support of reading WMTS Get Cap document ([@htulipe](https://github.com/htulipe))
* [#3201](https://github.com/openlayers/ol3/pull/3201) - Pass on opt_fast to parent clear function in ol.source.ServerVector (r=@elemoine,@gberaudo) ([@bartvde](https://github.com/bartvde))
* [#3199](https://github.com/openlayers/ol3/pull/3199) - Minor jsdoc fixes ([@fredj](https://github.com/fredj))
* [#3059](https://github.com/openlayers/ol3/pull/3059) - Cache the buffered extent value ([@fredj](https://github.com/fredj))
* [#3196](https://github.com/openlayers/ol3/pull/3196) - Remove unnecessary newlines ([@fredj](https://github.com/fredj))
* [#3099](https://github.com/openlayers/ol3/pull/3099) - Fix up parsing of OGR GML with ol.format.GML ([@bartvde](https://github.com/bartvde))
* [#3195](https://github.com/openlayers/ol3/pull/3195) - Coding style ([@fredj](https://github.com/fredj))
* [#3192](https://github.com/openlayers/ol3/pull/3192) - Add "url" option to ol.source.MapQuest ([@elemoine](https://github.com/elemoine))
* [#3172](https://github.com/openlayers/ol3/pull/3172) - Introduce forEachLayerAtPixel ([@tsauerwein](https://github.com/tsauerwein))
* [#3178](https://github.com/openlayers/ol3/pull/3178) - GeoJSON externs fixes ([@fredj](https://github.com/fredj))
* [#3179](https://github.com/openlayers/ol3/pull/3179) - Disallow undefined values for ol.layer.Base ([@fredj](https://github.com/fredj))
* [#3161](https://github.com/openlayers/ol3/pull/3161) - Doc fix. writeFeaturesNode receives an array of Feature ([@3x0dv5](https://github.com/3x0dv5))
* [#3169](https://github.com/openlayers/ol3/pull/3169) - Fix default icon style in kml format ([@oterral](https://github.com/oterral))
* [#3190](https://github.com/openlayers/ol3/pull/3190) - Introduce `dragging` flag for MapBrowserEvent ([@tsauerwein](https://github.com/tsauerwein))
* [#3135](https://github.com/openlayers/ol3/pull/3135) - Make changing the label of ZoomToExtent/FullScreen control consistent ([@tsauerwein](https://github.com/tsauerwein))
* [#3186](https://github.com/openlayers/ol3/pull/3186) - Take the pixel ratio into account when clipping the layer ([@fredj](https://github.com/fredj))
* [#3183](https://github.com/openlayers/ol3/pull/3183) - Allow other params than 'mode' in example page query string. ([@htulipe](https://github.com/htulipe))
* [#2791](https://github.com/openlayers/ol3/pull/2791) - Re enable rotation button transition ([@fredj](https://github.com/fredj))
* [#3180](https://github.com/openlayers/ol3/pull/3180) - Add a getMap function to ol.FeatureOverlay (r=@ahocevar) ([@bartvde](https://github.com/bartvde))
* [#3176](https://github.com/openlayers/ol3/pull/3176) - Disallowed undefined rotation value ([@fredj](https://github.com/fredj))
* [#3177](https://github.com/openlayers/ol3/pull/3177) - Add example showing how to style polygon vertices ([@tsauerwein](https://github.com/tsauerwein))
* [#3174](https://github.com/openlayers/ol3/pull/3174) - Use view.getRotation or view.getResolution instead of view.getState ([@fredj](https://github.com/fredj))
* [#3170](https://github.com/openlayers/ol3/pull/3170) - Coding style ([@fredj](https://github.com/fredj))
* [#3108](https://github.com/openlayers/ol3/pull/3108) - Support skipping features in the WebGL renderer ([@tsauerwein](https://github.com/tsauerwein))
* [#3163](https://github.com/openlayers/ol3/pull/3163) - Use the layerStatesArray property from the frameState ([@fredj](https://github.com/fredj))
* [#3159](https://github.com/openlayers/ol3/pull/3159) - Don't pass specific options to the parent constructor ([@fredj](https://github.com/fredj))
* [#3066](https://github.com/openlayers/ol3/pull/3066) - Introduce hasFeatureAtPixel ([@tsauerwein](https://github.com/tsauerwein))
* [#3065](https://github.com/openlayers/ol3/pull/3065) - Add hit-detection support for WebGL ([@tsauerwein](https://github.com/tsauerwein))
* [#3128](https://github.com/openlayers/ol3/pull/3128) - Allow rendering of feature when download of icon failed ([@oterral](https://github.com/oterral))
* [#3156](https://github.com/openlayers/ol3/pull/3156) - Move readProjectionFrom* functions to the base classes ([@fredj](https://github.com/fredj))
* [#3107](https://github.com/openlayers/ol3/pull/3107) - Also listen on loading images ([@elemoine](https://github.com/elemoine))
* [#3153](https://github.com/openlayers/ol3/pull/3153) - Add missing GeoJSONFeature#bbox property ([@fredj](https://github.com/fredj))
* [#3154](https://github.com/openlayers/ol3/pull/3154) - Remove unnecessary newlines ([@fredj](https://github.com/fredj))
* [#3146](https://github.com/openlayers/ol3/pull/3146) - Enable tests for ol.geom.flat.reverse ([@icholy](https://github.com/icholy))
* [#3152](https://github.com/openlayers/ol3/pull/3152) - Update closure-library and closure-util version ([@fredj](https://github.com/fredj))
* [#3145](https://github.com/openlayers/ol3/pull/3145) - Add wrapX option to source.OSM and source.BingMaps ([@elemoine](https://github.com/elemoine))
* [#3139](https://github.com/openlayers/ol3/pull/3139) - Add ol.control.Control#setTarget ([@elemoine](https://github.com/elemoine))
* [#3144](https://github.com/openlayers/ol3/pull/3144) - Update CONTRIBUTING style guide with recent guidelines ([@bartvde](https://github.com/bartvde))
* [#3136](https://github.com/openlayers/ol3/pull/3136) - Use array.length = 0 instead of goog.array.clear ([@fredj](https://github.com/fredj))
* [#3140](https://github.com/openlayers/ol3/pull/3140) - Avoid use of goog.array.clone with arrays. ([@tschaub](https://github.com/tschaub))
* [#3122](https://github.com/openlayers/ol3/pull/3122) - Revert "Use offsetX and offsetY if available" ([@fredj](https://github.com/fredj))
* [#2385](https://github.com/openlayers/ol3/pull/2385) - Option to update vector layers while animating ([@ahocevar](https://github.com/ahocevar))
* [#3129](https://github.com/openlayers/ol3/pull/3129) - Only update the rbush item if the extent has changed ([@fredj](https://github.com/fredj))
* [#3117](https://github.com/openlayers/ol3/pull/3117) - Add pixelRatio support for DOM vector renderer ([@ahocevar](https://github.com/ahocevar))
* [#3124](https://github.com/openlayers/ol3/pull/3124) - Add a space between scale -value and -unit ([@sirtet](https://github.com/sirtet))
* [#3130](https://github.com/openlayers/ol3/pull/3130) - Document default value ([@fredj](https://github.com/fredj))
* [#3105](https://github.com/openlayers/ol3/pull/3105) - ol.geom.Geometry#getExtent re-factoring ([@fredj](https://github.com/fredj))
* [#3118](https://github.com/openlayers/ol3/pull/3118) - Bugfix: "Cannot read property 'firstElementChild' of null" (WFS) ([@naturalatlas](https://github.com/naturalatlas))
* [#3114](https://github.com/openlayers/ol3/pull/3114) - Specify node version in CONTRIBUTING.md ([@elemoine](https://github.com/elemoine))
* [#3106](https://github.com/openlayers/ol3/pull/3106) - Don't pass specific options to the parent constructor ([@fredj](https://github.com/fredj))
* [#3110](https://github.com/openlayers/ol3/pull/3110) - Use svg instead of png to get better image quality ([@PeterDaveHello](https://github.com/PeterDaveHello))
* [#2707](https://github.com/openlayers/ol3/pull/2707) - Generate source map of minified ol.js ([@gberaudo](https://github.com/gberaudo))
* [#3104](https://github.com/openlayers/ol3/pull/3104) - Don't pass renderBuffer option to the parent constructor ([@fredj](https://github.com/fredj))
* [#3096](https://github.com/openlayers/ol3/pull/3096) - popup example cleanup / simplification ([@fredj](https://github.com/fredj))
* [#3072](https://github.com/openlayers/ol3/pull/3072) - Optimize canvas hit detection by rendering features in a limited extent. ([@tschaub](https://github.com/tschaub))
* [#3101](https://github.com/openlayers/ol3/pull/3101) - Use bracket notation instead of goog.object functions. ([@tschaub](https://github.com/tschaub))
* [#3079](https://github.com/openlayers/ol3/pull/3079) - Exclude source files from docs. ([@tschaub](https://github.com/tschaub))
* [#3100](https://github.com/openlayers/ol3/pull/3100) - Assert that ol.layer.Tile#getPreload is always set ([@fredj](https://github.com/fredj))
* [#3084](https://github.com/openlayers/ol3/pull/3084) - Changes from the v3.1.x branch. ([@openlayers](https://github.com/openlayers))
* [#3094](https://github.com/openlayers/ol3/pull/3094) - Remove AUTHORS.md. ([@tschaub](https://github.com/tschaub))
* [#3089](https://github.com/openlayers/ol3/pull/3089) - Fixed URL link for test README ([@mike-mcgann](https://github.com/mike-mcgann))
* [#2894](https://github.com/openlayers/ol3/pull/2894) - Simplify CSS code in custom-controls example ([@fredj](https://github.com/fredj))
* [#3085](https://github.com/openlayers/ol3/pull/3085) - Fixed documentation typo for return value of ol.proj.Projection.isGlobal(). ([@mike-mcgann](https://github.com/mike-mcgann))
* [#3073](https://github.com/openlayers/ol3/pull/3073) - Make map's deviceOptions map options ([@ahocevar](https://github.com/ahocevar))

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

@@ -0,0 +1,9 @@
# 3.2.1
## Summary
This is a patch release that fixes a regression with the select interaction in the [3.2.0 release](https://github.com/openlayers/ol3/releases/tag/v3.2.0).
## Changes
* [#3236](https://github.com/openlayers/ol3/pull/3236) - Select the uppermost feature. ([@tschaub](https://github.com/tschaub))

51
changelog/v3.3.0.md Normal file
View File

@@ -0,0 +1,51 @@
## Upgrade notes
* The `ol.events.condition.mouseMove` function was replaced by `ol.events.condition.pointerMove` (see [#3281](https://github.com/openlayers/ol3/pull/3281)). For example, if you use `ol.events.condition.mouseMove` as the condition in a `Select` interaction then you now need to use `ol.events.condition.pointerMove`:
```js
var selectInteraction = new ol.interaction.Select({
condition: ol.events.condition.pointerMove
// …
});
```
## Overview of all changes
* [#3263](https://github.com/openlayers/ol3/pull/3263) - Support ArcGIS Rest Services ([@cwgrant](https://github.com/cwgrant))
* [#3295](https://github.com/openlayers/ol3/pull/3295) - Add RESTful to WMTS GetCapabilities optionsFromCapabilities ([@sarametz](https://github.com/sarametz))
* [#3304](https://github.com/openlayers/ol3/pull/3304) - Remove scale line inner padding ([@fredj](https://github.com/fredj))
* [#3296](https://github.com/openlayers/ol3/pull/3296) - Add upgrade-notes.md file ([@elemoine](https://github.com/elemoine))
* [#3303](https://github.com/openlayers/ol3/pull/3303) - Add constant for us-ft units ([@ahocevar](https://github.com/ahocevar))
* [#3018](https://github.com/openlayers/ol3/pull/3018) - Add SelectEvent to interaction ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3301](https://github.com/openlayers/ol3/pull/3301) - Select interaction unit tests ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3298](https://github.com/openlayers/ol3/pull/3298) - Make ol.source.Source inherit from ol.Object ([@fredj](https://github.com/fredj))
* [#3297](https://github.com/openlayers/ol3/pull/3297) - Add getters to ol.source.WMTS ([@fredj](https://github.com/fredj))
* [#3281](https://github.com/openlayers/ol3/pull/3281) - Fix mouseMove event type comparison for IE10-11, pointermove ([@adube](https://github.com/adube))
* [#3293](https://github.com/openlayers/ol3/pull/3293) - Add missing opacity option for ol.style.IconOptions ([@ahocevar](https://github.com/ahocevar))
* [#3284](https://github.com/openlayers/ol3/pull/3284) - Fix jsdoc type for arrays of listening keys ([@fredj](https://github.com/fredj))
* [#3278](https://github.com/openlayers/ol3/pull/3278) - Add goog.provide for ol.DrawEventType ([@elemoine](https://github.com/elemoine))
* [#3272](https://github.com/openlayers/ol3/pull/3272) - Added getter function to return the wrapped source within the cluster ([@acanimal](https://github.com/acanimal))
* [#3275](https://github.com/openlayers/ol3/pull/3275) - Add ol.layer.Heatmap#blur getter and setter ([@fredj](https://github.com/fredj))
* [#3142](https://github.com/openlayers/ol3/pull/3142) - WMTS Get Cap document with updated WMTS.optionsFromCapabilities function ([@sarametz](https://github.com/sarametz))
* [#3271](https://github.com/openlayers/ol3/pull/3271) - [wip] Fix misplaced comment blocks ([@fredj](https://github.com/fredj))
* [#3273](https://github.com/openlayers/ol3/pull/3273) - Remove unused createGetTileIfLoadedFunction function. ([@tschaub](https://github.com/tschaub))
* [#3270](https://github.com/openlayers/ol3/pull/3270) - Make ol.Overlay autoPan default to false ([@elemoine](https://github.com/elemoine))
* [#3268](https://github.com/openlayers/ol3/pull/3268) - Fix autoPan in examples with ol.Overlay on hover ([@tsauerwein](https://github.com/tsauerwein))
* [#3256](https://github.com/openlayers/ol3/pull/3256) - Add autoPan option to ol.Overlay ([@tsauerwein](https://github.com/tsauerwein))
* [#3261](https://github.com/openlayers/ol3/pull/3261) - Fix forEachCorner extent, add TopLeft ([@adube](https://github.com/adube))
* [#3260](https://github.com/openlayers/ol3/pull/3260) - Remove unused goog.require ([@fredj](https://github.com/fredj))
* [#3246](https://github.com/openlayers/ol3/pull/3246) - Avoid creating unnecessary images in tile layers. ([@tschaub](https://github.com/tschaub))
* [#3254](https://github.com/openlayers/ol3/pull/3254) - Use lineCap, lineJoin and miterLimit stroke properties in RegularShape ([@fredj](https://github.com/fredj))
* [#3252](https://github.com/openlayers/ol3/pull/3252) - Avoid leaking global listenerSpy. ([@tschaub](https://github.com/tschaub))
* [#3248](https://github.com/openlayers/ol3/pull/3248) - Add tile loading events to image tile sources. ([@tschaub](https://github.com/tschaub))
* [#3240](https://github.com/openlayers/ol3/pull/3240) - Changes from the v3.2.x branch. ([@openlayers](https://github.com/openlayers))
* [#3233](https://github.com/openlayers/ol3/pull/3233) - Four small fixes. ([@stweil](https://github.com/stweil))
* [#3232](https://github.com/openlayers/ol3/pull/3232) - Fix typos found by codespell. ([@stweil](https://github.com/stweil))
* [#3231](https://github.com/openlayers/ol3/pull/3231) - Make ol.layer.Heatmap#radius configurable ([@fredj](https://github.com/fredj))
* [#3225](https://github.com/openlayers/ol3/pull/3225) - Respect attributions passed to TileJSON source. ([@tschaub](https://github.com/tschaub))
* [#3223](https://github.com/openlayers/ol3/pull/3223) - Resize the canvas when the tile size changes. ([@tschaub](https://github.com/tschaub))
* [#3224](https://github.com/openlayers/ol3/pull/3224) - Provide the ability to get the layer name from a MapQuest source ([@bartvde](https://github.com/bartvde))
* [#3222](https://github.com/openlayers/ol3/pull/3222) - Add geodesic option for measure ([@bartvde](https://github.com/bartvde))
* [#3221](https://github.com/openlayers/ol3/pull/3221) - Select the uppermost feature ([@fredj](https://github.com/fredj))
* [#3211](https://github.com/openlayers/ol3/pull/3211) - Bing https logo fix. ([@photostu](https://github.com/photostu))
* [#3215](https://github.com/openlayers/ol3/pull/3215) - Allow reuse of layer rendering code without creating a map. ([@tschaub](https://github.com/tschaub))

43
changelog/v3.4.0.md Normal file
View File

@@ -0,0 +1,43 @@
## Overview of all changes
* [#3383](https://github.com/openlayers/ol3/pull/3383) - GML3 tests time out in unit tests ([@bartvde](https://github.com/bartvde))
* [#3401](https://github.com/openlayers/ol3/pull/3401) - Allow GeoJSON to be serialized according to the right-hand rule. ([@tschaub](https://github.com/tschaub))
* [#3403](https://github.com/openlayers/ol3/pull/3403) - Remove unused goog.require ([@fredj](https://github.com/fredj))
* [#3362](https://github.com/openlayers/ol3/pull/3362) - Configure proj4 options and transforms upon construction ([@ahocevar](https://github.com/ahocevar))
* [#3394](https://github.com/openlayers/ol3/pull/3394) - Fix fullscreen pseudo CSS class name ([@fredj](https://github.com/fredj))
* [#3399](https://github.com/openlayers/ol3/pull/3399) - Clarify when widths need to be configured on a tile grid ([@ahocevar](https://github.com/ahocevar))
* [#3398](https://github.com/openlayers/ol3/pull/3398) - Make sure that the return value of wrapX() is stable ([@ahocevar](https://github.com/ahocevar))
* [#3396](https://github.com/openlayers/ol3/pull/3396) - Move the compare function out of ol.interaction.Modify.handleDownEvent_ ([@fredj](https://github.com/fredj))
* [#3395](https://github.com/openlayers/ol3/pull/3395) - ol.Interaction.Modify fixes ([@fperucic](https://github.com/fperucic))
* [#3387](https://github.com/openlayers/ol3/pull/3387) - Add wrapX option for ol.source.WMTS ([@ahocevar](https://github.com/ahocevar))
* [#3393](https://github.com/openlayers/ol3/pull/3393) - Remove unused define ([@fredj](https://github.com/fredj))
* [#3392](https://github.com/openlayers/ol3/pull/3392) - Fix switching class name of full-screen control ([@tsauerwein](https://github.com/tsauerwein))
* [#3391](https://github.com/openlayers/ol3/pull/3391) - Minor code cleanup ([@fredj](https://github.com/fredj))
* [#3388](https://github.com/openlayers/ol3/pull/3388) - Add new geometry layout option for polyline format ([@fredj](https://github.com/fredj))
* [#3385](https://github.com/openlayers/ol3/pull/3385) - Fix ol.tilegrid.TileGrid#getZForResolution ([@elemoine](https://github.com/elemoine))
* [#3377](https://github.com/openlayers/ol3/pull/3377) - Support wrapX for attributions ([@ahocevar](https://github.com/ahocevar))
* [#3382](https://github.com/openlayers/ol3/pull/3382) - Create github source links ([@ahocevar](https://github.com/ahocevar))
* [#3376](https://github.com/openlayers/ol3/pull/3376) - Add ol.source.Tile support for wrapping around the x-axis ([@ahocevar](https://github.com/ahocevar))
* [#3378](https://github.com/openlayers/ol3/pull/3378) - Clarify where to ask questions ([@ahocevar](https://github.com/ahocevar))
* [#3380](https://github.com/openlayers/ol3/pull/3380) - Test the GeoJSON layout ([@fredj](https://github.com/fredj))
* [#3360](https://github.com/openlayers/ol3/pull/3360) - Don't unlisten image twice when disposing an ol.ImageTile ([@fredj](https://github.com/fredj))
* [#3361](https://github.com/openlayers/ol3/pull/3361) - Listen on localhost to avoid phantomjs browsing 0.0.0.0 ([@ahocevar](https://github.com/ahocevar))
* [#3365](https://github.com/openlayers/ol3/pull/3365) - Better docs for #getPointResolution ([@ahocevar](https://github.com/ahocevar))
* [#3363](https://github.com/openlayers/ol3/pull/3363) - New ol.proj features ([@bill-chadwick](https://github.com/bill-chadwick))
* [#3305](https://github.com/openlayers/ol3/pull/3305) - Add image loading events to image sources (r=@ahocevar,@elemoine) ([@bartvde](https://github.com/bartvde))
* [#3343](https://github.com/openlayers/ol3/pull/3343) - Line arrows example ([@fredj](https://github.com/fredj))
* [#3354](https://github.com/openlayers/ol3/pull/3354) - Mark ol.format.GeoJSON#writeFeature(s) option param optional ([@fredj](https://github.com/fredj))
* [#3346](https://github.com/openlayers/ol3/pull/3346) - Set the 'properties' member to null if the feature has not properties ([@fredj](https://github.com/fredj))
* [#3344](https://github.com/openlayers/ol3/pull/3344) - Minor code cleanup ([@fredj](https://github.com/fredj))
* [#3237](https://github.com/openlayers/ol3/pull/3237) - Add circles to Draw interaction. ([@Morgul](https://github.com/Morgul))
* [#2691](https://github.com/openlayers/ol3/pull/2691) - Add will-change CSS properties ([@fredj](https://github.com/fredj))
* [#3336](https://github.com/openlayers/ol3/pull/3336) - Use ol.Map#getTargetElement function ([@fredj](https://github.com/fredj))
* [#3335](https://github.com/openlayers/ol3/pull/3335) - Update rbush to version 1.3.5 ([@fredj](https://github.com/fredj))
* [#3322](https://github.com/openlayers/ol3/pull/3322) - Remove unneeded map.isDef call ([@fredj](https://github.com/fredj))
* [#3327](https://github.com/openlayers/ol3/pull/3327) - Add css to dist directory ([@ahocevar](https://github.com/ahocevar))
* [#3324](https://github.com/openlayers/ol3/pull/3324) - Add interface definition for ol.SelectEvent ([@ahocevar](https://github.com/ahocevar))
* [#3315](https://github.com/openlayers/ol3/pull/3315) - Fix Tissot indicatrix example description ([@fredj](https://github.com/fredj))
* [#3312](https://github.com/openlayers/ol3/pull/3312) - Fix HiDPI support for ArcGIS REST ([@ahocevar](https://github.com/ahocevar))
* [#2910](https://github.com/openlayers/ol3/pull/2910) - Support multiple featureTpes in GML parser ([@bartvde](https://github.com/bartvde))
* [#3309](https://github.com/openlayers/ol3/pull/3309) - Fix select event always reporting as multi select ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3307](https://github.com/openlayers/ol3/pull/3307) - Handle all non-degree units in ol.control.ScaleLine ([@ahocevar](https://github.com/ahocevar))

289
changelog/v3.5.0.md Normal file
View File

@@ -0,0 +1,289 @@
# v3.5.0
## Summary
The 3.5.0 release includes features and fixes from a whopping 129 pull requests since 3.4.0. This release removes a number of "experimental" features from the API, so take a close look at the notes below when upgrading.
## Upgrade notes
### `ol.Object` and `bindTo`
* The following experimental methods have been removed from `ol.Object`: `bindTo`, `unbind`, and `unbindAll`. If you want to get notification about `ol.Object` property changes, you can listen for the `'propertychange'` event (e.g. `object.on('propertychange', listener)`). Two-way binding can be set up at the application level using property change listeners. See [#3472](https://github.com/openlayers/ol3/pull/3472) for details on the change.
* The experimental `ol.dom.Input` component has been removed. If you need to synchronize the state of a dom Input element with an `ol.Object`, this can be accomplished using listeners for change events. For example, you might bind the state of a checkbox type input with a layer's visibility like this:
```js
var layer = new ol.layer.Tile();
var checkbox = document.querySelector('#checkbox');
checkbox.addEventListener('change', function() {
var checked = this.checked;
if (checked !== layer.getVisible()) {
layer.setVisible(checked);
}
});
layer.on('change:visible', function() {
var visible = this.getVisible();
if (visible !== checkbox.checked) {
checkbox.checked = visible;
}
});
```
### New Vector API
* The following experimental vector classes have been removed: `ol.source.GeoJSON`, `ol.source.GML`, `ol.source.GPX`, `ol.source.IGC`, `ol.source.KML`, `ol.source.OSMXML`, and `ol.source.TopoJSON`. You now will use `ol.source.Vector` instead.
For example, if you used `ol.source.GeoJSON` as follows:
```js
var source = new ol.source.GeoJSON({
url: 'features.json',
projection: 'EPSG:3857'
});
```
you will need to change your code to:
```js
var source = new ol.source.Vector({
url: 'features.json',
format: new ol.format.GeoJSON()
});
```
See http://openlayers.org/en/master/examples/vector-layer.html for a real example.
Note that you no longer need to set a `projection` on the source!
Previously the vector data was loaded at source construction time, and, if the data projection and the source projection were not the same, the vector data was transformed to the source projection before being inserted (as features) into the source.
The vector data is now loaded at render time, when the view projection is known. And the vector data is transformed to the view projection if the data projection and the source projection are not the same.
If you still want to "eagerly" load the source you will use something like this:
```js
var source = new ol.source.Vector();
$.ajax('features.json').then(function(response) {
var geojsonFormat = new ol.format.GeoJSON();
var features = geojsonFormat.readFeatures(response,
{featureProjection: 'EPSG:3857'});
source.addFeatures(features);
});
```
The above code uses jQuery to send an Ajax request, but you can obviously use any Ajax library.
See http://openlayers.org/en/master/examples/igc.html for a real example.
* Note about KML
If you used `ol.source.KML`'s `extractStyles` or `defaultStyle` options, you will now have to set these options on `ol.format.KML` instead. For example, if you used:
```js
var source = new ol.source.KML({
url: 'features.kml',
extractStyles: false,
projection: 'EPSG:3857'
});
```
you will now use:
```js
var source = new ol.source.Vector({
url: 'features.kml',
format: new ol.format.KML({
extractStyles: false
})
});
```
* The `ol.source.ServerVector` class has been removed. If you used it, for example as follows:
```js
var source = new ol.source.ServerVector({
format: new ol.format.GeoJSON(),
loader: function(extent, resolution, projection) {
var url = …;
$.ajax(url).then(function(response) {
source.addFeatures(source.readFeatures(response));
});
},
strategy: ol.loadingstrategy.bbox,
projection: 'EPSG:3857'
});
```
you will need to change your code to:
```js
var source = new ol.source.Vector({
loader: function(extent, resolution, projection) {
var url = …;
$.ajax(url).then(function(response) {
var format = new ol.format.GeoJSON();
var features = format.readFeatures(response,
{featureProjection: projection});
source.addFeatures(features);
});
},
strategy: ol.loadingstrategy.bbox
});
```
See http://openlayers.org/en/master/examples/vector-osm.html for a real example.
* The experimental `ol.loadingstrategy.createTile` function has been renamed to `ol.loadingstrategy.tile`. The signature of the function hasn't changed. See http://openlayers.org/en/master/examples/vector-osm.html for an example.
### Change to `ol.style.Icon`
* When manually loading an image for `ol.style.Icon`, the image size should now be set
with the `imgSize` option and not with `size`. `size` is supposed to be used for the
size of a sub-rectangle in an image sprite.
### Support for non-square tiles
The return value of `ol.tilegrid.TileGrid#getTileSize()` will now be an `ol.Size` array instead of a number if non-square tiles (i.e. an `ol.Size` array instead of a number as `tilsSize`) are used. To always get an `ol.Size`, the new `ol.size.toSize()` was added.
### Change to `ol.interaction.Draw`
When finishing a draw, the `drawend` event is now dispatched before the feature is inserted to either the source or the collection. This change allows application code to finish setting up the feature.
### Misc.
If you compile your application together with the library and use the `ol.feature.FeatureStyleFunction` type annotation (this should be extremely rare), the type is now named `ol.FeatureStyleFunction`.
## New features and fixes
* [#3646](https://github.com/openlayers/ol3/pull/3646) - Use graceful-fs in place of fs ([@elemoine](https://github.com/elemoine))
* [#3645](https://github.com/openlayers/ol3/pull/3645) - Fix test-coverage.js script ([@elemoine](https://github.com/elemoine))
* [#3640](https://github.com/openlayers/ol3/pull/3640) - Make make fail on requires and whitespace errors ([@elemoine](https://github.com/elemoine))
* [#3644](https://github.com/openlayers/ol3/pull/3644) - added altclick select to selectfeatures example ([@t27](https://github.com/t27))
* [#3612](https://github.com/openlayers/ol3/pull/3612) - Add ol.source.WMTS#getUrls and getRequestEncoding ([@elemoine](https://github.com/elemoine))
* [#3616](https://github.com/openlayers/ol3/pull/3616) - Add support for freehand drawing to the Draw interaction ([@ahocevar](https://github.com/ahocevar))
* [#3634](https://github.com/openlayers/ol3/pull/3634) - Remove unused local variable ([@fredj](https://github.com/fredj))
* [#3629](https://github.com/openlayers/ol3/pull/3629) - Problems with XYZ coordinates in snap interaction ([@tsauerwein](https://github.com/tsauerwein))
* [#3633](https://github.com/openlayers/ol3/pull/3633) - Add a Makefile section to .editorconfig ([@elemoine](https://github.com/elemoine))
* [#3632](https://github.com/openlayers/ol3/pull/3632) - Make host-examples target copy index.js ([@elemoine](https://github.com/elemoine))
* [#3631](https://github.com/openlayers/ol3/pull/3631) - Restore Modify interaction constructor test ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3630](https://github.com/openlayers/ol3/pull/3630) - Initial tests for Modify interaction vertex creation ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3527](https://github.com/openlayers/ol3/pull/3527) - Replace pake with make? ([@elemoine](https://github.com/elemoine))
* [#3624](https://github.com/openlayers/ol3/pull/3624) - Add a one sentence summary for several exportable symbols ([@marcjansen](https://github.com/marcjansen))
* [#3623](https://github.com/openlayers/ol3/pull/3623) - ol3 overwrites WMS format_options instead of extending them. ([@bartvde](https://github.com/bartvde))
* [#3621](https://github.com/openlayers/ol3/pull/3621) - Fix typo in documentation comment ([@openlayers](https://github.com/openlayers))
* [#3614](https://github.com/openlayers/ol3/pull/3614) - GML2 parser does not parse all features ([@bartvde](https://github.com/bartvde))
* [#3619](https://github.com/openlayers/ol3/pull/3619) - Add a one sentence summary for ol.geom.* exportable symbols ([@marcjansen](https://github.com/marcjansen))
* [#3618](https://github.com/openlayers/ol3/pull/3618) - Replace non-breaking space (U+00A0) with regular space (U+0020). ([@tschaub](https://github.com/tschaub))
* [#3617](https://github.com/openlayers/ol3/pull/3617) - Add ol.size.hasArea. ([@tschaub](https://github.com/tschaub))
* [#3597](https://github.com/openlayers/ol3/pull/3597) - Remove dead link in api doc ([@fredj](https://github.com/fredj))
* [#3613](https://github.com/openlayers/ol3/pull/3613) - Add a one sentence summary for ol.interaction* exportable symbols ([@marcjansen](https://github.com/marcjansen))
* [#3611](https://github.com/openlayers/ol3/pull/3611) - Improve error handling in Esri JSON format ([@bartvde](https://github.com/bartvde))
* [#3560](https://github.com/openlayers/ol3/pull/3560) - Add an example showing how to create a permalink ([@tsauerwein](https://github.com/tsauerwein))
* [#3571](https://github.com/openlayers/ol3/pull/3571) - Add wrapX support for vector layers (canvas renderer only) ([@ahocevar](https://github.com/ahocevar))
* [#3605](https://github.com/openlayers/ol3/pull/3605) - vector-esri-edit.html uses non api method ([@bartvde](https://github.com/bartvde))
* [#3602](https://github.com/openlayers/ol3/pull/3602) - Rename ol.feature.FeatureStyleFunction to ol.FeatureStyleFunction. ([@tschaub](https://github.com/tschaub))
* [#3604](https://github.com/openlayers/ol3/pull/3604) - Add charset so that zoom out button shows correctly ([@bartvde](https://github.com/bartvde))
* [#3603](https://github.com/openlayers/ol3/pull/3603) - Reformat upgrade-notes.md ([@elemoine](https://github.com/elemoine))
* [#3599](https://github.com/openlayers/ol3/pull/3599) - Improve docs for source.Vector options ([@probins](https://github.com/probins))
* [#3598](https://github.com/openlayers/ol3/pull/3598) - Remove unnecessary entry in `.gitignore`. ([@tschaub](https://github.com/tschaub))
* [#3595](https://github.com/openlayers/ol3/pull/3595) - Add featureloader.jsdoc ([@probins](https://github.com/probins))
* [#3593](https://github.com/openlayers/ol3/pull/3593) - Add /examples/index.js to .gitignore ([@fredj](https://github.com/fredj))
* [#3592](https://github.com/openlayers/ol3/pull/3592) - Remove reference to binding in Collection docs ([@probins](https://github.com/probins))
* [#3591](https://github.com/openlayers/ol3/pull/3591) - Only draw the layer if visible and inside the resolution range ([@fredj](https://github.com/fredj))
* [#3528](https://github.com/openlayers/ol3/pull/3528) - Fix memory leak when removing layers from ol.layer.Group ([@fredj](https://github.com/fredj))
* [#3549](https://github.com/openlayers/ol3/pull/3549) - Move ol.*_DURATION const to a constructor option ([@fredj](https://github.com/fredj))
* [#3587](https://github.com/openlayers/ol3/pull/3587) - Handle left/right segment intersections for top/bottom spans. ([@tschaub](https://github.com/tschaub))
* [#3516](https://github.com/openlayers/ol3/pull/3516) - Remove ol.format.BinaryFeature. ([@tschaub](https://github.com/tschaub))
* [#3586](https://github.com/openlayers/ol3/pull/3586) - Simplify dragAndDropInteraction in examples. ([@probins](https://github.com/probins))
* [#3555](https://github.com/openlayers/ol3/pull/3555) - Esri JSON support ([@bartvde](https://github.com/bartvde))
* [#3583](https://github.com/openlayers/ol3/pull/3583) - Add a one sentence summary for ol.proj.* and ol.layer.* exportable symbols ([@marcjansen](https://github.com/marcjansen))
* [#3581](https://github.com/openlayers/ol3/pull/3581) - Always show links to related API documentation. ([@tschaub](https://github.com/tschaub))
* [#3582](https://github.com/openlayers/ol3/pull/3582) - Index what the examples require. ([@tschaub](https://github.com/tschaub))
* [#3580](https://github.com/openlayers/ol3/pull/3580) - Add a one sentence summary for ol.source.* exportable symbols ([@marcjansen](https://github.com/marcjansen))
* [#3551](https://github.com/openlayers/ol3/pull/3551) - Automatically add links to API-docs in examples ([@marcjansen](https://github.com/marcjansen))
* [#3575](https://github.com/openlayers/ol3/pull/3575) - Check proj equivalence by code. ([@nd0ut](https://github.com/nd0ut))
* [#3579](https://github.com/openlayers/ol3/pull/3579) - Use HTTPS were available. ([@tschaub](https://github.com/tschaub))
* [#3558](https://github.com/openlayers/ol3/pull/3558) - Example sources in examples dir and built examples in build/examples. ([@tschaub](https://github.com/tschaub))
* [#3550](https://github.com/openlayers/ol3/pull/3550) - Reduce differences between the rendering test runner and the standard test runner. ([@tschaub](https://github.com/tschaub))
* [#3576](https://github.com/openlayers/ol3/pull/3576) - Add KML options related note the upgrade notes ([@elemoine](https://github.com/elemoine))
* [#3573](https://github.com/openlayers/ol3/pull/3573) - Modify draw interaction dispatch order ([@gberaudo](https://github.com/gberaudo))
* [#3572](https://github.com/openlayers/ol3/pull/3572) - Do not return a null tileSize ([@ahocevar](https://github.com/ahocevar))
* [#3570](https://github.com/openlayers/ol3/pull/3570) - Add missing @api ([@gberaudo](https://github.com/gberaudo))
* [#3569](https://github.com/openlayers/ol3/pull/3569) - Fix link to Bootstrap documentation ([@fredj](https://github.com/fredj))
* [#3559](https://github.com/openlayers/ol3/pull/3559) - Add support for non-square tiles ([@ahocevar](https://github.com/ahocevar))
* [#3568](https://github.com/openlayers/ol3/pull/3568) - Move extractStyles option to ol.format.KML ([@fredj](https://github.com/fredj))
* [#3562](https://github.com/openlayers/ol3/pull/3562) - Simplify .ol-zoomslider and .ol-overviewmap CSS ([@fredj](https://github.com/fredj))
* [#3565](https://github.com/openlayers/ol3/pull/3565) - Move extractStyles option to ol.format.KML ([@fredj](https://github.com/fredj))
* [#3523](https://github.com/openlayers/ol3/pull/3523) - Update proj4 version to 2.3.6 ([@fredj](https://github.com/fredj))
* [#3556](https://github.com/openlayers/ol3/pull/3556) - Minor TileUTFGrid error fix ([@klokantech](https://github.com/klokantech))
* [#3557](https://github.com/openlayers/ol3/pull/3557) - Update FastClick externs to version 1.0.6 ([@fredj](https://github.com/fredj))
* [#3517](https://github.com/openlayers/ol3/pull/3517) - Add tests for previously untested classes ([@marcjansen](https://github.com/marcjansen))
* [#3548](https://github.com/openlayers/ol3/pull/3548) - Write the error stack instead of the error itself. ([@tschaub](https://github.com/tschaub))
* [#3542](https://github.com/openlayers/ol3/pull/3542) - Generate example index and rebuild examples on source changes. ([@tschaub](https://github.com/tschaub))
* [#3530](https://github.com/openlayers/ol3/pull/3530) - external resources not correctly in inline source of example ([@bartvde](https://github.com/bartvde))
* [#3448](https://github.com/openlayers/ol3/pull/3448) - Fix WebGL image layer rendering on retina displays ([@elemoine](https://github.com/elemoine))
* [#3544](https://github.com/openlayers/ol3/pull/3544) - Update comments about remaining GeoJSON work. ([@tschaub](https://github.com/tschaub))
* [#3531](https://github.com/openlayers/ol3/pull/3531) - Fix PointerEventHandler exception with Overlay containing SVG and IE9 ([@mantonovic](https://github.com/mantonovic))
* [#3521](https://github.com/openlayers/ol3/pull/3521) - Remove goog.isDefAndNotNull test on ol.layer.Group#getLayers result ([@fredj](https://github.com/fredj))
* [#3481](https://github.com/openlayers/ol3/pull/3481) - Proposal for a simpler vector API ([@elemoine](https://github.com/elemoine))
* [#3472](https://github.com/openlayers/ol3/pull/3472) - Remove the experimental bindTo method from ol.Object. ([@tschaub](https://github.com/tschaub))
* [#3505](https://github.com/openlayers/ol3/pull/3505) - Add a Create Custom Builds tutorial ([@elemoine](https://github.com/elemoine))
* [#3513](https://github.com/openlayers/ol3/pull/3513) - Remove layerGroup.setLayers(null) test ([@fredj](https://github.com/fredj))
* [#3511](https://github.com/openlayers/ol3/pull/3511) - Add goog.provide's ([@elemoine](https://github.com/elemoine))
* [#3509](https://github.com/openlayers/ol3/pull/3509) - Dispatch change event even when geometry is set to null ([@pgiraud](https://github.com/pgiraud))
* [#3510](https://github.com/openlayers/ol3/pull/3510) - Use sinon.spy to ensure change event is dispatched ([@pgiraud](https://github.com/pgiraud))
* [#3504](https://github.com/openlayers/ol3/pull/3504) - Rework build-examples.js task. ([@tschaub](https://github.com/tschaub))
* [#3470](https://github.com/openlayers/ol3/pull/3470) - Add rendering tests ([@tsauerwein](https://github.com/tsauerwein))
* [#3413](https://github.com/openlayers/ol3/pull/3413) - Add support for generic external modules with Browserify ([@tsauerwein](https://github.com/tsauerwein))
* [#3503](https://github.com/openlayers/ol3/pull/3503) - Use vector source instead of feature overlay in snap example. ([@tschaub](https://github.com/tschaub))
* [#3495](https://github.com/openlayers/ol3/pull/3495) - Initial basic project setup tutorial ([@bjornharrtell](https://github.com/bjornharrtell))
* [#3488](https://github.com/openlayers/ol3/pull/3488) - Add docs for exportable symbols. ([@tschaub](https://github.com/tschaub))
* [#3441](https://github.com/openlayers/ol3/pull/3441) - Add a "Compile Application and OpenLayers 3 Together" tutorial ([@elemoine](https://github.com/elemoine))
* [#3499](https://github.com/openlayers/ol3/pull/3499) - Update to closure-util 1.4.0 ([@elemoine](https://github.com/elemoine))
* [#3494](https://github.com/openlayers/ol3/pull/3494) - Mark VectorContext @api ([@gberaudo](https://github.com/gberaudo))
* [#3409](https://github.com/openlayers/ol3/pull/3409) - AssertionError in WMTS.optionsFromCapabilities. ([@bartvde](https://github.com/bartvde))
* [#3493](https://github.com/openlayers/ol3/pull/3493) - Add image loading events to ol.source.ImageStatic ([@tsauerwein](https://github.com/tsauerwein))
* [#3490](https://github.com/openlayers/ol3/pull/3490) - Add .editorconfig and instructions on its use. ([@tschaub](https://github.com/tschaub))
* [#3489](https://github.com/openlayers/ol3/pull/3489) - Use an abstract base class instead of IVectorContext. ([@gberaudo](https://github.com/gberaudo))
* [#3483](https://github.com/openlayers/ol3/pull/3483) - Clarify view.setRotation docs ([@tsauerwein](https://github.com/tsauerwein))
* [#3485](https://github.com/openlayers/ol3/pull/3485) - build.py graceful interrupt ([@malaretv](https://github.com/malaretv))
* [#3484](https://github.com/openlayers/ol3/pull/3484) - Make sure we copy the example css if it exists ([@bartvde](https://github.com/bartvde))
* [#3462](https://github.com/openlayers/ol3/pull/3462) - Remove ol.format.GMLBase from the API ([@ahocevar](https://github.com/ahocevar))
* [#3445](https://github.com/openlayers/ol3/pull/3445) - Start a FAQ document. ([@marcjansen](https://github.com/marcjansen))
* [#3468](https://github.com/openlayers/ol3/pull/3468) - Use the coveralls executable. ([@marcjansen](https://github.com/marcjansen))
* [#3415](https://github.com/openlayers/ol3/pull/3415) - Stable Only unchecked by default. ([@malaretv](https://github.com/malaretv))
* [#3420](https://github.com/openlayers/ol3/pull/3420) - Unregister viewport size listener on setTarget(null) ([@elemoine](https://github.com/elemoine))
* [#3456](https://github.com/openlayers/ol3/pull/3456) - Updated menu on the JSDOC template (non-responsive) ([@klokan](https://github.com/klokan))
* [#3475](https://github.com/openlayers/ol3/pull/3475) - Template examples ([@openlayers](https://github.com/openlayers))
* [#3455](https://github.com/openlayers/ol3/pull/3455) - Fix pre-loaded icons images for WebGL ([@tsauerwein](https://github.com/tsauerwein))
* [#3473](https://github.com/openlayers/ol3/pull/3473) - Add more tests for ol.coordinate. ([@marcjansen](https://github.com/marcjansen))
* [#3464](https://github.com/openlayers/ol3/pull/3464) - Mark more of the API stable. ([@tschaub](https://github.com/tschaub))
* [#3469](https://github.com/openlayers/ol3/pull/3469) - Update README. ([@malaretv](https://github.com/malaretv))
* [#3467](https://github.com/openlayers/ol3/pull/3467) - Update the coveralls badge. ([@openlayers](https://github.com/openlayers))
* [#3466](https://github.com/openlayers/ol3/pull/3466) - Include coveralls code-coverage badge in README. ([@marcjansen](https://github.com/marcjansen))
* [#3457](https://github.com/openlayers/ol3/pull/3457) - Integrate istanbul for test coverage ([@marcjansen](https://github.com/marcjansen))
* [#3446](https://github.com/openlayers/ol3/pull/3446) - Add updateWhileInteracting to olx.layer.VectorOptions ([@elemoine](https://github.com/elemoine))
* [#3438](https://github.com/openlayers/ol3/pull/3438) - Parser documentation and XML readme ([@gberaudo](https://github.com/gberaudo))
* [#3449](https://github.com/openlayers/ol3/pull/3449) - Fix assertion message ([@gberaudo](https://github.com/gberaudo))
* [#3440](https://github.com/openlayers/ol3/pull/3440) - Add fromLonLat and toLonLat convenience functions ([@ahocevar](https://github.com/ahocevar))
* [#3423](https://github.com/openlayers/ol3/pull/3423) - Parse extrude and altitude mode ([@gberaudo](https://github.com/gberaudo))
* [#3431](https://github.com/openlayers/ol3/pull/3431) - Better typing ([@fredj](https://github.com/fredj))
* [#3436](https://github.com/openlayers/ol3/pull/3436) - Mention readme.md files as help for contributors ([@ahocevar](https://github.com/ahocevar))
* [#3433](https://github.com/openlayers/ol3/pull/3433) - Add missing goog.provide/goog.require ol.source.TileEvent ([@fredj](https://github.com/fredj))
* [#3422](https://github.com/openlayers/ol3/pull/3422) - Fix Select behavior when multi is false ([@elemoine](https://github.com/elemoine))
* [#3428](https://github.com/openlayers/ol3/pull/3428) - Reorder assertions and variable declarations. ([@marcjansen](https://github.com/marcjansen))
* [#3414](https://github.com/openlayers/ol3/pull/3414) - Add missing ol.style.AtlasManager goog.require ([@fredj](https://github.com/fredj))
* [#3429](https://github.com/openlayers/ol3/pull/3429) - Adding missing provide for SelectFilterFunction ([@pgiraud](https://github.com/pgiraud))
* [#3426](https://github.com/openlayers/ol3/pull/3426) - Add assertion messages for all assertion statements ([@bartvde](https://github.com/bartvde))
* [#3425](https://github.com/openlayers/ol3/pull/3425) - Fix typo in ol.js ([@elemoine](https://github.com/elemoine))
* [#3424](https://github.com/openlayers/ol3/pull/3424) - Remove `@api` annotation from `ol.WEBGL_MAX_TEXTURE_SIZE`. ([@tschaub](https://github.com/tschaub))
* [#3419](https://github.com/openlayers/ol3/pull/3419) - Remove describe.only ([@elemoine](https://github.com/elemoine))
* [#3417](https://github.com/openlayers/ol3/pull/3417) - ol.interaction.Snap extent fix ([@fperucic](https://github.com/fperucic))
* [#3410](https://github.com/openlayers/ol3/pull/3410) - Add ol.Object.unset() method ([@gberaudo](https://github.com/gberaudo))
* [#3402](https://github.com/openlayers/ol3/pull/3402) - Add "filter" option to Select interaction ([@elemoine](https://github.com/elemoine))
* [#3416](https://github.com/openlayers/ol3/pull/3416) - Remove unnecessary typecasts in examples ([@fredj](https://github.com/fredj))
* [#3411](https://github.com/openlayers/ol3/pull/3411) - Listen for a 'change:geometry' event ([@fperucic](https://github.com/fperucic))
* [#3109](https://github.com/openlayers/ol3/pull/3109) - Snap feature ([@fperucic](https://github.com/fperucic))
* [#3407](https://github.com/openlayers/ol3/pull/3407) - Add v3.4.0 empty section to upgrade notes ([@bartvde](https://github.com/bartvde))

View File

@@ -1,3 +1,3 @@
{
"library_url": "https://github.com/google/closure-library/archive/ad5e66c1e7d7829b0d77feae49aaf5f011265715.zip"
"library_url": "https://github.com/google/closure-library/archive/0011afd534469ba111786fe68300a634e08a4d80.zip"
}

79
config/example.json Normal file
View File

@@ -0,0 +1,79 @@
{
"exports": [],
"src": [
"src/**/*.js",
"build/ol.ext/*.js",
"build/examples/{{id}}.js"
],
"compile": {
"js": [
"externs/olx.js",
"externs/oli.js"
],
"externs": [
"externs/bingmaps.js",
"externs/bootstrap.js",
"externs/closure-compiler.js",
"externs/example.js",
"externs/fastclick.js",
"externs/geojson.js",
"externs/jquery-1.9.js",
"externs/proj4js.js",
"externs/tilejson.js",
"externs/topojson.js",
"externs/vbarray.js"
],
"define": [
"goog.array.ASSUME_NATIVE_FUNCTIONS=true",
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false"
],
"jscomp_error": [
"accessControls",
"ambiguousFunctionDecl",
"checkEventfulObjectDisposal",
"checkRegExp",
"checkStructDictInheritance",
"checkTypes",
"checkVars",
"const",
"constantProperty",
"deprecated",
"duplicateMessage",
"es3",
"es5Strict",
"externsValidation",
"fileoverviewTags",
"globalThis",
"internetExplorerChecks",
"invalidCasts",
"misplacedTypeAnnotation",
"missingGetCssName",
"missingProperties",
"missingProvide",
"missingRequire",
"missingReturn",
"newCheckTypes",
"nonStandardJsDocs",
"suspiciousCode",
"strictModuleDepCheck",
"typeInvalidation",
"undefinedNames",
"undefinedVars",
"uselessCode",
"visibility"
],
"jscomp_off": [
"unknownDefines"
],
"extra_annotation_name": [
"api", "observable"
],
"compilation_level": "ADVANCED",
"warning_level": "VERBOSE",
"output_wrapper": "(function(){%output%})();",
"use_types_for_optimization": true,
"manage_closure_dependencies": true
}
}

View File

@@ -3,7 +3,7 @@
"src": [
"src/**/*.js",
"build/ol.ext/*.js",
"build/examples/all.js"
"build/compiled-examples/all.js"
],
"compile": {
"js": [
@@ -14,14 +14,14 @@
"externs/bingmaps.js",
"externs/bootstrap.js",
"externs/closure-compiler.js",
"externs/esrijson.js",
"externs/example.js",
"externs/fastclick.js",
"externs/geojson.js",
"externs/jquery-1.9.js",
"externs/proj4js.js",
"externs/tilejson.js",
"externs/topojson.js",
"externs/vbarray.js"
"externs/topojson.js"
],
"define": [
"goog.array.ASSUME_NATIVE_FUNCTIONS=true",

View File

@@ -0,0 +1 @@
{{{ contents }}}

View File

@@ -0,0 +1,87 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" type="text/css">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
{{{ extraHead }}}
{{{ css.tag }}}
<link rel="stylesheet" href="./resources/prism/prism.css" type="text/css">
<script src="./resources/zeroclipboard/ZeroClipboard.min.js"></script>
<title>{{ title }}</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container" id="navbar-inner-container">
<a class="brand" href="./"><img src="./resources/logo-70x70.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
{{{ contents }}}
<div class="row-fluid">
<div class="span12">
<h4 id="title">{{ title }}</h4>
<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>
<div class="row-fluid">
<hr>
<form method="POST" target="_blank" action="http://jsfiddle.net/api/post/jquery/1.11.0/">
<input type="button" class="btn btn-info" id="copy-button" value="Copy example code">
<input type="submit" class="btn btn-primary" id="jsfiddle-button" value="Create JSFiddle">
<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,https://cdnjs.cloudflare.com/ajax/libs/ol3/{{ olVersion }}/ol.css,https://cdnjs.cloudflare.com/ajax/libs/ol3/{{ olVersion }}/ol.js">
<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.4/css/bootstrap.min.css"&gt;
&lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/{{ olVersion }}/ol.css" type="text/css"&gt;
&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/{{ olVersion }}/ol.js"&gt;&lt;/script&gt;
{{ extraHead }}
{{#if css.source}}
&lt;style&gt;
{{ css.source }}
&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;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
</div>
</div>
</div>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
<script src="./resources/common.js"></script>
<script src="./resources/prism/prism.min.js"></script>
{{{ js.tag }}}
</body>
</html>

21
config/examples/readme.md Normal file
View File

@@ -0,0 +1,21 @@
This folder contains example templates. These templates are used to build the examples in the `examples/` folder. The resulting examples are written to the `build/examples` folder.
Although the main purpose of these examples is to demonstrate how to use the API, they also serve other purposes in the development cycle, and so are not exactly as they would be in normal application code:
* every time the library changes, they are compiled together with the library as a basic check that they remain in sync with the library
* they use a special loader script to enable defining at run time which build mode (raw/debug/advanced) to use
To enable this, examples have the following, not needed in application code:
* each html file loads `loader.js`; application code would not need this, but would instead load the appropriate library build file, either a hosted version or a custom build
* each js file starts with `goog.require` functions, used by the compiler; application code would only have these if the code is to be compiled together with the library and/or Closure library
* some js files use type definitions (comments with @type tags); these are also used by the compiler, and are only needed if the code is to be compiled together with the library
* 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

@@ -34,7 +34,7 @@
"cleverLinks": true,
"monospaceLinks": true,
"default": {
"outputSourceFiles": true
"outputSourceFiles": false
},
"applicationName": "OpenLayers 3"
},

View File

@@ -29,11 +29,10 @@ Interactions for [vector features](ol.Feature.html)
<br>[Vector sources](ol.source.Vector.html) for [ol.layer.Vector](ol.layer.Vector.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>2-way bindings</th><th>Other components</th></tr>
<tr><th>Projections</th><th>Observable objects</th><th>Other components</th></tr>
<tr><td><p>All coordinates and extents need to be provided in view projection (default: EPSG:3857). To transform, use [ol.proj.transform()](ol.proj.html#transform) and [ol.proj.transformExtent()](ol.proj.html#transformExtent).</p>
[ol.proj](ol.proj.html)</td>
<td><p>[Objects](ol.Object.html) can be kept in sync using the [bindTo()](ol.Object.html#bindTo) method.</p>
<p>A [DOM Input](ol.dom.Input.html) class is available to bind Object properties to HTML Input elements.</p></td>
<td><p>Changes to all [ol.Objects](ol.Object.html) can observed by calling the [object.on('propertychange')](ol.Object.html#on) method. Listeners receive an [ol.ObjectEvent](ol.ObjectEvent.html) with information on the changed property and old value.</p>
<td>[ol.DeviceOrientation](ol.DeviceOrientation.html)<br>
[ol.Geolocation](ol.Geolocation.html)<br>
[ol.Overlay](ol.Overlay.html)<br>

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -53,13 +53,28 @@ $(function () {
$(window).on('resize', _onResize);
_onResize();
// create source code links to github
var srcLinks = $('div.tag-source');
var masterSearch = window.location.href.match(/\/([^\/]*\/)apidoc\//);
if (masterSearch && masterSearch.length) {
var branch = masterSearch[1];
srcLinks.each(function(i, el) {
var textParts = el.innerHTML.trim().split(', ');
var link = 'https://github.com/openlayers/ol3/blob/' + branch +
textParts[0];
el.innerHTML = '<a href="' + link + '">' + textParts[0] + '</a>, ' +
'<a href="' + link + textParts[1].replace('line ', '#l') + '">' +
textParts[1] + '</a>';
});
}
// show/hide unstable items
var links = $('a[href^="ol."]');
var unstable = $('.unstable');
var stabilityToggle = $('#stability-toggle');
stabilityToggle.change(function() {
unstable.toggleClass('hidden', this.checked);
var search = this.checked ? '' : '?unstable=true';
var search = this.checked ? '?stableonly=true' : '';
links.each(function(i, el) {
this.href = this.pathname + search + this.hash;
});
@@ -73,6 +88,6 @@ $(function () {
links.each(function(i, el) {
this.href = this.pathname + search + this.hash;
});
stabilityToggle.prop('checked', search !== '?unstable=true');
stabilityToggle.prop('checked', search === '?stableonly=true');
unstable.toggleClass('hidden', stabilityToggle[0].checked);
});

File diff suppressed because one or more lines are too long

View File

@@ -1,15 +1,47 @@
@import url(http://fonts.googleapis.com/css?family=Quattrocento+Sans:400,400italic,700);
.navbar-inverse {
border: 0;
}
.navbar-inverse .navbar-inner {
background: #1F6B75;
height: 50px;
text-shadow: 1px 1px 2px rgba(0,0,0,0.25);
}
.navbar-inverse .brand {
color: white;
font-size: 20px;
color: #fff;
font-size: 160%;
font-weight: bold;
position: absolute;
top: 6px;
left: 16px;
}
.navbar-inverse .brand:hover,
.navbar-inverse .brand:focus {
color: #aae1e9;
text-decoration: none;
}
.navbar-inverse .brand img {
width: 35px;
height: 35px;
vertical-align: middle;
margin-right: 5px;
border:0;
}
.navbar-inverse .container {
padding: 5px 0 5px 0;
padding: 0;
}
.navbar-inverse .navbar-nav>li>a {
color: #fff;
}
.navbar-inverse .navbar-nav>li>a:hover,
.navbar-inverse .navbar-nav>li>a:focus,
.navbar-inverse .navbar-nav>li>a.active
{
outline:0;
color: #fff;
background-color: #268591;
}
body {
padding-top: 50px;
}
@@ -20,6 +52,8 @@ body {
a {
position: relative;
z-index: 1;
-webkit-transition: all .2s;
transition: all .2s;
}
.navigation li {
color: #888;
@@ -379,5 +413,6 @@ footer {
color: white;
position: absolute;
top: 1em;
right: 8em;
left: 250px;
font-weight: normal;
}

View File

@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>OpenLayers 3 API Documentation - <?js= title ?></title>
<title>OpenLayers 3 API Reference - <?js= title ?></title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<script src="scripts/jquery.min.js"> </script>
@@ -18,11 +18,16 @@
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="/"><img src="../resources/logo.png" width="40"> OpenLayers 3</a>
<a class="brand" href="index.html">API Documentation</a>
<a class="brand" href="/"><img src="logo-70x70.png"> OpenLayers 3</a>
<label id="stability">
<input type="checkbox" id="stability-toggle" checked> Stable Only
<input type="checkbox" id="stability-toggle"> Stable Only
</label>
<ul class="nav navbar-nav pull-right">
<li><a href="../doc">Docs</a></li>
<li><a href="../examples">Examples</a></li>
<li><a href="index.html" class="active">API</a></li>
<li><a href="https://github.com/openlayers/ol3">Code</a></li>
</ul>
</div>
</div>
</div>
@@ -42,4 +47,4 @@
<script src="scripts/linenumber.js"></script>
<script src="scripts/main.js"></script>
</body>
</html>
</html>

View File

@@ -5,13 +5,13 @@
"externs": [
"externs/bingmaps.js",
"externs/closure-compiler.js",
"externs/esrijson.js",
"externs/geojson.js",
"externs/oli.js",
"externs/olx.js",
"externs/proj4js.js",
"externs/tilejson.js",
"externs/topojson.js",
"externs/vbarray.js"
"externs/topojson.js"
],
"define": [
"goog.array.ASSUME_NATIVE_FUNCTIONS=true",
@@ -61,6 +61,8 @@
"compilation_level": "ADVANCED",
"warning_level": "VERBOSE",
"use_types_for_optimization": true,
"manage_closure_dependencies": true
"manage_closure_dependencies": true,
"create_source_map": "build/ol.js.map",
"source_map_format": "V3"
}
}

View File

@@ -21,8 +21,12 @@
font-size: 10px;
text-align: center;
margin: 1px;
padding: 0px 2px;
will-change: contents, width;
}
.ol-overlay-container {
will-change: left,right,top,bottom;
}
.ol-unsupported {
display: none;
}
@@ -53,11 +57,12 @@
.ol-rotate {
top: .5em;
right: .5em;
transition: opacity .25s;
transition: opacity .25s linear, visibility 0s linear;
}
.ol-rotate.ol-hidden {
opacity: 0;
display: none;
visibility: hidden;
transition: opacity .25s linear, visibility 0s linear .25s;
}
.ol-zoom-extent {
top: 4.643em;
@@ -101,6 +106,7 @@
display: block;
font-weight: normal;
font-size: 1.2em;
will-change: transform;
}
.ol-touch .ol-control button {
font-size: 1.5em;
@@ -114,21 +120,12 @@
background-color: #4c6079;
background-color: rgba(0,60,136,0.7);
}
.ol-zoom-extent button:after {
content: "E";
}
.ol-zoom .ol-zoom-in {
border-radius: 2px 2px 0 0;
}
.ol-zoom .ol-zoom-out {
border-radius: 0 0 2px 2px;
}
button.ol-full-screen-false:after {
content: "\2194";
}
button.ol-full-screen-true:after {
content: "\00d7";
}
.ol-attribution {
@@ -193,11 +190,8 @@ button.ol-full-screen-true:after {
}
.ol-zoomslider {
position: absolute;
top: 4.5em;
left: .5em;
background: #eee;
background: rgba(255, 255, 255, 0.4);
width: 24px;
height: 200px;
}
@@ -221,7 +215,6 @@ button.ol-full-screen-true:after {
}
.ol-overviewmap {
position: absolute;
left: 0.5em;
bottom: 0.5em;
}

334
doc/faq.md Normal file
View File

@@ -0,0 +1,334 @@
---
title: Frequently Asked Questions (FAQ)
layout: doc.hbs
---
# Frequently Asked Questions (FAQ)
Certain questions arise more often than others when users ask for help. This
document tries to list some of the common questions that frequently get asked,
e.g. on [Stack Overflow](http://stackoverflow.com/questions/tagged/openlayers-3).
If you think a question (and naturally its answer) should be added here, feel
free to ping us or to send a pull request enhancing this document.
Table of contents:
* [What projection is OpenLayers using?](#what-projection-is-openlayers-using)
* [How do I change the projection of my map?](#how-do-i-change-the-projection-of-my-map)
* [Why is my map centered on the gulf of guinea (or africa, the ocean, null-island)?](#why-is-my-map-centered-on-the-gulf-of-guinea-or-africa-the-ocean-null-island)
* [Why is the order of a coordinate [lon,lat], and not [lat,lon]?](#why-is-the-order-of-a-coordinate-lonlat-and-not-latlon)
* [Why aren't there any features in my source?](#why-arent-there-any-features-in-my-source)
* [How do I force a re-render of the map?](#how-do-i-force-a-re-render-of-the-map)
* [How do I create a custom build of OpenLayers?](#how-do-i-create-a-custom-build-of-openlayers)
* [Do I need to write my own code using Closure library?](#do-i-need-to-write-my-own-code-using-closure-library)
* [Do I need to compress my code with Closure compiler?](#do-i-need-to-compress-my-code-with-closure-compiler)
## What projection is OpenLayers using?
Every map that you'll create with OpenLayers will have a view, and every view
will have a projection. As the earth is three-dimensional and round but the 2D
view of a map isn't, we need a mathematical expression to represent it. Enter
projections.
There isn't only one projection, but there are many common ones. Each projection
has different properties, in that it accurately represents distances, angles or
areas. Certain projections are better suited for different regions in the world.
Back to the original question: OpenLayers is capable of dealing with most
projections. If you do not explicitly set one, your map is going to use our
default which is the Web Mercator projection (EPSG:3857). The same projection is
used e.g. for the maps of the OpenStreetMap-project and commercial products such
as Bing Maps or Google Maps.
This projection is a good choice if you want a map which shows the whole world,
and you may need to have this projection if you want to e.g. use the
OpenStreetMap or Bing tiles.
## How do I change the projection of my map?
There is a good chance that you want to change the default projection of
OpenLayers to something more appropriate for your region or your specific data.
The projection of your map can be set through the `view`-property. Here are some
examples:
```javascript
// OpenLayers comes with support for the World Geodetic System 1984, EPSG:4326:
var map = new ol.Map({
view: new ol.View({
projection: 'EPSG:4326'
// other view properties like map center etc.
})
// other properties for your map like layers etc.
});
```
```javascript
// To use other projections, you have to register the projection in OpenLayers:
//
// By default OpenLayers does not know about the EPSG:21781 (Swiss) projection.
// So we create a projection instance for EPSG:21781 and pass it to
// ol.proj.addProjection to make it available to the library for lookup by its
// code.
var swissProjection = new ol.proj.Projection({
code: 'EPSG:21781',
// The extent is used to determine zoom level 0. Recommended values for a
// projection's validity extent can be found at http://epsg.io/.
extent: [485869.5728, 76443.1884, 837076.5648, 299941.7864],
units: 'm'
});
ol.proj.addProjection(swissProjection);
// we can now use the projection:
var map = new ol.Map({
view: new ol.View({
projection: swissProjection
// other view properties like map center etc.
})
// other properties for your map like layers etc.
});
```
We recommend to lookup parameters of your projection (like the validity extent)
over at [epsg.io](http://epsg.io/).
## Why is my map centered on the gulf of guinea (or africa, the ocean, null-island)?
If you have set a center in your map view, but don't see a real change in visual
output, chances are that you have provided the coordinates of the map center in
the wrong (a non-matching) projection.
As the default projection in OpenLayers is Web Mercator (see above), the
coordinates for the center have to be provided in that projection. Chances are
that your map looks like this:
```javascript
var washingtonLonLat = [-77.036667, 38.895];
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
target: 'map',
view: new ol.View({
center: washingtonLonLat,
zoom: 12
})
});
```
Here `[-77.036667, 38.895]` is provided as the center of the view. But as Web
Mercator is a metric projection, you are currently telling OpenLayers that the
center shall be some meters (~77m and ~39m respectively) away from `[0, 0]`. In
the Web Mercator projection the coordinate is right in the gulf of guinea.
The solution is easy: Provide the coordinates projected into Web Mercator.
OpenLayers has some helpful utility methods to assist you:
```javascript
var washingtonLonLat = [-77.036667, 38.895];
var washingtonWebMercator = ol.proj.fromLonLat(washingtonLonLat);
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
target: 'map',
view: new ol.View({
center: washingtonWebMercator,
zoom: 8
})
});
```
The method `ol.proj.fromLonLat()` is available from version 3.5 onwards.
If you told OpenLayers about a custom projection (see above), you can use the
following method to transform a coordinate from WGS84 to your projection:
```javascript
// assuming that OpenLayers knows about EPSG:21781, see above
var swissCoord = ol.proj.transform([8.23, 46.86], 'EPSG:4326', 'EPSG:21781');
```
## Why is the order of a coordinate [lon,lat], and not [lat,lon]?
So you want to center your map on a certain place on the earth and obviously you
need to have its coordinates for this. Let's assume you want your map centered
on Schladming, a beautiful place in Austria. Head over to the wikipedia
page for [Schladming](http://en.wikipedia.org/wiki/Schladming). In the top-right
corner there is a link to [GeoHack](http://tools.wmflabs.org/geohack/geohack.php?pagename=Schladming&params=47_23_39_N_13_41_21_E_type:city(4565)_region:AT-6),
which effectively tells you the coordinates are:
WGS84:
47° 23 39″ N, 13° 41 21″ E
47.394167, 13.689167
So the next step would be to put the decimal coordinates into an array and use
it as center:
```javascript
var schladming = [47.394167, 13.689167]; // caution partner, read on...
// since we are using OSM, we have to transform the coordinates...
var schladmingWebMercator = ol.proj.fromLonLat(schladming);
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
target: 'map',
view: new ol.View({
center: schladmingWebMercator,
zoom: 9
})
});
```
Running the above example will possibly surprise you, since we are not centered
on Schladming, Austria, but instead on Abyan, a region in Yemen (possibly also a
nice place). So what happened?
Many people mix up the order of longitude and latitude in a coordinate array.
Don't worry if you get it wrong at first, many OpenLayers developers have to
think twice about whether to put the longitude or the latitude first when they
e.g. try to change the map center.
Ok, then let's flip the coordinates:
```javascript
var schladming = [13.689167, 47.394167]; // longitude first, then latitude
// since we are using OSM, we have to transform the coordinates...
var schladmingWebMercator = ol.proj.fromLonLat(schladming);
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
target: 'map',
view: new ol.View({
center: schladmingWebMercator,
zoom: 9
})
});
```
Schladming is now correctly displayed in the center of the map.
So when you deal with EPSG:4326 coordinates in OpenLayers, put the longitude
first, and then the latitude. This behaviour is the same as we had in OpenLayers
2, and it actually makes sense because of the natural axis order in WGS84.
If you cannot remember the correct order, just have a look at the method name
we used: `ol.proj.fromLonLat`; even there we hint that we expect longitude
first, and then latitude.
## Why aren't there any features in my source?
Suppose you want to load a KML file and display the contained features on the
map. Code like the following could be used:
```javascript
var vector = new ol.layer.Vector({
source: new ol.source.KML({
projection: 'EPSG:3857',
url: 'data/kml/2012-02-10.kml'
})
});
```
You may ask yourself how many features are in that KML, and try something like
the following:
```javascript
var vector = new ol.layer.Vector({
source: new ol.source.KML({
projection: 'EPSG:3857',
url: 'data/kml/2012-02-10.kml'
})
});
var numFeatures = vector.getSource().getFeatures().length;
console.log("Count right after construction: " + numFeatures);
```
This will log a count of `0` features to be in the source. This is because the
loading of the KML-file will happen in an asynchronous manner. To get the count
as soon as possible (right after the file has been fetched and the source has
been populated with features), you should use an event listener function on the
`source`:
```javascript
vector.getSource().on('change', function(evt){
var source = evt.target;
if (source.getState() === 'ready') {
var numFeatures = source.getFeatures().length;
console.log("Count after change: " + numFeatures);
}
});
```
This will correctly report the number of features, `1119` in that particular
case.
## How do I force a re-render of the map?
Usually the map is automatically re-rendered, once a source changes (for example
when a remote source has loaded).
If you actually want to manually trigger a rendering, you could use
```javascript
map.render();
```
...or its companion method
```javascript
map.renderSync();
```
## How do I create a custom build of OpenLayers?
Please refer to [this blog post](http://boundlessgeo.com/2014/10/openlayers-custom-builds-revisited/)
which explains how to create a custom build of OpenLayers with just those parts
included that you want.
## Do I need to write my own code using Closure library?
OpenLayers is built on top of the [Google Closure JavaScript
library](https://developers.google.com/closure/library/), but this
does not mean that you must use that library in your application code.
OpenLayers should play well with all sorts of JavaScript libraries out there,
and you are in no way forced to use a specific one. Choose one that looks
right for you.
## Do I need to compress my code with Closure compiler?
No, you don't need to do compress your code with the [Google Closure
compiler](https://developers.google.com/closure/compiler/).
It may be a good choice though, because when your application code and the
OpenLayers source code is compiled together using closure compiler, the
resulting build will most probably be the smallest in terms of byte-size. For
more details refer to [this tutorial](compile-application.md).
If you don't want to use the closure compiler, or you can't, you are not at all
forced to use it.

View File

@@ -12,3 +12,7 @@ For a more in-depth overview of OpenLayers 3 core concepts, check out the [tutor
Make sure to also check out the [OpenLayers 3 workshop](../../../ol3-workshop/).
Find additional reference material in the [API docs](../apidoc).
# Questions
If you cannot find an answer in the documentation, you can ask your question on [stackoverflow using the tag 'openlayers-3'](http://stackoverflow.com/questions/tagged/openlayers-3).

View File

@@ -0,0 +1,89 @@
---
title: Basic project setup using NPM and Browserify
layout: doc.hbs
---
# Introduction
When going beyond modifying existing examples you might be looking for a
way to setup your own code with dependency management together with external
dependencies like OpenLayers 3.
This tutorial serves as a suggested project setup using NPM and Browserify
for the most basic needs. There are several other options and in particular
you might be interested in
[compiling your own code together with OpenLayers 3](closure.html).
## Initial steps
Create a new empty directory for your project and navigate to it by running
`mkdir new-project && cd new-project`. Initialize your project using `npm init`
and answer the questions asked.
At this point you can ask NPM to add required dependencies by running
`npm install --save-dev openlayers browserify watchify uglify-js`. Watchify and
Uglify will be used to monitor for changes and to build into a minified
bundle.
## Application code and index.html
Place your application code in `index.js`. Here is a simple starting point:
```js
var ol = require('openlayers');
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
view: new ol.View({
center: [0, 0],
zoom: 0
})
});
```
You will also need an `ìndex.html` file that will use your bundle. Here is a simple
example:
```html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Using Browserify with OpenLayers</title>
<link rel="stylesheet" href="node_modules/openlayers/dist/ol.css" type="text/css">
<style>
#map {
width: 400px;
height: 250px;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="bundle.js"></script>
</body>
</html>
```
## Creating a bundle
With simple scripts you can introduce the commands `npm run build` and `npm start` to
manually build your bundle and watch for changes, respectively. Add the following
to the script section in `package.json`:
```json
"scripts": {
"start": "watchify index.js --outfile bundle.js",
"build": "browserify index.js | uglifyjs --compress --output bundle.js"
}
```
Note that `bundle.js` will contain your application code and all dependencies
used in your application, in this case the official full build of OpenLayers 3.
If you only need parts of OpenLayers 3 you can create
[custom builds](../../builder).

337
doc/tutorials/closure.md Normal file
View File

@@ -0,0 +1,337 @@
---
title: Compiling Application with Closure Compiler
layout: doc.hbs
---
# Compiling Application with Closure Compiler
The OpenLayers 3 code uses the Closure Library, and it is compiled with the
Closure Compiler. Using OpenLayers 3 in an application does not require using
Closure. But using Closure in an OpenLayers 3 application is possible. And this
is what this tutorial is about.
This tutorial will teach you how to set up an OpenLayers 3 application based on
the [`closure-util`](https://github.com/openlayers/closure-util) node package,
which provides utilities for working with Closure. Using `closure-util` is one
way to use Closure in a web application, but there are others. This tutorial
just covers the "`closure-util`" way.
The `closure-util` documentation is available on the [`closure-util` readme
page](https://github.com/openlayers/closure-util/blob/master/readme.md). You
don't need to read the `closure-util` documentation to follow this tutorial,
but it's available in `closure-util`'s [readme
file](https://github.com/openlayers/closure-util/blob/master/readme.md) if you
need it.
Also, the sample application built in this tutorial is
[available](https://github.com/openlayers/openlayers-closure-application) on
GitHub.
## Advantages of using Closure
This tutorial will show you how to use the Closure Compiler to compile an
application and OpenLayers 3 together. Compiling the application code together
with the OpenLayers 3 code has a number of advantages.
First of all, it allows you to only "pay" for the OpenLayers 3 code your
application uses, as the compiler will exclude the OpenLayers 3 code that the
application doesn't use. And there is no need to write and maintain a list of
"exports", which is necessary when creating custom builds of OpenLayers 3.
Also, compiling the application and OpenLayers 3 together allows using
OpenLayers 3 functions and objects that are not part of the official OpenLayers
3 API. Using non-API functions and objects may be risky, but it is mitigated by
the fact that the compiler will complain if you use functions or objects
that are not in OpenLayers 3 anymore.
## Setting up the Application
First, create a directory for the application. We will name that directory
`openlayers-closure-application` in this tutorial.
$ mkdir openlayers-closure-application
Now change to that directory:
$ cd openlayers-closure-application
Our application will be a `node` application, and the `openlayers` and
`closure-util` node packages will be downloaded from the node package registry
using the `npm` command line tool.
So we're going to create a `package.json` file for the application, which every
node application includes. This file basically includes metadata for the
application.
Create the application's `package.json` file:
$ npm init
You can pretty much use the default answers to the questions `npm init` asks
you.
Now install OpenLayers 3 using:
$ npm install openlayers --save
The `--save` flag persists the `openlayers` dependency in the application's
`package.json` file. You can edit `package.json` to verify that the dependency
was added.
`closure-util` is a dependency of the `openlayers` package, so it should have
been installed with `openlayers`. Use the following to verify that
`closure-util` is installed:
$ ./node_modules/openlayers/node_modules/.bin/closure-util
command argument is required
Usage: node closure-util <command> [options]
command
update-compiler Update the Compiler
update-library Update the Library
update Update both the Library and the Compiler
build Build with Closure Compiler
serve Start the development server
Options:
-l LEVEL, --loglevel LEVEL Log level [info]
## Create an OpenLayers 3 map
You're now going to create a JavaScript file that creates an OpenLayers 3 map.
This is the file that we will define the application's entry point.
First of all create an `src` directory at the root of the application:
$ mkdir src
Now add a file `main.js` to `src`, with the following content:
```js
goog.provide('app');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
/**
* @type {ol.Map}
*/
app.map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
view: new ol.View({
center: [0, 0],
zoom: 4
})
});
```
`goog.provide('app')` creates the namespace `app` for the application. The
`goog.require` statements that follow define the OpenLayers constructors and
namespaces that the application uses. The rest of the code just creates the
OpenLayers map as you would do in any OpenLayers application.
## Compiling the Application
We're now going to compile the application and OpenLayers 3 together, using the
Closure Compiler and `closure-util`. For this we need to create a JSON config
file, that we will then pass as an input file to the `closure-util` command.
The minimum config file looks like this:
```json
{
"lib": [
"node_modules/openlayers/src/**/*.js",
"node_modules/openlayers/build/ol.ext/**/*.js",
"src/**/*.js"
],
"compile": {
"closure_entry_point": "app",
"externs": [
"node_modules/openlayers/externs/bingmaps.js",
"node_modules/openlayers/externs/closure-compiler.js",
"node_modules/openlayers/externs/geojson.js",
"node_modules/openlayers/externs/proj4js.js",
"node_modules/openlayers/externs/tilejson.js",
"node_modules/openlayers/externs/topojson.js"
],
"define": [
"goog.array.ASSUME_NATIVE_FUNCTIONS=true",
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false",
"ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false"
],
"js": [
"node_modules/openlayers/externs/olx.js",
"node_modules/openlayers/externs/oli.js"
],
"jscomp_off": [
"unknownDefines"
],
"extra_annotation_name": [
"api", "observable"
],
"compilation_level": "ADVANCED",
"warning_level": "VERBOSE",
"output_wrapper": "(function(){%output%})();",
"use_types_for_optimization": true
}
}
```
Create a `config.json` file with the above content at the root of the
application directory.
We can now use `closure-util` to compile the code:
$ ./node_modules/openlayers/node_modules/.bin/closure-util build config.json app.js
The resulting `app.js` file, which you can view in your editor if you're
curious, includes a minified version of the application code (`main.js`), and
the OpenLayers 3 code that the application code uses.
Here is a version of `config.json` with more compilation checks enabled:
```json
{
"lib": [
"node_modules/openlayers/src/**/*.js",
"node_modules/openlayers/build/ol.ext/**/*.js",
"src/**/*.js"
],
"compile": {
"closure_entry_point": "app",
"externs": [
"node_modules/openlayers/externs/bingmaps.js",
"node_modules/openlayers/externs/closure-compiler.js",
"node_modules/openlayers/externs/geojson.js",
"node_modules/openlayers/externs/proj4js.js",
"node_modules/openlayers/externs/tilejson.js",
"node_modules/openlayers/externs/topojson.js"
],
"define": [
"goog.array.ASSUME_NATIVE_FUNCTIONS=true",
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false",
"ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false"
],
"js": [
"node_modules/openlayers/externs/olx.js",
"node_modules/openlayers/externs/oli.js"
],
"jscomp_error": [
"accessControls",
"ambiguousFunctionDecl",
"checkEventfulObjectDisposal",
"checkRegExp",
"checkStructDictInheritance",
"checkTypes",
"checkVars",
"const",
"constantProperty",
"deprecated",
"duplicateMessage",
"es3",
"es5Strict",
"externsValidation",
"fileoverviewTags",
"globalThis",
"internetExplorerChecks",
"invalidCasts",
"misplacedTypeAnnotation",
"missingGetCssName",
"missingProperties",
"missingProvide",
"missingRequire",
"missingReturn",
"newCheckTypes",
"nonStandardJsDocs",
"suspiciousCode",
"strictModuleDepCheck",
"typeInvalidation",
"undefinedNames",
"undefinedVars",
"uselessCode",
"visibility"
],
"jscomp_off": [
"unknownDefines"
],
"extra_annotation_name": [
"api", "observable"
],
"compilation_level": "ADVANCED",
"warning_level": "VERBOSE",
"output_wrapper": "(function(){%output%})();",
"use_types_for_optimization": true
}
}
```
## Create an HTML file for the Application
You can now go ahead and create a simple HTML for the application. Create
a `index.html` file with the following content at the root the application
directory:
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="node_modules/openlayers/css/ol.css" type="text/css">
<title>Simple example</title>
<style>
#map {
width: 600px;
height: 400px;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="app.js" type="text/javascript"></script>
</body>
</html>
```
Note that the page includes a `script` tag referencing the `app.js` file,
which is the file resuted from the compilation.
You are done!
## Run Application in Debug Mode
As a bonus, we're going to show how to use `closure-util` to run the
application in "debug" mode, where the original application and OpenLayers
scripts are loaded one by one in the page.
Start the `closure-util` development server:
$ ./node_modules/openlayers/node_modules/.bin/closure-util serve config.json
Now change the `script` tag to the following in the `index.html` file:
```html
<script src="@?main=src/main.js" type="text/javascript"></script>
```
Reload the page in your browser and you should see that scripts are now loaded
individually, making debugging much easier.

View File

@@ -0,0 +1,234 @@
---
title: Custom builds
layout: doc.hbs
---
# Creating custom builds
OpenLayers 3 is a big library providing a lot of functionality. So it is unlikely that an application will need and use all the functionality OpenLayers 3 provides. This is why creating application-specific OpenLayers 3 builds, with just the functionality your application needs, is often a good idea.
An alternative to creating custom builds is to compile your application code together with OpenLayers 3. See the [Compiling Application with Closure Compiler](closure.html) tutorial for more information.
This particular tutorial explains how to create custom builds of OpenLayers 3.
## Requirements
OpenLayers 3's build tools use Node and Java, so you need to have Node and Java installed on your machine. You can run `node --version` and `java -version` to test that Node and Java are installed, respectively.
## Download OpenLayers
Obviously, creating a custom build requires the OpenLayers 3 source and specific build scripts.
To get the OpenLayers 3 source and the build scripts you can clone the `ol3` [repository](https://github.com/openlayers/ol3), or you can download one of the release archives. You can also download the `openlayers` Node package from the Node package registry, using NPM (the Node Package Manager). This is the method we are going to use in this tutorial.
Create a directory:
$ mkdir openlayers
Download the OpenLayers 3 distribution using NPM:
$ npm install openlayers
This will download the latest stable version of OpenLayers 3, and install it under `node_modules`. You can list the content of `node_modules` to verify that it effectively contains a directory named "openlayers".
The Node packages onto which the `openlayers` package depends are installed under `node_modules/openlayers/node_modules`. That directory should, for example, include `closure-util`, which is the utility library OpenLayers 3 uses for Closure.
You should now have everything you need to create custom builds of OpenLayers 3!
## Create a build configuration file
Creating a custom build requires writing a build configuration file. The format of build configuration files is JSON. Here is a simple example of a build configuration file:
```json
{
"exports": [
"ol.Map",
"ol.View",
"ol.control.defaults",
"ol.layer.Tile",
"ol.source.OSM"
],
"compile": {
"externs": [
"externs/bingmaps.js",
"externs/closure-compiler.js",
"externs/geojson.js",
"externs/oli.js",
"externs/olx.js",
"externs/proj4js.js",
"externs/tilejson.js",
"externs/topojson.js"
],
"define": [
"goog.array.ASSUME_NATIVE_FUNCTIONS=true",
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.json.USE_NATIVE_JSON=true",
"goog.DEBUG=false"
],
"jscomp_off": [
"unknownDefines"
],
"extra_annotation_name": [
"api", "observable"
],
"compilation_level": "ADVANCED_OPTIMIZATIONS",
"use_types_for_optimization": true,
"manage_closure_dependencies": true
}
}
```
Create a file named `ol-custom.json` with that content, and save it under the `node_modules/openlayers/build` directory. (You can save it to any location really.)
The most relevant part of this configuration object is the `"exports"` array. This array declares the functions/constructors you use in your JavaScript code. For example, the above configuration file is what you'd use for the following JavaScript code:
```js
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
controls: ol.control.defaults({
attributionOptions: {
collapsible: false
}
}),
view: new ol.View({
center: [0, 0],
zoom: 4
})
});
```
Note that this JavaScript code corresponds to OpenLayers 3's [`simple`](http://openlayers.org/en/master/examples/simple.html) example.
You are now ready to create your first OpenLayers 3 build. Use the following command to create the build:
$ cd node_modules/openlayers
$ node tasks/build.js build/ol-custom.json build/ol-custom.js
The build command may take some time, but it should end with the following output in the console:
info ol Parsing dependencies
info ol Compiling 364 sources
The build command should have created an `ol-custom.js` file in the `node_modules/openlayers/build` directory. You can verify that the file was created. You can even open it in your editor if you're curious.
As a test, you can use the following HTML file to verify that your custom build works as expected:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>OpenLayers 3 example</title>
<link rel="stylesheet" href="node_modules/openlayers/css/ol.css" />
<style>
#map {
width: 600px;
height: 400px;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="node_modules/openlayers/build/ol-custom.js"></script>
<script>
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
view: new ol.View({
center: [0, 0],
zoom: 4
})
});
</script>
</body>
</html>
```
## More on the config file
### `define`'s
Closure allows you to define constants that can be set at compile time. The `define` config property above sets four `goog` properties for the Closure library. The OpenLayers 3 code also has defined values you can set.
Setting some of these to `false` means that the portions of the code relating to this setting become "dead", i.e. are never executed. As Closure Compiler's `ADVANCED` mode removes dead code, this makes the size of the advanced compiled file smaller.
You might have noticed that the build file you've just created is considerably smaller than the full build, but it can be reduced further. This is because all three renderers and all layer types are included by default. We only need one renderer, and only need the tile layer, so can exclude the others by setting these properties with `define`s. So add the following to the define section of the config above:
```
"ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false",
"ol.ENABLE_PROJ4JS=false",
"ol.ENABLE_IMAGE=false",
"ol.ENABLE_VECTOR=false",
```
and re-run the build script. The build size should now be smaller.
### Externs
The Closure documentation explains that "externs" are for external names used in the code being compiled. The compiler includes externs for built-ins such as `document`. The `externs` directory of the OpenLayers 3 code includes files for all those used in some part of the library. For example, if you use Bing Maps, you should include the Bing externs file in the `externs` section of the config file.
`oli.js` and `olx.js` are externs files for the OpenLayers 3 API. For examples `olx.js` includes extern definitions for OpenLayers 3's constructor options. You should always use these two files as externs when creating custom builds.
### Other compiler options
There are a couple of other compiler options in the config file above. `manage_closure_dependencies` should always be used. `use_types_for_optimization` should be used for better compression rates.
You can specify any of the other compiler options here as needed, such as the renaming reports, output manifest, or source maps. There is a full list of available options in [closure-util](https://github.com/openlayers/closure-util/blob/master/compiler-options.txt).
Note that `build.js` currently requires you to enter an output file and will write the output from the compiler to it; it does not use the `js_output_file` compiler option. If you specify this in the config file, there will be no compiler output, so `build.js`'s output file will be empty.
## A more complicated example
Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openlayers.org/en/master/examples/heatmap-earthquakes.html). The build configuration file looks like this:
```json
{
"exports": [
"ol.layer.Heatmap",
"ol.source.KML",
"ol.layer.Heatmap#getSource",
"ol.source.KML#on",
"ol.source.VectorEvent#feature",
"ol.Feature#get",
"ol.Feature#set",
"ol.layer.Tile",
"ol.source.Stamen",
"ol.Map",
"ol.View"
],
"compile": {
"externs": [
"externs/olx.js",
"externs/oli.js"
],
"define": [
"ol.ENABLE_DOM=false",
"ol.ENABLE_WEBGL=false",
"ol.ENABLE_PROJ4JS=false",
"ol.ENABLE_IMAGE=false",
"goog.dom.ASSUME_STANDARDS_MODE=true",
"goog.DEBUG=false"
],
"compilation_level": "ADVANCED_OPTIMIZATIONS",
"use_types_for_optimization": true,
"manage_closure_dependencies": true
}
}
```
The exports are given here in the order in which they occur in the `heatmaps-earthquakes` example's JavaScript code. In this example we not only use the `ol.` functions and constructors, but also `prototype` methods where the `ol` namespace is not directly used. In the code, we have for example `vector.getSource().on()`. This means we are using the `getSource` method of `layer.Heatmap` and the `on` method of `source.KML`, so this is what has to be exported. Similarly, `event.feature.get()` means we are using the `feature` property of `source.VectorEvent` and the `get` method of `Feature`. If any of these names are left out, the compile will complete successfully, but the missing names will be obfuscated and you will get a 'property undefined' error when you try and run the script.
As this example uses a vector layer it is necessary to remove `"ol.ENABLE_VECTOR=false"` in the `define` section of the configuration.
## Conclusion
This tutorial should have given you the information you need to create custom builds, i.e. builds tailored to your application. See the [tasks readme](https://github.com/openlayers/ol3/tree/master/tasks/readme.md) for more information on the build scripts and the properties you can use in the build configuration file.

View File

@@ -5,4 +5,8 @@ layout: doc.hbs
# Tutorials
We'll be putting together a more comprehensive set of tutorials here. For now, you can take a look at the [introduction](introduction.html) and [basic concepts](concepts.html) tutorial. Stay tuned for more!
* [Introduction to OpenLayers 3](introduction.html)
* [Basic Concepts](concepts.html)
* [Create Custom Builds](custom-builds.html)
* [Bundle Application and OpenLayers using Browserify](browserify.html)
* [Compile Application and OpenLayers together](closure.html)

View File

@@ -39,6 +39,4 @@ Class namespaces, such as `ol.layer` have a base class type with the same name,
Source files are similarly organised, with a directory for each class namespace. Names are however all lower-case, and the subclasses repeat the superclass type in their name, for example, `ol/layer/vectorlayer.js`.
The naming structure means that there are sometimes 2 objects with the same name but different initial, such as `ol.feature`, a simple object with static functions to be used with features, and `ol.Feature`, a class used to instantiate new features. These two objects are however stored in the same file, in this case, `ol/feature.js`
OL3 follows the convention that the names of private properties and methods, that is, those that are not part of the API, end in an underscore. In general, instance properties are private and accessed using accessors.
OL3 follows the convention that the names of private properties and methods, that is, those that are not part of the API, end in an underscore. In general, instance properties are private and accessed using accessors.

16
examples/accessible.css Normal file
View File

@@ -0,0 +1,16 @@
a.skiplink {
position: absolute;
clip: rect(1px, 1px, 1px, 1px);
padding: 0;
border: 0;
height: 1px;
width: 1px;
overflow: hidden;
}
a.skiplink:focus {
clip: auto;
height: auto;
width: auto;
background-color: #fff;
padding: 0.3em;
}

View File

@@ -1,72 +1,20 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Accessibility example</title>
<style>
a.skiplink {
position: absolute;
clip: rect(1px, 1px, 1px, 1px);
padding: 0;
border: 0;
height: 1px;
width: 1px;
overflow: hidden;
}
a.skiplink:focus {
clip: auto;
height: auto;
width: auto;
background-color: #fff;
padding: 0.3em;
}
</style>
</head>
<body>
---
template: example.html
title: Accessibility example
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.
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png" alt=""> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
Clicking on the "Zoom in" and "Zoom out" buttons below the map zooms the map in and out. You can navigate to the buttons using the "tab" key, and press the "enter" key to trigger the zooming action.
<div class="row-fluid">
<div class="span12">
<a class="skiplink" href="#map">Go to map</a>
<div id="map" class="map" tabindex="0"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Accessibility example</h4>
<p id="shortdesc">Example of an accessible map.</p>
<div id="docs">
<p>This page's <code>map</code> element has its <code>tabindex</code> attribute set to <code>"0"</code>, 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 <code>map</code> element is focused the + and - keys can be used to zoom in and out and the arrow keys can be used to pan.</p>
<p>When clicked the "Zoom in" and "Zoom out" buttons below the map zoom the map in and out, respectively. You can navigate to the buttons using the "tab" key, and press the "enter" key to trigger the zooming action.</p>
<p>See the <a href="accessible.js" target="_blank">accessible.js source</a> to see how this is done.</p>
</div>
<div id="tags">accessibility, tabindex</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=accessible" type="text/javascript"></script>
</body>
</html>
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

@@ -11,7 +11,7 @@ var map = new ol.Map({
source: new ol.source.OSM()
})
],
renderer: exampleNS.getRendererFromQueryString(),
renderer: common.getRendererFromQueryString(),
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
@@ -24,9 +24,14 @@ var map = new ol.Map({
})
});
jQuery('#map').after('<button type="button" ' +
'onclick="map.getView().setZoom(map.getView().getZoom() - 1);">' +
'Zoom out</button>');
jQuery('#map').after('<button type="button" ' +
'onclick="map.getView().setZoom(map.getView().getZoom() + 1);">' +
'Zoom in</button>');
document.getElementById('zoom-out').onclick = function() {
var view = map.getView();
var zoom = view.getZoom();
view.setZoom(zoom - 1);
};
document.getElementById('zoom-in').onclick = function() {
var view = map.getView();
var zoom = view.getZoom();
view.setZoom(zoom + 1);
};

View File

@@ -1,65 +1,27 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Animation example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<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"><i class="icon-arrow-left"></i></button>
<button id="rotate-right"><i class="icon-arrow-right"></i></button>
<button id="rotate-around-rome">Rotate around Rome</button>
<button id="pan-to-london">Pan to London</button>
<button id="elastic-to-moscow">Elastic to Moscow</button>
<button id="bounce-to-istanbul">Bounce to Istanbul</button>
<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>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Animation example</h4>
<p id="shortdesc">Demonstrates animated pan, zoom, and rotation.</p>
<div id="docs">
<p>See the <a href="animation.js" target="_blank">animation.js source</a> to see how this is done.</p>
</div>
<div id="tags">animation</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=animation" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: Animation example
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"><i class="icon-arrow-left"></i></button>
<button id="rotate-right"><i class="icon-arrow-right"></i></button>
<button id="rotate-around-rome">Rotate around Rome</button>
<button id="pan-to-london">Pan to London</button>
<button id="elastic-to-moscow">Elastic to Moscow</button>
<button id="bounce-to-istanbul">Bounce to Istanbul</button>
<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

@@ -34,12 +34,12 @@ function elastic(t) {
return Math.pow(2, -10 * t) * Math.sin((t - 0.075) * (2 * Math.PI) / 0.3) + 1;
}
var london = ol.proj.transform([-0.12755, 51.507222], 'EPSG:4326', 'EPSG:3857');
var moscow = ol.proj.transform([37.6178, 55.7517], 'EPSG:4326', 'EPSG:3857');
var istanbul = ol.proj.transform([28.9744, 41.0128], 'EPSG:4326', 'EPSG:3857');
var rome = ol.proj.transform([12.5, 41.9], 'EPSG:4326', 'EPSG:3857');
var bern = ol.proj.transform([7.4458, 46.95], 'EPSG:4326', 'EPSG:3857');
var madrid = ol.proj.transform([-3.683333, 40.4], 'EPSG:4326', 'EPSG:3857');
var london = ol.proj.fromLonLat([-0.12755, 51.507222]);
var moscow = ol.proj.fromLonLat([37.6178, 55.7517]);
var istanbul = ol.proj.fromLonLat([28.9744, 41.0128]);
var rome = ol.proj.fromLonLat([12.5, 41.9]);
var bern = ol.proj.fromLonLat([7.4458, 46.95]);
var madrid = ol.proj.fromLonLat([-3.683333, 40.4]);
var view = new ol.View({
// the view's initial state
@@ -54,7 +54,10 @@ var map = new ol.Map({
source: new ol.source.OSM()
})
],
renderer: exampleNS.getRendererFromQueryString(),
renderer: common.getRendererFromQueryString(),
// Improve user experience by loading tiles while animating. Will make
// animations stutter on mobile or slow devices.
loadTilesWhileAnimating: true,
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({

View File

@@ -0,0 +1,16 @@
---
template: example.html
title: Tiled ArcGIS MapServer example
shortdesc: Example of a tiled ArcGIS layer.
docs: >
This example shows how to use an ArcGIS REST MapService as tiles.
This source type supports Map and Image Services. For cached ArcGIS
services, better performance is available by using
<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>

28
examples/arcgis-tiled.js Normal file
View File

@@ -0,0 +1,28 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.layer.Tile');
goog.require('ol.source.MapQuest');
goog.require('ol.source.TileArcGISRest');
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
'Specialty/ESRI_StateCityHighway_USA/MapServer';
var layers = [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
}),
new ol.layer.Tile({
extent: [-13884991, 2870341, -7455066, 6338219],
source: new ol.source.TileArcGISRest({
url: url
})
})
];
var map = new ol.Map({
layers: layers,
target: 'map',
view: new ol.View({
center: [-10997148, 4569099],
zoom: 4
})
});

View File

@@ -1,51 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Attributions example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Attributions example</h4>
<p id="shortdesc">Example of a attributions visibily change on map resize, to collapse them on small maps.</p>
<div id="docs">
<p>See the <a href="attributions.js" target="_blank">attributions.js source</a> to see how this is done.</p>
</div>
<div id="tags">attributions, openstreetmap</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=attributions" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: Attributions example
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.
This is because the <code>collapsible</code> option is set to true if the width
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

@@ -15,7 +15,7 @@ var map = new ol.Map({
})
],
controls: ol.control.defaults({ attribution: false }).extend([attribution]),
renderer: exampleNS.getRendererFromQueryString(),
renderer: common.getRendererFromQueryString(),
target: 'map',
view: new ol.View({
center: [0, 0],
@@ -29,5 +29,5 @@ function checkSize() {
attribution.setCollapsed(small);
}
$(window).on('resize', checkSize);
window.addEventListener('resize', checkSize);
checkSize();

View File

@@ -1,92 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Bind HTML input example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span4">
<h4 id="title">Bind HTML input example</h4>
<p id="shortdesc">Demonstrates two-way binding of HTML input elements to OpenLayers objects.</p>
<div id="docs">
<p>See the <a href="bind-input.js" target="_blank">bind-input.js source</a> to see how this is done.</p>
<p id="has-webgl" style="display: none">With the <a href="?renderer=webgl">WebGL renderer</a>, <strong>hue</strong>, <strong>saturation</strong>, <strong>contrast</strong> and <strong>brightness</strong> can also be controlled.</p>
<div id="no-webgl" class="alert alert-warning" style="display: none">
<h4>Warning!</h4>
A browser that supports <a href="http://get.webgl.org/">WebGL</a> is required to change the
<strong>hue</strong>, <strong>saturation</strong>, <strong>contrast</strong> and <strong>brightness</strong>.
</div>
</div>
<div id="tags">input, bind, openstreetmap</div>
</div>
<div class="span4">
<form class="">
<fieldset>
<legend>Layer</legend>
<label class="checkbox" for="visible">
<input id="visible" type="checkbox"/>visibility
</label>
<label>opacity</label>
<input id="opacity" type="range" min="0" max="1" step="0.01"/>
</fieldset>
<fieldset id="webgl" style="display: none">
<label>hue</label>
<input id="hue" type="range" min="-3.141592653589793" max="3.141592653589793" step="0.01"/>
<label>saturation</label>
<input id="saturation" type="range" min="0" max="5" step="0.01"/>
<label>contrast</label>
<input id="contrast" type="range" min="0" max="2" step="0.01"/>
<label>brightness</label>
<input id="brightness" type="range" min="-1" max="1" step="0.01"/>
</fieldset>
</form>
</div>
<div class="span4">
<form class="">
<fieldset>
<legend>View</legend>
<label>rotation</label>
<input id="rotation" type="range" min="-3.141592653589793" max="3.141592653589793" step="0.01"/>
<label>resolution</label>
<input id="resolution" type="number" min="0" step="250"/>
</fieldset>
</form>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=bind-input" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,69 +0,0 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.dom.Input');
goog.require('ol.has');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
function checkWebGL(evt) {
document.getElementById('no-webgl').style.display =
ol.has.WEBGL ? 'none' : '';
document.getElementById('has-webgl').style.display =
ol.has.WEBGL && !evt.glContext ? '' : 'none';
document.getElementById('webgl').style.display =
evt.glContext ? '' : 'none';
}
var layer = new ol.layer.Tile({
source: new ol.source.OSM()
});
layer.once('precompose', checkWebGL);
var view = new ol.View({
center: [0, 0],
zoom: 2
});
var map = new ol.Map({
layers: [layer],
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
collapsible: false
})
}),
view: view
});
var visible = new ol.dom.Input(document.getElementById('visible'));
visible.bindTo('checked', layer, 'visible');
var opacity = new ol.dom.Input(document.getElementById('opacity'));
opacity.bindTo('value', layer, 'opacity')
.transform(parseFloat, String);
var hue = new ol.dom.Input(document.getElementById('hue'));
hue.bindTo('value', layer, 'hue')
.transform(parseFloat, String);
var saturation = new ol.dom.Input(document.getElementById('saturation'));
saturation.bindTo('value', layer, 'saturation')
.transform(parseFloat, String);
var contrast = new ol.dom.Input(document.getElementById('contrast'));
contrast.bindTo('value', layer, 'contrast')
.transform(parseFloat, String);
var brightness = new ol.dom.Input(document.getElementById('brightness'));
brightness.bindTo('value', layer, 'brightness')
.transform(parseFloat, String);
var rotation = new ol.dom.Input(document.getElementById('rotation'));
rotation.bindTo('value', view, 'rotation').transform(parseFloat, String);
var resolution = new ol.dom.Input(document.getElementById('resolution'));
resolution.bindTo('value', view, 'resolution').transform(parseFloat, String);

View File

@@ -1,60 +1,20 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Bing Maps example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<select id="layer-select">
<option value="Aerial">Aerial</option>
<option value="AerialWithLabels" selected>Aerial with labels</option>
<option value="Road">Road</option>
<option value="collinsBart">Collins Bart</option>
<option value="ordnanceSurvey">Ordnance Survey</option>
</select>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Bing Maps example</h4>
<p id="shortdesc">Example of a Bing Maps layer.</p>
<div id="docs">
<p>When the Bing Maps tile service doesn't have tiles for a given resolution and region it returns "placeholder" tiles indicating that. Zoom the map beyond level 19 to see the "placeholder" tiles. If you want OpenLayers to display stretched tiles in place of "placeholder" tiles beyond zoom level 19 then set <code>maxZoom</code> to <code>19</code> in the options passed to <code>ol.source.BingMaps</code>.</p>
<p>See the <a href="bing-maps.js" target="_blank">bing-maps.js source</a> to see how this is done.</p>
</div>
<div id="tags">bing, bing-maps</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=bing-maps" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: Bing Maps example
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>
tags: "bing, bing-maps"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<select id="layer-select">
<option value="Aerial">Aerial</option>
<option value="AerialWithLabels" selected>Aerial with labels</option>
<option value="Road">Road</option>
<option value="collinsBart">Collins Bart</option>
<option value="ordnanceSurvey">Ordnance Survey</option>
</select>
</div>
</div>

View File

@@ -28,7 +28,10 @@ for (i = 0, ii = styles.length; i < ii; ++i) {
}
var map = new ol.Map({
layers: layers,
renderer: exampleNS.getRendererFromQueryString(),
renderer: common.getRendererFromQueryString(),
// Improve user experience by loading tiles while dragging/zooming. Will make
// zooming choppy on mobile or slow devices.
loadTilesWhileInteracting: true,
target: 'map',
view: new ol.View({
center: [-6655.5402445057125, 6709968.258934638],
@@ -36,11 +39,12 @@ var map = new ol.Map({
})
});
$('#layer-select').change(function() {
var style = $(this).find(':selected').val();
var i, ii;
for (i = 0, ii = layers.length; i < ii; ++i) {
layers[i].setVisible(styles[i] == style);
var select = document.getElementById('layer-select');
function onChange() {
var style = select.value;
for (var i = 0, ii = layers.length; i < ii; ++i) {
layers[i].setVisible(styles[i] === style);
}
});
$('#layer-select').trigger('change');
}
select.addEventListener('change', onChange);
onChange();

View File

@@ -1,59 +1,20 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Box selection example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
---
template: example.html
title: Box selection example
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>SHIFT+drag</code> 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 class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span4">
<h4 id="title">Box selection example</h4>
<p id="shortdesc">Using a DragBox interaction to select features.</p>
<div id="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>SHIFT+drag</code> to draw boxes.</p>
<p>See the <a href="box-selection.js" target="_blank">box-selection.js source</a> to see how this is done.</p>
</div>
<div id="tags">DragBox, feature, selection, box</div>
</div>
<div class="span4 offset4">
<div id="info" class="alert alert-success">
&nbsp;
</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=box-selection" type="text/javascript"></script>
</body>
</html>
</div>
</div>

View File

@@ -1,20 +1,20 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.events.condition');
goog.require('ol.interaction');
goog.require('ol.format.GeoJSON');
goog.require('ol.interaction.DragBox');
goog.require('ol.interaction.Select');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.GeoJSON');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var vectorSource = new ol.source.GeoJSON({
projection: 'EPSG:3857',
url: 'data/geojson/countries.geojson'
var vectorSource = new ol.source.Vector({
url: 'data/geojson/countries.geojson',
format: new ol.format.GeoJSON()
});

View File

@@ -0,0 +1,7 @@
#reset-brightness {
min-width: 138px;
}
#reset-contrast {
min-width: 120px;
}

View File

@@ -1,74 +1,27 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Brightness/contrast example</title>
<style>
#reset-brightness {
min-width: 138px;
}
#reset-contrast {
min-width: 120px;
}
</style>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
---
template: example.html
title: Brightness/contrast example
shortdesc: Example of brightness/contrast control on the client (WebGL only).
docs: >
This example shows how to control brightness/contrast on the client,
the example is limited to WebGL.
tags: "brightness, contrast, webgl"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<div id="no-webgl" class="alert alert-error" style="display: none">
This example requires a browser that supports <a href="http://get.webgl.org/">WebGL</a>.
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
<div id="no-webgl" class="alert alert-error" style="display: none">
This example requires a browser that supports <a href="http://get.webgl.org/">WebGL</a>.
</div>
<div class="btn-group">
<button id="increase-brightness"><i class="icon-plus"></i></button>
<button id="reset-brightness">Brightness</button>
<button id="decrease-brightness"><i class="icon-minus"></i></button>
</div>
<div class="btn-group">
<button id="increase-contrast"><i class="icon-plus"></i></button>
<button id="reset-contrast">Contrast</button>
<button id="decrease-contrast"><i class="icon-minus"></i></button>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Brightness/contrast example</h4>
<p id="shortdesc">Example of brightness/contrast control on the client (WebGL only).</p>
<div id="docs">
<p>See the <a href="brightness-contrast.js" target="_blank">brightness-contrast.js source</a> to see how this is done.</p>
</div>
<div id="tags">brightness, contrast, webgl</div>
</div>
</div>
<div class="btn-group">
<button id="increase-brightness"><i class="icon-plus"></i></button>
<button id="reset-brightness">Brightness</button>
<button id="decrease-brightness"><i class="icon-minus"></i></button>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=brightness-contrast" type="text/javascript"></script>
</body>
</html>
<div class="btn-group">
<button id="increase-contrast"><i class="icon-plus"></i></button>
<button id="reset-contrast">Contrast</button>
<button id="decrease-contrast"><i class="icon-minus"></i></button>
</div>
</div>
</div>

View File

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

View File

@@ -1,62 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<style type="text/css">
.tooltip-inner {
white-space: nowrap;
}
</style>
<title>ol3 custom tooltips example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Custom tooltips</h4>
<p id="shortdesc">
This example shows how to customize the buttons tooltips with
<a href="http://getbootstrap.com/javascript/#tooltips">Bootstrap</a>.
</p>
<div id="docs">
<p>
See the <a href="button-title.js" target="_blank">button-title.js source</a> to see how this is done.
</p>
</div>
<div id="tags">
custom, tooltip
</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=button-title" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: Custom tooltips example
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"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -9,7 +9,7 @@ var map = new ol.Map({
source: new ol.source.OSM()
})
],
renderer: exampleNS.getRendererFromQueryString(),
renderer: common.getRendererFromQueryString(),
target: 'map',
view: new ol.View({
center: [-8730000, 5930000],

View File

@@ -1,52 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Canvas tiles example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Canvas tiles example</h4>
<p id="shortdesc">Renders tiles with coordinates for debugging.</p>
<div id="docs">
<p>The black grid tiles are generated on the client with an HTML5 canvas. Note that the tile coordinates are ol3 normalized tile coordinates (origin bottom left), not OSM tile coordinates (origin top left).</p>
<p>See the <a href="canvas-tiles.js" target="_blank">canvas-tiles.js source</a> to see how this is done.</p>
</div>
<div id="tags">layers, openstreetmap, canvas</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=canvas-tiles" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: Canvas tiles example
shortdesc: Renders tiles with coordinates for debugging.
docs: >
<p>The black grid tiles are generated on the client with an HTML5 canvas. Note that the tile coordinates are ol3 normalized tile coordinates (origin bottom left), not
OSM tile coordinates (origin top left).</p>
tags: "layers, openstreetmap, canvas"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -22,7 +22,7 @@ var map = new ol.Map({
})
})
],
renderer: exampleNS.getRendererFromQueryString(),
renderer: common.getRendererFromQueryString(),
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({

56
examples/center.css Normal file
View File

@@ -0,0 +1,56 @@
.mapcontainer {
position: relative;
margin-bottom: 20px;
}
.map {
width: 1000px;
height: 600px;
}
div.ol-zoom {
top: 178px;
left: 158px;
}
div.ol-attribution {
bottom: 30px;
right: 50px;
}
.padding-top {
position: absolute;
top: 0;
left: 0px;
width: 1000px;
height: 170px;
background: rgba(255, 255, 255, 0.5);
}
.padding-left {
position: absolute;
top: 170px;
left: 0;
width: 150px;
height: 400px;
background: rgba(255, 255, 255, 0.5);
}
.padding-right {
position: absolute;
top: 170px;
left: 950px;
width: 50px;
height: 400px;
background: rgba(255, 255, 255, 0.5);
}
.padding-bottom {
position: absolute;
top: 570px;
left: 0px;
width: 1000px;
height: 30px;
background: rgba(255, 255, 255, 0.5);
}
.center {
position: absolute;
border: solid 1px black;
top: 490px;
left: 560px;
width: 20px;
height: 20px;
}

View File

@@ -1,131 +1,34 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<style>
.mapcontainer {
position: relative;
margin-bottom: 20px;
}
.map {
width: 1000px;
height: 600px;
}
div.ol-zoom {
top: 178px;
left: 158px;
}
div.ol-attribution {
bottom: 30px;
right: 50px;
}
.padding-top {
position: absolute;
top: 0;
left: 0px;
width: 1000px;
height: 170px;
background: rgba(255, 255, 255, 0.5);
}
.padding-left {
position: absolute;
top: 170px;
left: 0;
width: 150px;
height: 400px;
background: rgba(255, 255, 255, 0.5);
}
.padding-right {
position: absolute;
top: 170px;
left: 950px;
width: 50px;
height: 400px;
background: rgba(255, 255, 255, 0.5);
}
.padding-bottom {
position: absolute;
top: 570px;
left: 0px;
width: 1000px;
height: 30px;
background: rgba(255, 255, 255, 0.5);
}
.center {
position: absolute;
border: solid 1px black;
top: 490px;
left: 560px;
width: 20px;
height: 20px;
}
</style>
<title>Advanced View Positioning example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png">OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12 mapcontainer">
<div id="map" class="map"></div>
<div class="padding-top"></div>
<div class="padding-left"></div>
<div class="padding-right"></div>
<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>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Advanced View Positioning example</h4>
<p id="shortdesc">This example demonstrates how a map's view can be
adjusted so a geometry or coordinate is positioned at a specific
pixel location. The map above has top, right, bottom, and left
padding applied inside the viewport. The view's <code>fitGeometry</code> method
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>
<div id="docs">
<p>Use <code>Alt</code>+<code>Shift</code>+drag to rotate the map.</p>
<p>See the <a href="center.js" target="_blank">center.js source</a> to see how this is done.</p>
</div>
<div id="tags">center, rotation, openstreetmap</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="loader.js?id=center" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: Advanced View Positioning example
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
adjusted so a geometry or coordinate is positioned at a specific
pixel location. The map above has top, right, bottom, and left
padding applied inside the viewport. The view's <code>fitGeometry</code> method
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>
tags: "center, rotation, openstreetmap"
---
<div class="row-fluid">
<div class="span12 mapcontainer">
<div id="map" class="map"></div>
<div class="padding-top"></div>
<div class="padding-left"></div>
<div class="padding-right"></div>
<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,20 +1,21 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.format.GeoJSON');
goog.require('ol.geom.Point');
goog.require('ol.geom.SimpleGeometry');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.GeoJSON');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');
goog.require('ol.style.Circle');
goog.require('ol.style.Fill');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
var source = new ol.source.GeoJSON({
projection: 'EPSG:3857',
url: 'data/geojson/switzerland.geojson'
var source = new ol.source.Vector({
url: 'data/geojson/switzerland.geojson',
format: new ol.format.GeoJSON()
});
var style = new ol.style.Style({
fill: new ol.style.Fill({

View File

@@ -1,51 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Clustering example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Clustering example</h4>
<p id="shortdesc">Example of using <code>ol.Cluster</code>.</p>
<div id="docs">
<p>See the <a href="cluster.js" target="_blank">cluster.js source</a> to see how this is done.</p>
</div>
<div id="tags">cluster vector</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=cluster" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: Clustering example
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

@@ -0,0 +1,7 @@
.rotate-north {
top: 65px;
left: .5em;
}
.ol-touch .rotate-north {
top: 80px;
}

View File

@@ -1,91 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<style type="text/css">
.rotate-north {
position: absolute;
top: 65px;
left: 8px;
background: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
.ol-touch .rotate-north {
top: 80px;
}
.rotate-north a {
display: block;
color: white;
font-size: 16px;
font-family: 'Lucida Grande',Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif;
font-weight: bold;
margin: 1px;
text-decoration: none;
text-align: center;
border-radius: 2px;
height: 22px;
width: 22px;
background: rgba(0,60,136,0.5);
}
.ol-touch .rotate-north a {
font-size: 20px;
height: 30px;
width: 30px;
line-height: 26px;
}
.rotate-north a:hover {
background: rgba(0,60,136,0.7);
}
</style>
<title>ol3 custom controls example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Custom controls</h4>
<p id="shortdesc">This example shows how to create custom controls.</p>
<div id="docs">
<p>
This example creates a "rotate to north" button.
See the <a href="custom-controls.js" target="_blank">custom-controls.js
source</a> to see how this is done.
</p>
</div>
<div id="tags">
custom, control
</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=custom-controls" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: Custom control example
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

@@ -29,23 +29,20 @@ app.RotateNorthControl = function(opt_options) {
var options = opt_options || {};
var anchor = document.createElement('a');
anchor.href = '#rotate-north';
anchor.innerHTML = 'N';
var button = document.createElement('button');
button.innerHTML = 'N';
var this_ = this;
var handleRotateNorth = function(e) {
// prevent #rotate-north anchor from getting appended to the url
e.preventDefault();
this_.getMap().getView().setRotation(0);
};
anchor.addEventListener('click', handleRotateNorth, false);
anchor.addEventListener('touchstart', handleRotateNorth, false);
button.addEventListener('click', handleRotateNorth, false);
button.addEventListener('touchstart', handleRotateNorth, false);
var element = document.createElement('div');
element.className = 'rotate-north ol-unselectable';
element.appendChild(anchor);
element.className = 'rotate-north ol-unselectable ol-control';
element.appendChild(button);
ol.control.Control.call(this, {
element: element,
@@ -74,7 +71,7 @@ var map = new ol.Map({
source: new ol.source.OSM()
})
],
renderer: exampleNS.getRendererFromQueryString(),
renderer: common.getRendererFromQueryString(),
target: 'map',
view: new ol.View({
center: [0, 0],

View File

@@ -1,54 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>d3 integration example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">d3 integration example</h4>
<p id="shortdesc">Example of using ol3 and d3 together.</p>
<div id="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>
<p>See the <a href="d3.js" target="_blank">d3.js source</a> to see how this is done.</p>
</div>
<div id="tags">d3</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=d3" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: d3 integration example
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>
tags: "d3"
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>

2
examples/d3.js vendored
View File

@@ -21,7 +21,7 @@ var map = new ol.Map({
],
target: 'map',
view: new ol.View({
center: ol.proj.transform([-97, 38], 'EPSG:4326', 'EPSG:3857'),
center: ol.proj.fromLonLat([-97, 38]),
zoom: 4
})
});

View File

@@ -1,374 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<Capabilities xmlns="http://www.opengis.net/wmts/1.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd" version="1.0.0">
<ows:ServiceIdentification>
<ows:Title>Web Map Tile Service</ows:Title>
<ows:ServiceType>OGC WMTS</ows:ServiceType>
<ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
<ows:Fees>none</ows:Fees>
<ows:AccessConstraints>http://data.wien.gv.at/nutzungsbedingungen</ows:AccessConstraints>
</ows:ServiceIdentification>
<ows:ServiceProvider>
<ows:ProviderName>Magistrat Wien</ows:ProviderName>
<ows:ProviderSite xlink:href="http://www.wien.gv.at"/>
<ows:ServiceContact>
<ows:IndividualName>Gerhard Sommer</ows:IndividualName>
</ows:ServiceContact>
</ows:ServiceProvider>
<ows:OperationsMetadata>
<ows:Operation name="GetCapabilities">
<ows:DCP>
<ows:HTTP>
<ows:Get xlink:href="http://maps.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps1.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps2.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps3.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps4.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
</ows:HTTP>
</ows:DCP>
</ows:Operation>
<ows:Operation name="GetTile">
<ows:DCP>
<ows:HTTP>
<ows:Get xlink:href="http://maps.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps1.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps2.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps3.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
<ows:Get xlink:href="http://maps4.wien.gv.at/wmts">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>RESTful</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
</ows:HTTP>
</ows:DCP>
</ows:Operation>
</ows:OperationsMetadata>
<Contents>
<Layer>
<ows:Title>Luftbild</ows:Title>
<ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
<ows:LowerCorner>16.17 48.10</ows:LowerCorner>
<ows:UpperCorner>16.58 48.33</ows:UpperCorner>
</ows:WGS84BoundingBox>
<ows:Identifier>lb</ows:Identifier>
<Style isDefault="true">
<ows:Identifier>farbe</ows:Identifier>
</Style>
<Format>image/jpeg</Format>
<TileMatrixSetLink>
<TileMatrixSet>google3857</TileMatrixSet>
</TileMatrixSetLink>
<ResourceURL format="image/jpeg" template="http://maps1.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps2.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps3.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps4.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
</Layer>
<Layer>
<ows:Title>MZK Flächen</ows:Title>
<ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
<ows:LowerCorner>16.17 48.10</ows:LowerCorner>
<ows:UpperCorner>16.58 48.33</ows:UpperCorner>
</ows:WGS84BoundingBox>
<ows:Identifier>fmzk</ows:Identifier>
<Style isDefault="true">
<ows:Identifier>pastell</ows:Identifier>
</Style>
<Format>image/jpeg</Format>
<TileMatrixSetLink>
<TileMatrixSet>google3857</TileMatrixSet>
</TileMatrixSetLink>
<ResourceURL format="image/jpeg" template="http://maps1.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps2.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps3.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps4.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
</Layer>
<Layer>
<ows:Title>Flächenwidmungs- und Bebauungsplan</ows:Title>
<ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
<ows:LowerCorner>16.17 48.10</ows:LowerCorner>
<ows:UpperCorner>16.58 48.33</ows:UpperCorner>
</ows:WGS84BoundingBox>
<ows:Identifier>flwbplmzk</ows:Identifier>
<Style isDefault="true">
<ows:Identifier>rot</ows:Identifier>
</Style>
<Format>image/jpeg</Format>
<TileMatrixSetLink>
<TileMatrixSet>google3857</TileMatrixSet>
</TileMatrixSetLink>
<ResourceURL format="image/jpeg" template="http://maps1.wien.gv.at/wmts/flwbplmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps2.wien.gv.at/wmts/flwbplmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps3.wien.gv.at/wmts/flwbplmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps4.wien.gv.at/wmts/flwbplmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
<ResourceURL format="image/jpeg" template="http://maps.wien.gv.at/wmts/flwbplmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" resourceType="tile"/>
</Layer>
<Layer>
<ows:Title>Beschriftung</ows:Title>
<ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
<ows:LowerCorner>16.17 48.10</ows:LowerCorner>
<ows:UpperCorner>16.58 48.33</ows:UpperCorner>
</ows:WGS84BoundingBox>
<ows:Identifier>beschriftung</ows:Identifier>
<Style isDefault="true">
<ows:Identifier>normal</ows:Identifier>
</Style>
<Format>image/png</Format>
<TileMatrixSetLink>
<TileMatrixSet>google3857</TileMatrixSet>
</TileMatrixSetLink>
<ResourceURL format="image/png" template="http://maps1.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png" resourceType="tile"/>
<ResourceURL format="image/png" template="http://maps2.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png" resourceType="tile"/>
<ResourceURL format="image/png" template="http://maps3.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png" resourceType="tile"/>
<ResourceURL format="image/png" template="http://maps4.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png" resourceType="tile"/>
<ResourceURL format="image/png" template="http://maps.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png" resourceType="tile"/>
</Layer>
<TileMatrixSet>
<!-- -180 85.05112878 -->
<ows:Identifier>google3857</ows:Identifier>
<ows:BoundingBox crs="urn:ogc:def:crs:EPSG:6.18:3:3857">
<ows:LowerCorner>1799448.394855 6124949.747770</ows:LowerCorner>
<ows:UpperCorner>1848250.442089 6162571.828177</ows:UpperCorner>
</ows:BoundingBox>
<ows:SupportedCRS>urn:ogc:def:crs:EPSG:6.18:3:3857</ows:SupportedCRS>
<WellKnownScaleSet>urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible</WellKnownScaleSet>
<TileMatrix>
<ows:Identifier>0</ows:Identifier>
<ScaleDenominator>559082264.029</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>1</MatrixWidth>
<MatrixHeight>1</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>1</ows:Identifier>
<ScaleDenominator>279541132.015</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>2</MatrixWidth>
<MatrixHeight>2</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>2</ows:Identifier>
<ScaleDenominator>139770566.007</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>4</MatrixWidth>
<MatrixHeight>4</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>3</ows:Identifier>
<ScaleDenominator>69885283.0036</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>8</MatrixWidth>
<MatrixHeight>8</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>4</ows:Identifier>
<ScaleDenominator>34942641.5018</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>16</MatrixWidth>
<MatrixHeight>16</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>5</ows:Identifier>
<ScaleDenominator>17471320.7509</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>32</MatrixWidth>
<MatrixHeight>32</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>6</ows:Identifier>
<ScaleDenominator>8735660.37545</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>64</MatrixWidth>
<MatrixHeight>64</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>7</ows:Identifier>
<ScaleDenominator>4367830.18773</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>128</MatrixWidth>
<MatrixHeight>128</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>8</ows:Identifier>
<ScaleDenominator>2183915.09386</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>256</MatrixWidth>
<MatrixHeight>256</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>9</ows:Identifier>
<ScaleDenominator>1091957.54693</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>512</MatrixWidth>
<MatrixHeight>512</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>10</ows:Identifier>
<ScaleDenominator>545978.773466</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>1024</MatrixWidth>
<MatrixHeight>1024</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>11</ows:Identifier>
<ScaleDenominator>272989.386733</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>2048</MatrixWidth>
<MatrixHeight>2048</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>12</ows:Identifier>
<ScaleDenominator>136494.693366</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>4096</MatrixWidth>
<MatrixHeight>4096</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>13</ows:Identifier>
<ScaleDenominator>68247.3466832</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>8192</MatrixWidth>
<MatrixHeight>8192</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>14</ows:Identifier>
<ScaleDenominator>34123.6733416</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>16384</MatrixWidth>
<MatrixHeight>16384</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>15</ows:Identifier>
<ScaleDenominator>17061.8366708</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>32768</MatrixWidth>
<MatrixHeight>32768</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>16</ows:Identifier>
<ScaleDenominator>8530.91833540</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>65536</MatrixWidth>
<MatrixHeight>65536</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>17</ows:Identifier>
<ScaleDenominator>4265.45916770</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>131072</MatrixWidth>
<MatrixHeight>131072</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>18</ows:Identifier>
<ScaleDenominator>2132.72958385</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>262144</MatrixWidth>
<MatrixHeight>262144</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>19</ows:Identifier>
<ScaleDenominator>1066.36479193</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>524288</MatrixWidth>
<MatrixHeight>524288</MatrixHeight>
</TileMatrix>
</TileMatrixSet>
</Contents>
<ServiceMetadataURL xlink:href="http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml"/>
<Capabilities version="1.0.0" xmlns="http://www.opengis.net/wmts/1.0" xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd">
<ows:ServiceIdentification>
<ows:Title>Koordinates Labs</ows:Title>
<ows:ServiceType>OGC WMTS</ows:ServiceType>
<ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
</ows:ServiceIdentification>
<ows:ServiceProvider>
<ows:ProviderName>Koordinates</ows:ProviderName>
<ows:ProviderSite xlink:href="http://labs.koordinates.com"/>
<ows:ServiceContact/>
</ows:ServiceProvider>
<ows:OperationsMetadata>
<ows:Operation name="GetCapabilities">
<ows:DCP>
<ows:HTTP>
<ows:Get xlink:href="https://labs.koordinates.com/services;key=d740ea02e0c44cafb70dce31a774ca10/wmts/1.0.0/layer/7328/WMTSCapabilities.xml?">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>KVP</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
</ows:HTTP>
</ows:DCP>
</ows:Operation>
<ows:Operation name="GetFeatureInfo">
<ows:DCP>
<ows:HTTP>
<ows:Get xlink:href="https://labs.koordinates.com/services;key=d740ea02e0c44cafb70dce31a774ca10/wmts/?">
<ows:Constraint name="GetEncoding">
<ows:AllowedValues>
<ows:Value>KVP</ows:Value>
</ows:AllowedValues>
</ows:Constraint>
</ows:Get>
</ows:HTTP>
</ows:DCP>
</ows:Operation>
</ows:OperationsMetadata>
<Contents>
<Layer>
<ows:Title>New Zealand Earthquakes</ows:Title>
<ows:Abstract>Historical earthquake data, accessed via the [GeoNet WFS feed](http://info.geonet.org.nz/display/appdata/Advanced+Queries). The data has been filtered to only include quakes in proximity to New Zealand with an `eventtype` of &quot;Earthquake&quot; or &quot;none&quot; per the [GeoNet catalogue](http://info.geonet.org.nz/display/appdata/Catalogue+Output). Most fields have been removed. Please also note the excluded data per this [GeoNet page](http://info.geonet.org.nz/display/appdata/The+Gap). We acknowledge the New Zealand GeoNet project and its sponsors EQC, GNS Science and LINZ, for providing data used in this layer.</ows:Abstract>
<ows:Identifier>layer-7328</ows:Identifier>
<ows:BoundingBox crs="urn:ogc:def:crs:EPSG::3857">
<ows:LowerCorner>-20037508.342789 -6406581.708337</ows:LowerCorner>
<ows:UpperCorner>20037508.342789 -3653545.667928</ows:UpperCorner>
</ows:BoundingBox>
<ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
<ows:LowerCorner>-180.000000 -49.454297</ows:LowerCorner>
<ows:UpperCorner>180.000000 -31.160000</ows:UpperCorner>
</ows:WGS84BoundingBox>
<Style isDefault="true">
<ows:Title>Weighted point styles</ows:Title>
<ows:Identifier>style=39</ows:Identifier>
</Style>
<Format>image/png</Format>
<InfoFormat>application/json</InfoFormat>
<InfoFormat>text/html</InfoFormat>
<TileMatrixSetLink>
<TileMatrixSet>EPSG:3857</TileMatrixSet>
</TileMatrixSetLink>
<ResourceURL format="image/png" resourceType="tile" template="https://koordinates-tiles-a.global.ssl.fastly.net/services;key=d740ea02e0c44cafb70dce31a774ca10/tiles/v4/layer=7328,{style}/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.png"/>
<ResourceURL format="application/json" resourceType="FeatureInfo" template="https://labs.koordinates.com/services;key=d740ea02e0c44cafb70dce31a774ca10/wmts/1.0.0/layer/7328/featureinfo/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}/{I}/{J}.json"/>
<ResourceURL format="text/html" resourceType="FeatureInfo" template="https://labs.koordinates.com/services;key=d740ea02e0c44cafb70dce31a774ca10/wmts/1.0.0/layer/7328/featureinfo/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}/{I}/{J}.html"/>
</Layer>
<TileMatrixSet>
<ows:Title>GoogleMapsCompatible</ows:Title>
<ows:Abstract>The well-known 'GoogleMapsCompatible' tile matrix set defined by the OGC WMTS specification</ows:Abstract>
<ows:Identifier>EPSG:3857</ows:Identifier>
<ows:BoundingBox crs="urn:ogc:def:crs:EPSG::3857">
<ows:LowerCorner>-20037508.342789 -20037508.342789</ows:LowerCorner>
<ows:UpperCorner>20037508.342789 20037508.342789</ows:UpperCorner>
</ows:BoundingBox>
<ows:SupportedCRS>urn:ogc:def:crs:EPSG::3857</ows:SupportedCRS>
<WellKnownScaleSet>urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible</WellKnownScaleSet>
<TileMatrix>
<ows:Identifier>0</ows:Identifier>
<ScaleDenominator>559082264.029</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>1</MatrixWidth>
<MatrixHeight>1</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>1</ows:Identifier>
<ScaleDenominator>279541132.014</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>2</MatrixWidth>
<MatrixHeight>2</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>2</ows:Identifier>
<ScaleDenominator>139770566.007</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>4</MatrixWidth>
<MatrixHeight>4</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>3</ows:Identifier>
<ScaleDenominator>69885283.0036</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>8</MatrixWidth>
<MatrixHeight>8</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>4</ows:Identifier>
<ScaleDenominator>34942641.5018</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>16</MatrixWidth>
<MatrixHeight>16</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>5</ows:Identifier>
<ScaleDenominator>17471320.7509</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>32</MatrixWidth>
<MatrixHeight>32</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>6</ows:Identifier>
<ScaleDenominator>8735660.37545</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>64</MatrixWidth>
<MatrixHeight>64</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>7</ows:Identifier>
<ScaleDenominator>4367830.18772</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>128</MatrixWidth>
<MatrixHeight>128</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>8</ows:Identifier>
<ScaleDenominator>2183915.09386</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>256</MatrixWidth>
<MatrixHeight>256</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>9</ows:Identifier>
<ScaleDenominator>1091957.54693</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>512</MatrixWidth>
<MatrixHeight>512</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>10</ows:Identifier>
<ScaleDenominator>545978.773466</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>1024</MatrixWidth>
<MatrixHeight>1024</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>11</ows:Identifier>
<ScaleDenominator>272989.386733</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>2048</MatrixWidth>
<MatrixHeight>2048</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>12</ows:Identifier>
<ScaleDenominator>136494.693366</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>4096</MatrixWidth>
<MatrixHeight>4096</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>13</ows:Identifier>
<ScaleDenominator>68247.3466832</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>8192</MatrixWidth>
<MatrixHeight>8192</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>14</ows:Identifier>
<ScaleDenominator>34123.6733416</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>16384</MatrixWidth>
<MatrixHeight>16384</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>15</ows:Identifier>
<ScaleDenominator>17061.8366708</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>32768</MatrixWidth>
<MatrixHeight>32768</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>16</ows:Identifier>
<ScaleDenominator>8530.9183354</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>65536</MatrixWidth>
<MatrixHeight>65536</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>17</ows:Identifier>
<ScaleDenominator>4265.4591677</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>131072</MatrixWidth>
<MatrixHeight>131072</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>18</ows:Identifier>
<ScaleDenominator>2132.72958385</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>262144</MatrixWidth>
<MatrixHeight>262144</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>19</ows:Identifier>
<ScaleDenominator>1066.36479192</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>524288</MatrixWidth>
<MatrixHeight>524288</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>20</ows:Identifier>
<ScaleDenominator>533.182395962</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>1048576</MatrixWidth>
<MatrixHeight>1048576</MatrixHeight>
</TileMatrix>
<TileMatrix>
<ows:Identifier>21</ows:Identifier>
<ScaleDenominator>266.591197981</ScaleDenominator>
<TopLeftCorner>-20037508.3428 20037508.3428</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>2097152</MatrixWidth>
<MatrixHeight>2097152</MatrixHeight>
</TileMatrix>
</TileMatrixSet>
</Contents>
<ServiceMetadataURL xlink:href="https://labs.koordinates.com/services;key=d740ea02e0c44cafb70dce31a774ca10/wmts/1.0.0/layer/7328/WMTSCapabilities.xml"/>
</Capabilities>

BIN
examples/data/arrow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

View File

@@ -1,58 +1,23 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Device-Orientation example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
---
template: example.html
title: Device-Orientation example
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>
<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 class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Device orientation example</h4>
<label class="checkbox" for="track">
<input id="track" type="checkbox"/>track changes
</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>
<p id="shortdesc">Listen to DeviceOrientation events</p>
<div id="docs">
<p>See the <a href="device-orientation.js" target="_blank">device-orientation.js source</a> to see how this is done.</p>
</div>
<div id="tags">orientation, openstreetmap</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=device-orientation" type="text/javascript"></script>
</body>
</html>
</div>
</div>

View File

@@ -2,7 +2,6 @@ goog.require('ol.DeviceOrientation');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.dom.Input');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.source.OSM');
@@ -20,7 +19,7 @@ var map = new ol.Map({
source: new ol.source.OSM()
})
],
renderer: exampleNS.getRendererFromQueryString(),
renderer: common.getRendererFromQueryString(),
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
@@ -31,14 +30,20 @@ var map = new ol.Map({
});
var deviceOrientation = new ol.DeviceOrientation();
var track = new ol.dom.Input(document.getElementById('track'));
track.bindTo('checked', deviceOrientation, 'tracking');
function el(id) {
return document.getElementById(id);
}
el('track').addEventListener('change', function() {
deviceOrientation.setTracking(this.checked);
});
deviceOrientation.on('change', function(event) {
$('#alpha').text(deviceOrientation.getAlpha() + ' [rad]');
$('#beta').text(deviceOrientation.getBeta() + ' [rad]');
$('#gamma').text(deviceOrientation.getGamma() + ' [rad]');
$('#heading').text(deviceOrientation.getHeading() + ' [rad]');
el('alpha').innerText = deviceOrientation.getAlpha() + ' [rad]';
el('beta').innerText = deviceOrientation.getBeta() + ' [rad]';
el('gamma').innerText = deviceOrientation.getGamma() + ' [rad]';
el('heading').innerText = deviceOrientation.getHeading() + ' [rad]';
});
// tilt the map

View File

@@ -1,56 +1,19 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Drag-and-Drop image vector example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
---
template: 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.
docs: >
Example of using the drag-and-drop interaction with a ol.source.ImageVector. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. Each file is rendered to
an image on the client.
tags: "drag-and-drop-image-vector, gpx, geojson, igc, kml, topojson, vector, image"
---
<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 class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span4">
<h4 id="title">Drag-and-Drop image vector example</h4>
<p id="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.</p>
<div id="docs">
<p>See the <a href="drag-and-drop-image-vector.js" target="_blank">drag-and-drop-image-vector.js source</a> to see how this is done.</p>
</div>
<div id="tags">drag-and-drop-image-vector, gpx, geojson, igc, kml, topojson, vector, image</div>
</div>
<div class="span4 offset4">
<div id="info" class="alert alert-success">
&nbsp;
</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=drag-and-drop-image-vector" type="text/javascript"></script>
</body>
</html>
</div>
</div>

View File

@@ -104,7 +104,7 @@ var map = new ol.Map({
})
})
],
renderer: exampleNS.getRendererFromQueryString(),
renderer: common.getRendererFromQueryString(),
target: 'map',
view: new ol.View({
center: [0, 0],
@@ -114,17 +114,15 @@ var map = new ol.Map({
dragAndDropInteraction.on('addfeatures', function(event) {
var vectorSource = new ol.source.Vector({
features: event.features,
projection: event.projection
features: event.features
});
map.getLayers().push(new ol.layer.Image({
map.addLayer(new ol.layer.Image({
source: new ol.source.ImageVector({
source: vectorSource,
style: styleFunction
})
}));
var view = map.getView();
view.fitExtent(
map.getView().fitExtent(
vectorSource.getExtent(), /** @type {ol.Size} */ (map.getSize()));
});
@@ -145,7 +143,10 @@ var displayFeatureInfo = function(pixel) {
}
};
$(map.getViewport()).on('mousemove', function(evt) {
map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent);
displayFeatureInfo(pixel);
});

View File

@@ -1,56 +1,19 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Drag-and-Drop example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
---
template: 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.
docs: >
Example of using the drag-and-drop interaction. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. There is no projection transform support, so this will
only work with data in EPSG:4326 and EPSG:3857.
tags: "drag-and-drop, gpx, geojson, igc, kml, topojson"
---
<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 class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span4">
<h4 id="title">Drag-and-Drop example</h4>
<p id="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.</p>
<div id="docs">
<p>See the <a href="drag-and-drop.js" target="_blank">drag-and-drop.js source</a> to see how this is done.</p>
</div>
<div id="tags">drag-and-drop, gpx, geojson, igc, kml, topojson</div>
</div>
<div class="span4 offset4">
<div id="info" class="alert alert-success">
&nbsp;
</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=drag-and-drop" type="text/javascript"></script>
</body>
</html>
</div>
</div>

View File

@@ -112,15 +112,13 @@ var map = new ol.Map({
dragAndDropInteraction.on('addfeatures', function(event) {
var vectorSource = new ol.source.Vector({
features: event.features,
projection: event.projection
features: event.features
});
map.getLayers().push(new ol.layer.Vector({
map.addLayer(new ol.layer.Vector({
source: vectorSource,
style: styleFunction
}));
var view = map.getView();
view.fitExtent(
map.getView().fitExtent(
vectorSource.getExtent(), /** @type {ol.Size} */ (map.getSize()));
});
@@ -141,7 +139,10 @@ var displayFeatureInfo = function(pixel) {
}
};
$(map.getViewport()).on('mousemove', function(evt) {
map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent);
displayFeatureInfo(pixel);
});

View File

@@ -1,51 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Drag features example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Drag features example</h4>
<p id="shortdesc">Example of a drag features interaction.</p>
<div id="docs">
<p>See the <a href="drag-features.js" target="_blank">drag-features.js source</a> to see how this is done.</p>
</div>
<div id="tags">drag, feature, vector, editing</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=drag-features" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: Drag features example
shortdesc: Example of a drag features interaction.
docs: >
The drag features interaction can be used to drag features to a new position.
tags: "drag, feature, vector, editing"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -1,52 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Drag rotate and zoom example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Drag rotate and zoom example</h4>
<p id="shortdesc">A single interaction to drag, rotate, and zoom.</p>
<div id="docs">
<p><code>Shift</code> + Drag to rotate and zoom the map around its center.</p>
<p>See the <a href="drag-rotate-and-zoom.js" target="_blank">drag-rotate-and-zoom.js source</a> to see how this is done.</p>
</div>
<div id="tags">drag, rotate, zoom, interaction</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=drag-rotate-and-zoom" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: Drag rotate and zoom example
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>
tags: "drag, rotate, zoom, interaction"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>

View File

@@ -15,7 +15,7 @@ var map = new ol.Map({
source: new ol.source.MapQuest({layer: 'sat'})
})
],
renderer: exampleNS.getRendererFromQueryString(),
renderer: common.getRendererFromQueryString(),
target: 'map',
view: new ol.View({
center: [0, 0],

View File

@@ -1,61 +1,21 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Draw and modify features example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Draw and modify features example</h4>
<p id="shortdesc">Example of using the ol.interaction.Draw interaction together with
the ol.interaction.Modify interaction.</p>
<form class="form-inline">
<label>Geometry type &nbsp;</label>
<select id="type">
<option value="Point">Point</option>
<option value="LineString">LineString</option>
<option value="Polygon">Polygon</option>
</select>
</form>
<div id="docs">
<p>See the <a href="draw-and-modify-features.js" target="_blank">draw-and-modify-features.js source</a> to see how this is done.</p>
</div>
<div id="tags">draw, edit, modify, vector, featureoverlay</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=draw-and-modify-features" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: Draw and modify features example
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">
<option value="Point">Point</option>
<option value="LineString">LineString</option>
<option value="Polygon">Polygon</option>
</select>
</form>
</div>

View File

@@ -2,7 +2,6 @@ goog.require('ol.FeatureOverlay');
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.events.condition');
goog.require('ol.interaction');
goog.require('ol.interaction.Draw');
goog.require('ol.interaction.Modify');
goog.require('ol.layer.Tile');

View File

@@ -1,61 +1,26 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Draw features example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Draw features example</h4>
<p id="shortdesc">Example of using the ol.interaction.Draw interaction.</p>
<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>
</select>
</form>
<div id="docs">
<p>See the <a href="draw-features.js" target="_blank">draw-features.js source</a> to see how this is done.</p>
</div>
<div id="tags">draw, edit, vector</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=draw-features" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: Draw features example
shortdesc: Example of using the ol.interaction.Draw interaction.
docs: >
Example of using the Draw interaction. Select a geometry type from the
dropdown above to start drawing. To finish drawing, click the last
point. To activate freehand drawing for lines and polygons, hold the `Shift`
key.
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>
</select>
</form>
</div>
</div>

View File

@@ -1,6 +1,5 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.interaction');
goog.require('ol.interaction.Draw');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
@@ -15,7 +14,7 @@ var raster = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
});
var source = new ol.source.Vector();
var source = new ol.source.Vector({wrapX: false});
var vector = new ol.layer.Vector({
source: source,
@@ -38,7 +37,7 @@ var vector = new ol.layer.Vector({
var map = new ol.Map({
layers: [raster, vector],
renderer: exampleNS.getRendererFromQueryString(),
renderer: common.getRendererFromQueryString(),
target: 'map',
view: new ol.View({
center: [-11000000, 4600000],

View File

@@ -1,51 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Dynamic data example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Dynamic data example</h4>
<p id="shortdesc">Example of dynamic data.</p>
<div id="docs">
<p>See the <a href="dynamic-data.js" target="_blank">dynamic-data.js source</a> to see how this is done.</p>
</div>
<div id="tags">dynamic-data</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=dynamic-data" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: Dynamic data example
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

@@ -17,7 +17,7 @@ var map = new ol.Map({
source: new ol.source.MapQuest({layer: 'sat'})
})
],
renderer: exampleNS.getRendererFromQueryString(),
renderer: common.getRendererFromQueryString(),
target: 'map',
view: new ol.View({
center: [0, 0],

View File

@@ -0,0 +1,19 @@
#map {
position: relative;
}
#info {
position: absolute;
height: 1px;
width: 1px;
z-index: 100;
}
.tooltip.in {
opacity: 1;
filter: alpha(opacity=100);
}
.tooltip.top .tooltip-arrow {
border-top-color: white;
}
.tooltip-inner {
border: 2px solid white;
}

View File

@@ -1,75 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>Earthquake Clusters</title>
<style>
#map {
position: relative;
}
#info {
position: absolute;
height: 1px;
width: 1px;
z-index: 100;
}
.tooltip.in {
opacity: 1;
filter: alpha(opacity=100);
}
.tooltip.top .tooltip-arrow {
border-top-color: white;
}
.tooltip-inner {
border: 2px solid white;
}
</style>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h4 id="title">Earthquake Clusters</h4>
<p id="shortdesc">Demonstrates the use of style geometries to render source features of a cluster.</p>
<div id="docs">
<p>
This example parses a KML file and renders the features as clusters on a vector layer. The styling in this example is quite involved. Single earthquake locations (rendered as stars) have a size relative to their magnitude. Clusters have an opacity relative to the number of features in the cluster, and a size that represents the extent of the features that make up the cluster. When clicking or hovering on a cluster, the individual features that make up the cluster will be shown.
</p>
<p>To achieve this, we make heavy use of style functions and <code>ol.style.Style#geometry</code>. See the <a href="earthquake-clusters.js" target="_blank">earthquake-clusters.js source</a> to see how this is done.</p>
</div>
<div id="tags">KML, vector, style, geometry, cluster</div>
</div>
</div>
</div>
<script src="../resources/jquery.min.js" type="text/javascript"></script>
<script src="../resources/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
<script src="loader.js?id=earthquake-clusters" type="text/javascript"></script>
</body>
</html>
---
template: example.html
title: Earthquake Clusters
shortdesc: Demonstrates the use of style geometries to render source features of a cluster.
docs: >
<p>This example parses a KML file and renders the features as clusters on a vector layer. The styling in this example is quite involved. Single earthquake locations
(rendered as stars) have a size relative to their magnitude. Clusters have an opacity relative to the number of features in the cluster, and a size that represents
the extent of the features that make up the cluster. When clicking or hovering on a cluster, the individual features that make up the cluster will be shown.</p>
<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>

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