Compare commits
198 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d64762bcb | ||
|
|
7c98e922c3 | ||
|
|
41c81dec88 | ||
|
|
887e90af1e | ||
|
|
69c44e50df | ||
|
|
bd4c1f8da6 | ||
|
|
95443d0c88 | ||
|
|
9b1416da29 | ||
|
|
48c8f9ea84 | ||
|
|
9f5d85f2c6 | ||
|
|
c4237c7858 | ||
|
|
fbb59d29b9 | ||
|
|
554aaf1574 | ||
|
|
2ebcadfcd5 | ||
|
|
d9bb3adbe8 | ||
|
|
070a6b11f0 | ||
|
|
43e1c86b6e | ||
|
|
b0b202f112 | ||
|
|
2fdf7f508d | ||
|
|
e14197c060 | ||
|
|
814fd858d8 | ||
|
|
97995cf20b | ||
|
|
8fc85198b0 | ||
|
|
2b64a7af7b | ||
|
|
fc2c9176a6 | ||
|
|
7192644c07 | ||
|
|
992870e2d2 | ||
|
|
ad3c6713da | ||
|
|
3fef07f9e9 | ||
|
|
a5abd8df23 | ||
|
|
73158b8c71 | ||
|
|
4f85cbec54 | ||
|
|
8f4c6a5bbf | ||
|
|
5b7227a0bf | ||
|
|
f387bb75bf | ||
|
|
e27bfc4fa6 | ||
|
|
aa2838cdcd | ||
|
|
be16ba01ca | ||
|
|
3413f6d138 | ||
|
|
954a5077cf | ||
|
|
0050f00703 | ||
|
|
867bcce1cc | ||
|
|
257abb63d7 | ||
|
|
ba93698c20 | ||
|
|
35064a45f7 | ||
|
|
a940cdd6a7 | ||
|
|
e978133b85 | ||
|
|
0b4c0ee41c | ||
|
|
5a1588a2dc | ||
|
|
abb680d28f | ||
|
|
8fcedb03a4 | ||
|
|
7ecb6700fb | ||
|
|
4892a2f039 | ||
|
|
9363a6a340 | ||
|
|
6e58be72bb | ||
|
|
6530fbe6c3 | ||
|
|
612aa3493b | ||
|
|
609e94a58a | ||
|
|
652638e902 | ||
|
|
7149113ab6 | ||
|
|
2215f49617 | ||
|
|
40fec9ca35 | ||
|
|
279eae1dba | ||
|
|
cf1b1822b8 | ||
|
|
952a282756 | ||
|
|
51b62fb188 | ||
|
|
5a123d0840 | ||
|
|
a186254e14 | ||
|
|
d96d82939a | ||
|
|
1ebdba13a6 | ||
|
|
f6326fcc99 | ||
|
|
c8e35afecb | ||
|
|
a2e3f28060 | ||
|
|
ef54dddbbc | ||
|
|
46b7f80fef | ||
|
|
890b515e44 | ||
|
|
7174f65da3 | ||
|
|
fb52d472d2 | ||
|
|
5f0ea2c2c7 | ||
|
|
f0048a5611 | ||
|
|
a9cd2cd278 | ||
|
|
8d72589743 | ||
|
|
90e224bd96 | ||
|
|
290a83e2ed | ||
|
|
44a3595d77 | ||
|
|
6525bda9fd | ||
|
|
1b36050621 | ||
|
|
7cc2a070e8 | ||
|
|
230f24208b | ||
|
|
0ecf981673 | ||
|
|
cacf2629fd | ||
|
|
2c935dc4e0 | ||
|
|
a2d7f56933 | ||
|
|
b338c77726 | ||
|
|
40e9f0eaf2 | ||
|
|
a2011b035d | ||
|
|
e34c18a26e | ||
|
|
1092f6b2a2 | ||
|
|
6897e3cc52 | ||
|
|
2242224a0f | ||
|
|
f63963403b | ||
|
|
498e3aa3ee | ||
|
|
b0c14cfe05 | ||
|
|
0259977fa9 | ||
|
|
eb5607544c | ||
|
|
4999c792f1 | ||
|
|
5af338f92b | ||
|
|
071aad4815 | ||
|
|
a43cca7720 | ||
|
|
aa260f800e | ||
|
|
a4fb2501d8 | ||
|
|
627abaf1a7 | ||
|
|
5ead77bcd1 | ||
|
|
9ffed70ffd | ||
|
|
cbfd533d49 | ||
|
|
d3ff8d7fb0 | ||
|
|
19fe73e78e | ||
|
|
72a0f70e7a | ||
|
|
645a0ce2d4 | ||
|
|
d19bf0970b | ||
|
|
10eb041199 | ||
|
|
99ca4047dd | ||
|
|
d838214f96 | ||
|
|
c463321643 | ||
|
|
a94a00de1d | ||
|
|
9a35c08300 | ||
|
|
8bd97532df | ||
|
|
baed03d50d | ||
|
|
c984bedd09 | ||
|
|
e6343ca272 | ||
|
|
f88681951a | ||
|
|
87fcca91bd | ||
|
|
6fd6b794ef | ||
|
|
2fff18fd0c | ||
|
|
91a772a952 | ||
|
|
88ec3b9f6c | ||
|
|
2e8f4806d2 | ||
|
|
b8cf2b213b | ||
|
|
3035bbdfd3 | ||
|
|
c3165252f8 | ||
|
|
5a511c7591 | ||
|
|
48be3ee572 | ||
|
|
734712bf9c | ||
|
|
a2f84b144f | ||
|
|
74f2b4cb74 | ||
|
|
58d22350d8 | ||
|
|
b69e453061 | ||
|
|
a8cd6b735f | ||
|
|
51d5182592 | ||
|
|
6240162ecf | ||
|
|
5c592731f3 | ||
|
|
aef097e348 | ||
|
|
77ca38aa10 | ||
|
|
0b23eae429 | ||
|
|
b92565a096 | ||
|
|
3dcc2843ae | ||
|
|
34dd7b76b1 | ||
|
|
b435723b8c | ||
|
|
749dacc749 | ||
|
|
fd44295b17 | ||
|
|
17e69f9326 | ||
|
|
b44d1f4fec | ||
|
|
10ed2997d8 | ||
|
|
bfd33becbc | ||
|
|
50c28cdd60 | ||
|
|
764875147a | ||
|
|
440a8bdea7 | ||
|
|
faf9e467e4 | ||
|
|
072a347a54 | ||
|
|
eee205c688 | ||
|
|
f0dbedd39d | ||
|
|
f4ad1214e7 | ||
|
|
ca575bd35d | ||
|
|
fabda7c4b2 | ||
|
|
18c41bfc19 | ||
|
|
dfbe7447c9 | ||
|
|
5e0b0e69a5 | ||
|
|
6280ed2201 | ||
|
|
44cfb190f3 | ||
|
|
f86a7455c4 | ||
|
|
69c332b023 | ||
|
|
6280b35035 | ||
|
|
4a97e26bd9 | ||
|
|
152dc6e5d0 | ||
|
|
f5a148e6b3 | ||
|
|
a8a796f922 | ||
|
|
41a232de60 | ||
|
|
c3c8c4fa73 | ||
|
|
0f70a21ba6 | ||
|
|
132861e175 | ||
|
|
bd1febeb41 | ||
|
|
f588fcf7b0 | ||
|
|
99a902a311 | ||
|
|
e8c99e4e63 | ||
|
|
afba132c13 | ||
|
|
8a7907e4cf | ||
|
|
a52187a276 | ||
|
|
4a163b54f3 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,3 @@
|
||||
*.pyc
|
||||
/build/
|
||||
/node_modules/
|
||||
/dist/
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
*.pyc
|
||||
/build/
|
||||
|
||||
@@ -106,6 +106,13 @@ style of the existing OpenLayers 3 code, which includes:
|
||||
|
||||
* Use `array.length = 0` instead of `goog.array.clear`.
|
||||
|
||||
* Use `v !== undefined` instead of `goog.isDef(v)` and `v === null` instead of
|
||||
`goog.isNull(v)`.
|
||||
|
||||
* Use ECMAScript 5.1 functions instead of the `goog` equivalents. For example,
|
||||
use `Object.keys(obj)` instead of `goog.object.getKeys(obj)`, `arr.forEach(f)`
|
||||
instead of `goog.array.forEach(arr, f)`, etc ...
|
||||
|
||||
* Use bracket notation instead of `goog.object.set` and `goog.object.get` (with
|
||||
two arguments).
|
||||
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
## Upgrade notes
|
||||
|
||||
### v3.12.0
|
||||
|
||||
#### `ol.Map#forEachFeatureAtPixel` changes
|
||||
|
||||
The optional `layerFilter` function is now also called for unmanaged layers. To get the same behaviour as before, wrap your layer filter code in an if block like this:
|
||||
```js
|
||||
function layerFilter(layer) {
|
||||
if (map.getLayers().getArray().indexOf(layer) !== -1) {
|
||||
// existing layer filter code
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### v3.11.0
|
||||
|
||||
#### `ol.format.KML` changes
|
||||
|
||||
11
changelog/v3.11.2.md
Normal file
11
changelog/v3.11.2.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# v3.11.2
|
||||
|
||||
## Summary
|
||||
|
||||
The v3.11.2 release is a patch release that addresses a few regressions in the v3.11.1 release. See the [v3.11.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.11.0) for details on upgrading from v3.10.
|
||||
|
||||
## Fixes
|
||||
|
||||
* [#4450](https://github.com/openlayers/ol3/pull/4450) - Fix select interaction regression caused by #4391 ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4448](https://github.com/openlayers/ol3/pull/4448) - Check ol.source.UrlTile#urls property for null value ([@fredj](https://github.com/fredj))
|
||||
* [#4439](https://github.com/openlayers/ol3/pull/4439) - Allow '' for crossOrigin (as Anonymous alias) ([@ahocevar](https://github.com/ahocevar))
|
||||
96
changelog/v3.12.0.md
Normal file
96
changelog/v3.12.0.md
Normal file
@@ -0,0 +1,96 @@
|
||||
# v3.12.0
|
||||
|
||||
## Summary
|
||||
|
||||
The v3.12.0 release includes features and fixes from 71 pull requests since the v3.11.2 release. New features and improvements include:
|
||||
|
||||
* Tile coordinate wrapping for raster reprojection.
|
||||
* Support for multi-line labels.
|
||||
* Allow rendering geometries to an arbitrary canvas (useful for vector legends).
|
||||
|
||||
## Upgrade notes
|
||||
|
||||
#### `ol.Map#forEachFeatureAtPixel` changes
|
||||
|
||||
The optional `layerFilter` function is now also called for unmanaged layers. To get the same behaviour as before, wrap your layer filter code in an if block like this:
|
||||
```js
|
||||
function layerFilter(layer) {
|
||||
if (map.getLayers().getArray().indexOf(layer) !== -1) {
|
||||
// existing layer filter code
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Full list of changes
|
||||
|
||||
* [#4559](https://github.com/openlayers/ol3/pull/4559) - Fix up failing KML test in Firefox ([@bartvde](https://github.com/bartvde))
|
||||
* [#4561](https://github.com/openlayers/ol3/pull/4561) - Exclude feature loader MVT test from IE9 ([@bartvde](https://github.com/bartvde))
|
||||
* [#4552](https://github.com/openlayers/ol3/pull/4552) - Make sure compiled code calls ol.VectorTile#setProjection ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4551](https://github.com/openlayers/ol3/pull/4551) - Handle tile coordinate wrapping when reprojecting raster tiles ([@klokantech](https://github.com/klokantech))
|
||||
* [#4544](https://github.com/openlayers/ol3/pull/4544) - Update vector-tile to version 1.2.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4537](https://github.com/openlayers/ol3/pull/4537) - Allow specifying non default DPI on ol.source.TileArcGISRest ([@bartvde](https://github.com/bartvde))
|
||||
* [#4548](https://github.com/openlayers/ol3/pull/4548) - Improve vector tile related docs ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4549](https://github.com/openlayers/ol3/pull/4549) - Update vector label example ([@tsauerwein](https://github.com/tsauerwein))
|
||||
* [#4512](https://github.com/openlayers/ol3/pull/4512) - Support for multi-line labels (improved) ([@flightaware](https://github.com/flightaware))
|
||||
* [#4546](https://github.com/openlayers/ol3/pull/4546) - Update coveralls to version 2.11.6 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4539](https://github.com/openlayers/ol3/pull/4539) - Ignore index.html in example list ([@fredj](https://github.com/fredj))
|
||||
* [#4536](https://github.com/openlayers/ol3/pull/4536) - Register the change callback when the tile is enqueued ([@fredj](https://github.com/fredj))
|
||||
* [#4528](https://github.com/openlayers/ol3/pull/4528) - Remove redundant code from ol.featureloader.tile ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4535](https://github.com/openlayers/ol3/pull/4535) - Do not use an array for a single style ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4532](https://github.com/openlayers/ol3/pull/4532) - Mark olx.source.WMTSOptions#dimensions as not null ([@fredj](https://github.com/fredj))
|
||||
* [#4530](https://github.com/openlayers/ol3/pull/4530) - Remove use of goog.isNull ([@fredj](https://github.com/fredj))
|
||||
* [#4529](https://github.com/openlayers/ol3/pull/4529) - Update coding style rules ([@fredj](https://github.com/fredj))
|
||||
* [#4518](https://github.com/openlayers/ol3/pull/4518) - Add support for OSM vector tiles ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4524](https://github.com/openlayers/ol3/pull/4524) - Add example for rendering custom point symbols ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4523](https://github.com/openlayers/ol3/pull/4523) - Allow rendering geometries to an arbitrary canvas ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4525](https://github.com/openlayers/ol3/pull/4525) - Make render tests work on more devices ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4515](https://github.com/openlayers/ol3/pull/4515) - Accept HTMLCanvasElement for an icon's img ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4521](https://github.com/openlayers/ol3/pull/4521) - Fix imagestyle docs ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4508](https://github.com/openlayers/ol3/pull/4508) - Remove unused files ([@fredj](https://github.com/fredj))
|
||||
* [#4487](https://github.com/openlayers/ol3/pull/4487) - Remove fallback css color ([@fredj](https://github.com/fredj))
|
||||
* [#4502](https://github.com/openlayers/ol3/pull/4502) - Improve ol.source.WMTS.optionsFromCapabilities jsdoc layout ([@fredj](https://github.com/fredj))
|
||||
* [#4511](https://github.com/openlayers/ol3/pull/4511) - Minor code cleanup ([@fredj](https://github.com/fredj))
|
||||
* [#4510](https://github.com/openlayers/ol3/pull/4510) - Adding a check just in case the projection is not defined/supported ([@GeoCat](https://github.com/GeoCat))
|
||||
* [#4505](https://github.com/openlayers/ol3/pull/4505) - Remove use of goog.object.getKeys ([@fredj](https://github.com/fredj))
|
||||
* [#4472](https://github.com/openlayers/ol3/pull/4472) - Do not ignore layer filter for unmanaged layers ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4476](https://github.com/openlayers/ol3/pull/4476) - Remove use of goog.functions.constant ([@fredj](https://github.com/fredj))
|
||||
* [#4484](https://github.com/openlayers/ol3/pull/4484) - Remove use of goog.dom.createDom ([@fredj](https://github.com/fredj))
|
||||
* [#4486](https://github.com/openlayers/ol3/pull/4486) - Remove note about DragZoom and vector support ([@fredj](https://github.com/fredj))
|
||||
* [#4483](https://github.com/openlayers/ol3/pull/4483) - Remove use of goog.object.containsKey ([@fredj](https://github.com/fredj))
|
||||
* [#4475](https://github.com/openlayers/ol3/pull/4475) - Fix up failing tests in Internet Explorer ([@bartvde](https://github.com/bartvde))
|
||||
* [#4485](https://github.com/openlayers/ol3/pull/4485) - Use appendChild instead of goog.dom.append ([@fredj](https://github.com/fredj))
|
||||
* [#4481](https://github.com/openlayers/ol3/pull/4481) - Remove blur workaround in ol.control.Attribution ([@fredj](https://github.com/fredj))
|
||||
* [#4479](https://github.com/openlayers/ol3/pull/4479) - Export ol.interaction.Interaction#getMap function ([@fredj](https://github.com/fredj))
|
||||
* [#4478](https://github.com/openlayers/ol3/pull/4478) - Fix olx.control.FullScreenOptions#label apidoc ([@fredj](https://github.com/fredj))
|
||||
* [#4477](https://github.com/openlayers/ol3/pull/4477) - Replace goog.nullFunction with ol.nullFunction ([@fredj](https://github.com/fredj))
|
||||
* [#4474](https://github.com/openlayers/ol3/pull/4474) - Remove use of goog.dom.createElement and goog.dom.createTextNode ([@fredj](https://github.com/fredj))
|
||||
* [#4469](https://github.com/openlayers/ol3/pull/4469) - Upgrade to JSTS 0.17.0 in example ([@bjornharrtell](https://github.com/bjornharrtell))
|
||||
* [#4465](https://github.com/openlayers/ol3/pull/4465) - Update handlebars to version 4.0.5 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4464](https://github.com/openlayers/ol3/pull/4464) - Merge in changes from the 3.11.2 release. ([@openlayers](https://github.com/openlayers))
|
||||
* [#4463](https://github.com/openlayers/ol3/pull/4463) - Remove use of goog.array.sort ([@fredj](https://github.com/fredj))
|
||||
* [#4450](https://github.com/openlayers/ol3/pull/4450) - Fix select interaction regression caused by #4391 ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4458](https://github.com/openlayers/ol3/pull/4458) - Remove extra space in type annotation ([@fredj](https://github.com/fredj))
|
||||
* [#4420](https://github.com/openlayers/ol3/pull/4420) - Remove Bootstrap and jQuery from example snippets. ([@openlayers](https://github.com/openlayers))
|
||||
* [#4442](https://github.com/openlayers/ol3/pull/4442) - Use jsdoc@3.4.0. ([@tschaub](https://github.com/tschaub))
|
||||
* [#4449](https://github.com/openlayers/ol3/pull/4449) - Change the label of the full screen button to be more intuitive ([@bartvde](https://github.com/bartvde))
|
||||
* [#4448](https://github.com/openlayers/ol3/pull/4448) - Check ol.source.UrlTile#urls property for null value ([@fredj](https://github.com/fredj))
|
||||
* [#4440](https://github.com/openlayers/ol3/pull/4440) - Raster reprojection tutorial ([@klokantech](https://github.com/klokantech))
|
||||
* [#4439](https://github.com/openlayers/ol3/pull/4439) - Allow '' for crossOrigin (as Anonymous alias) ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4429](https://github.com/openlayers/ol3/pull/4429) - Dispatch a change event only if the value changes ([@fredj](https://github.com/fredj))
|
||||
* [#4435](https://github.com/openlayers/ol3/pull/4435) - Remove unnecessary cast ([@fredj](https://github.com/fredj))
|
||||
* [#4434](https://github.com/openlayers/ol3/pull/4434) - Remove unused local variables ([@fredj](https://github.com/fredj))
|
||||
* [#4433](https://github.com/openlayers/ol3/pull/4433) - Remove unused local variables ([@fredj](https://github.com/fredj))
|
||||
* [#4140](https://github.com/openlayers/ol3/pull/4140) - Add flight animation example ([@tsauerwein](https://github.com/tsauerwein))
|
||||
* [#4428](https://github.com/openlayers/ol3/pull/4428) - Add imageSize regression test for ol.source.ImageWMS ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4426](https://github.com/openlayers/ol3/pull/4426) - Improve ol.source.StaticImage ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4425](https://github.com/openlayers/ol3/pull/4425) - Test number property with !== undefined ([@fredj](https://github.com/fredj))
|
||||
* [#4423](https://github.com/openlayers/ol3/pull/4423) - Update mocha to version 2.3.4 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4416](https://github.com/openlayers/ol3/pull/4416) - Update clean-css to version 3.4.8 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4415](https://github.com/openlayers/ol3/pull/4415) - Scale StaticImage image to imageExtent ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4414](https://github.com/openlayers/ol3/pull/4414) - Remove ol.ImageUrlFunction ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#4389](https://github.com/openlayers/ol3/pull/4389) - Smooth transitions on parameter changes ([@elemoine](https://github.com/elemoine))
|
||||
* [#4410](https://github.com/openlayers/ol3/pull/4410) - Merge in changes from the 3.11.1 release. ([@openlayers](https://github.com/openlayers))
|
||||
* [#4401](https://github.com/openlayers/ol3/pull/4401) - Allow style function to return a style. ([@tschaub](https://github.com/tschaub))
|
||||
* [#4404](https://github.com/openlayers/ol3/pull/4404) - Set correctly the opt_this parameter when writing a KML document ([@oterral](https://github.com/oterral))
|
||||
* [#4397](https://github.com/openlayers/ol3/pull/4397) - Update glob to version 6.0.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4362](https://github.com/openlayers/ol3/pull/4362) - Rotate control now takes optional resetNorth function. ([@tamarmot](https://github.com/tamarmot))
|
||||
@@ -1,8 +1,8 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" type="text/css">
|
||||
@@ -11,6 +11,7 @@
|
||||
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
|
||||
{{{ extraHead.local }}}
|
||||
{{{ css.tag }}}
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch"></script>
|
||||
<script src="./resources/zeroclipboard/ZeroClipboard.min.js"></script>
|
||||
<title>{{ title }}</title>
|
||||
</head>
|
||||
@@ -24,14 +25,17 @@
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
{{{ contents }}}
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<h4 id="title">{{ title }}</h4>
|
||||
{{{ contents }}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<p id="shortdesc">{{ shortdesc }}</p>
|
||||
<div id="docs">{{ md docs }}</div>
|
||||
<div id="tags">{{ tags }}</div>
|
||||
<div id="api-links">Related API documentation: {{{ js.apiHtml }}}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,47 +45,33 @@
|
||||
<a id="copy-button"><i class="fa fa-clipboard"></i> Copy</a>
|
||||
<a id="jsfiddle-button"><i class="fa fa-jsfiddle"></i> Edit</a>
|
||||
</div>
|
||||
<form method="POST" id="jsfiddle-form" target="_blank" action="http://jsfiddle.net/api/post/jquery/1.11.0/">
|
||||
<form method="POST" id="jsfiddle-form" target="_blank" action="http://jsfiddle.net/api/post/library/pure/">
|
||||
<textarea class="hidden" name="js">{{ js.source }}</textarea>
|
||||
<textarea class="hidden" name="css">{{ css.source }}</textarea>
|
||||
<textarea class="hidden" name="html">{{ contents }}</textarea>
|
||||
<input type="hidden" name="wrap" value="l">
|
||||
<input type="hidden" name="resources" value="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css,https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js,http://openlayers.org/en/v{{ olVersion }}/css/ol.css,http://openlayers.org/en/v{{ olVersion }}/build/ol.js{{ extraResources }}">
|
||||
<input type="hidden" name="resources" value="http://openlayers.org/en/v{{ olVersion }}/css/ol.css,http://openlayers.org/en/v{{ olVersion }}/build/ol.js{{ extraResources }}">
|
||||
</form>
|
||||
<pre><code id="example-source" class="language-markup"><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ title }}</title>
|
||||
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
|
||||
<link rel="stylesheet" href="http://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css">
|
||||
<script src="http://openlayers.org/en/v{{ olVersion }}/build/ol.js"></script>
|
||||
{{ extraHead.remote }}
|
||||
{{#if css.source}}
|
||||
<script src="http://openlayers.org/en/v{{ olVersion }}/build/ol.js"></script>{{#if extraHead.remote}}
|
||||
{{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}}
|
||||
<style>
|
||||
{{ css.source }}
|
||||
</style>
|
||||
{{/if}}
|
||||
{{ indent css.source spaces=6 }} </style>{{/if}}
|
||||
</head>
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
|
||||
{{ contents }}
|
||||
</div>
|
||||
<script>
|
||||
{{ js.source }}
|
||||
</script>
|
||||
{{ indent contents spaces=4 }} <script>
|
||||
{{ indent js.source spaces=6 }} </script>
|
||||
</body>
|
||||
</html></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
|
||||
<script src="./resources/common.js"></script>
|
||||
<script src="./resources/prism/prism.min.js"></script>
|
||||
{{{ js.tag }}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -16,6 +16,4 @@ To enable this, examples have the following, not needed in application code:
|
||||
|
||||
* html files load `resources/common.js` and some scripts use `common.getRendererFromQueryString()` to set the map renderer; application code would not need these
|
||||
|
||||
* in addition, examples use Twitter Bootstrap and jQuery; this is of course not a requirement - you may use whichever presentation/helper libraries you wish
|
||||
|
||||
At the bottom of each example generated in the `build/examples` folder, a modified version of its source code is shown. That modified version can be run standalone and is usually used as starting point for users to extend examples into their own application.
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
]
|
||||
},
|
||||
"plugins": [
|
||||
"node_modules/jsdoc-fork/plugins/markdown",
|
||||
"node_modules/jsdoc/plugins/markdown",
|
||||
"config/jsdoc/api/plugins/inheritdoc",
|
||||
"config/jsdoc/api/plugins/typedefs",
|
||||
"config/jsdoc/api/plugins/events",
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
[ol.layer.Tile](ol.layer.Tile.html)<br>
|
||||
[ol.layer.Image](ol.layer.Image.html)<br>
|
||||
[ol.layer.Vector](ol.layer.Vector.html)</td>
|
||||
[ol.layer.VectorTile](ol.layer.VectorTile.html)</td>
|
||||
</tr><tr>
|
||||
<th>Controls</th><th>Interactions</th><th>Sources and formats</th>
|
||||
</tr><tr>
|
||||
@@ -27,6 +28,7 @@ Interactions for [vector features](ol.Feature.html)
|
||||
<td>[Tile sources](ol.source.Tile.html) for [ol.layer.Tile](ol.layer.Tile.html)
|
||||
<br>[Image sources](ol.source.Image.html) for [ol.layer.Image](ol.layer.Image.html)
|
||||
<br>[Vector sources](ol.source.Vector.html) for [ol.layer.Vector](ol.layer.Vector.html)
|
||||
<br>[Vector tile sources](ol.source.VectorTile.html) for [ol.layer.VectorTile](ol.layer.VectorTile.html)
|
||||
<br>[Formats](ol.format.Feature.html) for reading/writing vector data
|
||||
<br>[ol.format.WMSCapabilities](ol.format.WMSCapabilities.html)</td></tr>
|
||||
<tr><th>Projections</th><th>Observable objects</th><th>Other components</th></tr>
|
||||
|
||||
@@ -16,7 +16,7 @@ exports.defineTags = function(dictionary) {
|
||||
doclet.stability = level;
|
||||
} else {
|
||||
var errorText = util.format('Invalid stability level (%s) in %s line %s', tag.text, doclet.meta.filename, doclet.meta.lineno);
|
||||
require('jsdoc-fork/lib/jsdoc/util/error').handle( new Error(errorText) );
|
||||
require('jsdoc/lib/jsdoc/util/error').handle( new Error(errorText) );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*global env: true */
|
||||
var template = require('jsdoc-fork/lib/jsdoc/template'),
|
||||
fs = require('jsdoc-fork/lib/jsdoc/fs'),
|
||||
path = require('jsdoc-fork/lib/jsdoc/path'),
|
||||
var template = require('jsdoc/lib/jsdoc/template'),
|
||||
fs = require('jsdoc/lib/jsdoc/fs'),
|
||||
path = require('jsdoc/lib/jsdoc/path'),
|
||||
taffy = require('taffydb').taffy,
|
||||
handle = require('jsdoc-fork/lib/jsdoc/util/error').handle,
|
||||
helper = require('jsdoc-fork/lib/jsdoc/util/templateHelper'),
|
||||
handle = require('jsdoc/lib/jsdoc/util/error').handle,
|
||||
helper = require('jsdoc/lib/jsdoc/util/templateHelper'),
|
||||
_ = require('underscore'),
|
||||
htmlsafe = helper.htmlsafe,
|
||||
linkto = helper.linkto,
|
||||
@@ -350,8 +350,8 @@ exports.publish = function(taffyData, opts, tutorials) {
|
||||
var staticFileScanner;
|
||||
if (conf['default'].staticFiles) {
|
||||
staticFilePaths = conf['default'].staticFiles.paths || [];
|
||||
staticFileFilter = new (require('jsdoc-fork/lib/jsdoc/src/filter')).Filter(conf['default'].staticFiles);
|
||||
staticFileScanner = new (require('jsdoc-fork/lib/jsdoc/src/scanner')).Scanner();
|
||||
staticFileFilter = new (require('jsdoc/lib/jsdoc/src/filter')).Filter(conf['default'].staticFiles);
|
||||
staticFileScanner = new (require('jsdoc/lib/jsdoc/src/scanner')).Scanner();
|
||||
|
||||
staticFilePaths.forEach(function(filePath) {
|
||||
var extraStaticFiles = staticFileScanner.scan([filePath], 10, staticFileFilter);
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -6,8 +6,6 @@ var assert = require('assert');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
var Promise = require('bluebird');
|
||||
|
||||
|
||||
/**
|
||||
* Publish hook for the JSDoc template. Writes to JSON stdout.
|
||||
@@ -171,8 +169,6 @@ exports.publish = function(data, opts) {
|
||||
return (symbol.name in augments || symbol.virtual);
|
||||
});
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
|
||||
process.stdout.write(
|
||||
JSON.stringify({
|
||||
symbols: symbols,
|
||||
@@ -180,8 +176,6 @@ exports.publish = function(data, opts) {
|
||||
typedefs: typedefs,
|
||||
externs: externs,
|
||||
base: base
|
||||
}, null, 2), resolve);
|
||||
|
||||
});
|
||||
}, null, 2));
|
||||
|
||||
};
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
}
|
||||
|
||||
.ol-scale-line {
|
||||
background: #95b9e6;
|
||||
background: rgba(0,60,136,0.3);
|
||||
border-radius: 4px;
|
||||
bottom: 8px;
|
||||
@@ -20,9 +19,9 @@
|
||||
position: absolute;
|
||||
}
|
||||
.ol-scale-line-inner {
|
||||
border: 1px solid #eeeeee;
|
||||
border: 1px solid #eee;
|
||||
border-top: none;
|
||||
color: #eeeeee;
|
||||
color: #eee;
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
margin: 1px;
|
||||
@@ -47,7 +46,6 @@
|
||||
|
||||
.ol-control {
|
||||
position: absolute;
|
||||
background-color: #eee;
|
||||
background-color: rgba(255,255,255,0.4);
|
||||
border-radius: 4px;
|
||||
padding: 2px;
|
||||
@@ -95,7 +93,6 @@
|
||||
height: 1.375em;
|
||||
width: 1.375em;
|
||||
line-height: .4em;
|
||||
background-color: #7b98bc;
|
||||
background-color: rgba(0,60,136,0.5);
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
@@ -122,7 +119,6 @@
|
||||
.ol-control button:hover,
|
||||
.ol-control button:focus {
|
||||
text-decoration: none;
|
||||
background-color: #4c6079;
|
||||
background-color: rgba(0,60,136,0.7);
|
||||
}
|
||||
.ol-zoom .ol-zoom-in {
|
||||
|
||||
@@ -10,3 +10,4 @@ layout: doc.hbs
|
||||
* [Create Custom Builds](custom-builds.html)
|
||||
* [Bundle Application and OpenLayers using Browserify](browserify.html)
|
||||
* [Compile Application and OpenLayers together](closure.html)
|
||||
* [Raster Reprojection](raster-reprojection.html)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 102 KiB |
BIN
doc/tutorials/raster-reprojection-resources/how-it-works.jpg
Normal file
BIN
doc/tutorials/raster-reprojection-resources/how-it-works.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 127 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
132
doc/tutorials/raster-reprojection.md
Normal file
132
doc/tutorials/raster-reprojection.md
Normal file
@@ -0,0 +1,132 @@
|
||||
---
|
||||
title: Raster Reprojection
|
||||
layout: doc.hbs
|
||||
---
|
||||
|
||||
# Raster Reprojection
|
||||
|
||||
OpenLayers 3 has an ability to display raster data from WMS, WMTS, static images and many other sources in a different coordinate system than delivered from the server.
|
||||
Transformation of the map projections of the image happens directly in a web browser.
|
||||
The view in any Proj4js supported coordinate reference system is possible and previously incompatible layers can now be combined and overlaid.
|
||||
|
||||
# Usage
|
||||
The API usage is very simple. Just specify proper projection (using [EPSG](http://epsg.io) code) on `ol.View`:
|
||||
``` javascript
|
||||
var map = new ol.Map({
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
projection: 'EPSG:3857', //HERE IS THE VIEW PROJECTION
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
}),
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.TileWMS({
|
||||
projection: 'EPSG:4326', //HERE IS THE DATA SOURCE PROJECTION
|
||||
url: 'http://demo.boundlessgeo.com/geoserver/wms',
|
||||
params: {
|
||||
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
|
||||
}
|
||||
})
|
||||
})
|
||||
]
|
||||
});
|
||||
```
|
||||
If a source (based on `ol.source.TileImage` or `ol.source.Image`) has a projection different from the current `ol.View`’s projection then the reprojection happens automatically under the hood.
|
||||
|
||||
### Examples
|
||||
- [Raster reprojection demo](http://openlayers.org/en/master/examples/reprojection.html)
|
||||
- [OpenStreetMap to WGS84 reprojection](http://openlayers.org/en/master/examples/reprojection-wgs84.html)
|
||||
- [Reprojection with EPSG.io database search](http://openlayers.org/en/master/examples/reprojection-by-code.html)
|
||||
- [Image reprojection](http://openlayers.org/en/master/examples/reprojection-image.html)
|
||||
|
||||
### Custom projection
|
||||
The easiest way to use a custom projection is to add the [Proj4js](http://proj4js.org/) library to your project and then define the projection using a proj4 definition string.
|
||||
Following example shows definition of a [British National Grid](http://epsg.io/27700):
|
||||
|
||||
``` html
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.12/proj4.js"></script>
|
||||
```
|
||||
|
||||
``` javascript
|
||||
proj4.defs('EPSG:27700', '+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 ' +
|
||||
'+x_0=400000 +y_0=-100000 +ellps=airy ' +
|
||||
'+towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 ' +
|
||||
'+units=m +no_defs');
|
||||
var proj27700 = ol.proj.get('EPSG:27700');
|
||||
proj27700.setExtent([0, 0, 700000, 1300000]);
|
||||
```
|
||||
|
||||
### Change of the view projection
|
||||
To switch the projection used to display the map you have to set a new `ol.View` with selected projection on the `ol.Map`:
|
||||
``` javascript
|
||||
map.setView(new ol.View({
|
||||
projection: 'EPSG:27700',
|
||||
center: [400000, 650000],
|
||||
zoom: 4
|
||||
}));
|
||||
```
|
||||
|
||||
## TileGrid and Extents
|
||||
When reprojection is needed, new tiles (in the target projection) are under the hood created from the original source tiles.
|
||||
The TileGrid of the reprojected tiles is by default internally constructed using `ol.tilegrid.getForProjection(projection)`.
|
||||
The projection should have extent defined (see above) for this to work properly.
|
||||
|
||||
Alternatively, a custom target TileGrid can be constructed manually and set on the source instance using `ol.source.TileImage#setTileGridForProjection(projection, tilegrid)`.
|
||||
This TileGrid will then be used when reprojecting to the specified projection instead of creating the default one.
|
||||
In certain cases, this can be used to optimize performance (by tweaking tile sizes) or visual quality (by specifying resolutions).
|
||||
|
||||
# How it works
|
||||
|
||||
The reprojection process is based on triangles -- the target raster is divided into a limited number of triangles with vertices transformed using `ol.proj` capabilities ([proj4js](http://proj4js.org/) is usually utilized to define custom transformations).
|
||||
The reprojection of pixels inside the triangle is approximated with an affine transformation (with rendering hardware-accelerated by the canvas 2d context):
|
||||
|
||||
<img src="raster-reprojection-resources/how-it-works.jpg" alt="How it works" width="600" />
|
||||
|
||||
This way we can support a wide range of projections from proj4js (or even custom transformation functions) on almost any hardware (with canvas 2d support) with a relatively small number of actual transformation calculations.
|
||||
|
||||
The precision of the reprojection is then limited by the number of triangles.
|
||||
|
||||
The reprojection process preserves transparency on the raster data supplied from the source (png or gif) and the gaps and no-data pixels generated by reprojection are automatically transparent.
|
||||
|
||||
###Dynamic triangulation
|
||||
|
||||
The above image above shows a noticeable error (especially on the edges) when the original image (left; EPSG:27700) is transformed with only a limited number of triangles (right; EPSG:3857).
|
||||
The error can be minimized by increasing the number of triangles used.
|
||||
|
||||
Since some transformations require a more detail triangulation network, the dynamic triangulation process automatically measures reprojection error and iteratively subdivides to meet a specific error threshold:
|
||||
|
||||
<img src="raster-reprojection-resources/iterative-triangulation.png" alt="Iterative triangulation" width="600" />
|
||||
|
||||
For debugging, rendering of the reprojection edges can be enabled by `ol.source.TileImage#setRenderReprojectionEdges(true)`.
|
||||
|
||||
# Advanced
|
||||
|
||||
### Disabling reprojection
|
||||
In case you are creating a custom build of OpenLayers and do not need the reprojection code, you can reduce the build size by setting `ol.ENABLE_RASTER_REPROJECTION` to `false`, which completely disables the reprojection support.
|
||||
See [Custom builds](custom-builds.html#defines) tutorial on how to do this.
|
||||
|
||||
### Triangulation precision threshold
|
||||
The default [triangulation error threshold](#dynamic-triangulation) in pixels is given by `ol.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD` (0.5 pixel).
|
||||
In case a different threshold needs to be defined for different sources, the `reprojectionErrorThreshold` option can be passed when constructing the tile image source.
|
||||
|
||||
###Limiting visibility of reprojected map by extent
|
||||
|
||||
The reprojection algorithm uses inverse transformation (from *view projection* to *data projection*).
|
||||
For certain coordinate systems this can result in a "double occurrence" of the source data on a map.
|
||||
For example, when reprojecting a map of Switzerland from EPSG:21781 to EPSG:3857, it is displayed twice: once at the proper place in Europe, but also in the Pacific Ocean near New Zealand, on the opposite side of the globe.
|
||||
|
||||
<img src="raster-reprojection-resources/double-occurrence.jpg" alt="Double occurrence of a reprojected map" width="600" />
|
||||
|
||||
Although this is mathematically correct behavior of the inverse transformation, visibility of the layer on multiple places is not expected by users.
|
||||
A possible general solution would be to calculate the forward transformation for every vertex as well - but this would significantly decrease performance (especially for computationally expensive transformations).
|
||||
|
||||
Therefore a recommended workaround is to define a proper visibility extent on the `ol.layer.Tile` in the view projection.
|
||||
Setting such a limit is demonstrated in the [reprojection demo example](http://openlayers.org/en/master/examples/reprojection.html).
|
||||
|
||||
### Resolution calculation
|
||||
When determining source tiles to load, the ideal source resolution needs to be calculated.
|
||||
The `ol.reproj.calculateSourceResolution(sourceProj, targetProj, targetCenter, targetResolution)` function calculates the ideal value in order to achieve pixel mapping as close as possible to 1:1 during reprojection, which is then used to select proper zoom level from the source.
|
||||
|
||||
It is, however, generally not practical to use the same source zoom level for the whole target zoom level -- different projections can have significantly different resolutions in different parts of the world (e.g. polar regions in EPSG:3857 vs EPSG:4326) and enforcing a single resolution for the whole zoom level would result in some tiles being scaled up/down, possibly requiring a huge number of source tiles to be loaded.
|
||||
Therefore, the resolution mapping is calculated separately for each reprojected tile (in the middle of the tile extent).
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Accessibility example
|
||||
title: Accessible Map
|
||||
shortdesc: Example of an accessible map.
|
||||
docs: >
|
||||
This page's `map` element has its `tabindex` attribute set to `"0"`, that makes it focusable. To focus the map element you can either navigate to it using the "tab" key or use the skip link. When the `map` element is focused the + and - keys can be used to zoom in and out and the arrow keys can be used to pan.
|
||||
@@ -10,11 +10,7 @@ docs: >
|
||||
|
||||
tags: "accessibility, tabindex"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<a class="skiplink" href="#map">Go to map</a>
|
||||
<div id="map" class="map" tabindex="0"></div>
|
||||
<button id="zoom-out">Zoom out</button>
|
||||
<button id="zoom-in">Zoom in</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Animation example
|
||||
title: View Animation
|
||||
shortdesc: Demonstrates animated pan, zoom, and rotation.
|
||||
docs: >
|
||||
This example shows how to use the beforeRender function on the Map to run one
|
||||
or more animations.
|
||||
tags: "animation"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<button id="rotate-left" title="Rotate clockwise">↻</button>
|
||||
<button id="rotate-right" title="Rotate counterclockwise">↺</button>
|
||||
<button id="rotate-around-rome">Rotate around Rome</button>
|
||||
@@ -23,5 +17,3 @@ tags: "animation"
|
||||
<button id="spin-to-rome">Spin to Rome</button>
|
||||
<button id="fly-to-bern">Fly to Bern</button>
|
||||
<button id="spiral-to-madrid">Spiral to Madrid</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Tiled ArcGIS MapServer example
|
||||
title: Tiled ArcGIS MapServer
|
||||
shortdesc: Example of a tiled ArcGIS layer.
|
||||
docs: >
|
||||
This example shows how to use an ArcGIS REST MapService as tiles.
|
||||
@@ -9,8 +9,4 @@ docs: >
|
||||
<code>ol.source.XYZ</code> instead.
|
||||
tags: arcgis, tile, tilelayer"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Attributions example
|
||||
title: Attributions
|
||||
shortdesc: Example of a attributions visibily change on map resize, to collapse them on small maps.
|
||||
docs: >
|
||||
When the map gets too small because of a resize, the attribution will be collapsed.
|
||||
@@ -8,8 +8,4 @@ docs: >
|
||||
of the map gets smaller than 600 pixels.
|
||||
tags: "attributions, openstreetmap"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Bing Maps example
|
||||
title: Bing Maps
|
||||
shortdesc: Example of a Bing Maps layer.
|
||||
docs: >
|
||||
<p>When the Bing Maps tile service doesn't have tiles for a given resolution and region it returns "placeholder" tiles indicating that. Zoom the map beyond level 19 to see the "placeholder" tiles. If you want OpenLayers to display stretched tiles in place of "placeholder" tiles beyond zoom level 19 then set <code>maxZoom</code> to <code>19</code> in the options passed to <code>ol.source.BingMaps</code>.</p>
|
||||
@@ -8,8 +8,6 @@ tags: "bing, bing-maps"
|
||||
cloak:
|
||||
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<select id="layer-select">
|
||||
<option value="Aerial">Aerial</option>
|
||||
@@ -18,5 +16,3 @@ cloak:
|
||||
<option value="collinsBart">Collins Bart</option>
|
||||
<option value="ordnanceSurvey">Ordnance Survey</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Blend modes example
|
||||
title: Blend Modes
|
||||
shortdesc: Shows how to change the canvas compositing / blending mode in post- and precompose eventhandlers.
|
||||
docs: >
|
||||
<p>This example shows how to change the canvas compositing / blending mode in
|
||||
@@ -20,13 +20,7 @@ docs: >
|
||||
checkboxes.</p>
|
||||
tags: "blendmode, blend-mode, blend mode, blendingmode, blending-mode, blending mode, composition, compositing, canvas, vector"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<form class="form-horizontal">
|
||||
<label>
|
||||
<select id="blend-mode" class="form-control">
|
||||
@@ -72,5 +66,3 @@ tags: "blendmode, blend-mode, blend mode, blendingmode, blending-mode, blending
|
||||
Blue circle affected
|
||||
</label>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Box selection example
|
||||
title: Box Selection
|
||||
shortdesc: Using a DragBox interaction to select features.
|
||||
docs: >
|
||||
<p>This example shows how to use a <code>DragBox</code> interaction to select features. Selected features are added
|
||||
to the feature overlay of a select interaction (<code>ol.interaction.Select</code>) for highlighting.</p>
|
||||
<p>Use <code>Ctrl+drag</code> (<code>Meta+drag</code> on Mac) to draw boxes.</p>
|
||||
<p>Use <code>Ctrl+Drag</code> (<code>Command+Drag</code> on Mac) to draw boxes.</p>
|
||||
tags: "DragBox, feature, selection, box"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
<div class="span4 offset4 pull-right">
|
||||
<div id="info" class="alert alert-success">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="info">No countries selected</div>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
.tooltip-inner {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Custom tooltips example
|
||||
title: Custom Tooltips
|
||||
shortdesc: This example shows how to customize the buttons tooltips with Bootstrap.
|
||||
docs: >
|
||||
This example shows how to customize the buttons tooltips with <a href="http://getbootstrap.com/javascript/#tooltips">Bootstrap</a>.
|
||||
tags: "custom, tooltip"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Canvas tiles example
|
||||
title: Canvas Tiles
|
||||
shortdesc: Renders tiles with coordinates for debugging.
|
||||
docs: >
|
||||
The black grid tiles are generated on the client with an HTML5 canvas. The
|
||||
@@ -10,8 +10,4 @@ docs: >
|
||||
`-y - 1`.
|
||||
tags: "layers, openstreetmap, canvas"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Advanced View Positioning example
|
||||
title: Advanced View Positioning
|
||||
shortdesc: This example demonstrates how a map's view can be adjusted so a geometry or coordinate is positioned at a specific pixel location.
|
||||
docs: >
|
||||
This example demonstrates how a map's view can be
|
||||
@@ -10,11 +10,10 @@ docs: >
|
||||
is used to fit a geometry in the view with the same padding. The
|
||||
view's <code>centerOn</code> method is used to position a coordinate (Lausanne)
|
||||
at a specific pixel location (the center of the black box).
|
||||
<p>Use <code>Alt</code>+<code>Shift</code>+drag to rotate the map.</p>
|
||||
<p>Use <code>Alt+Shift+Drag</code> to rotate the map.</p>
|
||||
tags: "center, rotation, openstreetmap"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12 mapcontainer">
|
||||
<div class="mapcontainer">
|
||||
<div id="map" class="map"></div>
|
||||
<div class="padding-top"></div>
|
||||
<div class="padding-left"></div>
|
||||
@@ -22,13 +21,8 @@ tags: "center, rotation, openstreetmap"
|
||||
<div class="padding-bottom"></div>
|
||||
<div class="center"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<button id="zoomtoswitzerlandbest">Zoom to Switzerland</button> (best fit),<br/>
|
||||
<button id="zoomtoswitzerlandconstrained">Zoom to Switzerland</button> (respect resolution constraint).<br/>
|
||||
<button id="zoomtoswitzerlandnearest">Zoom to Switzerland</button> (nearest),<br/>
|
||||
<button id="zoomtolausanne">Zoom to Lausanne</button> (with min resolution),<br/>
|
||||
<button id="centerlausanne">Center on Lausanne</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Clustering example
|
||||
title: Clustered Features
|
||||
shortdesc: Example of using <code>ol.source.Cluster</code>.
|
||||
docs: >
|
||||
This example shows how to do clustering on point features.
|
||||
tags: "cluster, vector"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -38,7 +38,7 @@ var clusters = new ol.layer.Vector({
|
||||
var size = feature.get('features').length;
|
||||
var style = styleCache[size];
|
||||
if (!style) {
|
||||
style = [new ol.style.Style({
|
||||
style = new ol.style.Style({
|
||||
image: new ol.style.Circle({
|
||||
radius: 10,
|
||||
stroke: new ol.style.Stroke({
|
||||
@@ -54,7 +54,7 @@ var clusters = new ol.layer.Vector({
|
||||
color: '#fff'
|
||||
})
|
||||
})
|
||||
})];
|
||||
});
|
||||
styleCache[size] = style;
|
||||
}
|
||||
return style;
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Manipulating colors with a raster source
|
||||
title: Color Manipulation
|
||||
shortdesc: Demonstrates color manipulation with a raster source.
|
||||
docs: >
|
||||
A raster source allows arbitrary manipulation of pixel values. In this example, RGB values on the input tile source are adjusted in a pixel-wise operation before being rendered with a second raster source. The raster operation takes pixels in in RGB space, converts them to HCL color space, adjusts the values based on the controls above, and then converts them back to RGB space for rendering.
|
||||
tags: "color, hue, lightness, chroma"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<table class="controls">
|
||||
<tr>
|
||||
@@ -26,5 +24,3 @@ tags: "color, hue, lightness, chroma"
|
||||
<td><input id="lightness" type="range" min="0" max="100" value="100"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Custom control example
|
||||
title: Custom Controls
|
||||
shortdesc: Shows how to create custom controls.
|
||||
docs: >
|
||||
This example creates a "rotate to north" button.
|
||||
tags: "custom, control"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -75,7 +75,7 @@ var map = new ol.Map({
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 2,
|
||||
zoom: 3,
|
||||
rotation: 1
|
||||
})
|
||||
});
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Custom interaction example
|
||||
title: Custom Interactions
|
||||
shortdesc: Example of a custom interaction.
|
||||
docs: >
|
||||
This example demonstrates creating a custom interaction by subclassing `ol.interaction.Pointer`.
|
||||
Note that the built in interaction `ol.interaction.Translate` might be a better option for moving features.
|
||||
tags: "drag, feature, vector, editing, custom, interaction"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -19,8 +19,7 @@ goog.require('ol.style.Style');
|
||||
/**
|
||||
* Define a namespace for the application.
|
||||
*/
|
||||
window.app = {};
|
||||
var app = window.app;
|
||||
var app = {};
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: d3 integration example
|
||||
title: d3 Integration
|
||||
shortdesc: Example of using ol3 and d3 together.
|
||||
docs: >
|
||||
<p>The example loads TopoJSON geometries and uses d3 (<code>d3.geo.path</code>) to render these geometries to a canvas element that is then used as the image of an ol3 image layer.</p>
|
||||
@@ -9,8 +9,4 @@ resources:
|
||||
- http://d3js.org/d3.v3.min.js
|
||||
- http://d3js.org/topojson.v1.min.js
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
1
examples/d3.js
vendored
1
examples/d3.js
vendored
@@ -1,5 +1,4 @@
|
||||
// NOCOMPILE
|
||||
// this example uses d3 for which we don't have an externs file.
|
||||
goog.require('ol');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
|
||||
1
examples/data/openflights/flights.json
Normal file
1
examples/data/openflights/flights.json
Normal file
File diff suppressed because one or more lines are too long
@@ -1,23 +1,19 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Device-Orientation example
|
||||
title: Device Orientation
|
||||
shortdesc: Listen to DeviceOrientation events.
|
||||
docs: >
|
||||
This example shows how to track changes in device orientation.
|
||||
tags: "orientation, openstreetmap"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<div class="span12">
|
||||
<h4 id="title">Device orientation example</h4>
|
||||
<label class="checkbox" for="track">
|
||||
<input id="track" type="checkbox"/>track changes
|
||||
<label>
|
||||
track changes
|
||||
<input id="track" type="checkbox"/>
|
||||
</label>
|
||||
<p>α : <code id="alpha"></code></p>
|
||||
<p>β : <code id="beta"></code></p>
|
||||
<p>γ : <code id="gamma"></code></p>
|
||||
<p>heading : <code id="heading"></code></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
α : <code id="alpha"></code>
|
||||
β : <code id="beta"></code>
|
||||
γ : <code id="gamma"></code>
|
||||
heading : <code id="heading"></code>
|
||||
</p>
|
||||
|
||||
@@ -1,21 +1,12 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Drag-and-Drop image vector example
|
||||
shortdesc: Example of using the drag-and-drop interaction with a ol.source.ImageVector. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. Each file is rendered to an image on the client.
|
||||
title: Drag-and-Drop Image Vector
|
||||
shortdesc: Example of using the drag-and-drop interaction with a ol.source.ImageVector.
|
||||
docs: >
|
||||
Example of using the drag-and-drop interaction with a ol.source.ImageVector. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. Each file is rendered to
|
||||
an image on the client.
|
||||
Example of using the drag-and-drop interaction with a ol.source.ImageVector. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. Each file is rendered to an image on the client.
|
||||
tags: "drag-and-drop-image-vector, gpx, geojson, igc, kml, topojson, vector, image"
|
||||
cloak:
|
||||
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<div class="span4 offset4 pull-right">
|
||||
<div id="info" class="alert alert-success">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="info"> </div>
|
||||
|
||||
@@ -19,7 +19,7 @@ goog.require('ol.style.Style');
|
||||
|
||||
|
||||
var defaultStyle = {
|
||||
'Point': [new ol.style.Style({
|
||||
'Point': new ol.style.Style({
|
||||
image: new ol.style.Circle({
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(255,255,0,0.5)'
|
||||
@@ -30,14 +30,14 @@ var defaultStyle = {
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
})],
|
||||
'LineString': [new ol.style.Style({
|
||||
}),
|
||||
'LineString': new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#f00',
|
||||
width: 3
|
||||
})
|
||||
})],
|
||||
'Polygon': [new ol.style.Style({
|
||||
}),
|
||||
'Polygon': new ol.style.Style({
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(0,255,255,0.5)'
|
||||
}),
|
||||
@@ -45,8 +45,8 @@ var defaultStyle = {
|
||||
color: '#0ff',
|
||||
width: 1
|
||||
})
|
||||
})],
|
||||
'MultiPoint': [new ol.style.Style({
|
||||
}),
|
||||
'MultiPoint': new ol.style.Style({
|
||||
image: new ol.style.Circle({
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(255,0,255,0.5)'
|
||||
@@ -57,14 +57,14 @@ var defaultStyle = {
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
})],
|
||||
'MultiLineString': [new ol.style.Style({
|
||||
}),
|
||||
'MultiLineString': new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#0f0',
|
||||
width: 3
|
||||
})
|
||||
})],
|
||||
'MultiPolygon': [new ol.style.Style({
|
||||
}),
|
||||
'MultiPolygon': new ol.style.Style({
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(0,0,255,0.5)'
|
||||
}),
|
||||
@@ -72,7 +72,7 @@ var defaultStyle = {
|
||||
color: '#00f',
|
||||
width: 1
|
||||
})
|
||||
})]
|
||||
})
|
||||
};
|
||||
|
||||
var styleFunction = function(feature, resolution) {
|
||||
|
||||
@@ -1,21 +1,12 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Drag-and-Drop example
|
||||
shortdesc: Example of using the drag-and-drop interaction. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. There is no projection transform support, so this will only work with data in EPSG:4326 and EPSG:3857.
|
||||
title: Drag-and-Drop
|
||||
shortdesc: Example of using the drag-and-drop interaction.
|
||||
docs: >
|
||||
Example of using the drag-and-drop interaction. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. There is no projection transform support, so this will
|
||||
only work with data in EPSG:4326 and EPSG:3857.
|
||||
Example of using the drag-and-drop interaction. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. There is no projection transform support, so this will only work with data in EPSG:4326 and EPSG:3857.
|
||||
tags: "drag-and-drop, gpx, geojson, igc, kml, topojson"
|
||||
cloak:
|
||||
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<div class="span4 offset4 pull-right">
|
||||
<div id="info" class="alert alert-success">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="info"> </div>
|
||||
|
||||
@@ -18,7 +18,7 @@ goog.require('ol.style.Style');
|
||||
|
||||
|
||||
var defaultStyle = {
|
||||
'Point': [new ol.style.Style({
|
||||
'Point': new ol.style.Style({
|
||||
image: new ol.style.Circle({
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(255,255,0,0.5)'
|
||||
@@ -29,14 +29,14 @@ var defaultStyle = {
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
})],
|
||||
'LineString': [new ol.style.Style({
|
||||
}),
|
||||
'LineString': new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#f00',
|
||||
width: 3
|
||||
})
|
||||
})],
|
||||
'Polygon': [new ol.style.Style({
|
||||
}),
|
||||
'Polygon': new ol.style.Style({
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(0,255,255,0.5)'
|
||||
}),
|
||||
@@ -44,8 +44,8 @@ var defaultStyle = {
|
||||
color: '#0ff',
|
||||
width: 1
|
||||
})
|
||||
})],
|
||||
'MultiPoint': [new ol.style.Style({
|
||||
}),
|
||||
'MultiPoint': new ol.style.Style({
|
||||
image: new ol.style.Circle({
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(255,0,255,0.5)'
|
||||
@@ -56,14 +56,14 @@ var defaultStyle = {
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
})],
|
||||
'MultiLineString': [new ol.style.Style({
|
||||
}),
|
||||
'MultiLineString': new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#0f0',
|
||||
width: 3
|
||||
})
|
||||
})],
|
||||
'MultiPolygon': [new ol.style.Style({
|
||||
}),
|
||||
'MultiPolygon': new ol.style.Style({
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(0,0,255,0.5)'
|
||||
}),
|
||||
@@ -71,7 +71,7 @@ var defaultStyle = {
|
||||
color: '#00f',
|
||||
width: 1
|
||||
})
|
||||
})]
|
||||
})
|
||||
};
|
||||
|
||||
var styleFunction = function(feature, resolution) {
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Drag rotate and zoom example
|
||||
title: Drag, Rotate, and Zoom
|
||||
shortdesc: A single interaction to drag, rotate, and zoom.
|
||||
docs: >
|
||||
<p><code>Shift</code> + Drag to rotate and zoom the map around its center.</p>
|
||||
<p><code>Shift+Drag</code> to rotate and zoom the map around its center.</p>
|
||||
tags: "drag, rotate, zoom, interaction"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Draw and modify features example
|
||||
title: Draw and Modify Features
|
||||
shortdesc: Example of using the ol.interaction.Draw interaction together with the ol.interaction.Modify interaction.
|
||||
docs: >
|
||||
Example of using the ol.interaction.Draw interaction together with the ol.interaction.Modify interaction.
|
||||
tags: "draw, edit, modify, vector, featureoverlay"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
<form class="form-inline">
|
||||
<label>Geometry type </label>
|
||||
<select id="type">
|
||||
@@ -18,4 +15,3 @@ tags: "draw, edit, modify, vector, featureoverlay"
|
||||
<option value="Polygon">Polygon</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Draw features example
|
||||
title: Draw Features
|
||||
shortdesc: Example of using the ol.interaction.Draw interaction.
|
||||
docs: >
|
||||
Example of using the Draw interaction. Select a geometry type from the
|
||||
@@ -12,20 +12,16 @@ docs: >
|
||||
points and creates a rectangular box.
|
||||
tags: "draw, edit, freehand, vector"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<form class="form-inline">
|
||||
<label>Geometry type </label>
|
||||
<select id="type">
|
||||
<option value="None">None</option>
|
||||
<option value="Point">Point</option>
|
||||
<option value="LineString">LineString</option>
|
||||
<option value="Polygon">Polygon</option>
|
||||
<option value="Circle">Circle</option>
|
||||
<option value="Square">Square</option>
|
||||
<option value="Box">Box</option>
|
||||
<option value="None">None</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Dynamic data example
|
||||
title: Dynamic Data
|
||||
shortdesc: Example of dynamic data.
|
||||
docs: >
|
||||
Example of dynamic data.
|
||||
tags: "dynamic-data"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,8 +9,4 @@ docs: >
|
||||
<p>To achieve this, we make heavy use of style functions and <code>ol.style.Style#geometry</code>.</p>
|
||||
tags: "KML, vector, style, geometry, cluster"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -84,7 +84,7 @@ function styleFunction(feature, resolution) {
|
||||
var style;
|
||||
var size = feature.get('features').length;
|
||||
if (size > 1) {
|
||||
style = [new ol.style.Style({
|
||||
style = new ol.style.Style({
|
||||
image: new ol.style.Circle({
|
||||
radius: feature.get('radius'),
|
||||
fill: new ol.style.Fill({
|
||||
@@ -96,10 +96,10 @@ function styleFunction(feature, resolution) {
|
||||
fill: textFill,
|
||||
stroke: textStroke
|
||||
})
|
||||
})];
|
||||
});
|
||||
} else {
|
||||
var originalFeature = feature.get('features')[0];
|
||||
style = [createEarthquakeStyle(originalFeature)];
|
||||
style = createEarthquakeStyle(originalFeature);
|
||||
}
|
||||
return style;
|
||||
}
|
||||
|
||||
9
examples/earthquake-custom-symbol.html
Normal file
9
examples/earthquake-custom-symbol.html
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Earthquakes with custom symbols
|
||||
shortdesc: Demonstrates the use of `ol.render.toCanvas` to create custom icon symbols.
|
||||
docs: >
|
||||
This example parses a KML file and renders the features as a vector layer. The layer is given a <code>style</code> that renders earthquake locations with a custom lightning symbol and a size relative to their magnitude.
|
||||
tags: "KML, vector, style, canvas, symbol"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
71
examples/earthquake-custom-symbol.js
Normal file
71
examples/earthquake-custom-symbol.js
Normal file
@@ -0,0 +1,71 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.format.KML');
|
||||
goog.require('ol.geom.Polygon');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.render');
|
||||
goog.require('ol.source.Stamen');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Icon');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
|
||||
var styleCache = {};
|
||||
var styleFunction = function(feature, resolution) {
|
||||
// 2012_Earthquakes_Mag5.kml stores the magnitude of each earthquake in a
|
||||
// standards-violating <magnitude> tag in each Placemark. We extract it from
|
||||
// the Placemark's name instead.
|
||||
var name = feature.get('name');
|
||||
var magnitude = parseFloat(name.substr(2));
|
||||
var size = parseInt(10 + 40 * (magnitude - 5), 10);
|
||||
var style = styleCache[size];
|
||||
if (!style) {
|
||||
var canvas =
|
||||
/** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
|
||||
var render = ol.render.toContext(
|
||||
/** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')),
|
||||
{size: [size + 2, size + 2], pixelRatio: size / 10});
|
||||
render.setFillStrokeStyle(
|
||||
new ol.style.Fill({ color: 'rgba(255, 153, 0, 0.4)' }),
|
||||
new ol.style.Stroke({ color: 'rgba(255, 204, 0, 0.2)', width: 1 }));
|
||||
render.drawPolygonGeometry(new ol.geom.Polygon(
|
||||
[[[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]]]));
|
||||
style = new ol.style.Style({
|
||||
image: new ol.style.Icon({
|
||||
img: canvas,
|
||||
imgSize: [canvas.width, canvas.height],
|
||||
rotation: 1.2
|
||||
})
|
||||
});
|
||||
styleCache[size] = style;
|
||||
}
|
||||
return style;
|
||||
};
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
source: new ol.source.Vector({
|
||||
url: 'data/kml/2012_Earthquakes_Mag5.kml',
|
||||
format: new ol.format.KML({
|
||||
extractStyles: false
|
||||
})
|
||||
}),
|
||||
style: styleFunction
|
||||
});
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.Stamen({
|
||||
layer: 'toner'
|
||||
})
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [raster, vector],
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
})
|
||||
});
|
||||
@@ -1,13 +1,9 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: EPSG:4326 example
|
||||
title: EPSG:4326
|
||||
shortdesc: Example of a map in EPSG:4326.
|
||||
docs: >
|
||||
This example shows how to create a map in EPSG:4326.
|
||||
tags: "epsg4326"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Export map example
|
||||
title: Map Export
|
||||
shortdesc: Example of exporting a map as a PNG image.
|
||||
docs: >
|
||||
Example of exporting a map as a PNG image.
|
||||
tags: "export, png, openstreetmap"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<div id="no-download" class="alert alert-danger" style="display: none">
|
||||
This example requires a browser that supports the
|
||||
<a href="http://caniuse.com/#feat=download">link download</a> attribute.
|
||||
</div>
|
||||
<a id="export-png" class="btn btn-default" download="map.png"><i class="fa fa-download"></i> Export PNG</a>
|
||||
</div>
|
||||
</div>
|
||||
<a id="export-png" class="btn btn-default" download="map.png"><i class="fa fa-download"></i> Download PNG</a>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Feature animation example
|
||||
title: Custom Animation
|
||||
shortdesc: Demonstrates how to animate features.
|
||||
docs: >
|
||||
This example shows how to use <b>postcompose</b> and <b>vectorContext</b> to
|
||||
@@ -8,8 +8,4 @@ docs: >
|
||||
is added to the layer.
|
||||
tags: "animation, vector, feature, flash"
|
||||
---
|
||||
<div class="row">
|
||||
<div class="span8">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -83,7 +83,7 @@ function flash(feature) {
|
||||
return;
|
||||
}
|
||||
// tell OL3 to continue postcompose animation
|
||||
frameState.animate = true;
|
||||
map.render();
|
||||
}
|
||||
listenerKey = map.on('postcompose', animate);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Animate a feature movement
|
||||
title: Marker Animation
|
||||
shortdesc: Demonstrates how to move a feature along a line.
|
||||
docs: >
|
||||
This example shows how to use <b>postcompose</b> and <b>vectorContext</b> to
|
||||
@@ -8,17 +8,9 @@ docs: >
|
||||
is being used.
|
||||
tags: "animation, feature, postcompose, polyline"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<label for="speed">
|
||||
speed:
|
||||
<input id="speed" type="range" min="10" max="999" step="10" value="60">
|
||||
</label>
|
||||
<button id="start-animation">Start Animation</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -115,9 +115,9 @@ var vectorLayer = new ol.layer.Vector({
|
||||
style: function(feature, resolution) {
|
||||
// hide geoMarker if animation is active
|
||||
if (animating && feature.get('type') === 'geoMarker') {
|
||||
return [];
|
||||
return null;
|
||||
}
|
||||
return [styles[feature.get('type')]];
|
||||
return styles[feature.get('type')];
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
17
examples/flight-animation.html
Normal file
17
examples/flight-animation.html
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Flight Animation
|
||||
shortdesc: Demonstrates how to animate flights with ´postcompose´.
|
||||
docs: >
|
||||
This example shows how to use <b>postcompose</b> and <b>vectorContext</b> to
|
||||
animate flights. A great circle arc between two airports is calculated using
|
||||
<a href="https://github.com/springmeyer/arc.js">arc.js</a> and then the flight
|
||||
paths are animated with <b>postcompose</b>. The flight data is provided by
|
||||
<a href="http://openflights.org/data.html">OpenFlights</a> (a simplified data
|
||||
set from the <a href="https://www.mapbox.com/mapbox.js/example/v1.0.0/animating-flight-paths/">
|
||||
Mapbox.js documentation</a> is used).
|
||||
tags: "animation, vector, feature, flights, arc"
|
||||
resources:
|
||||
- https://api.mapbox.com/mapbox.js/plugins/arc.js/v0.1.0/arc.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
129
examples/flight-animation.js
Normal file
129
examples/flight-animation.js
Normal file
@@ -0,0 +1,129 @@
|
||||
// NOCOMPILE
|
||||
goog.require('ol.Attribution');
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.geom.LineString');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.Stamen');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.Stamen({
|
||||
layer: 'toner'
|
||||
})
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
})
|
||||
});
|
||||
|
||||
var defaultStroke = new ol.style.Stroke({
|
||||
color: '#EAE911',
|
||||
width: 2
|
||||
});
|
||||
var defaultStyle = new ol.style.Style({
|
||||
stroke: defaultStroke
|
||||
});
|
||||
|
||||
var pointsPerMs = 0.1;
|
||||
var animateFlights = function(event) {
|
||||
var vectorContext = event.vectorContext;
|
||||
var frameState = event.frameState;
|
||||
vectorContext.setFillStrokeStyle(null, defaultStroke);
|
||||
|
||||
var features = flightsSource.getFeatures();
|
||||
for (var i = 0; i < features.length; i++) {
|
||||
var feature = features[i];
|
||||
if (!feature.get('finished')) {
|
||||
// only draw the lines for which the animation has not
|
||||
// finished yet
|
||||
var coords = feature.getGeometry().getCoordinates();
|
||||
var elapsedTime = frameState.time - feature.get('start');
|
||||
var elapsedPoints = elapsedTime * pointsPerMs;
|
||||
|
||||
if (elapsedPoints >= coords.length) {
|
||||
feature.set('finished', true);
|
||||
}
|
||||
|
||||
var maxIndex = Math.min(elapsedPoints, coords.length);
|
||||
var currentLine = new ol.geom.LineString(coords.slice(0, maxIndex));
|
||||
|
||||
// directly draw the line with the vector context
|
||||
vectorContext.drawLineStringGeometry(currentLine, feature);
|
||||
}
|
||||
}
|
||||
// tell OL3 to continue the postcompose animation
|
||||
map.render();
|
||||
};
|
||||
|
||||
var addLater = function(feature, timeout) {
|
||||
window.setTimeout(function() {
|
||||
feature.set('start', new Date().getTime());
|
||||
flightsSource.addFeature(feature);
|
||||
}, timeout);
|
||||
};
|
||||
|
||||
var flightsSource = new ol.source.Vector({
|
||||
wrapX: false,
|
||||
attributions: [new ol.Attribution({
|
||||
html: 'Flight data by ' +
|
||||
'<a href="http://openflights.org/data.html">OpenFlights</a>,'
|
||||
})],
|
||||
loader: function(extent, resolution, projection) {
|
||||
var url = 'data/openflights/flights.json';
|
||||
fetch(url).then(function(response) {
|
||||
return response.json();
|
||||
}).then(function(json) {
|
||||
var flightsData = json.flights;
|
||||
for (var i = 0; i < flightsData.length; i++) {
|
||||
var flight = flightsData[i];
|
||||
var from = flight[0];
|
||||
var to = flight[1];
|
||||
|
||||
// create an arc circle between the two locations
|
||||
var arcGenerator = new arc.GreatCircle(
|
||||
{x: from[1], y: from[0]},
|
||||
{x: to[1], y: to[0]});
|
||||
|
||||
var arcLine = arcGenerator.Arc(100, {offset: 10});
|
||||
if (arcLine.geometries.length === 1) {
|
||||
var line = new ol.geom.LineString(arcLine.geometries[0].coords);
|
||||
line.transform(ol.proj.get('EPSG:4326'), ol.proj.get('EPSG:3857'));
|
||||
|
||||
var feature = new ol.Feature({
|
||||
geometry: line,
|
||||
finished: false
|
||||
});
|
||||
// add the feature with a delay so that the animation
|
||||
// for all features does not start at the same time
|
||||
addLater(feature, i * 50);
|
||||
}
|
||||
}
|
||||
map.on('postcompose', animateFlights);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var flightsLayer = new ol.layer.Vector({
|
||||
source: flightsSource,
|
||||
style: function(feature, resolution) {
|
||||
// if the animation is still active for a feature, do not
|
||||
// render the feature with the layer style
|
||||
if (feature.get('finished')) {
|
||||
return defaultStyle;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
map.addLayer(flightsLayer);
|
||||
@@ -1,18 +1,14 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Fractal Example
|
||||
title: Fractal Rendering
|
||||
shortdesc: Example of a fractal.
|
||||
docs: >
|
||||
Example of a fractal.
|
||||
This example demonstrates how features with many vertices can be efficiently rendered.
|
||||
tags: "fractal, vector"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<label for="depth">
|
||||
depth:
|
||||
<input id="depth" type="range" min="0" max="9" step="1" value="5">
|
||||
(<span id="count">#</span> points)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Full screen drag rotate and zoom example
|
||||
title: Full Screen Drag, Rotate, and Zoom
|
||||
shortdesc: Example of drag rotate and zoom control with full screen effect.
|
||||
docs: >
|
||||
<p>Hold down <code>Shift</code> + drag to rotate and zoom. Click the button in the top right corner to go full screen. Then do the <code>Shift</code> + drag thing again.</p>
|
||||
<p>Hold down <code>Shift+Drag</code> to rotate and zoom. Click the button in the top right corner to go full screen. Then do the <code>Shift+Drag</code> thing again.</p>
|
||||
<p>If there is no button on the map, your browser does not support the <a href="http://caniuse.com/#feat=fullscreen">Full Screen API</a>.</p>
|
||||
tags: "full-screen, drag, rotate, zoom, bing, bing-maps"
|
||||
cloak:
|
||||
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Full screen control example
|
||||
title: Full Screen Control
|
||||
shortdesc: Example of a full screen control.
|
||||
docs: >
|
||||
<p>Click the control in the top right corner to go full screen. Click it again to exit full screen.</p>
|
||||
@@ -9,8 +9,4 @@ tags: "full-screen, bing, bing-maps"
|
||||
cloak:
|
||||
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: GeoJSON example
|
||||
title: GeoJSON
|
||||
shortdesc: Example of GeoJSON features.
|
||||
docs: >
|
||||
Example of GeoJSON features.
|
||||
tags: "geojson, vector, openstreetmap"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -21,25 +21,25 @@ var image = new ol.style.Circle({
|
||||
});
|
||||
|
||||
var styles = {
|
||||
'Point': [new ol.style.Style({
|
||||
'Point': new ol.style.Style({
|
||||
image: image
|
||||
})],
|
||||
'LineString': [new ol.style.Style({
|
||||
}),
|
||||
'LineString': new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'green',
|
||||
width: 1
|
||||
})
|
||||
})],
|
||||
'MultiLineString': [new ol.style.Style({
|
||||
}),
|
||||
'MultiLineString': new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'green',
|
||||
width: 1
|
||||
})
|
||||
})],
|
||||
'MultiPoint': [new ol.style.Style({
|
||||
}),
|
||||
'MultiPoint': new ol.style.Style({
|
||||
image: image
|
||||
})],
|
||||
'MultiPolygon': [new ol.style.Style({
|
||||
}),
|
||||
'MultiPolygon': new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'yellow',
|
||||
width: 1
|
||||
@@ -47,8 +47,8 @@ var styles = {
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(255, 255, 0, 0.1)'
|
||||
})
|
||||
})],
|
||||
'Polygon': [new ol.style.Style({
|
||||
}),
|
||||
'Polygon': new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'blue',
|
||||
lineDash: [4],
|
||||
@@ -57,8 +57,8 @@ var styles = {
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(0, 0, 255, 0.1)'
|
||||
})
|
||||
})],
|
||||
'GeometryCollection': [new ol.style.Style({
|
||||
}),
|
||||
'GeometryCollection': new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'magenta',
|
||||
width: 2
|
||||
@@ -73,8 +73,8 @@ var styles = {
|
||||
color: 'magenta'
|
||||
})
|
||||
})
|
||||
})],
|
||||
'Circle': [new ol.style.Style({
|
||||
}),
|
||||
'Circle': new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'red',
|
||||
width: 2
|
||||
@@ -82,7 +82,7 @@ var styles = {
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(255,0,0,0.2)'
|
||||
})
|
||||
})]
|
||||
})
|
||||
};
|
||||
|
||||
var styleFunction = function(feature, resolution) {
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Geolocation example
|
||||
shortdesc: Example of a geolocation map.
|
||||
title: Geolocation
|
||||
shortdesc: Using geolocation to control a map view.
|
||||
docs: >
|
||||
Example of a geolocation map.
|
||||
This example uses the Geolocation API to control the view.
|
||||
tags: "geolocation, openstreetmap"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<div class="span4 pull-right">
|
||||
<div id="info" class="alert alert-danger" style="display: none;"></div>
|
||||
</div>
|
||||
<label class="checkbox" for="track">
|
||||
<input id="track" type="checkbox"/>track position
|
||||
<div id="info" style="display: none;"></div>
|
||||
<label for="track">
|
||||
track position
|
||||
<input id="track" type="checkbox"/>
|
||||
</label>
|
||||
<p>position accuracy : <code id="accuracy"></code></p>
|
||||
<p>altitude : <code id="altitude"></code></p>
|
||||
<p>altitude accuracy : <code id="altitudeAccuracy"></code></p>
|
||||
<p>heading : <code id="heading"></code></p>
|
||||
<p>speed : <code id="speed"></code></p>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
position accuracy : <code id="accuracy"></code>
|
||||
altitude : <code id="altitude"></code>
|
||||
altitude accuracy : <code id="altitudeAccuracy"></code>
|
||||
heading : <code id="heading"></code>
|
||||
speed : <code id="speed"></code>
|
||||
</p>
|
||||
|
||||
@@ -1,20 +1,10 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: GetFeatureInfo example (image layer)
|
||||
shortdesc: This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS image layer.
|
||||
title: WMS GetFeatureInfo (Image Layer)
|
||||
shortdesc: Using an image WMS source with GetFeatureInfo requests
|
||||
docs: >
|
||||
<p>Additionally <code>map.forEachLayerAtPixel</code> is used to change the mouse pointer when hovering a non-transparent pixel on the map.</p>
|
||||
This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS image layer. Additionally <code>map.forEachLayerAtPixel</code> is used to change the mouse pointer when hovering a non-transparent pixel on the map.
|
||||
tags: "getfeatureinfo, forEachLayerAtPixel"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span4 offset4 iframe-info">
|
||||
<div id="info" class="alert alert-success">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="info"> </div>
|
||||
|
||||
@@ -8,7 +8,7 @@ var wmsSource = new ol.source.ImageWMS({
|
||||
url: 'http://demo.boundlessgeo.com/geoserver/wms',
|
||||
params: {'LAYERS': 'ne:ne'},
|
||||
serverType: 'geoserver',
|
||||
crossOrigin: ''
|
||||
crossOrigin: 'anonymous'
|
||||
});
|
||||
|
||||
var wmsLayer = new ol.layer.Image({
|
||||
|
||||
@@ -1,20 +1,10 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: WMS GetFeatureInfo example (tile layer)
|
||||
shortdesc: This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS tile layer.
|
||||
title: WMS GetFeatureInfo (Tile Layer)
|
||||
shortdesc: Issuing GetFeatureInfo requests with a WMS tiled source
|
||||
docs: >
|
||||
<p>Additionally <code>map.forEachLayerAtPixel</code> is used to change the mouse pointer when hovering a non-transparent pixel on the map.</p>
|
||||
This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS tile layer. Additionally <code>map.forEachLayerAtPixel</code> is used to change the mouse pointer when hovering a non-transparent pixel on the map.
|
||||
tags: "getfeatureinfo, forEachLayerAtPixel"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span4 offset4 iframe-info">
|
||||
<div id="info" class="alert alert-success">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="info"> </div>
|
||||
|
||||
@@ -8,7 +8,7 @@ var wmsSource = new ol.source.TileWMS({
|
||||
url: 'http://demo.boundlessgeo.com/geoserver/wms',
|
||||
params: {'LAYERS': 'ne:ne'},
|
||||
serverType: 'geoserver',
|
||||
crossOrigin: ''
|
||||
crossOrigin: 'anonymous'
|
||||
});
|
||||
|
||||
var wmsLayer = new ol.layer.Tile({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: GPX example
|
||||
title: GPX Data
|
||||
shortdesc: Example of using the GPX source.
|
||||
docs: >
|
||||
Example of using the GPX source.
|
||||
@@ -8,13 +8,5 @@ tags: "GPX"
|
||||
cloak:
|
||||
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<div class="span4 offset4 pull-right">
|
||||
<div id="info" class="alert alert-success">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="info"> </div>
|
||||
|
||||
@@ -21,7 +21,7 @@ var raster = new ol.layer.Tile({
|
||||
});
|
||||
|
||||
var style = {
|
||||
'Point': [new ol.style.Style({
|
||||
'Point': new ol.style.Style({
|
||||
image: new ol.style.Circle({
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(255,255,0,0.4)'
|
||||
@@ -32,19 +32,19 @@ var style = {
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
})],
|
||||
'LineString': [new ol.style.Style({
|
||||
}),
|
||||
'LineString': new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#f00',
|
||||
width: 3
|
||||
})
|
||||
})],
|
||||
'MultiLineString': [new ol.style.Style({
|
||||
}),
|
||||
'MultiLineString': new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#0f0',
|
||||
width: 3
|
||||
})
|
||||
})]
|
||||
})
|
||||
};
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Graticule example
|
||||
title: Map Graticule
|
||||
shortdesc: This example shows how to add a graticule overlay to a map.
|
||||
docs: >
|
||||
This example shows how to add a graticule overlay to a map.
|
||||
tags: "graticule"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,21 +1,15 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Earthquakes heatmap
|
||||
title: Earthquakes Heatmap
|
||||
shortdesc: Demonstrates the use of a heatmap layer.
|
||||
docs: >
|
||||
This example parses a KML file and renders the features as a <code>ol.layer.Heatmap</code> layer.
|
||||
tags: "heatmap, kml, vector, style"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
<div class="span4">
|
||||
<form>
|
||||
<label>radius size</label>
|
||||
<input id="radius" type="range" min="1" max="50" step="1" value="5"/>
|
||||
<label>blur size</label>
|
||||
<input id="blur" type="range" min="1" max="50" step="1" value="15"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
9
examples/icon-negative.html
Normal file
9
examples/icon-negative.html
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Icon Pixel Operations
|
||||
shortdesc: Canvas pixel operations on a point icon.
|
||||
docs: >
|
||||
Example using an icon to symbolize a point. Click on the icon to select it, and it will be rendered using its negative image.
|
||||
tags: "vector, style, icon, marker, canvas, select"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
71
examples/icon-negative.js
Normal file
71
examples/icon-negative.js
Normal file
@@ -0,0 +1,71 @@
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.interaction.Select');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.Stamen');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Icon');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
|
||||
function createStyle(src, img) {
|
||||
return new ol.style.Style({
|
||||
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
|
||||
anchor: [0.5, 0.96],
|
||||
src: src,
|
||||
img: img,
|
||||
imgSize: img ? [img.width, img.height] : undefined
|
||||
}))
|
||||
});
|
||||
}
|
||||
|
||||
var iconFeature = new ol.Feature(new ol.geom.Point([0, 0]));
|
||||
iconFeature.set('style', createStyle('data/icon.png', undefined));
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.Stamen({ layer: 'watercolor' })
|
||||
}),
|
||||
new ol.layer.Vector({
|
||||
style: function(feature) { return feature.get('style'); },
|
||||
source: new ol.source.Vector({ features: [iconFeature] })
|
||||
})
|
||||
],
|
||||
target: document.getElementById('map'),
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 3
|
||||
})
|
||||
});
|
||||
|
||||
var selectStyle = {};
|
||||
var select = new ol.interaction.Select({
|
||||
style: function(feature, resolution) {
|
||||
var image = feature.get('style').getImage().getImage();
|
||||
if (!selectStyle[image.src]) {
|
||||
var canvas = document.createElement('canvas');
|
||||
var context = canvas.getContext('2d');
|
||||
canvas.width = image.width;
|
||||
canvas.height = image.height;
|
||||
context.drawImage(image, 0, 0, image.width, image.height);
|
||||
var imageData = context.getImageData(0, 0, canvas.width, canvas.height);
|
||||
var data = imageData.data;
|
||||
for (var i = 0, ii = data.length; i < ii; i = i + (i % 4 == 2 ? 2 : 1)) {
|
||||
data[i] = 255 - data[i];
|
||||
}
|
||||
context.putImageData(imageData, 0, 0);
|
||||
selectStyle[image.src] = createStyle(undefined, canvas);
|
||||
}
|
||||
return selectStyle[image.src];
|
||||
}
|
||||
});
|
||||
map.addInteraction(select);
|
||||
|
||||
map.on('pointermove', function(evt) {
|
||||
map.getTargetElement().style.cursor =
|
||||
map.hasFeatureAtPixel(evt.pixel) ? 'pointer' : '';
|
||||
});
|
||||
@@ -1,18 +1,10 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Icon sprites with WebGL example
|
||||
title: Icon Sprites with WebGL
|
||||
shortdesc: Icon sprite with WebGL
|
||||
docs: >
|
||||
<p>In this example a sprite image is used for the icon styles. Using a sprite is required to get good performance with WebGL.</p>
|
||||
tags: "webgl, icon, sprite, vector, point"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<div class="span2 offset2 pull-right">
|
||||
<div id="info" class="alert alert-success">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="info"> </div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Vector Icon Example
|
||||
title: Icon Symbolizer
|
||||
shortdesc: Example using an icon to symbolize a point.
|
||||
docs: >
|
||||
Example using an icon to symbolize a point.
|
||||
tags: "vector, style, icon, marker, popup"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"><div id="popup"></div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: IGC example
|
||||
title: IGC Data
|
||||
shortdesc: Example of tracks recorded from multiple paraglider flights on the same day, read from an IGC file.
|
||||
docs: >
|
||||
<p>The five tracks contain a total of 49,707 unique coordinates. Zoom in to see more detail. The background layer is from <a href="http://www.opencyclemap.org/">OpenCycleMap</a>.</p>
|
||||
tags: "complex-geometry, closest-feature, igc, opencyclemap"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<input id="time" type="range" value="0" steps="1" />
|
||||
<div class="span4 offset4 pull-right">
|
||||
<div id="info" class="alert alert-success">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="info"> </div>
|
||||
|
||||
@@ -27,17 +27,17 @@ var colors = {
|
||||
var styleCache = {};
|
||||
var styleFunction = function(feature, resolution) {
|
||||
var color = colors[feature.get('PLT')];
|
||||
var styleArray = styleCache[color];
|
||||
if (!styleArray) {
|
||||
styleArray = [new ol.style.Style({
|
||||
var style = styleCache[color];
|
||||
if (!style) {
|
||||
style = new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: color,
|
||||
width: 3
|
||||
})
|
||||
})];
|
||||
styleCache[color] = styleArray;
|
||||
});
|
||||
styleCache[color] = style;
|
||||
}
|
||||
return styleArray;
|
||||
return style;
|
||||
};
|
||||
|
||||
var vectorSource = new ol.source.Vector();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Image Filter Example
|
||||
title: Image Filters
|
||||
shortdesc: Apply a filter to imagery
|
||||
docs: >
|
||||
<p>Layer rendering can be manipulated in <code>precompose</code> and <code>postcompose</code> event listeners.
|
||||
@@ -10,11 +10,7 @@ tags: "filter, image manipulation"
|
||||
cloak:
|
||||
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
<select id="kernel" name="kernel">
|
||||
<option>none</option>
|
||||
<option selected>sharpen</option>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Image load events example
|
||||
title: Image Load Events
|
||||
shortdesc: Example using image load events.
|
||||
docs: >
|
||||
<p>Image sources fire events related to image loading. You can
|
||||
@@ -10,9 +10,7 @@ docs: >
|
||||
renders an image loading progress bar at the bottom of the map.</p>
|
||||
tags: "image, events, loading"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12 wrapper">
|
||||
<div class="wrapper">
|
||||
<div id="map" class="map"></div>
|
||||
<div id="progress"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Image vector layer example
|
||||
title: Image Vector Layer
|
||||
shortdesc: Example of an image vector layer.
|
||||
docs: >
|
||||
<p>This example uses a <code>ol.source.ImageVector</code> source. That source gets vector features from the
|
||||
@@ -8,13 +8,5 @@ docs: >
|
||||
is then used as the image of an image layer.</p>
|
||||
tags: "vector, image"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<div class="span4 pull-right">
|
||||
<div id="info" class="alert alert-success">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="info"> </div>
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: JSTS Example
|
||||
title: JSTS Integration
|
||||
shortdesc: Example on how to use JSTS with OpenLayers 3.
|
||||
docs: >
|
||||
Example showing the integration of <a href="https://github.com/bjornharrtell/jsts">JSTS</a>
|
||||
with OpenLayers 3.
|
||||
tags: "vector, jsts, buffer"
|
||||
resources:
|
||||
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/lib/0.16.0/javascript.util.min.js
|
||||
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/lib/0.16.0/jsts.min.js
|
||||
|
||||
|
||||
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/lib/0.17.0/javascript.util.min.js
|
||||
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/lib/0.17.0/jsts.min.js
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,10 +12,11 @@ goog.require('ol.source.Vector');
|
||||
|
||||
|
||||
var source = new ol.source.Vector();
|
||||
$.ajax('data/geojson/roads-seoul.geojson').then(function(response) {
|
||||
fetch('data/geojson/roads-seoul.geojson').then(function(response) {
|
||||
return response.json();
|
||||
}).then(function(json) {
|
||||
var format = new ol.format.GeoJSON();
|
||||
var features = format.readFeatures(response,
|
||||
{featureProjection: 'EPSG:3857'});
|
||||
var features = format.readFeatures(json, {featureProjection: 'EPSG:3857'});
|
||||
|
||||
var parser = new jsts.io.olParser();
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ shortdesc: Demonstrates the use of a Shape symbolizer to render earthquake locat
|
||||
docs: >
|
||||
This example parses a KML file and renders the features as a vector layer. The layer is given a <code>style</code> that renders earthquake locations with a size relative to their magnitude.
|
||||
tags: "KML, vector, style, tooltip"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"><div id="info"></div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -21,7 +21,7 @@ var styleFunction = function(feature, resolution) {
|
||||
var radius = 5 + 20 * (magnitude - 5);
|
||||
var style = styleCache[radius];
|
||||
if (!style) {
|
||||
style = [new ol.style.Style({
|
||||
style = new ol.style.Style({
|
||||
image: new ol.style.Circle({
|
||||
radius: radius,
|
||||
fill: new ol.style.Fill({
|
||||
@@ -32,7 +32,7 @@ var styleFunction = function(feature, resolution) {
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
})];
|
||||
});
|
||||
styleCache[radius] = style;
|
||||
}
|
||||
return style;
|
||||
|
||||
@@ -6,9 +6,9 @@ docs: >
|
||||
This example parses a KML file and renders the features as a vector layer. The layer is given a <code>ol.style.Style</code> that fills timezones
|
||||
yellow with an opacity calculated based on the current offset to local noon.
|
||||
tags: "KML, vector, style"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"><div id="info"></div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -35,14 +35,14 @@ var styleFunction = function(feature, resolution) {
|
||||
delta = 24 - delta;
|
||||
}
|
||||
var opacity = 0.75 * (1 - delta / 12);
|
||||
return [new ol.style.Style({
|
||||
return new ol.style.Style({
|
||||
fill: new ol.style.Fill({
|
||||
color: [0xff, 0xff, 0x33, opacity]
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#ffffff'
|
||||
})
|
||||
})];
|
||||
});
|
||||
};
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: KML example
|
||||
shortdesc: Example of using the KML source.
|
||||
title: KML
|
||||
shortdesc: Rendering KML with a vector source.
|
||||
docs: >
|
||||
Example of using the KML source.
|
||||
This example uses the <code>ol.format.KML</code> to parse KML for rendering with a vector source.
|
||||
tags: "KML"
|
||||
cloak:
|
||||
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<div class="span4 offset4 pull-right">
|
||||
<div id="info" class="alert alert-success">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="info"> </div>
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Layer WebGL clipping example
|
||||
title: Layer Clipping with WebGL
|
||||
shortdesc: Layer WebGL clipping example.
|
||||
docs: >
|
||||
This example shows how to use the <code>precompose</code> and <code>postcompose</code> rendering hooks to clip layers using WebGL.
|
||||
tags: "clipping, webgl, openstreetmap"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="no-webgl" class="alert alert-danger" style="display: none">
|
||||
This example requires a browser that supports <a href="http://get.webgl.org/">WebGL</a>.
|
||||
</div>
|
||||
|
||||
3
examples/layer-clipping.css
Normal file
3
examples/layer-clipping.css
Normal file
@@ -0,0 +1,3 @@
|
||||
#map {
|
||||
background: transparent;
|
||||
}
|
||||
@@ -1,13 +1,9 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Layer clipping example
|
||||
title: Layer Clipping
|
||||
shortdesc: Layer clipping example
|
||||
docs: >
|
||||
Layer clipping example
|
||||
tags: "clipping, openstreetmap"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,15 +8,9 @@ docs: >
|
||||
to limit rendering based on an extent.
|
||||
tags: "extent, tilejson"
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default" id="northwest">northwest</button>
|
||||
<button type="button" class="btn btn-default" id="northeast">northeast</button>
|
||||
<button type="button" class="btn btn-default" id="southeast">southeast</button>
|
||||
<button type="button" class="btn btn-default" id="southwest">southwest</button>
|
||||
<button type="button" class="btn btn-default" id="world">world</button>
|
||||
</div>
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Layer group example
|
||||
title: Layer Groups
|
||||
shortdesc: Example of a map with layer group.
|
||||
docs: >
|
||||
Example of a map with layer group.
|
||||
tags: "tilejson, input, bind, group, layergroup"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span6">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
<div id="layertree" class="span6">
|
||||
<div id="layertree">
|
||||
<h5>Click on layer nodes below to change their properties.</h5>
|
||||
<ul>
|
||||
<li><span>OpenAerial layer</span>
|
||||
@@ -53,4 +52,3 @@ tags: "tilejson, input, bind, group, layergroup"
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Layer Spy Example
|
||||
title: Layer Spy
|
||||
shortdesc: View a portion of one layer over another
|
||||
docs: >
|
||||
<p>Layer rendering can be manipulated in <code>precompose</code> and <code>postcompose</code> event listeners.
|
||||
@@ -12,8 +12,4 @@ tags: "spy, image manipulation"
|
||||
cloak:
|
||||
Ak-dzM4wZjSqTlzveKz5u0d4IQ4bRzVI309GxmkgSVr1ewS6iPSrOvOKhA-CJlm3: Your Bing Maps Key from http://bingmapsportal.com/ here
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,9 +14,11 @@ var imagery = new ol.layer.Tile({
|
||||
source: new ol.source.BingMaps({key: key, imagerySet: 'Aerial'})
|
||||
});
|
||||
|
||||
var container = document.getElementById('map');
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [roads, imagery],
|
||||
target: 'map',
|
||||
target: container,
|
||||
view: new ol.View({
|
||||
center: ol.proj.fromLonLat([-109, 46.5]),
|
||||
zoom: 6
|
||||
@@ -24,22 +26,27 @@ var map = new ol.Map({
|
||||
});
|
||||
|
||||
var radius = 75;
|
||||
$(document).keydown(function(evt) {
|
||||
document.addEventListener('keydown', function(evt) {
|
||||
if (evt.which === 38) {
|
||||
radius = Math.min(radius + 5, 150);
|
||||
map.render();
|
||||
evt.preventDefault();
|
||||
} else if (evt.which === 40) {
|
||||
radius = Math.max(radius - 5, 25);
|
||||
map.render();
|
||||
evt.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
// get the pixel position with every move
|
||||
var mousePosition = null;
|
||||
$(map.getViewport()).on('mousemove', function(evt) {
|
||||
mousePosition = map.getEventPixel(evt.originalEvent);
|
||||
|
||||
container.addEventListener('mousemove', function(event) {
|
||||
mousePosition = map.getEventPixel(event);
|
||||
map.render();
|
||||
}).on('mouseout', function() {
|
||||
});
|
||||
|
||||
container.addEventListener('mouseout', function() {
|
||||
mousePosition = null;
|
||||
map.render();
|
||||
});
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user