Compare commits
385 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5498f5f7db | ||
|
|
84a3d6bee0 | ||
|
|
47c5e8fef7 | ||
|
|
d6f157a792 | ||
|
|
d88f5a8c2c | ||
|
|
574c570242 | ||
|
|
7584c6d540 | ||
|
|
dc7f367eaa | ||
|
|
12fb632999 | ||
|
|
1fbfd4aced | ||
|
|
0345055cfb | ||
|
|
88cebbf6c1 | ||
|
|
e8bc38b6a9 | ||
|
|
61fcc4a326 | ||
|
|
76e0a37d69 | ||
|
|
de5b16c0d3 | ||
|
|
8fb6b6b6e6 | ||
|
|
4e1ccaafcd | ||
|
|
3ce93a51ed | ||
|
|
e542c622a7 | ||
|
|
e853f1ed2a | ||
|
|
1311f65ece | ||
|
|
92bd1d67a8 | ||
|
|
2c200dcf5f | ||
|
|
b89eb77f20 | ||
|
|
e890b4b1d6 | ||
|
|
bca5fde854 | ||
|
|
dc23683c0c | ||
|
|
24d03bc014 | ||
|
|
8456270316 | ||
|
|
6caf8adc4c | ||
|
|
74bf0dfd72 | ||
|
|
68488eced9 | ||
|
|
910c9d7c4e | ||
|
|
f6b2858348 | ||
|
|
971faf230d | ||
|
|
625273c017 | ||
|
|
1181607f39 | ||
|
|
884e05b90b | ||
|
|
4904b5035e | ||
|
|
5644fe3e2f | ||
|
|
ac805e804b | ||
|
|
ec1ad89338 | ||
|
|
1e6c4472b2 | ||
|
|
9b12cac5c6 | ||
|
|
92583542eb | ||
|
|
7068081c67 | ||
|
|
8e6f74fecd | ||
|
|
7c983058ad | ||
|
|
2e5ecd1efb | ||
|
|
626968f72e | ||
|
|
0925538525 | ||
|
|
c016a497c3 | ||
|
|
0382c34c78 | ||
|
|
324e67fac1 | ||
|
|
8c8246a33f | ||
|
|
ff754a0a9f | ||
|
|
da402b22af | ||
|
|
100c42e671 | ||
|
|
9875df39bf | ||
|
|
978548b085 | ||
|
|
8f57ebd2c6 | ||
|
|
484b684d20 | ||
|
|
cba270efa1 | ||
|
|
4b0e857b93 | ||
|
|
1c8ed12b68 | ||
|
|
fad6d368a6 | ||
|
|
8d68d68c9d | ||
|
|
a80d073da9 | ||
|
|
333ccb6ae4 | ||
|
|
c58d98248a | ||
|
|
fdae2e8e00 | ||
|
|
068c9ceba4 | ||
|
|
b563e9079f | ||
|
|
78082e2833 | ||
|
|
eacc3a52bb | ||
|
|
988b3f8b9b | ||
|
|
761c63585d | ||
|
|
6be7dcf9d2 | ||
|
|
07a413efff | ||
|
|
22084aa960 | ||
|
|
f5eaba4255 | ||
|
|
674e2ab37e | ||
|
|
ed677cec4e | ||
|
|
58d459bca0 | ||
|
|
5a3794752a | ||
|
|
189a7f1759 | ||
|
|
80a6512d55 | ||
|
|
99dcaf3830 | ||
|
|
74450f40be | ||
|
|
f655f6740e | ||
|
|
cd4f2cc2d8 | ||
|
|
ba9e332baa | ||
|
|
a0ab27c182 | ||
|
|
8c4abaf47a | ||
|
|
941fbbedc0 | ||
|
|
df4f2ff28d | ||
|
|
cbf5d0bae0 | ||
|
|
0d686fe88b | ||
|
|
043a8ab1db | ||
|
|
0c4705fb9d | ||
|
|
9094894a41 | ||
|
|
857c9e83ac | ||
|
|
251ff89c70 | ||
|
|
de4728b1b7 | ||
|
|
309b2145cf | ||
|
|
c1c7c8bc11 | ||
|
|
5f18246355 | ||
|
|
f23921367b | ||
|
|
e26a4b36bb | ||
|
|
004afa6b9a | ||
|
|
fe874938c3 | ||
|
|
7cf1e74ae3 | ||
|
|
04649a74cd | ||
|
|
8ac6c85f0f | ||
|
|
321c65b023 | ||
|
|
5cdbd76b1e | ||
|
|
9f8315762a | ||
|
|
869153e7ac | ||
|
|
1bdf480670 | ||
|
|
eab85a2107 | ||
|
|
3f2424c0d8 | ||
|
|
74466a3561 | ||
|
|
09eee4aa43 | ||
|
|
19c5518c96 | ||
|
|
da32e5e367 | ||
|
|
8669dec33b | ||
|
|
72e0ad13b3 | ||
|
|
40c639b194 | ||
|
|
fb8c4820d0 | ||
|
|
eb4b2d4bcc | ||
|
|
5973644c4b | ||
|
|
0e6919462d | ||
|
|
6f4f2f100e | ||
|
|
cad455f635 | ||
|
|
529da77b49 | ||
|
|
4b6e907f69 | ||
|
|
2ce2e5bf27 | ||
|
|
f8bcd725ad | ||
|
|
0ae73632cc | ||
|
|
1fffd0d749 | ||
|
|
f444800fc6 | ||
|
|
3026fda02b | ||
|
|
d8fbc09326 | ||
|
|
27cdbf9c00 | ||
|
|
5083e7a395 | ||
|
|
b92dc1b55d | ||
|
|
0b1e16bf58 | ||
|
|
66854c0669 | ||
|
|
833247d24e | ||
|
|
78af52d62d | ||
|
|
addc23b20e | ||
|
|
1d43ee38e6 | ||
|
|
d27b057969 | ||
|
|
b20a9ac1e9 | ||
|
|
84c50ca6b2 | ||
|
|
22014f2454 | ||
|
|
ae61fcfb34 | ||
|
|
474e5a0a98 | ||
|
|
8bf2ebb38d | ||
|
|
096506ed37 | ||
|
|
90cfde39b3 | ||
|
|
36aeccdac2 | ||
|
|
a88f150c4b | ||
|
|
d4024846cf | ||
|
|
e9056c9d30 | ||
|
|
76605e232a | ||
|
|
9950e97c54 | ||
|
|
b0a654534c | ||
|
|
e87c198eef | ||
|
|
7d5635092a | ||
|
|
49e2e55063 | ||
|
|
c80918c8d8 | ||
|
|
000207016f | ||
|
|
932269c8b6 | ||
|
|
415105c4db | ||
|
|
d812804b2e | ||
|
|
d108658cff | ||
|
|
97ececb470 | ||
|
|
a4504b0e00 | ||
|
|
175727c782 | ||
|
|
589c6b7ded | ||
|
|
e416a884b7 | ||
|
|
2591f61fd3 | ||
|
|
bdced57162 | ||
|
|
f12a407a7d | ||
|
|
752b4c6247 | ||
|
|
d2291360ba | ||
|
|
7ec100f3f8 | ||
|
|
4864306d0c | ||
|
|
1372f98822 | ||
|
|
057f60e4f1 | ||
|
|
f5d82ff7bd | ||
|
|
dfbeba02c8 | ||
|
|
e48fda6bef | ||
|
|
c8c1578928 | ||
|
|
7392db0f57 | ||
|
|
7b8b300b31 | ||
|
|
bb43a45f91 | ||
|
|
e7bc7121d6 | ||
|
|
430aee95fd | ||
|
|
129757578d | ||
|
|
51776ed79e | ||
|
|
640307d8f1 | ||
|
|
6192234e4e | ||
|
|
ef0300b828 | ||
|
|
c5ba4af2a6 | ||
|
|
2ac33073cf | ||
|
|
37a11c89b9 | ||
|
|
b86a12e121 | ||
|
|
9f32e8d566 | ||
|
|
147f091998 | ||
|
|
a183c66704 | ||
|
|
c561f1587b | ||
|
|
ae16b9ed63 | ||
|
|
f61a43b3c6 | ||
|
|
e7ff7786a6 | ||
|
|
c7e743805b | ||
|
|
46908bad18 | ||
|
|
6c56d34330 | ||
|
|
5f9855bf5a | ||
|
|
09d3028ece | ||
|
|
e5ac575eb3 | ||
|
|
f860c94840 | ||
|
|
c6a9bc66d6 | ||
|
|
c30a97ef59 | ||
|
|
fa40b59c53 | ||
|
|
82d172545c | ||
|
|
3d1b1d5ac5 | ||
|
|
3e4ed489a4 | ||
|
|
9a9b22ec5e | ||
|
|
d35537e975 | ||
|
|
302f37ae7a | ||
|
|
151e9866ea | ||
|
|
cfc1337cde | ||
|
|
d08e9e65b4 | ||
|
|
36b50ab491 | ||
|
|
7ced5e68be | ||
|
|
107dd6a85f | ||
|
|
a40717b7c9 | ||
|
|
14c9212992 | ||
|
|
dfa0c00810 | ||
|
|
6c7b395024 | ||
|
|
ac26a2cfcd | ||
|
|
d55e4cd028 | ||
|
|
db2b8666b6 | ||
|
|
f6daa99082 | ||
|
|
7135cec0fd | ||
|
|
86c1513062 | ||
|
|
00c62f4db7 | ||
|
|
860aa9ff46 | ||
|
|
d06b5dc818 | ||
|
|
df6eee5d79 | ||
|
|
ed4401e15e | ||
|
|
cd7bc2e4bf | ||
|
|
d863cff28d | ||
|
|
6c7f50a38e | ||
|
|
1deedd5b7a | ||
|
|
6bb3301b7d | ||
|
|
a3a2e82696 | ||
|
|
c4ea5e60c2 | ||
|
|
956aed7eb4 | ||
|
|
f4b40ab28e | ||
|
|
ae41b83a78 | ||
|
|
9b61e8f44c | ||
|
|
8af5dd7157 | ||
|
|
64e44009e0 | ||
|
|
ed17cbc6f0 | ||
|
|
69fc9edb4d | ||
|
|
9bf524a288 | ||
|
|
98aba50735 | ||
|
|
02c1e78412 | ||
|
|
5afd5c838e | ||
|
|
36281373b7 | ||
|
|
58e4bad459 | ||
|
|
794abed395 | ||
|
|
0586a3d98a | ||
|
|
ae929c1b6d | ||
|
|
7c58794b6f | ||
|
|
f3979d47db | ||
|
|
5448871029 | ||
|
|
ae67419f76 | ||
|
|
3740f05d5b | ||
|
|
2c4060a38d | ||
|
|
e8fed9c21f | ||
|
|
870ddceafd | ||
|
|
46272fbaa4 | ||
|
|
d5691676de | ||
|
|
e962b6f801 | ||
|
|
eddfc04ccc | ||
|
|
651c6959ab | ||
|
|
785639338b | ||
|
|
0fd834b4e1 | ||
|
|
617dca34f5 | ||
|
|
a445d80c03 | ||
|
|
7911ab1d18 | ||
|
|
6e0b406c7b | ||
|
|
935348fdca | ||
|
|
0ea5ded807 | ||
|
|
0a60eced25 | ||
|
|
54357bbc2b | ||
|
|
c11c4e4d17 | ||
|
|
c469241bee | ||
|
|
ca5a858b21 | ||
|
|
bd89d1f227 | ||
|
|
5ce55d39ba | ||
|
|
11e4675337 | ||
|
|
ff8a84a220 | ||
|
|
9e1a3f59e3 | ||
|
|
d1d3e6a37a | ||
|
|
74047e747d | ||
|
|
c316e5f39a | ||
|
|
00a50b3f66 | ||
|
|
e757c014d1 | ||
|
|
1d2e4fed4a | ||
|
|
f9bbaed717 | ||
|
|
cc87a092fd | ||
|
|
fcdeda7f14 | ||
|
|
af29aa7d21 | ||
|
|
db741a1530 | ||
|
|
0b2d183009 | ||
|
|
8b3536fc85 | ||
|
|
f09460b717 | ||
|
|
7df8b2bb2b | ||
|
|
556e443705 | ||
|
|
1fa91717bd | ||
|
|
3972ec42f6 | ||
|
|
21d436e529 | ||
|
|
5457917e75 | ||
|
|
cda8a5a8b7 | ||
|
|
1de3f99123 | ||
|
|
14e3914b7d | ||
|
|
11c8b99602 | ||
|
|
d0801036d2 | ||
|
|
e402d1db30 | ||
|
|
fe16cf9702 | ||
|
|
2972917bb9 | ||
|
|
843a6a4bf4 | ||
|
|
a8d8942fba | ||
|
|
1beddcd99a | ||
|
|
b44685494f | ||
|
|
6e52f61011 | ||
|
|
e4091051a2 | ||
|
|
bb5c1664d0 | ||
|
|
00905e8131 | ||
|
|
d1e4b33760 | ||
|
|
92ab5a079c | ||
|
|
367f0923c5 | ||
|
|
5bb887d3ce | ||
|
|
784c19a9b3 | ||
|
|
3b6f1f99bc | ||
|
|
d93bb74068 | ||
|
|
c7eeec018d | ||
|
|
f3ca9e4bf5 | ||
|
|
5583a09889 | ||
|
|
92f05f40c8 | ||
|
|
70792a1610 | ||
|
|
f57896d848 | ||
|
|
cf9683dc03 | ||
|
|
b9a7fb2421 | ||
|
|
854b20a8fd | ||
|
|
389ae13cea | ||
|
|
f16e40742c | ||
|
|
710c95c5cd | ||
|
|
bed95e3b5b | ||
|
|
1fecb6fd16 | ||
|
|
c393d43005 | ||
|
|
edfbbc4b40 | ||
|
|
fcc854bcea | ||
|
|
d35e978c35 | ||
|
|
7128e86e3c | ||
|
|
2037e725b3 | ||
|
|
5d00edfc1d | ||
|
|
cb7c15c767 | ||
|
|
fe6fe702b2 | ||
|
|
4b97612900 | ||
|
|
3f7d884d4f | ||
|
|
0d0f2d454b | ||
|
|
4b2884f10f | ||
|
|
7ed96f69f7 | ||
|
|
3118df320b | ||
|
|
e0d75555c5 | ||
|
|
a44cc1a3a6 | ||
|
|
50e314adbd | ||
|
|
9e7a2ae17a |
@@ -77,7 +77,7 @@ Then, just point your browser <http://localhost:3000/build/examples> in your bro
|
|||||||
Run examples against the `ol.js` standalone build:
|
Run examples against the `ol.js` standalone build:
|
||||||
|
|
||||||
The examples can also be run against the `ol.js` standalone build, just like
|
The examples can also be run against the `ol.js` standalone build, just like
|
||||||
the examples [hosted](http://openlayers.org/en/master/examples/) on GitHub.
|
the examples [hosted](https://openlayers.org/en/master/examples/) on GitHub.
|
||||||
Start by executing the `host-examples` build target:
|
Start by executing the `host-examples` build target:
|
||||||
|
|
||||||
$ make host-examples
|
$ make host-examples
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
[](https://coveralls.io/r/openlayers/ol3?branch=master)
|
[](https://coveralls.io/r/openlayers/ol3?branch=master)
|
||||||
[](http://osgeo.org/)
|
[](http://osgeo.org/)
|
||||||
|
|
||||||
[OpenLayers 3](http://openlayers.org/) is a high-performance, feature-packed library for creating interactive maps on the web. It can display map tiles, vector data and markers loaded from any source on any web page. OpenLayers has been developed to further the use of geographic information of all kinds. It is completely free, Open Source JavaScript, released under the 2-clause BSD License (also known as the FreeBSD).
|
[OpenLayers 3](https://openlayers.org/) is a high-performance, feature-packed library for creating interactive maps on the web. It can display map tiles, vector data and markers loaded from any source on any web page. OpenLayers has been developed to further the use of geographic information of all kinds. It is completely free, Open Source JavaScript, released under the 2-clause BSD License (also known as the FreeBSD).
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
- Download the [latest release](http://openlayers.org/download/)
|
- Download the [latest release](https://openlayers.org/download/)
|
||||||
- Install with npm: `npm install openlayers`
|
- Install with npm: `npm install openlayers`
|
||||||
- Clone the repo: `git clone git@github.com:openlayers/ol3.git`
|
- Clone the repo: `git clone git@github.com:openlayers/ol3.git`
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ OpenLayers runs on all modern browsers that support [HTML5](https://html.spec.wh
|
|||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Check out the [hosted examples](http://openlayers.org/en/latest/examples/), the [workshop](http://openlayers.org/workshop/) or the [API documentation](http://openlayers.org/en/latest/apidoc/).
|
Check out the [hosted examples](https://openlayers.org/en/latest/examples/), the [workshop](https://openlayers.org/workshop/) or the [API documentation](https://openlayers.org/en/latest/apidoc/).
|
||||||
|
|
||||||
## Bugs
|
## Bugs
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,78 @@
|
|||||||
## Upgrade notes
|
## Upgrade notes
|
||||||
|
|
||||||
|
### v3.19.0
|
||||||
|
|
||||||
|
#### `ol.style.Fill` with `CanvasGradient` or `CanvasPattern`
|
||||||
|
|
||||||
|
Previously, gradients and patterns were aligned with the canvas, so they did not
|
||||||
|
move and rotate with the map. This was changed to a more expected behavior by anchoring the fill to the map origin (usually at map coordinate `[0, 0]`).
|
||||||
|
|
||||||
|
#### `goog.DEBUG` define was renamed to `ol.DEBUG`
|
||||||
|
|
||||||
|
As last step in the removal of the dependency on Google Closure Library, the `goog.DEBUG` compiler define was renamed to `ol.DEBUG`. Please change accordingly in your custom build configuration json files.
|
||||||
|
|
||||||
|
#### `ol.format.ogc.filter` namespace was renamed to `ol.format.filter`
|
||||||
|
|
||||||
|
`ol.format.ogc.filter` was simplified to `ol.format.filter`; to upgrade your code, simply remove the `ogc` string from the name.
|
||||||
|
For example: `ol.format.ogc.filter.and` to `ol.format.filter.and`.
|
||||||
|
|
||||||
|
#### Changes only relevant to those who compile their applications together with the Closure Compiler
|
||||||
|
|
||||||
|
A number of internal types have been renamed. This will not affect those who use the API provided by the library, but if you are compiling your application together with OpenLayers and using type names, you'll need to do the following:
|
||||||
|
|
||||||
|
* rename `ol.CollectionProperty` to `ol.Collection.Property`
|
||||||
|
* rename `ol.DeviceOrientationProperty` to `ol.DeviceOrientation.Property`
|
||||||
|
* rename `ol.DragBoxEvent` to `ol.interaction.DragBox.Event`
|
||||||
|
* rename `ol.DragBoxEventType` to `ol.interaction.DragBox.EventType`
|
||||||
|
* rename `ol.GeolocationProperty` to `ol.Geolocation.Property`
|
||||||
|
* rename `ol.OverlayPositioning` to `ol.Overlay.Positioning`
|
||||||
|
* rename `ol.OverlayProperty` to `ol.Overlay.Property`
|
||||||
|
* rename `ol.control.MousePositionProperty` to `ol.control.MousePosition.Property`
|
||||||
|
* rename `ol.format.IGCZ` to `ol.format.IGC.Z`
|
||||||
|
* rename `ol.interaction.InteractionProperty` to `ol.interaction.Interaction.Property`
|
||||||
|
* rename `ol.interaction.DrawMode` to `ol.interaction.Draw.Mode`
|
||||||
|
* rename `ol.interaction.DrawEvent` to `ol.interaction.Draw.Event`
|
||||||
|
* rename `ol.interaction.DrawEventType` to `ol.interaction.Draw.EventType`
|
||||||
|
* rename `ol.interaction.ExtentEvent` to `ol.interaction.Extent.Event`
|
||||||
|
* rename `ol.interaction.ExtentEventType` to `ol.interaction.Extent.EventType`
|
||||||
|
* rename `ol.interaction.DragAndDropEvent` to `ol.interaction.DragAndDrop.Event`
|
||||||
|
* rename `ol.interaction.DragAndDropEventType` to `ol.interaction.DragAndDrop.EventType`
|
||||||
|
* rename `ol.interaction.ModifyEvent` to `ol.interaction.Modify.Event`
|
||||||
|
* rename `ol.interaction.SelectEvent` to `ol.interaction.Select.Event`
|
||||||
|
* rename `ol.interaction.SelectEventType` to `ol.interaction.Select.EventType`
|
||||||
|
* rename `ol.interaction.TranslateEvent` to `ol.interaction.Translate.Event`
|
||||||
|
* rename `ol.interaction.TranslateEventType` to `ol.interaction.Translate.EventType`
|
||||||
|
* rename `ol.layer.GroupProperty` to `ol.layer.Group.Property`
|
||||||
|
* rename `ol.layer.HeatmapLayerProperty` to `ol.layer.Heatmap.Property`
|
||||||
|
* rename `ol.layer.TileProperty` to `ol.layer.Tile.Property`
|
||||||
|
* rename `ol.layer.VectorTileRenderType` to `ol.layer.VectorTile.RenderType`
|
||||||
|
* rename `ol.MapEventType` to `ol.MapEvent.Type`
|
||||||
|
* rename `ol.MapProperty` to `ol.Map.Property`
|
||||||
|
* rename `ol.ModifyEventType` to `ol.interaction.Modify.EventType`
|
||||||
|
* rename `ol.RendererType` to `ol.renderer.Type`
|
||||||
|
* rename `ol.render.EventType` to `ol.render.Event.Type`
|
||||||
|
* rename `ol.source.ImageEvent` to `ol.source.Image.Event`
|
||||||
|
* rename `ol.source.ImageEventType` to `ol.source.Image.EventType`
|
||||||
|
* rename `ol.source.RasterEvent` to `ol.source.Raster.Event`
|
||||||
|
* rename `ol.source.RasterEventType` to `ol.source.Raster.EventType`
|
||||||
|
* rename `ol.source.TileEvent` to `ol.source.Tile.Event`
|
||||||
|
* rename `ol.source.TileEventType` to `ol.source.Tile.EventType`
|
||||||
|
* rename `ol.source.VectorEvent` to `ol.source.Vector.Event`
|
||||||
|
* rename `ol.source.VectorEventType` to `ol.source.Vector.EventType`
|
||||||
|
* rename `ol.source.wms.ServerType` to `ol.source.WMSServerType`
|
||||||
|
* rename `ol.source.WMTSRequestEncoding` to `ol.source.WMTS.RequestEncoding`
|
||||||
|
* rename `ol.style.IconAnchorUnits` to `ol.style.Icon.AnchorUnits`
|
||||||
|
* rename `ol.style.IconOrigin` to `ol.style.Icon.Origin`
|
||||||
|
|
||||||
### v3.18.0
|
### v3.18.0
|
||||||
|
|
||||||
|
#### Removal of the DOM renderer
|
||||||
|
|
||||||
|
The DOM renderer has been removed. Instead, the Canvas renderer should be used. If you were previously constructing a map with `'dom'` as the `renderer` option, you will see an error message in the console in debug mode and the Canvas renderer will be used instead. To remove the warning, remove the `renderer` option from your map constructor.
|
||||||
|
|
||||||
#### Changes in the way assertions are handled
|
#### Changes in the way assertions are handled
|
||||||
|
|
||||||
Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on http://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks in debug mode when the `goog.DEBUG` compiler flag is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.'
|
Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on https://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks in debug mode when the `goog.DEBUG` compiler flag is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.'
|
||||||
|
|
||||||
#### Removal of `ol.ENABLE_NAMED_COLORS`
|
#### Removal of `ol.ENABLE_NAMED_COLORS`
|
||||||
|
|
||||||
@@ -113,7 +181,7 @@ var v3source = new ol.source.TileUTFGrid({
|
|||||||
|
|
||||||
#### Internet Explorer 9 support
|
#### Internet Explorer 9 support
|
||||||
|
|
||||||
As of this release, OpenLayers requires a `classList` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features#Element_prototype_classList.
|
As of this release, OpenLayers requires a `classList` polyfill for IE 9 support. See https://cdn.polyfill.io/v2/docs/features#Element_prototype_classList.
|
||||||
|
|
||||||
#### Immediate rendering API
|
#### Immediate rendering API
|
||||||
|
|
||||||
@@ -162,7 +230,7 @@ The default cache size is `2048`.
|
|||||||
|
|
||||||
#### Internet Explorer 9 support
|
#### Internet Explorer 9 support
|
||||||
|
|
||||||
As of this release, OpenLayers requires a `requestAnimationFrame`/`cancelAnimationFrame` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features/#requestAnimationFrame.
|
As of this release, OpenLayers requires a `requestAnimationFrame`/`cancelAnimationFrame` polyfill for IE 9 support. See https://cdn.polyfill.io/v2/docs/features/#requestAnimationFrame.
|
||||||
|
|
||||||
#### Layer pre-/postcompose event changes
|
#### Layer pre-/postcompose event changes
|
||||||
|
|
||||||
@@ -480,7 +548,7 @@ now specify an `extent` instead of `widths`. These settings are used to restrict
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
See http://openlayers.org/en/master/examples/vector-layer.html for a real example.
|
See https://openlayers.org/en/master/examples/vector-layer.html for a real example.
|
||||||
|
|
||||||
Note that you no longer need to set a `projection` on the source!
|
Note that you no longer need to set a `projection` on the source!
|
||||||
|
|
||||||
@@ -502,7 +570,7 @@ now specify an `extent` instead of `widths`. These settings are used to restrict
|
|||||||
|
|
||||||
The above code uses jQuery to send an Ajax request, but you can obviously use any Ajax library.
|
The above code uses jQuery to send an Ajax request, but you can obviously use any Ajax library.
|
||||||
|
|
||||||
See http://openlayers.org/en/master/examples/igc.html for a real example.
|
See https://openlayers.org/en/master/examples/igc.html for a real example.
|
||||||
|
|
||||||
* Note about KML
|
* Note about KML
|
||||||
|
|
||||||
@@ -560,9 +628,9 @@ now specify an `extent` instead of `widths`. These settings are used to restrict
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
See http://openlayers.org/en/master/examples/vector-osm.html for a real example.
|
See https://openlayers.org/en/master/examples/vector-osm.html for a real example.
|
||||||
|
|
||||||
* The experimental `ol.loadingstrategy.createTile` function has been renamed to `ol.loadingstrategy.tile`. The signature of the function hasn't changed. See http://openlayers.org/en/master/examples/vector-osm.html for an example.
|
* The experimental `ol.loadingstrategy.createTile` function has been renamed to `ol.loadingstrategy.tile`. The signature of the function hasn't changed. See https://openlayers.org/en/master/examples/vector-osm.html for an example.
|
||||||
|
|
||||||
#### Change to `ol.style.Icon`
|
#### Change to `ol.style.Icon`
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ The v3.14.0 release includes features and fixes from 93 pull requests since the
|
|||||||
|
|
||||||
#### Internet Explorer 9 support
|
#### Internet Explorer 9 support
|
||||||
|
|
||||||
As of this release, OpenLayers requires a `requestAnimationFrame`/`cancelAnimationFrame` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features/#requestAnimationFrame.
|
As of this release, OpenLayers requires a `requestAnimationFrame`/`cancelAnimationFrame` polyfill for IE 9 support. See https://cdn.polyfill.io/v2/docs/features/#requestAnimationFrame.
|
||||||
|
|
||||||
#### Layer pre-/postcompose event changes
|
#### Layer pre-/postcompose event changes
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ The v3.15.0 release includes features and fixes from 136 pull requests since the
|
|||||||
|
|
||||||
#### Internet Explorer 9 support
|
#### Internet Explorer 9 support
|
||||||
|
|
||||||
As of this release, OpenLayers requires a `classList` polyfill for IE 9 support. See http://cdn.polyfill.io/v2/docs/features#Element_prototype_classList.
|
As of this release, OpenLayers requires a `classList` polyfill for IE 9 support. See https://cdn.polyfill.io/v2/docs/features#Element_prototype_classList.
|
||||||
|
|
||||||
#### Immediate rendering API
|
#### Immediate rendering API
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ The v3.18.0 release includes features and fixes from almost 120 pull requests si
|
|||||||
|
|
||||||
#### Changes in the way assertions are handled
|
#### Changes in the way assertions are handled
|
||||||
|
|
||||||
Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on http://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks in debug mode when the `goog.DEBUG` compiler flag is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.'
|
Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on https://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks in debug mode when the `goog.DEBUG` compiler flag is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.'
|
||||||
|
|
||||||
#### Removal of `ol.ENABLE_NAMED_COLORS`
|
#### Removal of `ol.ENABLE_NAMED_COLORS`
|
||||||
|
|
||||||
|
|||||||
203
changelog/v3.19.0.md
Normal file
203
changelog/v3.19.0.md
Normal file
@@ -0,0 +1,203 @@
|
|||||||
|
# v3.19.0
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
The v3.19.0 release includes features and fixes from a little more than 120 pull requests with more than 380 commits. Most of the changes are bug fixes, documentation enhancements or target the continuing removal of the dependency on Closure Library. Some notable new or enhanced features are:
|
||||||
|
|
||||||
|
* Vector fills with `CanvasGradient` or `CanvasPattern` now move and rotate with the map which is far more intuitive ([#5950](https://github.com/openlayers/ol3/pull/5950))
|
||||||
|
* Drawing in `freehand`-mode also became more intuitive ([#5970](https://github.com/openlayers/ol3/pull/5970), [#5973](https://github.com/openlayers/ol3/pull/5973), [#5975](https://github.com/openlayers/ol3/pull/5975))
|
||||||
|
* When tiles of different resolutions are combined for a layer (which is the case before all tiles of the best resolution have been loaded), lower resolution tiles now align with higher resolution tiles resulting in a map without gaps ([#5890](https://github.com/openlayers/ol3/pull/5890))
|
||||||
|
* Styles can now easily be cloned ([#5832](https://github.com/openlayers/ol3/pull/5832))
|
||||||
|
|
||||||
|
Additionally the [openlayers.org](https://openlayers.org) homepage is now available via the `https`-protocol.
|
||||||
|
|
||||||
|
## Upgrade notes
|
||||||
|
|
||||||
|
#### `ol.style.Fill` with `CanvasGradient` or `CanvasPattern`
|
||||||
|
|
||||||
|
Previously, gradients and patterns were aligned with the canvas, so they did not
|
||||||
|
move and rotate with the map. This was changed to a more expected behavior by anchoring the fill to the map origin (usually at map coordinate `[0, 0]`).
|
||||||
|
|
||||||
|
#### `goog.DEBUG` define was renamed to `ol.DEBUG`
|
||||||
|
|
||||||
|
As last step in the removal of the dependency on Google Closure Library, the `goog.DEBUG` compiler define was renamed to `ol.DEBUG`. Please change accordingly in your custom build configuration json files.
|
||||||
|
|
||||||
|
#### `ol.format.ogc.filter` namespace was renamed to `ol.format.filter`
|
||||||
|
|
||||||
|
`ol.format.ogc.filter` was simplified to `ol.format.filter`; to upgrade your code, simply remove the `ogc` string from the name.
|
||||||
|
For example: `ol.format.ogc.filter.and` to `ol.format.filter.and`.
|
||||||
|
|
||||||
|
#### Changes only relevant to those who compile their applications together with the Closure Compiler
|
||||||
|
|
||||||
|
A number of internal types have been renamed. This will not affect those who use the API provided by the library, but if you are compiling your application together with OpenLayers and using type names, you'll need to do the following:
|
||||||
|
|
||||||
|
* rename `ol.CollectionProperty` to `ol.Collection.Property`
|
||||||
|
* rename `ol.DeviceOrientationProperty` to `ol.DeviceOrientation.Property`
|
||||||
|
* rename `ol.DragBoxEvent` to `ol.interaction.DragBox.Event`
|
||||||
|
* rename `ol.DragBoxEventType` to `ol.interaction.DragBox.EventType`
|
||||||
|
* rename `ol.GeolocationProperty` to `ol.Geolocation.Property`
|
||||||
|
* rename `ol.OverlayPositioning` to `ol.Overlay.Positioning`
|
||||||
|
* rename `ol.OverlayProperty` to `ol.Overlay.Property`
|
||||||
|
* rename `ol.control.MousePositionProperty` to `ol.control.MousePosition.Property`
|
||||||
|
* rename `ol.format.IGCZ` to `ol.format.IGC.Z`
|
||||||
|
* rename `ol.interaction.InteractionProperty` to `ol.interaction.Interaction.Property`
|
||||||
|
* rename `ol.interaction.DrawMode` to `ol.interaction.Draw.Mode`
|
||||||
|
* rename `ol.interaction.DrawEvent` to `ol.interaction.Draw.Event`
|
||||||
|
* rename `ol.interaction.DrawEventType` to `ol.interaction.Draw.EventType`
|
||||||
|
* rename `ol.interaction.ExtentEvent` to `ol.interaction.Extent.Event`
|
||||||
|
* rename `ol.interaction.ExtentEventType` to `ol.interaction.Extent.EventType`
|
||||||
|
* rename `ol.interaction.DragAndDropEvent` to `ol.interaction.DragAndDrop.Event`
|
||||||
|
* rename `ol.interaction.DragAndDropEventType` to `ol.interaction.DragAndDrop.EventType`
|
||||||
|
* rename `ol.interaction.ModifyEvent` to `ol.interaction.Modify.Event`
|
||||||
|
* rename `ol.interaction.SelectEvent` to `ol.interaction.Select.Event`
|
||||||
|
* rename `ol.interaction.SelectEventType` to `ol.interaction.Select.EventType`
|
||||||
|
* rename `ol.interaction.TranslateEvent` to `ol.interaction.Translate.Event`
|
||||||
|
* rename `ol.interaction.TranslateEventType` to `ol.interaction.Translate.EventType`
|
||||||
|
* rename `ol.layer.GroupProperty` to `ol.layer.Group.Property`
|
||||||
|
* rename `ol.layer.HeatmapLayerProperty` to `ol.layer.Heatmap.Property`
|
||||||
|
* rename `ol.layer.TileProperty` to `ol.layer.Tile.Property`
|
||||||
|
* rename `ol.layer.VectorTileRenderType` to `ol.layer.VectorTile.RenderType`
|
||||||
|
* rename `ol.MapEventType` to `ol.MapEvent.Type`
|
||||||
|
* rename `ol.MapProperty` to `ol.Map.Property`
|
||||||
|
* rename `ol.ModifyEventType` to `ol.interaction.Modify.EventType`
|
||||||
|
* rename `ol.RendererType` to `ol.renderer.Type`
|
||||||
|
* rename `ol.render.EventType` to `ol.render.Event.Type`
|
||||||
|
* rename `ol.source.ImageEvent` to `ol.source.Image.Event`
|
||||||
|
* rename `ol.source.ImageEventType` to `ol.source.Image.EventType`
|
||||||
|
* rename `ol.source.RasterEvent` to `ol.source.Raster.Event`
|
||||||
|
* rename `ol.source.RasterEventType` to `ol.source.Raster.EventType`
|
||||||
|
* rename `ol.source.TileEvent` to `ol.source.Tile.Event`
|
||||||
|
* rename `ol.source.TileEventType` to `ol.source.Tile.EventType`
|
||||||
|
* rename `ol.source.VectorEvent` to `ol.source.Vector.Event`
|
||||||
|
* rename `ol.source.VectorEventType` to `ol.source.Vector.EventType`
|
||||||
|
* rename `ol.source.wms.ServerType` to `ol.source.WMSServerType`
|
||||||
|
* rename `ol.source.WMTSRequestEncoding` to `ol.source.WMTS.RequestEncoding`
|
||||||
|
* rename `ol.style.IconAnchorUnits` to `ol.style.Icon.AnchorUnits`
|
||||||
|
* rename `ol.style.IconOrigin` to `ol.style.Icon.Origin`
|
||||||
|
|
||||||
|
## Full list of changes
|
||||||
|
|
||||||
|
* [#6007](https://github.com/openlayers/ol3/pull/6007) - Add note to example that canvas.toBlob() is required ([@marcjansen](https://github.com/marcjansen))
|
||||||
|
* [#5979](https://github.com/openlayers/ol3/pull/5979) - Use FileSaver.js in export-map example ([@fredj](https://github.com/fredj))
|
||||||
|
* [#6004](https://github.com/openlayers/ol3/pull/6004) - Bring back the vector-osm example, using a different service ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#6002](https://github.com/openlayers/ol3/pull/6002) - Use tile pixel ratio for gutter calculation ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5991](https://github.com/openlayers/ol3/pull/5991) - Only test ol.format.MVT if ArrayBuffer.isView is supported ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#6000](https://github.com/openlayers/ol3/pull/6000) - Fix mockup of tile layer to keep drawImage arguments in range ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5997](https://github.com/openlayers/ol3/pull/5997) - Always load a gated URL polyfill when testing ([@marcjansen](https://github.com/marcjansen))
|
||||||
|
* [#5963](https://github.com/openlayers/ol3/pull/5963) - Remove the vertex on ol.interaction.Modify deactivation ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5994](https://github.com/openlayers/ol3/pull/5994) - Setup a loaded image with src for TileLayer test ([@marcjansen](https://github.com/marcjansen))
|
||||||
|
* [#5989](https://github.com/openlayers/ol3/pull/5989) - Remove vector-osm example ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5985](https://github.com/openlayers/ol3/pull/5985) - Update Mapzen urls to new scheme ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5984](https://github.com/openlayers/ol3/pull/5984) - Less examples with mixed content ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5986](https://github.com/openlayers/ol3/pull/5986) - Update eslint to version 3.8.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5982](https://github.com/openlayers/ol3/pull/5982) - Use a https enabled GeoServer ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5977](https://github.com/openlayers/ol3/pull/5977) - Convenience function for drawing boxes ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#5978](https://github.com/openlayers/ol3/pull/5978) - Update async to version 2.1.2 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5975](https://github.com/openlayers/ol3/pull/5975) - Finish drawing on pointerup when in freehand mode ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#5976](https://github.com/openlayers/ol3/pull/5976) - Use https where available ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#5973](https://github.com/openlayers/ol3/pull/5973) - Add a freehand option to the draw interaction ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#5964](https://github.com/openlayers/ol3/pull/5964) - Set one-off transform instead of transforming back and forth ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5970](https://github.com/openlayers/ol3/pull/5970) - Allow circles, squares, and boxes to be drawn in freehand mode ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#5972](https://github.com/openlayers/ol3/pull/5972) - Update eslint to version 3.8.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5969](https://github.com/openlayers/ol3/pull/5969) - Test all, not just one ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5967](https://github.com/openlayers/ol3/pull/5967) - Add missing jsdoc to ol.render.canvas.Replay#fill_ function ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5962](https://github.com/openlayers/ol3/pull/5962) - Use same proj4js version in examples and tests ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5961](https://github.com/openlayers/ol3/pull/5961) - Remove unused error codes ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5960](https://github.com/openlayers/ol3/pull/5960) - More renaming to have one provide per file ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5959](https://github.com/openlayers/ol3/pull/5959) - Remove unnecessary and misleading assertion ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5950](https://github.com/openlayers/ol3/pull/5950) - Move gradient and pattern fills with the view ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5957](https://github.com/openlayers/ol3/pull/5957) - Update async to version 2.1.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5956](https://github.com/openlayers/ol3/pull/5956) - Update async to version 2.1.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5955](https://github.com/openlayers/ol3/pull/5955) - Add getters to BingMaps source for api key and imagerySet ([@bartvde](https://github.com/bartvde))
|
||||||
|
* [#5944](https://github.com/openlayers/ol3/pull/5944) - Allow readFeature and readFeatures to be called with GeoJSON geometries ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#5949](https://github.com/openlayers/ol3/pull/5949) - Add prose documentation for ol.AttributionLike ([@marcjansen](https://github.com/marcjansen))
|
||||||
|
* [#5948](https://github.com/openlayers/ol3/pull/5948) - Fix API docs of ol.Feature#getStyle ([@marcjansen](https://github.com/marcjansen))
|
||||||
|
* [#5946](https://github.com/openlayers/ol3/pull/5946) - Update mocha to version 3.1.2 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5941](https://github.com/openlayers/ol3/pull/5941) - Update mocha to version 3.1.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5890](https://github.com/openlayers/ol3/pull/5890) - No gaps between tiles of different resolutions ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5935](https://github.com/openlayers/ol3/pull/5935) - Keep transformed coordinates within valid y range ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#5937](https://github.com/openlayers/ol3/pull/5937) - One provide per file for vector tiles ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5933](https://github.com/openlayers/ol3/pull/5933) - Update phantomjs-prebuilt to version 2.1.13 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5932](https://github.com/openlayers/ol3/pull/5932) - Update eslint to version 3.7.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5931](https://github.com/openlayers/ol3/pull/5931) - Update jsdoc to version 3.4.2 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5923](https://github.com/openlayers/ol3/pull/5923) - Update pbf to version 3.0.2 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5926](https://github.com/openlayers/ol3/pull/5926) - Ensure correct type of event.element ([@adube](https://github.com/adube))
|
||||||
|
* [#5928](https://github.com/openlayers/ol3/pull/5928) - Update eslint to version 3.7.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5919](https://github.com/openlayers/ol3/pull/5919) - Update resemblejs to version 2.2.2 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5909](https://github.com/openlayers/ol3/pull/5909) - Update jquery to version 3.1.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5917](https://github.com/openlayers/ol3/pull/5917) - Accept feature projection in GeoJSON constructor ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#5918](https://github.com/openlayers/ol3/pull/5918) - Update mocha to version 3.1.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5916](https://github.com/openlayers/ol3/pull/5916) - Update eslint to version 3.6.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5914](https://github.com/openlayers/ol3/pull/5914) - Allow clipping by MultiPolygon ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#5894](https://github.com/openlayers/ol3/pull/5894) - Reuse arrays for rendered tiles and extent ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5895](https://github.com/openlayers/ol3/pull/5895) - Always use the frameState's extent ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5911](https://github.com/openlayers/ol3/pull/5911) - Update eslint to version 3.6.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5903](https://github.com/openlayers/ol3/pull/5903) - Rename ol.format.ogc.filter namespace to ol.format.filter ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5913](https://github.com/openlayers/ol3/pull/5913) - Update clean-css to version 3.4.20 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5776](https://github.com/openlayers/ol3/pull/5776) - Add ol.style.Circle#setRadius ([@jonataswalker](https://github.com/jonataswalker))
|
||||||
|
* [#5905](https://github.com/openlayers/ol3/pull/5905) - Update pbf to version 3.0.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5904](https://github.com/openlayers/ol3/pull/5904) - Fix changelog/upgrade-notes.md formating ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5906](https://github.com/openlayers/ol3/pull/5906) - Update glob to version 7.1.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5898](https://github.com/openlayers/ol3/pull/5898) - Update sinon to version 1.17.6 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5888](https://github.com/openlayers/ol3/pull/5888) - Remove unused functions ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5900](https://github.com/openlayers/ol3/pull/5900) - Update coveralls to version 2.11.14 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5897](https://github.com/openlayers/ol3/pull/5897) - Show NEXRAD data in WMS Time example ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5896](https://github.com/openlayers/ol3/pull/5896) - Remove plain string from Map renderer option ([@probins](https://github.com/probins))
|
||||||
|
* [#5893](https://github.com/openlayers/ol3/pull/5893) - Fix fillStyle or strokeStyle defined assertion ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5892](https://github.com/openlayers/ol3/pull/5892) - Remove getRendererFromQueryString from examples ([@probins](https://github.com/probins))
|
||||||
|
* [#5889](https://github.com/openlayers/ol3/pull/5889) - Update coveralls to version 2.11.13 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5886](https://github.com/openlayers/ol3/pull/5886) - Remove unused functions ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5885](https://github.com/openlayers/ol3/pull/5885) - Remove unused pruneTileRange function ([@bartvde](https://github.com/bartvde))
|
||||||
|
* [#5853](https://github.com/openlayers/ol3/pull/5853) - Allow more than one digit range in ol.TileUrlFunction.expandUrl ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5445](https://github.com/openlayers/ol3/pull/5445) - Select interaction default styling function can now handle geometry less features ([@fblackburn](https://github.com/fblackburn))
|
||||||
|
* [#5884](https://github.com/openlayers/ol3/pull/5884) - Fix jsdoc tag indentation ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5863](https://github.com/openlayers/ol3/pull/5863) - Allow CanvasPattern or CanvasGradient as stroke style ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5838](https://github.com/openlayers/ol3/pull/5838) - Require ol where ol.DEBUG is being used ([@marcjansen](https://github.com/marcjansen))
|
||||||
|
* [#5878](https://github.com/openlayers/ol3/pull/5878) - Smarter handling of closed rings and closePath() instructions ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5880](https://github.com/openlayers/ol3/pull/5880) - More work towards one provide per file ([@marcjansen](https://github.com/marcjansen))
|
||||||
|
* [#5857](https://github.com/openlayers/ol3/pull/5857) - Fixed issue with multi option of ol.interaction.Select ([@KlausBenndorf](https://github.com/KlausBenndorf))
|
||||||
|
* [#5876](https://github.com/openlayers/ol3/pull/5876) - Use clone method in kml format ([@KlausBenndorf](https://github.com/KlausBenndorf))
|
||||||
|
* [#5832](https://github.com/openlayers/ol3/pull/5832) - Add clone methods to styles ([@KlausBenndorf](https://github.com/KlausBenndorf))
|
||||||
|
* [#5869](https://github.com/openlayers/ol3/pull/5869) - Update jsdoc to version 3.4.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5872](https://github.com/openlayers/ol3/pull/5872) - Keep ol.Color as Array<number> ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#5870](https://github.com/openlayers/ol3/pull/5870) - Update eslint to version 3.5.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5867](https://github.com/openlayers/ol3/pull/5867) - Add dedicated example using CanvasPattern and CanvasGradient for styling vectors ([@marcjansen](https://github.com/marcjansen))
|
||||||
|
* [#5864](https://github.com/openlayers/ol3/pull/5864) - More renaming ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5861](https://github.com/openlayers/ol3/pull/5861) - More renaming to have one provide per file ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5860](https://github.com/openlayers/ol3/pull/5860) - Rename ol.MapProperty and ol.interaction.DragAndDropEvent* ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5855](https://github.com/openlayers/ol3/pull/5855) - Rename ol.DragBoxEvent* to ol.interaction.DragBox.Event* ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5859](https://github.com/openlayers/ol3/pull/5859) - Rename ol.RendererType to ol.renderer.Type ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5846](https://github.com/openlayers/ol3/pull/5846) - Remove unused goog.require('ol') ([@probins](https://github.com/probins))
|
||||||
|
* [#5854](https://github.com/openlayers/ol3/pull/5854) - Use a canvas pattern in the vector-layer example ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5852](https://github.com/openlayers/ol3/pull/5852) - ol.interaction.extent cleanup ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5851](https://github.com/openlayers/ol3/pull/5851) - Remove unused imageByContext_ in ol.ImageTile ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5849](https://github.com/openlayers/ol3/pull/5849) - Remove 'global' from externs/closure-compiler.js ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5837](https://github.com/openlayers/ol3/pull/5837) - Remove ol.global ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#5842](https://github.com/openlayers/ol3/pull/5842) - Remove extra provide causing a circular dependency ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5795](https://github.com/openlayers/ol3/pull/5795) - Render older loaded tiles while waiting for new tiles ([@thomasmoelhave](https://github.com/thomasmoelhave))
|
||||||
|
* [#5840](https://github.com/openlayers/ol3/pull/5840) - Rename source.wms.ServerType ➛ source.WMSServerType ([@marcjansen](https://github.com/marcjansen))
|
||||||
|
* [#5839](https://github.com/openlayers/ol3/pull/5839) - Rename source.VectorEvent(*) to source.Vector.Event(*) ([@marcjansen](https://github.com/marcjansen))
|
||||||
|
* [#5835](https://github.com/openlayers/ol3/pull/5835) - document and test ol.getUid sequence behavior ([@thomasmoelhave](https://github.com/thomasmoelhave))
|
||||||
|
* [#5834](https://github.com/openlayers/ol3/pull/5834) - Rename goog.DEBUG to ol.DEBUG ([@thomasmoelhave](https://github.com/thomasmoelhave))
|
||||||
|
* [#5815](https://github.com/openlayers/ol3/pull/5815) - Remove the DOM renderer ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#5828](https://github.com/openlayers/ol3/pull/5828) - Always close polygon rings ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5794](https://github.com/openlayers/ol3/pull/5794) - Fix more missing requires ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5820](https://github.com/openlayers/ol3/pull/5820) - Change ol.format.Format to ol.format.Feature in format/readme.md ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5819](https://github.com/openlayers/ol3/pull/5819) - Add ArrayBuffer.isView method in externs/closure-compiler.js ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5793](https://github.com/openlayers/ol3/pull/5793) - Closure bye bye ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5809](https://github.com/openlayers/ol3/pull/5809) - Reuse ol.LayerState object ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5811](https://github.com/openlayers/ol3/pull/5811) - Use ol.global.getComputedStyle instead of window.getComputedStyle ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5810](https://github.com/openlayers/ol3/pull/5810) - ESLint rule typo ([@gberaudo](https://github.com/gberaudo))
|
||||||
|
* [#5807](https://github.com/openlayers/ol3/pull/5807) - Update pbf to version 3.0.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5806](https://github.com/openlayers/ol3/pull/5806) - Fix olx.style.TextOptions.rotateWithView option in externs ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5770](https://github.com/openlayers/ol3/pull/5770) - Update ol.source.Vector comments ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5803](https://github.com/openlayers/ol3/pull/5803) - V3.18.1 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5801](https://github.com/openlayers/ol3/pull/5801) - Remove ol.style.ImageState and use ol.ImageState instead ([@fredj](https://github.com/fredj))
|
||||||
|
* [#5790](https://github.com/openlayers/ol3/pull/5790) - Fix vector tile rotation on HiDPI devices ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5798](https://github.com/openlayers/ol3/pull/5798) - Move to 90° along the circle, not 0° ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#5800](https://github.com/openlayers/ol3/pull/5800) - Wrap values in <Literal> for InBetween filter ([@tsauerwein](https://github.com/tsauerwein))
|
||||||
|
* [#5769](https://github.com/openlayers/ol3/pull/5769) - Only call addToDrawing if sketchFeature ([@bartvde](https://github.com/bartvde))
|
||||||
|
* [#5745](https://github.com/openlayers/ol3/pull/5745) - removed dependencies on goog.object.clone and fixed placemark rendering ([@tamarmot](https://github.com/tamarmot))
|
||||||
|
* [#5290](https://github.com/openlayers/ol3/pull/5290) - Add extent interaction ([@tbarsballe](https://github.com/tbarsballe))
|
||||||
|
* [#5786](https://github.com/openlayers/ol3/pull/5786) - Update eslint to version 3.4.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#5785](https://github.com/openlayers/ol3/pull/5785) - Release v3.18.0 ([@openlayers](https://github.com/openlayers))
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
The 3.1.0 release includes 70 merged pull requests since 3.1.0. Of note, the KML format [now parses `NetworkingLink` tags](https://github.com/openlayers/ol3/pull/3171). The [measure example](http://openlayers.org/en/v3.2.0/examples/measure.html) was [reworked](https://github.com/openlayers/ol3/pull/3206) to display measurements and help messages while drawing. A WMTS GetCapabilities format was [added](https://github.com/openlayers/ol3/pull/3026). The WebGL renderer [now supports feature hit detection](https://github.com/openlayers/ol3/pull/3065) (on point features). And you can now [detect](https://github.com/openlayers/ol3/pull/3172) features/colored pixels on image and tile layers! See the full list of [changes](#changes) below.
|
The 3.1.0 release includes 70 merged pull requests since 3.1.0. Of note, the KML format [now parses `NetworkingLink` tags](https://github.com/openlayers/ol3/pull/3171). The [measure example](https://openlayers.org/en/v3.2.0/examples/measure.html) was [reworked](https://github.com/openlayers/ol3/pull/3206) to display measurements and help messages while drawing. A WMTS GetCapabilities format was [added](https://github.com/openlayers/ol3/pull/3026). The WebGL renderer [now supports feature hit detection](https://github.com/openlayers/ol3/pull/3065) (on point features). And you can now [detect](https://github.com/openlayers/ol3/pull/3172) features/colored pixels on image and tile layers! See the full list of [changes](#changes) below.
|
||||||
|
|
||||||
## Upgrade notes
|
## Upgrade notes
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ The 3.5.0 release includes features and fixes from a whopping 129 pull requests
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
See http://openlayers.org/en/master/examples/vector-layer.html for a real example.
|
See https://openlayers.org/en/master/examples/vector-layer.html for a real example.
|
||||||
|
|
||||||
Note that you no longer need to set a `projection` on the source!
|
Note that you no longer need to set a `projection` on the source!
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ The 3.5.0 release includes features and fixes from a whopping 129 pull requests
|
|||||||
|
|
||||||
The above code uses jQuery to send an Ajax request, but you can obviously use any Ajax library.
|
The above code uses jQuery to send an Ajax request, but you can obviously use any Ajax library.
|
||||||
|
|
||||||
See http://openlayers.org/en/master/examples/igc.html for a real example.
|
See https://openlayers.org/en/master/examples/igc.html for a real example.
|
||||||
|
|
||||||
* Note about KML
|
* Note about KML
|
||||||
|
|
||||||
@@ -133,9 +133,9 @@ The 3.5.0 release includes features and fixes from a whopping 129 pull requests
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
See http://openlayers.org/en/master/examples/vector-osm.html for a real example.
|
See https://openlayers.org/en/master/examples/vector-osm.html for a real example.
|
||||||
|
|
||||||
* The experimental `ol.loadingstrategy.createTile` function has been renamed to `ol.loadingstrategy.tile`. The signature of the function hasn't changed. See http://openlayers.org/en/master/examples/vector-osm.html for an example.
|
* The experimental `ol.loadingstrategy.createTile` function has been renamed to `ol.loadingstrategy.tile`. The signature of the function hasn't changed. See https://openlayers.org/en/master/examples/vector-osm.html for an example.
|
||||||
|
|
||||||
### Change to `ol.style.Icon`
|
### Change to `ol.style.Icon`
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.DEBUG=false"
|
"ol.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
"*"
|
"*"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.DEBUG=false"
|
"ol.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
"*"
|
"*"
|
||||||
|
|||||||
@@ -66,16 +66,16 @@
|
|||||||
<textarea class="hidden" name="css">{{ css.source }}</textarea>
|
<textarea class="hidden" name="css">{{ css.source }}</textarea>
|
||||||
<textarea class="hidden" name="html">{{ contents }}</textarea>
|
<textarea class="hidden" name="html">{{ contents }}</textarea>
|
||||||
<input type="hidden" name="wrap" value="l">
|
<input type="hidden" name="wrap" value="l">
|
||||||
<input type="hidden" name="resources" value="http://openlayers.org/en/v{{ olVersion }}/css/ol.css,http://openlayers.org/en/v{{ olVersion }}/build/ol.js{{ extraResources }}">
|
<input type="hidden" name="resources" value="https://openlayers.org/en/v{{ olVersion }}/css/ol.css,https://openlayers.org/en/v{{ olVersion }}/build/ol.js{{ extraResources }}">
|
||||||
</form>
|
</form>
|
||||||
<pre><code id="example-source" class="language-markup"><!DOCTYPE html>
|
<pre><code id="example-source" class="language-markup"><!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
<link rel="stylesheet" href="http://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css">
|
<link rel="stylesheet" href="https://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css">
|
||||||
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
|
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
|
||||||
<script src="http://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
|
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
|
||||||
<script src="http://openlayers.org/en/v{{ olVersion }}/build/ol.js"></script>{{#if extraHead.remote}}
|
<script src="https://openlayers.org/en/v{{ olVersion }}/build/ol.js"></script>{{#if extraHead.remote}}
|
||||||
{{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}}
|
{{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}}
|
||||||
<style>
|
<style>
|
||||||
{{ indent css.source spaces=6 }} </style>{{/if}}
|
{{ indent css.source spaces=6 }} </style>{{/if}}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.DEBUG=false"
|
"ol.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
"*"
|
"*"
|
||||||
|
|||||||
@@ -137,10 +137,6 @@ Invalid `units`. `'degrees'`, `'imperial'`, `'nautical'`, `'metric'` or `'us'` r
|
|||||||
|
|
||||||
Invalid geometry layout. Must be `XY`, `XYZ`, `XYM` or `XYZM`.
|
Invalid geometry layout. Must be `XY`, `XYZ`, `XYM` or `XYZM`.
|
||||||
|
|
||||||
### 35
|
|
||||||
|
|
||||||
Unknown GeoJSON object type. Expected `"Feature"` or `"FeatureCollection"`.
|
|
||||||
|
|
||||||
### 36
|
### 36
|
||||||
|
|
||||||
Unknown SRS type. Expected `"name"` or `"EPSG"`.
|
Unknown SRS type. Expected `"name"` or `"EPSG"`.
|
||||||
@@ -165,10 +161,6 @@ Expected `feature` to have a geometry.
|
|||||||
|
|
||||||
Expected an `ol.style.Style` or an array of `ol.style.Style`.
|
Expected an `ol.style.Style` or an array of `ol.style.Style`.
|
||||||
|
|
||||||
### 42
|
|
||||||
|
|
||||||
Expected an `ol.Feature`, but got an `ol.RenderFeature`.
|
|
||||||
|
|
||||||
### 43
|
### 43
|
||||||
|
|
||||||
Expected `layers` to be an array or an `ol.Collection`.
|
Expected `layers` to be an array or an `ol.Collection`.
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ var map = new ol.Map({
|
|||||||
var swissProjection = new ol.proj.Projection({
|
var swissProjection = new ol.proj.Projection({
|
||||||
code: 'EPSG:21781',
|
code: 'EPSG:21781',
|
||||||
// The extent is used to determine zoom level 0. Recommended values for a
|
// The extent is used to determine zoom level 0. Recommended values for a
|
||||||
// projection's validity extent can be found at http://epsg.io/.
|
// projection's validity extent can be found at https://epsg.io/.
|
||||||
extent: [485869.5728, 76443.1884, 837076.5648, 299941.7864],
|
extent: [485869.5728, 76443.1884, 837076.5648, 299941.7864],
|
||||||
units: 'm'
|
units: 'm'
|
||||||
});
|
});
|
||||||
@@ -94,7 +94,7 @@ var map = new ol.Map({
|
|||||||
```
|
```
|
||||||
|
|
||||||
We recommend to lookup parameters of your projection (like the validity extent)
|
We recommend to lookup parameters of your projection (like the validity extent)
|
||||||
over at [epsg.io](http://epsg.io/).
|
over at [epsg.io](https://epsg.io/).
|
||||||
|
|
||||||
|
|
||||||
## Why is my map centered on the gulf of guinea (or africa, the ocean, null-island)?
|
## Why is my map centered on the gulf of guinea (or africa, the ocean, null-island)?
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ Below you'll find a complete working example. Create a new file, copy in the co
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="http://openlayers.org/en/{{ latest }}/css/ol.css" type="text/css">
|
<link rel="stylesheet" href="https://openlayers.org/en/{{ latest }}/css/ol.css" type="text/css">
|
||||||
<style>
|
<style>
|
||||||
.map {
|
.map {
|
||||||
height: 400px;
|
height: 400px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script src="http://openlayers.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
|
<script src="https://openlayers.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
|
||||||
<title>OpenLayers 3 example</title>
|
<title>OpenLayers 3 example</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -55,7 +55,7 @@ To include a map a web page you will need 3 things:
|
|||||||
### Include OpenLayers
|
### Include OpenLayers
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<script src="http://openlayers.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
|
<script src="https://openlayers.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
The first part is to include the JavaScript library. For the purpose of this tutorial, here we simply point to the openlayers.org website to get the whole library. In a production environment, we would build a custom version of the library including only the module needed for our application.
|
The first part is to include the JavaScript library. For the purpose of this tutorial, here we simply point to the openlayers.org website to get the whole library. In a production environment, we would build a custom version of the library including only the module needed for our application.
|
||||||
@@ -63,7 +63,7 @@ The first part is to include the JavaScript library. For the purpose of this tut
|
|||||||
**Optional:** If the application is intended to run on old platforms like Internet Explorer or Android 4.x, another script needs to be included before OpenLayers:
|
**Optional:** If the application is intended to run on old platforms like Internet Explorer or Android 4.x, another script needs to be included before OpenLayers:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<script src="http://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList"></script>
|
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -169,8 +169,7 @@ The minimum config file looks like this:
|
|||||||
"node_modules/openlayers/externs/topojson.js"
|
"node_modules/openlayers/externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.DEBUG=false",
|
"ol.DEBUG=false",
|
||||||
"ol.ENABLE_DOM=false",
|
|
||||||
"ol.ENABLE_WEBGL=false"
|
"ol.ENABLE_WEBGL=false"
|
||||||
],
|
],
|
||||||
"js": [
|
"js": [
|
||||||
@@ -221,8 +220,7 @@ Here is a version of `config.json` with more compilation checks enabled:
|
|||||||
"node_modules/openlayers/externs/topojson.js"
|
"node_modules/openlayers/externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.DEBUG=false",
|
"ol.DEBUG=false",
|
||||||
"ol.ENABLE_DOM=false",
|
|
||||||
"ol.ENABLE_WEBGL=false"
|
"ol.ENABLE_WEBGL=false"
|
||||||
],
|
],
|
||||||
"js": [
|
"js": [
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ Creating a custom build requires writing a build configuration file. The format
|
|||||||
"externs/topojson.js"
|
"externs/topojson.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.DEBUG=false"
|
"ol.DEBUG=false"
|
||||||
],
|
],
|
||||||
"extra_annotation_name": [
|
"extra_annotation_name": [
|
||||||
"api", "observable"
|
"api", "observable"
|
||||||
@@ -95,7 +95,7 @@ var map = new ol.Map({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that this JavaScript code corresponds to OpenLayers 3's [`simple`](http://openlayers.org/en/master/examples/simple.html) example.
|
Note that this JavaScript code corresponds to OpenLayers 3's [`simple`](https://openlayers.org/en/master/examples/simple.html) example.
|
||||||
|
|
||||||
You are now ready to create your first OpenLayers 3 build. Use the following command to create the build:
|
You are now ready to create your first OpenLayers 3 build. Use the following command to create the build:
|
||||||
|
|
||||||
@@ -156,7 +156,6 @@ Setting some of these to `false` means that the portions of the code relating to
|
|||||||
|
|
||||||
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:
|
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_WEBGL=false",
|
||||||
"ol.ENABLE_PROJ4JS=false",
|
"ol.ENABLE_PROJ4JS=false",
|
||||||
"ol.ENABLE_IMAGE=false",
|
"ol.ENABLE_IMAGE=false",
|
||||||
@@ -181,7 +180,7 @@ Note that `build.js` currently requires you to enter an output file and will wri
|
|||||||
|
|
||||||
## A more complicated example
|
## A more complicated example
|
||||||
|
|
||||||
Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openlayers.org/en/master/examples/heatmap-earthquakes.html). The build configuration file looks like this:
|
Now let's try a more complicated example: [`heatmaps-earthquakes`](https://openlayers.org/en/master/examples/heatmap-earthquakes.html). The build configuration file looks like this:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
@@ -191,7 +190,7 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openla
|
|||||||
"ol.format.KML",
|
"ol.format.KML",
|
||||||
"ol.layer.Heatmap#getSource",
|
"ol.layer.Heatmap#getSource",
|
||||||
"ol.source.Vector#on",
|
"ol.source.Vector#on",
|
||||||
"ol.source.VectorEvent#feature",
|
"ol.source.Vector.Event#feature",
|
||||||
"ol.Feature#get",
|
"ol.Feature#get",
|
||||||
"ol.Feature#set",
|
"ol.Feature#set",
|
||||||
"ol.layer.Tile",
|
"ol.layer.Tile",
|
||||||
@@ -207,11 +206,10 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openla
|
|||||||
"externs/oli.js"
|
"externs/oli.js"
|
||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"ol.ENABLE_DOM=false",
|
|
||||||
"ol.ENABLE_WEBGL=false",
|
"ol.ENABLE_WEBGL=false",
|
||||||
"ol.ENABLE_PROJ4JS=false",
|
"ol.ENABLE_PROJ4JS=false",
|
||||||
"ol.ENABLE_IMAGE=false",
|
"ol.ENABLE_IMAGE=false",
|
||||||
"goog.DEBUG=false"
|
"ol.DEBUG=false"
|
||||||
],
|
],
|
||||||
"compilation_level": "ADVANCED",
|
"compilation_level": "ADVANCED",
|
||||||
"manage_closure_dependencies": true
|
"manage_closure_dependencies": true
|
||||||
@@ -219,7 +217,7 @@ Now let's try a more complicated example: [`heatmaps-earthquakes`](http://openla
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
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.Vector.Event` 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.
|
As this example uses a vector layer it is necessary to remove `"ol.ENABLE_VECTOR=false"` in the `define` section of the configuration.
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Transformation of the map projections of the image happens directly in a web bro
|
|||||||
The view in any Proj4js supported coordinate reference system is possible and previously incompatible layers can now be combined and overlaid.
|
The view in any Proj4js supported coordinate reference system is possible and previously incompatible layers can now be combined and overlaid.
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
The API usage is very simple. Just specify proper projection (using [EPSG](http://epsg.io) code) on `ol.View`:
|
The API usage is very simple. Just specify proper projection (using [EPSG](https://epsg.io) code) on `ol.View`:
|
||||||
``` javascript
|
``` javascript
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
target: 'map',
|
target: 'map',
|
||||||
@@ -35,14 +35,14 @@ var map = new ol.Map({
|
|||||||
If a source (based on `ol.source.TileImage` or `ol.source.Image`) has a projection different from the current `ol.View`’s projection then the reprojection happens automatically under the hood.
|
If a source (based on `ol.source.TileImage` or `ol.source.Image`) has a projection different from the current `ol.View`’s projection then the reprojection happens automatically under the hood.
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
- [Raster reprojection demo](http://openlayers.org/en/master/examples/reprojection.html)
|
- [Raster reprojection demo](https://openlayers.org/en/master/examples/reprojection.html)
|
||||||
- [OpenStreetMap to WGS84 reprojection](http://openlayers.org/en/master/examples/reprojection-wgs84.html)
|
- [OpenStreetMap to WGS84 reprojection](https://openlayers.org/en/master/examples/reprojection-wgs84.html)
|
||||||
- [Reprojection with EPSG.io database search](http://openlayers.org/en/master/examples/reprojection-by-code.html)
|
- [Reprojection with EPSG.io database search](https://openlayers.org/en/master/examples/reprojection-by-code.html)
|
||||||
- [Image reprojection](http://openlayers.org/en/master/examples/reprojection-image.html)
|
- [Image reprojection](https://openlayers.org/en/master/examples/reprojection-image.html)
|
||||||
|
|
||||||
### Custom projection
|
### Custom projection
|
||||||
The easiest way to use a custom projection is to add the [Proj4js](http://proj4js.org/) library to your project and then define the projection using a proj4 definition string.
|
The easiest way to use a custom projection is to add the [Proj4js](http://proj4js.org/) library to your project and then define the projection using a proj4 definition string.
|
||||||
Following example shows definition of a [British National Grid](http://epsg.io/27700):
|
Following example shows definition of a [British National Grid](https://epsg.io/27700):
|
||||||
|
|
||||||
``` html
|
``` html
|
||||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js"></script>
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js"></script>
|
||||||
@@ -122,7 +122,7 @@ Although this is mathematically correct behavior of the inverse transformation,
|
|||||||
A possible general solution would be to calculate the forward transformation for every vertex as well - but this would significantly decrease performance (especially for computationally expensive transformations).
|
A possible general solution would be to calculate the forward transformation for every vertex as well - but this would significantly decrease performance (especially for computationally expensive transformations).
|
||||||
|
|
||||||
Therefore a recommended workaround is to define a proper visibility extent on the `ol.layer.Tile` in the view projection.
|
Therefore a recommended workaround is to define a proper visibility extent on the `ol.layer.Tile` in the view projection.
|
||||||
Setting such a limit is demonstrated in the [reprojection demo example](http://openlayers.org/en/master/examples/reprojection.html).
|
Setting such a limit is demonstrated in the [reprojection demo example](https://openlayers.org/en/master/examples/reprojection.html).
|
||||||
|
|
||||||
### Resolution calculation
|
### Resolution calculation
|
||||||
When determining source tiles to load, the ideal source resolution needs to be calculated.
|
When determining source tiles to load, the ideal source resolution needs to be calculated.
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"d3": false,
|
"d3": false,
|
||||||
"jsPDF": false,
|
"jsPDF": false,
|
||||||
"jsts": false,
|
"jsts": false,
|
||||||
|
"saveAs": false,
|
||||||
"topojson": false,
|
"topojson": false,
|
||||||
"turf": false
|
"turf": false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
// Improve user experience by loading tiles while animating. Will make
|
// Improve user experience by loading tiles while animating. Will make
|
||||||
// animations stutter on mobile or slow devices.
|
// animations stutter on mobile or slow devices.
|
||||||
loadTilesWhileAnimating: true,
|
loadTilesWhileAnimating: true,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ goog.require('ol.layer.Image');
|
|||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
goog.require('ol.source.ImageArcGISRest');
|
goog.require('ol.source.ImageArcGISRest');
|
||||||
|
|
||||||
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
var url = 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
||||||
'Specialty/ESRI_StateCityHighway_USA/MapServer';
|
'Specialty/ESRI_StateCityHighway_USA/MapServer';
|
||||||
|
|
||||||
var layers = [
|
var layers = [
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ goog.require('ol.layer.Tile');
|
|||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
goog.require('ol.source.TileArcGISRest');
|
goog.require('ol.source.TileArcGISRest');
|
||||||
|
|
||||||
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
var url = 'https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
||||||
'Specialty/ESRI_StateCityHighway_USA/MapServer';
|
'Specialty/ESRI_StateCityHighway_USA/MapServer';
|
||||||
|
|
||||||
var layers = [
|
var layers = [
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
],
|
],
|
||||||
controls: ol.control.defaults({attribution: false}).extend([attribution]),
|
controls: ol.control.defaults({attribution: false}).extend([attribution]),
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ for (i = 0, ii = styles.length; i < ii; ++i) {
|
|||||||
}
|
}
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: layers,
|
layers: layers,
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
// Improve user experience by loading tiles while dragging/zooming. Will make
|
// Improve user experience by loading tiles while dragging/zooming. Will make
|
||||||
// zooming choppy on mobile or slow devices.
|
// zooming choppy on mobile or slow devices.
|
||||||
loadTilesWhileInteracting: true,
|
loadTilesWhileInteracting: true,
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ var map = new ol.Map({
|
|||||||
source: vectorSource
|
source: vectorSource
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: 'canvas',
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [-8730000, 5930000],
|
center: [-8730000, 5930000],
|
||||||
|
|||||||
5
examples/canvas-gradient-pattern.css
Normal file
5
examples/canvas-gradient-pattern.css
Normal file
File diff suppressed because one or more lines are too long
12
examples/canvas-gradient-pattern.html
Normal file
12
examples/canvas-gradient-pattern.html
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
layout: example.html
|
||||||
|
title: Styling feature with CanvasGradient or CanvasPattern
|
||||||
|
shortdesc: Example showing the countries vector layer styled with patterns and gradients.
|
||||||
|
docs: >
|
||||||
|
First this example creates a reusable [`CanvasPattern`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern)
|
||||||
|
and a [`CanvasGradient`](https://developer.mozilla.org/en/docs/Web/API/CanvasGradient). The countries are loaded from
|
||||||
|
a GeoJSON file. A style function determines for each country whether to use a fill with the pregenerated
|
||||||
|
CanvasGradient (rainbow colors) or a CanvasPattern (repeating stacked circles).
|
||||||
|
tags: "canvas, gradient, pattern, style"
|
||||||
|
---
|
||||||
|
<div id="map" class="map"></div>
|
||||||
101
examples/canvas-gradient-pattern.js
Normal file
101
examples/canvas-gradient-pattern.js
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.View');
|
||||||
|
goog.require('ol.format.GeoJSON');
|
||||||
|
goog.require('ol.has');
|
||||||
|
goog.require('ol.layer.Vector');
|
||||||
|
goog.require('ol.proj');
|
||||||
|
goog.require('ol.source.Vector');
|
||||||
|
goog.require('ol.style.Fill');
|
||||||
|
goog.require('ol.style.Stroke');
|
||||||
|
goog.require('ol.style.Style');
|
||||||
|
|
||||||
|
var canvas = document.createElement('canvas');
|
||||||
|
var context = canvas.getContext('2d');
|
||||||
|
|
||||||
|
// Gradient and pattern are in canvas pixel space, so we adjust for the
|
||||||
|
// renderer's pixel ratio
|
||||||
|
var pixelRatio = ol.has.DEVICE_PIXEL_RATIO;
|
||||||
|
|
||||||
|
// Generate a rainbow gradient
|
||||||
|
function gradient(feature, resolution) {
|
||||||
|
var extent = feature.getGeometry().getExtent();
|
||||||
|
// Gradient starts on the left edge of each feature, and ends on the right.
|
||||||
|
// Coordinate origin is [0, 0], so we just divide by resolution and multiply
|
||||||
|
// with pixelRatio to match the renderer's pixel coordinate system.
|
||||||
|
var grad = context.createLinearGradient(
|
||||||
|
extent[0] / resolution * pixelRatio, 0,
|
||||||
|
extent[2] / resolution * pixelRatio, 0);
|
||||||
|
grad.addColorStop(0, 'red');
|
||||||
|
grad.addColorStop(1 / 6, 'orange');
|
||||||
|
grad.addColorStop(2 / 6, 'yellow');
|
||||||
|
grad.addColorStop(3 / 6, 'green');
|
||||||
|
grad.addColorStop(4 / 6, 'aqua');
|
||||||
|
grad.addColorStop(5 / 6, 'blue');
|
||||||
|
grad.addColorStop(1, 'purple');
|
||||||
|
return grad;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate a canvasPattern with two circles on white background
|
||||||
|
var pattern = (function() {
|
||||||
|
canvas.width = 11 * pixelRatio;
|
||||||
|
canvas.height = 11 * pixelRatio;
|
||||||
|
// white background
|
||||||
|
context.fillStyle = 'white';
|
||||||
|
context.fillRect(0, 0, canvas.width, canvas.height);
|
||||||
|
// outer circle
|
||||||
|
context.fillStyle = 'rgba(102, 0, 102, 0.5)';
|
||||||
|
context.beginPath();
|
||||||
|
context.arc(5 * pixelRatio, 5 * pixelRatio, 4 * pixelRatio, 0, 2 * Math.PI);
|
||||||
|
context.fill();
|
||||||
|
// inner circle
|
||||||
|
context.fillStyle = 'rgb(55, 0, 170)';
|
||||||
|
context.beginPath();
|
||||||
|
context.arc(5 * pixelRatio, 5 * pixelRatio, 2 * pixelRatio, 0, 2 * Math.PI);
|
||||||
|
context.fill();
|
||||||
|
return context.createPattern(canvas, 'repeat');
|
||||||
|
}());
|
||||||
|
|
||||||
|
// Generate style for gradient or pattern fill
|
||||||
|
var fill = new ol.style.Fill();
|
||||||
|
var style = new ol.style.Style({
|
||||||
|
fill: fill,
|
||||||
|
stroke: new ol.style.Stroke({
|
||||||
|
color: '#333',
|
||||||
|
width: 2
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The styling function for the vector layer, will return an array of styles
|
||||||
|
* which either contains the aboove gradient or pattern.
|
||||||
|
*
|
||||||
|
* @param {ol.Feature} feature The feature to style.
|
||||||
|
* @param {number} resolution Resolution.
|
||||||
|
* @return {ol.style.Style} The style to use for the feature.
|
||||||
|
*/
|
||||||
|
var getStackedStyle = function(feature, resolution) {
|
||||||
|
var id = feature.getId();
|
||||||
|
fill.setColor(id > 'J' ? gradient(feature, resolution) : pattern);
|
||||||
|
return style;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create a vector layer that makes use of the style function above…
|
||||||
|
var vectorLayer = new ol.layer.Vector({
|
||||||
|
source: new ol.source.Vector({
|
||||||
|
url: 'data/geojson/countries.geojson',
|
||||||
|
format: new ol.format.GeoJSON()
|
||||||
|
}),
|
||||||
|
style: getStackedStyle
|
||||||
|
});
|
||||||
|
|
||||||
|
// … finally create a map with that layer.
|
||||||
|
var map = new ol.Map({
|
||||||
|
layers: [
|
||||||
|
vectorLayer
|
||||||
|
],
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View({
|
||||||
|
center: ol.proj.fromLonLat([7, 52]),
|
||||||
|
zoom: 3
|
||||||
|
})
|
||||||
|
});
|
||||||
@@ -20,7 +20,6 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ var raster = new ol.layer.Tile({
|
|||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [raster, clusters],
|
layers: [raster, clusters],
|
||||||
renderer: 'canvas',
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ goog.require('ol.layer.Tile');
|
|||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
|
|
||||||
var logoElement = document.createElement('a');
|
var logoElement = document.createElement('a');
|
||||||
logoElement.href = 'http://www.osgeo.org/';
|
logoElement.href = 'https://www.osgeo.org/';
|
||||||
logoElement.target = '_blank';
|
logoElement.target = '_blank';
|
||||||
|
|
||||||
var logoImage = document.createElement('img');
|
var logoImage = document.createElement('img');
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
<Document>
|
<Document>
|
||||||
<name>Skimap.org OpenSkiMap </name>
|
<name>Skimap.org OpenSkiMap </name>
|
||||||
<description>Created from OpenStreetMap data. Renderer v0.5</description>
|
<description>Created from OpenStreetMap data. Renderer v0.5</description>
|
||||||
<!--
|
<!--
|
||||||
Copyright (c) OpenStreetMap Contributors
|
Copyright (c) OpenStreetMap Contributors
|
||||||
http://www.openstreetmap.org/
|
https://www.openstreetmap.org/
|
||||||
|
|
||||||
This work is licensed under the
|
This work is licensed under the
|
||||||
Creative Commons Attribution-ShareAlike 2.0 License.
|
Creative Commons Attribution-ShareAlike 2.0 License.
|
||||||
@@ -13,7 +13,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
|
|||||||
<ScreenOverlay id="CopyrightNotice">
|
<ScreenOverlay id="CopyrightNotice">
|
||||||
<name>Copyright Notice</name>
|
<name>Copyright Notice</name>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[The data in this KML file is Copyright <a href="http://www.openstreetmap.org/">OpenStreetMap</a> Contributors. It is available under the <a href="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons Attribution-ShareAlike (CC-BY-SA) Version 2.0 License</a>.]]>
|
<![CDATA[The data in this KML file is Copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> Contributors. It is available under the <a href="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons Attribution-ShareAlike (CC-BY-SA) Version 2.0 License</a>.]]>
|
||||||
</description>
|
</description>
|
||||||
<Snippet>Copyright (c) OpenStreetMap Contributors. CC-BY-SA 2.0 License.</Snippet>
|
<Snippet>Copyright (c) OpenStreetMap Contributors. CC-BY-SA 2.0 License.</Snippet>
|
||||||
<Icon>
|
<Icon>
|
||||||
@@ -32,7 +32,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
|
|||||||
<IconStyle>
|
<IconStyle>
|
||||||
<scale>0.2</scale>
|
<scale>0.2</scale>
|
||||||
<Icon>
|
<Icon>
|
||||||
<href>http://maps.google.com/mapfiles/kml/shapes/parking_lot.png</href>
|
<href>https://maps.google.com/mapfiles/kml/shapes/parking_lot.png</href>
|
||||||
</Icon>
|
</Icon>
|
||||||
</IconStyle>
|
</IconStyle>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -140,7 +140,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
|
|||||||
<IconStyle>
|
<IconStyle>
|
||||||
<scale>0.7</scale>
|
<scale>0.7</scale>
|
||||||
<Icon>
|
<Icon>
|
||||||
<href>http://maps.google.com/mapfiles/kml/pal2/icon21.png</href>
|
<href>https://maps.google.com/mapfiles/kml/pal2/icon21.png</href>
|
||||||
</Icon>
|
</Icon>
|
||||||
</IconStyle>
|
</IconStyle>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -170,7 +170,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
|
|||||||
<IconStyle>
|
<IconStyle>
|
||||||
<scale>0.7</scale>
|
<scale>0.7</scale>
|
||||||
<Icon>
|
<Icon>
|
||||||
<href>http://maps.google.com/mapfiles/kml/pal2/icon30.png</href>
|
<href>https://maps.google.com/mapfiles/kml/pal2/icon30.png</href>
|
||||||
</Icon>
|
</Icon>
|
||||||
</IconStyle>
|
</IconStyle>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -188,7 +188,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
|
|||||||
<IconStyle>
|
<IconStyle>
|
||||||
<scale>0.7</scale>
|
<scale>0.7</scale>
|
||||||
<Icon>
|
<Icon>
|
||||||
<href>http://maps.google.com/mapfiles/kml/pal2/icon28.png</href>
|
<href>https://maps.google.com/mapfiles/kml/pal2/icon28.png</href>
|
||||||
</Icon>
|
</Icon>
|
||||||
</IconStyle>
|
</IconStyle>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -325,7 +325,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
|
|||||||
<IconStyle>
|
<IconStyle>
|
||||||
<scale>0.7</scale>
|
<scale>0.7</scale>
|
||||||
<Icon>
|
<Icon>
|
||||||
<href>http://maps.google.com/mapfiles/kml/pal2/icon40.png</href>
|
<href>https://maps.google.com/mapfiles/kml/pal2/icon40.png</href>
|
||||||
</Icon>
|
</Icon>
|
||||||
</IconStyle>
|
</IconStyle>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -548,7 +548,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
|
|||||||
<IconStyle>
|
<IconStyle>
|
||||||
<scale>0.7</scale>
|
<scale>0.7</scale>
|
||||||
<Icon>
|
<Icon>
|
||||||
<href>http://maps.google.com/mapfiles/kml/pal3/icon38.png</href>
|
<href>https://maps.google.com/mapfiles/kml/pal3/icon38.png</href>
|
||||||
</Icon>
|
</Icon>
|
||||||
</IconStyle>
|
</IconStyle>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -559,7 +559,7 @@ http://creativecommons.org/licenses/by-sa/2.0/
|
|||||||
<IconStyle>
|
<IconStyle>
|
||||||
<scale>0.7</scale>
|
<scale>0.7</scale>
|
||||||
<Icon>
|
<Icon>
|
||||||
<href>http://maps.google.com/mapfiles/kml/pal3/icon38.png</href>
|
<href>https://maps.google.com/mapfiles/kml/pal3/icon38.png</href>
|
||||||
</Icon>
|
</Icon>
|
||||||
</IconStyle>
|
</IconStyle>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -5,11 +5,8 @@ shortdesc: Example of using the ol.interaction.Draw interaction.
|
|||||||
docs: >
|
docs: >
|
||||||
Example of using the Draw interaction. Select a geometry type from the
|
Example of using the Draw interaction. Select a geometry type from the
|
||||||
dropdown above to start drawing. To finish drawing, click the last
|
dropdown above to start drawing. To finish drawing, click the last
|
||||||
point. To activate freehand drawing for lines and polygons, hold the `Shift`
|
point. To activate freehand drawing for lines, polygons, and circles, hold
|
||||||
key. Square drawing is achieved by using Circle mode with a `geometryFunction`
|
the `Shift` key.
|
||||||
that creates a 4-sided regular polygon instead of a circle. Box drawing uses a
|
|
||||||
custom `geometryFunction` that takes start and end point of a line with 2
|
|
||||||
points and creates a rectangular box.
|
|
||||||
tags: "draw, edit, freehand, vector"
|
tags: "draw, edit, freehand, vector"
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
@@ -20,8 +17,6 @@ tags: "draw, edit, freehand, vector"
|
|||||||
<option value="LineString">LineString</option>
|
<option value="LineString">LineString</option>
|
||||||
<option value="Polygon">Polygon</option>
|
<option value="Polygon">Polygon</option>
|
||||||
<option value="Circle">Circle</option>
|
<option value="Circle">Circle</option>
|
||||||
<option value="Square">Square</option>
|
|
||||||
<option value="Box">Box</option>
|
|
||||||
<option value="None">None</option>
|
<option value="None">None</option>
|
||||||
</select>
|
</select>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,15 +1,10 @@
|
|||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.geom.Polygon');
|
|
||||||
goog.require('ol.interaction.Draw');
|
goog.require('ol.interaction.Draw');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.layer.Vector');
|
goog.require('ol.layer.Vector');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
goog.require('ol.source.Vector');
|
goog.require('ol.source.Vector');
|
||||||
goog.require('ol.style.Circle');
|
|
||||||
goog.require('ol.style.Fill');
|
|
||||||
goog.require('ol.style.Stroke');
|
|
||||||
goog.require('ol.style.Style');
|
|
||||||
|
|
||||||
var raster = new ol.layer.Tile({
|
var raster = new ol.layer.Tile({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
@@ -18,27 +13,11 @@ var raster = new ol.layer.Tile({
|
|||||||
var source = new ol.source.Vector({wrapX: false});
|
var source = new ol.source.Vector({wrapX: false});
|
||||||
|
|
||||||
var vector = new ol.layer.Vector({
|
var vector = new ol.layer.Vector({
|
||||||
source: source,
|
source: source
|
||||||
style: new ol.style.Style({
|
|
||||||
fill: new ol.style.Fill({
|
|
||||||
color: 'rgba(255, 255, 255, 0.2)'
|
|
||||||
}),
|
|
||||||
stroke: new ol.style.Stroke({
|
|
||||||
color: '#ffcc33',
|
|
||||||
width: 2
|
|
||||||
}),
|
|
||||||
image: new ol.style.Circle({
|
|
||||||
radius: 7,
|
|
||||||
fill: new ol.style.Fill({
|
|
||||||
color: '#ffcc33'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [raster, vector],
|
layers: [raster, vector],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [-11000000, 4600000],
|
center: [-11000000, 4600000],
|
||||||
@@ -52,30 +31,9 @@ var draw; // global so we can remove it later
|
|||||||
function addInteraction() {
|
function addInteraction() {
|
||||||
var value = typeSelect.value;
|
var value = typeSelect.value;
|
||||||
if (value !== 'None') {
|
if (value !== 'None') {
|
||||||
var geometryFunction, maxPoints;
|
|
||||||
if (value === 'Square') {
|
|
||||||
value = 'Circle';
|
|
||||||
geometryFunction = ol.interaction.Draw.createRegularPolygon(4);
|
|
||||||
} else if (value === 'Box') {
|
|
||||||
value = 'LineString';
|
|
||||||
maxPoints = 2;
|
|
||||||
geometryFunction = function(coordinates, geometry) {
|
|
||||||
if (!geometry) {
|
|
||||||
geometry = new ol.geom.Polygon(null);
|
|
||||||
}
|
|
||||||
var start = coordinates[0];
|
|
||||||
var end = coordinates[1];
|
|
||||||
geometry.setCoordinates([
|
|
||||||
[start, [start[0], end[1]], end, [end[0], start[1]], start]
|
|
||||||
]);
|
|
||||||
return geometry;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
draw = new ol.interaction.Draw({
|
draw = new ol.interaction.Draw({
|
||||||
source: source,
|
source: source,
|
||||||
type: /** @type {ol.geom.GeometryType} */ (value),
|
type: /** @type {ol.geom.GeometryType} */ (typeSelect.value)
|
||||||
geometryFunction: geometryFunction,
|
|
||||||
maxPoints: maxPoints
|
|
||||||
});
|
});
|
||||||
map.addInteraction(draw);
|
map.addInteraction(draw);
|
||||||
}
|
}
|
||||||
|
|||||||
22
examples/draw-freehand.html
Normal file
22
examples/draw-freehand.html
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
layout: example.html
|
||||||
|
title: Freehand Drawing
|
||||||
|
shortdesc: Example using the ol.interaction.Draw interaction in freehand mode.
|
||||||
|
docs: >
|
||||||
|
This example demonstrates the `ol.interaction.Draw` in freehand mode. During
|
||||||
|
freehand drawing, points are added while dragging. Set `freehand: true` to
|
||||||
|
enable freehand mode. Note that freehand mode can be conditionally enabled
|
||||||
|
by using the `freehandCondition` option. For example to toggle freehand mode
|
||||||
|
with the `Shift` key, use `freehandCondition: ol.events.condition.shiftKeyOnly`.
|
||||||
|
tags: "draw, edit, freehand, vector"
|
||||||
|
---
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
<form class="form-inline">
|
||||||
|
<label>Geometry type </label>
|
||||||
|
<select id="type">
|
||||||
|
<option value="LineString">LineString</option>
|
||||||
|
<option value="Polygon">Polygon</option>
|
||||||
|
<option value="Circle">Circle</option>
|
||||||
|
<option value="None">None</option>
|
||||||
|
</select>
|
||||||
|
</form>
|
||||||
52
examples/draw-freehand.js
Normal file
52
examples/draw-freehand.js
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.View');
|
||||||
|
goog.require('ol.interaction.Draw');
|
||||||
|
goog.require('ol.layer.Tile');
|
||||||
|
goog.require('ol.layer.Vector');
|
||||||
|
goog.require('ol.source.OSM');
|
||||||
|
goog.require('ol.source.Vector');
|
||||||
|
|
||||||
|
var raster = new ol.layer.Tile({
|
||||||
|
source: new ol.source.OSM()
|
||||||
|
});
|
||||||
|
|
||||||
|
var source = new ol.source.Vector({wrapX: false});
|
||||||
|
|
||||||
|
var vector = new ol.layer.Vector({
|
||||||
|
source: source
|
||||||
|
});
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
layers: [raster, vector],
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View({
|
||||||
|
center: [-11000000, 4600000],
|
||||||
|
zoom: 4
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
var typeSelect = document.getElementById('type');
|
||||||
|
|
||||||
|
var draw; // global so we can remove it later
|
||||||
|
function addInteraction() {
|
||||||
|
var value = typeSelect.value;
|
||||||
|
if (value !== 'None') {
|
||||||
|
draw = new ol.interaction.Draw({
|
||||||
|
source: source,
|
||||||
|
type: /** @type {ol.geom.GeometryType} */ (typeSelect.value),
|
||||||
|
freehand: true
|
||||||
|
});
|
||||||
|
map.addInteraction(draw);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle change event.
|
||||||
|
*/
|
||||||
|
typeSelect.onchange = function() {
|
||||||
|
map.removeInteraction(draw);
|
||||||
|
addInteraction();
|
||||||
|
};
|
||||||
|
|
||||||
|
addInteraction();
|
||||||
25
examples/draw-shapes.html
Normal file
25
examples/draw-shapes.html
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
layout: example.html
|
||||||
|
title: Draw Shapes
|
||||||
|
shortdesc: Using the ol.interaction.Draw to create regular shapes
|
||||||
|
docs: >
|
||||||
|
This demonstrates the use of the `geometryFunction` option for the
|
||||||
|
`ol.interaction.Draw`. Select a shape type from the dropdown above to start
|
||||||
|
drawing. To activate freehand drawing, hold the `Shift` key. Square drawing is
|
||||||
|
achieved by using `type: 'Circle'` type with a `geometryFunction` that creates
|
||||||
|
a 4-sided regular polygon instead of a circle. Box drawing uses `type: 'Circle'`
|
||||||
|
with a `geometryFunction` that creates a box-shaped polygon instead of a
|
||||||
|
circle. Star drawing uses a custom geometry function that coverts a circle
|
||||||
|
into a start using the center and radius provided by the draw interaction.
|
||||||
|
tags: "draw, edit, freehand, vector"
|
||||||
|
---
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
<form class="form-inline">
|
||||||
|
<label>Shape type </label>
|
||||||
|
<select id="type">
|
||||||
|
<option value="Square">Square</option>
|
||||||
|
<option value="Box">Box</option>
|
||||||
|
<option value="Star">Star</option>
|
||||||
|
<option value="None">None</option>
|
||||||
|
</select>
|
||||||
|
</form>
|
||||||
86
examples/draw-shapes.js
Normal file
86
examples/draw-shapes.js
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.View');
|
||||||
|
goog.require('ol.geom.Polygon');
|
||||||
|
goog.require('ol.interaction.Draw');
|
||||||
|
goog.require('ol.layer.Tile');
|
||||||
|
goog.require('ol.layer.Vector');
|
||||||
|
goog.require('ol.source.OSM');
|
||||||
|
goog.require('ol.source.Vector');
|
||||||
|
|
||||||
|
var raster = new ol.layer.Tile({
|
||||||
|
source: new ol.source.OSM()
|
||||||
|
});
|
||||||
|
|
||||||
|
var source = new ol.source.Vector({wrapX: false});
|
||||||
|
|
||||||
|
var vector = new ol.layer.Vector({
|
||||||
|
source: source
|
||||||
|
});
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
layers: [raster, vector],
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View({
|
||||||
|
center: [-11000000, 4600000],
|
||||||
|
zoom: 4
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
var typeSelect = document.getElementById('type');
|
||||||
|
|
||||||
|
var draw; // global so we can remove it later
|
||||||
|
function addInteraction() {
|
||||||
|
var value = typeSelect.value;
|
||||||
|
if (value !== 'None') {
|
||||||
|
var geometryFunction;
|
||||||
|
if (value === 'Square') {
|
||||||
|
value = 'Circle';
|
||||||
|
geometryFunction = ol.interaction.Draw.createRegularPolygon(4);
|
||||||
|
} else if (value === 'Box') {
|
||||||
|
value = 'Circle';
|
||||||
|
geometryFunction = ol.interaction.Draw.createBox();
|
||||||
|
} else if (value === 'Star') {
|
||||||
|
value = 'Circle';
|
||||||
|
geometryFunction = function(coordinates, geometry) {
|
||||||
|
if (!geometry) {
|
||||||
|
geometry = new ol.geom.Polygon(null);
|
||||||
|
}
|
||||||
|
var center = coordinates[0];
|
||||||
|
var last = coordinates[1];
|
||||||
|
var dx = center[0] - last[0];
|
||||||
|
var dy = center[1] - last[1];
|
||||||
|
var radius = Math.sqrt(dx * dx + dy * dy);
|
||||||
|
var rotation = Math.atan2(dy, dx);
|
||||||
|
var newCoordinates = [];
|
||||||
|
var numPoints = 12;
|
||||||
|
for (var i = 0; i < numPoints; ++i) {
|
||||||
|
var angle = rotation + i * 2 * Math.PI / numPoints;
|
||||||
|
var fraction = i % 2 === 0 ? 1 : 0.5;
|
||||||
|
var offsetX = radius * fraction * Math.cos(angle);
|
||||||
|
var offsetY = radius * fraction * Math.sin(angle);
|
||||||
|
newCoordinates.push([center[0] + offsetX, center[1] + offsetY]);
|
||||||
|
}
|
||||||
|
newCoordinates.push(newCoordinates[0].slice());
|
||||||
|
geometry.setCoordinates([newCoordinates]);
|
||||||
|
return geometry;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
draw = new ol.interaction.Draw({
|
||||||
|
source: source,
|
||||||
|
type: /** @type {ol.geom.GeometryType} */ (value),
|
||||||
|
geometryFunction: geometryFunction
|
||||||
|
});
|
||||||
|
map.addInteraction(draw);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle change event.
|
||||||
|
*/
|
||||||
|
typeSelect.onchange = function() {
|
||||||
|
map.removeInteraction(draw);
|
||||||
|
addInteraction();
|
||||||
|
};
|
||||||
|
|
||||||
|
addInteraction();
|
||||||
@@ -16,7 +16,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ goog.require('ol.source.TileWMS');
|
|||||||
var layers = [
|
var layers = [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.TileWMS({
|
source: new ol.source.TileWMS({
|
||||||
url: 'http://demo.boundlessgeo.com/geoserver/wms',
|
url: 'https://ahocevar.com/geoserver/wms',
|
||||||
params: {
|
params: {
|
||||||
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
|
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ layout: example.html
|
|||||||
title: Map Export
|
title: Map Export
|
||||||
shortdesc: Example of exporting a map as a PNG image.
|
shortdesc: Example of exporting a map as a PNG image.
|
||||||
docs: >
|
docs: >
|
||||||
Example of exporting a map as a PNG image.
|
Example of exporting a map as a PNG image. This example requires a browser
|
||||||
|
that supports <a href="https://developer.mozilla.org/de/docs/Web/API/HTMLCanvasElement/toBlob#Browser_compatibility">
|
||||||
|
<code>canvas.toBlob()</code></a>.
|
||||||
tags: "export, png, openstreetmap"
|
tags: "export, png, openstreetmap"
|
||||||
|
resources:
|
||||||
|
- https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.3/FileSaver.min.js
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<div id="no-download" class="alert alert-danger" style="display: none">
|
<a id="export-png" class="btn btn-default"><i class="fa fa-download"></i> Download PNG</a>
|
||||||
This example requires a browser that supports the
|
|
||||||
<a href="http://caniuse.com/#feat=download">link download</a> attribute.
|
|
||||||
</div>
|
|
||||||
<a id="export-png" class="btn btn-default" download="map.png"><i class="fa fa-download"></i> Download PNG</a>
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// NOCOMPILE
|
||||||
|
// this example uses FileSaver.js for which we don't have an externs file.
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.control');
|
goog.require('ol.control');
|
||||||
@@ -31,20 +33,12 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var exportPNGElement = document.getElementById('export-png');
|
document.getElementById('export-png').addEventListener('click', function() {
|
||||||
|
map.once('postcompose', function(event) {
|
||||||
if ('download' in exportPNGElement) {
|
var canvas = event.context.canvas;
|
||||||
exportPNGElement.addEventListener('click', function() {
|
canvas.toBlob(function(blob) {
|
||||||
map.once('postcompose', function(event) {
|
saveAs(blob, 'map.png');
|
||||||
var canvas = event.context.canvas;
|
|
||||||
exportPNGElement.href = canvas.toDataURL('image/png');
|
|
||||||
});
|
});
|
||||||
map.renderSync();
|
});
|
||||||
}, false);
|
map.renderSync();
|
||||||
} else {
|
});
|
||||||
var info = document.getElementById('no-download');
|
|
||||||
/**
|
|
||||||
* display error message
|
|
||||||
*/
|
|
||||||
info.style.display = '';
|
|
||||||
}
|
|
||||||
|
|||||||
12
examples/extent-interaction.html
Normal file
12
examples/extent-interaction.html
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
layout: example.html
|
||||||
|
title: Extent Interaction
|
||||||
|
shortdesc: Using an Extent interaction to draw an extent.
|
||||||
|
docs: >
|
||||||
|
<p>This example shows how to use an <code>Extent</code> interaction to draw a modifiable extent.</p>
|
||||||
|
<p>Use <code>Shift+Drag</code> to draw an extent.
|
||||||
|
<code>Shift+Drag</code> on the corners or edges of the extent to resize it. <code>Shift+Click</code> off the extent to remove it.
|
||||||
|
</p>
|
||||||
|
tags: "Extent, interaction, box"
|
||||||
|
---
|
||||||
|
<div id="map" class="map"></div>
|
||||||
48
examples/extent-interaction.js
Normal file
48
examples/extent-interaction.js
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.View');
|
||||||
|
goog.require('ol.events.condition');
|
||||||
|
goog.require('ol.format.GeoJSON');
|
||||||
|
goog.require('ol.interaction.Extent');
|
||||||
|
goog.require('ol.layer.Tile');
|
||||||
|
goog.require('ol.layer.Vector');
|
||||||
|
goog.require('ol.source.OSM');
|
||||||
|
goog.require('ol.source.Vector');
|
||||||
|
|
||||||
|
var vectorSource = new ol.source.Vector({
|
||||||
|
url: 'data/geojson/countries.geojson',
|
||||||
|
format: new ol.format.GeoJSON()
|
||||||
|
});
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
layers: [
|
||||||
|
new ol.layer.Tile({
|
||||||
|
source: new ol.source.OSM()
|
||||||
|
}),
|
||||||
|
new ol.layer.Vector({
|
||||||
|
source: vectorSource
|
||||||
|
})
|
||||||
|
],
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 2
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
var extent = new ol.interaction.Extent({
|
||||||
|
condition: ol.events.condition.platformModifierKeyOnly
|
||||||
|
});
|
||||||
|
map.addInteraction(extent);
|
||||||
|
extent.setActive(false);
|
||||||
|
|
||||||
|
//Enable interaction by holding shift
|
||||||
|
this.addEventListener('keydown', function(event) {
|
||||||
|
if (event.keyCode == 16) {
|
||||||
|
extent.setActive(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.addEventListener('keyup', function(event) {
|
||||||
|
if (event.keyCode == 16) {
|
||||||
|
extent.setActive(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -28,7 +28,6 @@ var map = new ol.Map({
|
|||||||
collapsible: false
|
collapsible: false
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ tags: "fullscreen, geolocation, orientation, mobile"
|
|||||||
<button id="geolocate">Geolocate Me!</button>
|
<button id="geolocate">Geolocate Me!</button>
|
||||||
<button id="simulate">Simulate</button>
|
<button id="simulate">Simulate</button>
|
||||||
</div>
|
</div>
|
||||||
<script src="http://code.jquery.com/jquery-2.2.3.min.js" type="text/javascript"></script>
|
|
||||||
<script src="./resources/common.js" type="text/javascript"></script>
|
<script src="./resources/common.js" type="text/javascript"></script>
|
||||||
<script src="loader.js?id=geolocation-orientation" type="text/javascript"></script>
|
<script src="loader.js?id=geolocation-orientation" type="text/javascript"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ goog.require('ol.source.ImageWMS');
|
|||||||
|
|
||||||
|
|
||||||
var wmsSource = new ol.source.ImageWMS({
|
var wmsSource = new ol.source.ImageWMS({
|
||||||
url: 'http://demo.boundlessgeo.com/geoserver/wms',
|
url: 'https://ahocevar.com/geoserver/wms',
|
||||||
params: {'LAYERS': 'ne:ne'},
|
params: {'LAYERS': 'ne:ne'},
|
||||||
serverType: 'geoserver',
|
serverType: 'geoserver',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
@@ -21,7 +21,6 @@ var view = new ol.View({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
layers: [wmsLayer],
|
layers: [wmsLayer],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: view
|
view: view
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ goog.require('ol.source.TileWMS');
|
|||||||
|
|
||||||
|
|
||||||
var wmsSource = new ol.source.TileWMS({
|
var wmsSource = new ol.source.TileWMS({
|
||||||
url: 'http://demo.boundlessgeo.com/geoserver/wms',
|
url: 'https://ahocevar.com/geoserver/wms',
|
||||||
params: {'LAYERS': 'ne:ne'},
|
params: {'LAYERS': 'ne:ne'},
|
||||||
serverType: 'geoserver',
|
serverType: 'geoserver',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
@@ -21,7 +21,6 @@ var view = new ol.View({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
layers: [wmsLayer],
|
layers: [wmsLayer],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: view
|
view: view
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: 'canvas',
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: ol.proj.fromLonLat([4.8, 47.75]),
|
center: ol.proj.fromLonLat([4.8, 47.75]),
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ for (i = 0, ii = hereLayers.length; i < ii; ++i) {
|
|||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: layers,
|
layers: layers,
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
// Improve user experience by loading tiles while dragging/zooming. Will make
|
// Improve user experience by loading tiles while dragging/zooming. Will make
|
||||||
// zooming choppy on mobile or slow devices.
|
// zooming choppy on mobile or slow devices.
|
||||||
loadTilesWhileInteracting: true,
|
loadTilesWhileInteracting: true,
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ var rasterLayer = new ol.layer.Tile({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
layers: [rasterLayer, vectorLayer],
|
layers: [rasterLayer, vectorLayer],
|
||||||
target: document.getElementById('map'),
|
target: document.getElementById('map'),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ var vector = new ol.layer.Vector({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
renderer: common.getRendererFromQueryString('webgl'),
|
renderer: /** @type {ol.renderer.Type} */ ('webgl'),
|
||||||
layers: [vector],
|
layers: [vector],
|
||||||
target: document.getElementById('map'),
|
target: document.getElementById('map'),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ var rasterLayer = new ol.layer.Tile({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
layers: [rasterLayer, vectorLayer],
|
layers: [rasterLayer, vectorLayer],
|
||||||
target: document.getElementById('map'),
|
target: document.getElementById('map'),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ layout: example.html
|
|||||||
title: IGC Data
|
title: IGC Data
|
||||||
shortdesc: Example of tracks recorded from multiple paraglider flights on the same day, read from an IGC file.
|
shortdesc: Example of tracks recorded from multiple paraglider flights on the same day, read from an IGC file.
|
||||||
docs: >
|
docs: >
|
||||||
<p>The five tracks contain a total of 49,707 unique coordinates. Zoom in to see more detail. The background layer is from <a href="http://www.opencyclemap.org/">OpenCycleMap</a>.</p>
|
<p>The five tracks contain a total of 49,707 unique coordinates. Zoom in to see more detail. The background layer is from <a href="https://www.opencyclemap.org/">OpenCycleMap</a>.</p>
|
||||||
tags: "complex-geometry, closest-feature, igc, opencyclemap"
|
tags: "complex-geometry, closest-feature, igc, opencyclemap"
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -85,10 +85,10 @@ var map = new ol.Map({
|
|||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.OSM({
|
source: new ol.source.OSM({
|
||||||
attributions: [
|
attributions: [
|
||||||
'All maps © <a href="http://www.opencyclemap.org/">OpenCycleMap</a>',
|
'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>',
|
||||||
ol.source.OSM.ATTRIBUTION
|
ol.source.OSM.ATTRIBUTION
|
||||||
],
|
],
|
||||||
url: 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png'
|
url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png'
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
new ol.layer.Vector({
|
new ol.layer.Vector({
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ Progress.prototype.hide = function() {
|
|||||||
var progress = new Progress(document.getElementById('progress'));
|
var progress = new Progress(document.getElementById('progress'));
|
||||||
|
|
||||||
var source = new ol.source.ImageWMS({
|
var source = new ol.source.ImageWMS({
|
||||||
url: 'http://demo.boundlessgeo.com/geoserver/wms',
|
url: 'https://ahocevar.com/geoserver/wms',
|
||||||
params: {'LAYERS': 'topp:states'},
|
params: {'LAYERS': 'topp:states'},
|
||||||
serverType: 'geoserver'
|
serverType: 'geoserver'
|
||||||
});
|
});
|
||||||
@@ -99,7 +99,6 @@ var map = new ol.Map({
|
|||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Image({source: source})
|
new ol.layer.Image({source: source})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [-10997148, 4569099],
|
center: [-10997148, 4569099],
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (!ol.has.WEBGL) {
|
|||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [osm],
|
layers: [osm],
|
||||||
renderer: 'webgl',
|
renderer: /** @type {ol.renderer.Type} */ ('webgl'),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ var overlay = new ol.layer.Tile({
|
|||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [base, overlay],
|
layers: [base, overlay],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ var map = new ol.Map({
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: ol.proj.fromLonLat([37.40570, 8.81566]),
|
center: ol.proj.fromLonLat([37.40570, 8.81566]),
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ var layer = new ol.layer.Tile();
|
|||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [layer],
|
layers: [layer],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ var vector = new ol.layer.Vector({
|
|||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [raster, vector],
|
layers: [raster, vector],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [-11000000, 4600000],
|
center: [-11000000, 4600000],
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ layout: example.html
|
|||||||
title: Localized OpenStreetMap
|
title: Localized OpenStreetMap
|
||||||
shortdesc: Example of a localized OpenStreetMap map with a custom tile server and a custom attribution.
|
shortdesc: Example of a localized OpenStreetMap map with a custom tile server and a custom attribution.
|
||||||
docs: >
|
docs: >
|
||||||
<p>The base layer is <a href="http://www.opencyclemap.org/">OpenCycleMap</a> with an overlay from <a href="http://www.openseamap.org/">OpenSeaMap</a>.
|
<p>The base layer is <a href="https://www.opencyclemap.org/">OpenCycleMap</a> with an overlay from <a href="http://www.openseamap.org/">OpenSeaMap</a>.
|
||||||
tags: "localized-openstreetmap, openseamap, openstreetmap"
|
tags: "localized-openstreetmap, openseamap, openstreetmap"
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ goog.require('ol.source.OSM');
|
|||||||
var openCycleMapLayer = new ol.layer.Tile({
|
var openCycleMapLayer = new ol.layer.Tile({
|
||||||
source: new ol.source.OSM({
|
source: new ol.source.OSM({
|
||||||
attributions: [
|
attributions: [
|
||||||
'All maps © <a href="http://www.opencyclemap.org/">OpenCycleMap</a>',
|
'All maps © <a href="https://www.opencyclemap.org/">OpenCycleMap</a>',
|
||||||
ol.source.OSM.ATTRIBUTION
|
ol.source.OSM.ATTRIBUTION
|
||||||
],
|
],
|
||||||
url: 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png'
|
url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ var openSeaMapLayer = new ol.layer.Tile({
|
|||||||
ol.source.OSM.ATTRIBUTION
|
ol.source.OSM.ATTRIBUTION
|
||||||
],
|
],
|
||||||
opaque: false,
|
opaque: false,
|
||||||
url: 'http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png'
|
url: 'https://tiles.openseamap.org/seamark/{z}/{x}/{y}.png'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ var map = new ol.Map({
|
|||||||
preload: Infinity,
|
preload: Infinity,
|
||||||
source: new ol.source.VectorTile({
|
source: new ol.source.VectorTile({
|
||||||
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
||||||
'© <a href="http://www.openstreetmap.org/copyright">' +
|
'© <a href="https://www.openstreetmap.org/copyright">' +
|
||||||
'OpenStreetMap contributors</a>',
|
'OpenStreetMap contributors</a>',
|
||||||
format: new ol.format.MVT(),
|
format: new ol.format.MVT(),
|
||||||
tileGrid: new ol.tilegrid.TileGrid({
|
tileGrid: new ol.tilegrid.TileGrid({
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ var map = new ol.Map({
|
|||||||
new ol.layer.VectorTile({
|
new ol.layer.VectorTile({
|
||||||
source: new ol.source.VectorTile({
|
source: new ol.source.VectorTile({
|
||||||
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
||||||
'© <a href="http://www.openstreetmap.org/copyright">' +
|
'© <a href="https://www.openstreetmap.org/copyright">' +
|
||||||
'OpenStreetMap contributors</a>',
|
'OpenStreetMap contributors</a>',
|
||||||
format: new ol.format.MVT(),
|
format: new ol.format.MVT(),
|
||||||
tileGrid: ol.tilegrid.createXYZ({maxZoom: 22}),
|
tileGrid: ol.tilegrid.createXYZ({maxZoom: 22}),
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ var map = new ol.Map({
|
|||||||
maxResolution: 20000
|
maxResolution: 20000
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
goog.require('ol.Attribution');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.format.TopoJSON');
|
goog.require('ol.format.TopoJSON');
|
||||||
@@ -41,7 +42,7 @@ var map = new ol.Map({
|
|||||||
attributions: attribution,
|
attributions: attribution,
|
||||||
format: format,
|
format: format,
|
||||||
tileGrid: tileGrid,
|
tileGrid: tileGrid,
|
||||||
url: 'https://vector.mapzen.com/osm/water/{z}/{x}/{y}.topojson?api_key=' + key
|
url: 'https://tile.mapzen.com/mapzen/vector/v1/water/{z}/{x}/{y}.topojson?api_key=' + key
|
||||||
}),
|
}),
|
||||||
style: new ol.style.Style({
|
style: new ol.style.Style({
|
||||||
fill: new ol.style.Fill({
|
fill: new ol.style.Fill({
|
||||||
@@ -54,7 +55,7 @@ var map = new ol.Map({
|
|||||||
attributions: attribution,
|
attributions: attribution,
|
||||||
format: format,
|
format: format,
|
||||||
tileGrid: tileGrid,
|
tileGrid: tileGrid,
|
||||||
url: 'https://vector.mapzen.com/osm/roads/{z}/{x}/{y}.topojson?api_key=' + key
|
url: 'https://tile.mapzen.com/mapzen/vector/v1/roads/{z}/{x}/{y}.topojson?api_key=' + key
|
||||||
}),
|
}),
|
||||||
style: function(feature) {
|
style: function(feature) {
|
||||||
var kind = feature.get('kind');
|
var kind = feature.get('kind');
|
||||||
@@ -88,7 +89,7 @@ var map = new ol.Map({
|
|||||||
attributions: attribution,
|
attributions: attribution,
|
||||||
format: format,
|
format: format,
|
||||||
tileGrid: tileGrid,
|
tileGrid: tileGrid,
|
||||||
url: 'https://vector.mapzen.com/osm/buildings/{z}/{x}/{y}.topojson?api_key=' + key
|
url: 'https://tile.mapzen.com/mapzen/vector/v1/buildings/{z}/{x}/{y}.topojson?api_key=' + key
|
||||||
}),
|
}),
|
||||||
style: function(f, resolution) {
|
style: function(f, resolution) {
|
||||||
return (resolution < 10) ? buildingStyle : null;
|
return (resolution < 10) ? buildingStyle : null;
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ var layer = new ol.layer.Tile({
|
|||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [layer],
|
layers: [layer],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ var overviewMapControl = new ol.control.OverviewMap({
|
|||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.OSM({
|
source: new ol.source.OSM({
|
||||||
'url': 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png'
|
'url': 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
overlays: [overlay],
|
overlays: [overlay],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ var map1 = new ol.Map({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map1',
|
target: 'map1',
|
||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
@@ -34,7 +33,6 @@ var map2 = new ol.Map({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map2',
|
target: 'map2',
|
||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ shortdesc: Demonstrates client-side raster reprojection of OSM to arbitrary proj
|
|||||||
docs: >
|
docs: >
|
||||||
This example shows client-side raster reprojection capabilities from
|
This example shows client-side raster reprojection capabilities from
|
||||||
OSM (EPSG:3857) to arbitrary projection by searching
|
OSM (EPSG:3857) to arbitrary projection by searching
|
||||||
in <a href="http://epsg.io/">EPSG.io</a> database.
|
in <a href="https://epsg.io/">EPSG.io</a> database.
|
||||||
tags: "reprojection, projection, proj4js, epsg.io"
|
tags: "reprojection, projection, proj4js, epsg.io"
|
||||||
resources:
|
resources:
|
||||||
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
|
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<form class="form-inline">
|
<form class="form-inline">
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
projection: 'EPSG:3857',
|
projection: 'EPSG:3857',
|
||||||
@@ -64,7 +63,7 @@ function setProjection(code, name, proj4def, bbox) {
|
|||||||
|
|
||||||
function search(query) {
|
function search(query) {
|
||||||
resultSpan.innerHTML = 'Searching ...';
|
resultSpan.innerHTML = 'Searching ...';
|
||||||
fetch('http://epsg.io/?format=json&q=' + query).then(function(response) {
|
fetch('https://epsg.io/?format=json&q=' + query).then(function(response) {
|
||||||
return response.json();
|
return response.json();
|
||||||
}).then(function(json) {
|
}).then(function(json) {
|
||||||
var results = json['results'];
|
var results = json['results'];
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ docs: >
|
|||||||
This example shows client-side reprojection of single image source.
|
This example shows client-side reprojection of single image source.
|
||||||
tags: "reprojection, projection, proj4js, image, imagestatic"
|
tags: "reprojection, projection, proj4js, image, imagestatic"
|
||||||
resources:
|
resources:
|
||||||
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
|
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ var map = new ol.Map({
|
|||||||
}),
|
}),
|
||||||
new ol.layer.Image({
|
new ol.layer.Image({
|
||||||
source: new ol.source.ImageStatic({
|
source: new ol.source.ImageStatic({
|
||||||
url: 'http://upload.wikimedia.org/wikipedia/commons/thumb/1/18/' +
|
url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/18/' +
|
||||||
'British_National_Grid.svg/2000px-British_National_Grid.svg.png',
|
'British_National_Grid.svg/2000px-British_National_Grid.svg.png',
|
||||||
crossOrigin: '',
|
crossOrigin: '',
|
||||||
projection: 'EPSG:27700',
|
projection: 'EPSG:27700',
|
||||||
@@ -29,7 +29,6 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: ol.proj.transform(
|
center: ol.proj.transform(
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
projection: 'EPSG:4326',
|
projection: 'EPSG:4326',
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ docs: >
|
|||||||
This example shows client-side raster reprojection between various projections.
|
This example shows client-side raster reprojection between various projections.
|
||||||
tags: "reprojection, projection, proj4js, osm, wms, wmts, hidpi"
|
tags: "reprojection, projection, proj4js, osm, wms, wmts, hidpi"
|
||||||
resources:
|
resources:
|
||||||
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
|
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<form class="form-inline">
|
<form class="form-inline">
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ layers['osm'] = new ol.layer.Tile({
|
|||||||
|
|
||||||
layers['wms4326'] = new ol.layer.Tile({
|
layers['wms4326'] = new ol.layer.Tile({
|
||||||
source: new ol.source.TileWMS({
|
source: new ol.source.TileWMS({
|
||||||
url: 'http://demo.boundlessgeo.com/geoserver/wms',
|
url: 'https://ahocevar.com/geoserver/wms',
|
||||||
crossOrigin: '',
|
crossOrigin: '',
|
||||||
params: {
|
params: {
|
||||||
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
|
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
|
||||||
@@ -93,7 +93,7 @@ layers['wms21781'] = new ol.layer.Tile({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var parser = new ol.format.WMTSCapabilities();
|
var parser = new ol.format.WMTSCapabilities();
|
||||||
var url = 'http://map1.vis.earthdata.nasa.gov/wmts-arctic/' +
|
var url = 'https://map1.vis.earthdata.nasa.gov/wmts-arctic/' +
|
||||||
'wmts.cgi?SERVICE=WMTS&request=GetCapabilities';
|
'wmts.cgi?SERVICE=WMTS&request=GetCapabilities';
|
||||||
fetch(url).then(function(response) {
|
fetch(url).then(function(response) {
|
||||||
return response.text();
|
return response.text();
|
||||||
@@ -129,7 +129,7 @@ for (var i = 0, ii = resolutions.length; i < ii; ++i) {
|
|||||||
|
|
||||||
layers['states'] = new ol.layer.Tile({
|
layers['states'] = new ol.layer.Tile({
|
||||||
source: new ol.source.TileWMS({
|
source: new ol.source.TileWMS({
|
||||||
url: 'http://demo.boundlessgeo.com/geoserver/wms',
|
url: 'https://ahocevar.com/geoserver/wms',
|
||||||
crossOrigin: '',
|
crossOrigin: '',
|
||||||
params: {'LAYERS': 'topp:states', 'TILED': true},
|
params: {'LAYERS': 'topp:states', 'TILED': true},
|
||||||
serverType: 'geoserver',
|
serverType: 'geoserver',
|
||||||
@@ -148,7 +148,6 @@ var map = new ol.Map({
|
|||||||
layers['osm'],
|
layers['osm'],
|
||||||
layers['bng']
|
layers['bng']
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
projection: 'EPSG:3857',
|
projection: 'EPSG:3857',
|
||||||
|
|||||||
@@ -79,24 +79,3 @@
|
|||||||
|
|
||||||
container.appendChild(form);
|
container.appendChild(form);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
var common = {};
|
|
||||||
|
|
||||||
common.getRendererFromQueryString = function(opt_default) {
|
|
||||||
var obj = {};
|
|
||||||
var queryString = location.search.slice(1);
|
|
||||||
var re = /([^&=]+)=([^&]*)/g;
|
|
||||||
|
|
||||||
var m = re.exec(queryString);
|
|
||||||
while (m) {
|
|
||||||
obj[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
|
|
||||||
m = re.exec(queryString);
|
|
||||||
}
|
|
||||||
if ('renderers' in obj) {
|
|
||||||
return obj['renderers'].split(',');
|
|
||||||
} else if ('renderer' in obj) {
|
|
||||||
return [obj['renderer']];
|
|
||||||
} else {
|
|
||||||
return opt_default;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ docs: >
|
|||||||
This example shows client-side reprojection of OpenStreetMap to NAD83 Indiana East, including a ScaleLine control with US units.
|
This example shows client-side reprojection of OpenStreetMap to NAD83 Indiana East, including a ScaleLine control with US units.
|
||||||
tags: "reprojection, projection, openstreetmap, nad83, tile, scaleline"
|
tags: "reprojection, projection, openstreetmap, nad83, tile, scaleline"
|
||||||
resources:
|
resources:
|
||||||
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
|
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: common.getRendererFromQueryString(),
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: ol.proj.fromLonLat([-77.93255, 37.9555]),
|
center: ol.proj.fromLonLat([-77.93255, 37.9555]),
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: example.html
|
||||||
title: Shared Views
|
title: Shared Views
|
||||||
shortdesc: The three maps, one WebGL, one Canvas, one DOM, share the same center, resolution, rotation and layers.
|
shortdesc: Two maps with different renderers share view properties
|
||||||
docs: >
|
docs: >
|
||||||
The three maps, one WebGL, one Canvas, one DOM, share the same center, resolution, rotation and layers.
|
Two maps (one with the Canvas renderer, one with the WebGL renderer) share the same center, resolution, rotation and layers.
|
||||||
tags: "side-by-side, canvas, webgl, dom, canvas, sync, object"
|
tags: "side-by-side, canvas, webgl"
|
||||||
---
|
---
|
||||||
<h4>Canvas</h4>
|
<h4>Canvas</h4>
|
||||||
<div id="canvasMap" class="map"></div>
|
<div id="canvasMap" class="map"></div>
|
||||||
@@ -13,5 +13,3 @@ tags: "side-by-side, canvas, webgl, dom, canvas, sync, object"
|
|||||||
<div id="no-webgl" class="alert alert-danger" style="display: none">
|
<div id="no-webgl" class="alert alert-danger" style="display: none">
|
||||||
This map requires a browser that supports <a href="http://get.webgl.org/">WebGL</a>.
|
This map requires a browser that supports <a href="http://get.webgl.org/">WebGL</a>.
|
||||||
</div>
|
</div>
|
||||||
<h4>DOM</h4>
|
|
||||||
<div id="domMap" class="map"></div>
|
|
||||||
|
|||||||
@@ -4,33 +4,27 @@ goog.require('ol.has');
|
|||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
|
|
||||||
|
var layer = new ol.layer.Tile({
|
||||||
var map1 = new ol.Map({
|
source: new ol.source.OSM()
|
||||||
layers: [
|
|
||||||
new ol.layer.Tile({
|
|
||||||
source: new ol.source.OSM()
|
|
||||||
})
|
|
||||||
],
|
|
||||||
renderer: 'dom',
|
|
||||||
target: 'domMap',
|
|
||||||
view: new ol.View({
|
|
||||||
center: [0, 0],
|
|
||||||
zoom: 1
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var map2 = new ol.Map({
|
var view = new ol.View({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 1
|
||||||
|
});
|
||||||
|
|
||||||
|
var map1 = new ol.Map({
|
||||||
target: 'canvasMap',
|
target: 'canvasMap',
|
||||||
layers: map1.getLayers(),
|
layers: [layer],
|
||||||
view: map1.getView()
|
view: view
|
||||||
});
|
});
|
||||||
|
|
||||||
if (ol.has.WEBGL) {
|
if (ol.has.WEBGL) {
|
||||||
var map3 = new ol.Map({
|
var map2 = new ol.Map({
|
||||||
renderer: 'webgl',
|
|
||||||
target: 'webglMap',
|
target: 'webglMap',
|
||||||
layers: map1.getLayers(),
|
renderer: /** @type {ol.renderer.Type} */ ('webgl'),
|
||||||
view: map1.getView()
|
layers: [layer],
|
||||||
|
view: view
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
var info = document.getElementById('no-webgl');
|
var info = document.getElementById('no-webgl');
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ docs: >
|
|||||||
Example of a Sphere Mollweide map with a Graticule component.
|
Example of a Sphere Mollweide map with a Graticule component.
|
||||||
tags: "graticule, Mollweide, projection, proj4js"
|
tags: "graticule, Mollweide, projection, proj4js"
|
||||||
resources:
|
resources:
|
||||||
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
|
- https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
renderer: 'canvas',
|
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user