Compare commits
326 Commits
v4.4.0
...
v4.6.4-bac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
849ef07639 | ||
|
|
3696237894 | ||
|
|
af013db6d8 | ||
|
|
9b0cd2a7c8 | ||
|
|
f7a1aba38e | ||
|
|
6e9fc2cbad | ||
|
|
61245fb83a | ||
|
|
e065c851de | ||
|
|
ed29dde552 | ||
|
|
8a73db9331 | ||
|
|
72ca7b28c6 | ||
|
|
f11d55fde6 | ||
|
|
48217bc218 | ||
|
|
c76c445e43 | ||
|
|
3bba8ef061 | ||
|
|
a699cc348b | ||
|
|
f010f7b9c1 | ||
|
|
5d27dcc27c | ||
|
|
52bbebf9aa | ||
|
|
578f900435 | ||
|
|
3bc1de3f6c | ||
|
|
992bfdc126 | ||
|
|
a96b8c5ca6 | ||
|
|
2bce90470e | ||
|
|
50053c1b3f | ||
|
|
0c5134b789 | ||
|
|
ca3e11a10b | ||
|
|
7245805c90 | ||
|
|
5234a4dd21 | ||
|
|
b262b8535e | ||
|
|
45ae731aa6 | ||
|
|
8bc61504c8 | ||
|
|
5641430590 | ||
|
|
2e2d8ea3d7 | ||
|
|
d4f23e0ea9 | ||
|
|
607e836df4 | ||
|
|
8afcd1c2ff | ||
|
|
ebfdddbb8e | ||
|
|
14e3fd9214 | ||
|
|
9c8c9c1a17 | ||
|
|
c7cb26a066 | ||
|
|
b4a5142aaa | ||
|
|
e96d190e1e | ||
|
|
41efec1e74 | ||
|
|
7941a33069 | ||
|
|
8a9f32fa09 | ||
|
|
90d8224a08 | ||
|
|
55f7468c68 | ||
|
|
fca0b0771d | ||
|
|
19bceff077 | ||
|
|
c3db3e2f6f | ||
|
|
73f64a9e89 | ||
|
|
4990119f86 | ||
|
|
741baa8d20 | ||
|
|
74bf846ffe | ||
|
|
4e8714d619 | ||
|
|
9307c35c17 | ||
|
|
3bb62a2c41 | ||
|
|
b58073dd06 | ||
|
|
45d2f8debb | ||
|
|
e745c63383 | ||
|
|
5ed2f32621 | ||
|
|
6e39926dd0 | ||
|
|
466d63ac41 | ||
|
|
ac195c46b1 | ||
|
|
841e79b0e8 | ||
|
|
3c806f924e | ||
|
|
dde81d8585 | ||
|
|
29e3dd39e4 | ||
|
|
674868a683 | ||
|
|
7ffed344d1 | ||
|
|
dce56ac73a | ||
|
|
101b53e135 | ||
|
|
66d5d66129 | ||
|
|
f426c1cd18 | ||
|
|
ceab6444b9 | ||
|
|
5085cd8d6a | ||
|
|
4e0d52806c | ||
|
|
ee8ccc33e0 | ||
|
|
5e43208d93 | ||
|
|
7fbada28ac | ||
|
|
2278715f85 | ||
|
|
4f5613d2fa | ||
|
|
c48685565d | ||
|
|
0b3a92d89e | ||
|
|
53e675725b | ||
|
|
397c03a6b6 | ||
|
|
3e574529ad | ||
|
|
8aa591c04d | ||
|
|
5d71dde8dd | ||
|
|
c0d57ad005 | ||
|
|
ae6ba195f7 | ||
|
|
f5c0ea3a28 | ||
|
|
f139b7001a | ||
|
|
3e590f81ae | ||
|
|
9cc7cca447 | ||
|
|
0bf7e95619 | ||
|
|
1aa54b52b0 | ||
|
|
006f8d49ec | ||
|
|
94e821f9bf | ||
|
|
cbf24ebc4c | ||
|
|
f1aeb76ce8 | ||
|
|
000acfe854 | ||
|
|
8e9b69cb9b | ||
|
|
c35789ba73 | ||
|
|
ad8e4debbe | ||
|
|
febbba78dc | ||
|
|
4b0281bc8a | ||
|
|
c7f6c28d8e | ||
|
|
169e9583dd | ||
|
|
b9540460ff | ||
|
|
697406cf59 | ||
|
|
c490fd4af8 | ||
|
|
53b85a9192 | ||
|
|
a77d01945f | ||
|
|
9c45f9a8d6 | ||
|
|
5a252e628b | ||
|
|
a73170ca1d | ||
|
|
df90f1b78c | ||
|
|
1afc686af9 | ||
|
|
c811bd488e | ||
|
|
ce051b78a9 | ||
|
|
1103779432 | ||
|
|
bbec759c5e | ||
|
|
a2c5ce6925 | ||
|
|
54c69ae1c6 | ||
|
|
0bd989e917 | ||
|
|
93abd6fe57 | ||
|
|
3d8f39804e | ||
|
|
b2ef54d4a7 | ||
|
|
09a324bc6b | ||
|
|
07631e4d1f | ||
|
|
2825436983 | ||
|
|
4aee919de2 | ||
|
|
6cc3c47d95 | ||
|
|
55692c3da5 | ||
|
|
dbfca19e09 | ||
|
|
4324d49813 | ||
|
|
2da2ae0154 | ||
|
|
c6eca804f9 | ||
|
|
47e6918072 | ||
|
|
c1181bdfe7 | ||
|
|
9a8afff0fa | ||
|
|
0ec05f5795 | ||
|
|
6668d03122 | ||
|
|
3a6fc7a1f2 | ||
|
|
be06224756 | ||
|
|
9fe032b49c | ||
|
|
b9313e76f4 | ||
|
|
0d01a4ca0f | ||
|
|
82da43af35 | ||
|
|
967118e699 | ||
|
|
0fceb2f3e3 | ||
|
|
ccab7be20a | ||
|
|
39e3e9f915 | ||
|
|
cd5e5039e9 | ||
|
|
36fd49334c | ||
|
|
2e982deba6 | ||
|
|
2ebb1ce8fa | ||
|
|
d7bf98f49f | ||
|
|
2b09dc8b70 | ||
|
|
dbeef9f73e | ||
|
|
8a6fe81f09 | ||
|
|
4ea72c2483 | ||
|
|
d15a85c402 | ||
|
|
42da3f18dd | ||
|
|
260327341c | ||
|
|
7cb8b526a9 | ||
|
|
02016cf244 | ||
|
|
4a6317dde3 | ||
|
|
129350d863 | ||
|
|
72eb8ab5e8 | ||
|
|
5483fa3181 | ||
|
|
8c46f6d1f0 | ||
|
|
7f865b8520 | ||
|
|
dea8a340a6 | ||
|
|
06728ab0fa | ||
|
|
a80458f2c3 | ||
|
|
2451c8f1d0 | ||
|
|
431d570b91 | ||
|
|
ddba26b193 | ||
|
|
f05511cff7 | ||
|
|
e55985818f | ||
|
|
8a9d6b417f | ||
|
|
306851d6ee | ||
|
|
70dc35cc6c | ||
|
|
bfebc50a48 | ||
|
|
50b50ae21f | ||
|
|
a5625955a8 | ||
|
|
47a1aed750 | ||
|
|
4afb5bfd40 | ||
|
|
8ef9b8feea | ||
|
|
daea26ec50 | ||
|
|
1cf8631889 | ||
|
|
eefb3f9207 | ||
|
|
e6ae029d08 | ||
|
|
6ce201c429 | ||
|
|
b29e74d1ab | ||
|
|
4a73754b93 | ||
|
|
dfa3cbf4e2 | ||
|
|
29ebdde314 | ||
|
|
912e908032 | ||
|
|
53a2cf55f1 | ||
|
|
f4506d87eb | ||
|
|
22e4ba06a6 | ||
|
|
80e67bac7a | ||
|
|
b3f9e4e8ef | ||
|
|
08af207724 | ||
|
|
5ebc969599 | ||
|
|
dbeb3d2795 | ||
|
|
742a71cd4b | ||
|
|
1a1d45fdd1 | ||
|
|
da2a23aacd | ||
|
|
3c8c7db8f3 | ||
|
|
2836f9511f | ||
|
|
e2581931a7 | ||
|
|
435f93a197 | ||
|
|
27eaa0d8c0 | ||
|
|
00807ea98f | ||
|
|
a802f5937b | ||
|
|
485680919e | ||
|
|
cae6a07aa7 | ||
|
|
d33e41d322 | ||
|
|
8d59b5d301 | ||
|
|
5a6fafd85b | ||
|
|
343a4085a0 | ||
|
|
eeb20cf4ad | ||
|
|
35a357ee80 | ||
|
|
6da92d5f71 | ||
|
|
a625d1f1a8 | ||
|
|
10f59fc81c | ||
|
|
0c9e2458e6 | ||
|
|
b8589acc6e | ||
|
|
7a800d4b39 | ||
|
|
f7b6682832 | ||
|
|
e41693816a | ||
|
|
8d5a8665b2 | ||
|
|
e235c83231 | ||
|
|
cdea7040ee | ||
|
|
0e9bd75bc6 | ||
|
|
2e2e63a3e0 | ||
|
|
a121806715 | ||
|
|
2268cbe90f | ||
|
|
82b7116f81 | ||
|
|
ab85a91efd | ||
|
|
bcfad6ea8b | ||
|
|
011285aefe | ||
|
|
850aaf96f2 | ||
|
|
d40dd695cb | ||
|
|
382c6b9832 | ||
|
|
660a661aa1 | ||
|
|
924780abf1 | ||
|
|
7d8a74ee5a | ||
|
|
02b899869d | ||
|
|
1f34f17436 | ||
|
|
f6eeee37d2 | ||
|
|
d47dc52382 | ||
|
|
4d4afa1790 | ||
|
|
1141c82da1 | ||
|
|
637cf7c65f | ||
|
|
84f083af86 | ||
|
|
90b08cdc1c | ||
|
|
623dcd881f | ||
|
|
177fcc7bcc | ||
|
|
5a1effb483 | ||
|
|
97745c50af | ||
|
|
a4e0c54200 | ||
|
|
c679e3042e | ||
|
|
b0f291973b | ||
|
|
168e6db951 | ||
|
|
ad29aa742e | ||
|
|
d2e6acd478 | ||
|
|
80d5cc87c4 | ||
|
|
fe1d01a3cb | ||
|
|
c2926df045 | ||
|
|
8dbaf29fca | ||
|
|
ffb7d72c90 | ||
|
|
e6534894fd | ||
|
|
d74bef9fd7 | ||
|
|
380690a6a3 | ||
|
|
dcf38c22e2 | ||
|
|
b81952f142 | ||
|
|
d0092ecd18 | ||
|
|
1fcb94a29c | ||
|
|
80dbedf946 | ||
|
|
609bd23eff | ||
|
|
373179ad82 | ||
|
|
88ca77b8c7 | ||
|
|
55b5d0c719 | ||
|
|
5558994827 | ||
|
|
1aafd8320d | ||
|
|
02e23e3cd0 | ||
|
|
9b8232f65b | ||
|
|
83cfb77407 | ||
|
|
590dd6f1cf | ||
|
|
01b17de36d | ||
|
|
b94b8cc40d | ||
|
|
2dd8fdb5b7 | ||
|
|
a5a0f5b98b | ||
|
|
2eb8ed047a | ||
|
|
bedec9d596 | ||
|
|
dbaf24ec39 | ||
|
|
c96c9cfc6d | ||
|
|
c692b98fa9 | ||
|
|
9fb7778156 | ||
|
|
177156c293 | ||
|
|
10af59bfce | ||
|
|
ad5f21fa5c | ||
|
|
77892c435f | ||
|
|
917359107d | ||
|
|
c4f460bcc2 | ||
|
|
c5a05f1abd | ||
|
|
ad4a258c87 | ||
|
|
6e78148174 | ||
|
|
7d8e2a7372 | ||
|
|
adbc64507f | ||
|
|
be32b0f769 | ||
|
|
57a5ffa40b | ||
|
|
9c6c14a55c | ||
|
|
ae906c7aff | ||
|
|
a7729cc602 | ||
|
|
dfe9e9b59a | ||
|
|
a6a6ce9879 | ||
|
|
0802f50bc6 | ||
|
|
9a50f9ff75 | ||
|
|
232f56e229 |
@@ -1,6 +1,175 @@
|
||||
## Upgrade notes
|
||||
|
||||
### Next Release
|
||||
### Next release
|
||||
|
||||
#### Changed behavior of the `Draw` interaction
|
||||
|
||||
For better drawing experience, two changes were made to the behavior of the Draw interaction:
|
||||
|
||||
1. On long press, the current vertex can be dragged to its desired position.
|
||||
2. On touch move (e.g. when panning the map on a mobile device), no draw cursor is shown, and the geometry being drawn is not updated. But because of 1., the draw cursor will appear on long press. Mouse moves are not affected by this change.
|
||||
|
||||
#### Changes in proj4 integration
|
||||
|
||||
Because relying on a globally available proj4 is not practical with ES modules, we have made a change to the way we integrate proj4:
|
||||
|
||||
* The `setProj4()` function from the `ol/proj` module was removed.
|
||||
* A new `ol/proj/proj4` module with a `register()` function was added. Regardless of whether the application imports `proj4` or uses a global `proj4`, this function needs to be called with the proj4 instance as argument whenever projection definitions were added to proj4's registry with (`proj4.defs`).
|
||||
|
||||
It is also recommended to no longer use a global `proj4`. Instead,
|
||||
|
||||
npm install proj4
|
||||
|
||||
and import it:
|
||||
|
||||
```js
|
||||
import proj4 from 'proj4';
|
||||
```
|
||||
|
||||
Applications can be updated by importing the `register` function from the `ol/proj/proj4` module
|
||||
|
||||
```js
|
||||
import {register} from 'ol/proj/proj4'
|
||||
```
|
||||
|
||||
and calling it before using projections, and any time the proj4 registry was changed by `proj4.defs()` calls:
|
||||
|
||||
```js
|
||||
register(proj4);
|
||||
```
|
||||
|
||||
#### Removal of logos
|
||||
|
||||
The map and sources no longer accept a `logo` option. Instead, if you wish to append a logo to your map, add the desired markup directly in your HTML. In addition, you can use the `attributions` property of a source to display arbitrary markup per-source with the attribution control.
|
||||
|
||||
#### Replacement of `ol/Sphere` constructor with `ol/sphere` functions
|
||||
|
||||
The `ol/Sphere` constructor has been removed. If you were using the `getGeodesicArea` method, use the `getArea` function instead. If you were using the `haversineDistance` method, use the `getDistance` function instead.
|
||||
|
||||
Examples before:
|
||||
```js
|
||||
// using ol@4
|
||||
import Sphere from 'ol/sphere';
|
||||
|
||||
var sphere = new Sphere(Sphere.DEFAULT_RADIUS);
|
||||
var area = sphere.getGeodesicArea(polygon);
|
||||
var distance = sphere.haversineDistance(g1, g2);
|
||||
```
|
||||
|
||||
Examples after:
|
||||
```js
|
||||
// using ol@5
|
||||
import {circular as circularPolygon} from 'ol/geom/Polygon';
|
||||
import {getArea, getDistance} from 'ol/sphere';
|
||||
|
||||
var area = getArea(polygon);
|
||||
var distance = getDistance(g1, g2);
|
||||
var circle = circularPolygon(center, radius);
|
||||
```
|
||||
|
||||
#### New signature for the `circular` function for creating polygons
|
||||
|
||||
The `circular` function exported from `ol/geom/Polygon` no longer requires a `Sphere` as the first argument.
|
||||
|
||||
Example before:
|
||||
```js
|
||||
// using ol@4
|
||||
import Polygon from 'ol/geom/polygon';
|
||||
import Sphere from 'ol/sphere';
|
||||
|
||||
var poly = Polygon.circular(new Sphere(Sphere.DEFAULT_RADIUS), center, radius);
|
||||
```
|
||||
|
||||
Example after:
|
||||
```js
|
||||
// using ol@5
|
||||
import {circular as circularPolygon} from 'ol/geom/Polygon';
|
||||
|
||||
var poly = circularPolygon(center, radius);
|
||||
```
|
||||
|
||||
#### Removal of optional this arguments.
|
||||
|
||||
The following methods did get the optional this (i.e. opt_this) arguments removed. Please use closures, the es6 arrow function or the bind method to achieve this effect (Bind is explained here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
|
||||
|
||||
* Collection#forEach
|
||||
* geom/LineString#forEachSegment
|
||||
* Observable#on, #once, #un
|
||||
* source/TileUTFGrid#forDataAtCoordinateAndResolution
|
||||
* source/Vector#forEachFeature, #forEachFeatureInExtent, #forEachFeatureIntersectingExtent
|
||||
|
||||
### v4.6.0
|
||||
|
||||
#### Renamed `exceedLength` option of `ol.style.Text` to `overflow`
|
||||
|
||||
To update your applications, simply replace `exceedLength` with `overflow`.
|
||||
|
||||
#### Deprecation of `ol.source.ImageVector`
|
||||
|
||||
Rendering vector sources as image is now directly supported by `ol.layer.Vector` with the new `renderMode: 'image'` configuration option. Change code like this:
|
||||
|
||||
```js
|
||||
new ol.layer.Image({
|
||||
source: new ol.source.ImageVector({
|
||||
style: myStyle,
|
||||
source: new ol.source.Vector({
|
||||
url: 'my/data.json',
|
||||
format: new ol.format.GeoJSON()
|
||||
})
|
||||
})
|
||||
});
|
||||
```
|
||||
to:
|
||||
|
||||
```js
|
||||
new ol.layer.Vector({
|
||||
renderMode: 'image',
|
||||
style: myStyle,
|
||||
source: new ol.source.Vector({
|
||||
url: 'my/data.json',
|
||||
format: new ol.format.GeoJSON()
|
||||
})
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
### v4.5.0
|
||||
|
||||
#### Removed GeoJSON crs workaround for GeoServer
|
||||
|
||||
Previous version of GeoServer returned invalid crs in GeoJSON output. The workaround in `ol.format.GeoJSON` used to read this crs code is now removed.
|
||||
|
||||
#### Deprecation of `ol.Attribution`
|
||||
|
||||
`ol.Attribution` is deprecated and will be removed in the next major version. Instead, you can construct a source with a string attribution or an array of strings. For dynamic attributions, you can provide a function that gets called with the current frame state.
|
||||
|
||||
Before:
|
||||
```js
|
||||
var source = new ol.source.XYZ({
|
||||
attributions: [
|
||||
new ol.Attribution({html: 'some attribution'})
|
||||
]
|
||||
});
|
||||
```
|
||||
|
||||
After:
|
||||
```js
|
||||
var source = new ol.source.XYZ({
|
||||
attributions: 'some attribution'
|
||||
});
|
||||
```
|
||||
|
||||
In addition to passing a string or an array of strings for the `attributions` option, you can also pass a function that will get called with the current frame state.
|
||||
```js
|
||||
var source = new ol.source.XYZ({
|
||||
attributions: function(frameState) {
|
||||
// inspect the frame state and return attributions
|
||||
return 'some attribution'; // or ['multiple', 'attributions'] or null
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### v4.4.0
|
||||
|
||||
#### Behavior change for polygon labels
|
||||
|
||||
|
||||
@@ -1,8 +1,51 @@
|
||||
# 4.3.0
|
||||
# 4.4.0
|
||||
|
||||
## Summary
|
||||
|
||||
The 4.3.0 release includes features and fixes from 80 pull requests, including first time contributions from @EduardoNogueira, @ath0mas, @f7o, @trevorblades, @viethang, and @wb14123. There are some really nice rendering enhancements included in this release. It is now possible to render labels along lines (see [#7239](https://github.com/openlayers/openlayers/pull/7239) for more detail) and polygon labels are only rendered if they fit within the polygon ([#7292](https://github.com/openlayers/openlayers/pull/7292)). In addition, we now render tiles with an opacity transition, so tiled layers more gracefully fade in ([#7267](https://github.com/openlayers/openlayers/pull/7267)).
|
||||
The 4.4.0 release includes features and fixes from 80 pull requests, including first time contributions from @EduardoNogueira, @ath0mas, @f7o, @trevorblades, @viethang, and @wb14123. There are some really nice rendering enhancements included in this release. It is now possible to render labels along lines (see [#7239](https://github.com/openlayers/openlayers/pull/7239) for more detail) and polygon labels are only rendered if they fit within the polygon ([#7292](https://github.com/openlayers/openlayers/pull/7292)). In addition, we now render tiles with an opacity transition, so tiled layers more gracefully fade in ([#7267](https://github.com/openlayers/openlayers/pull/7267)).
|
||||
|
||||
### Upgrade notes
|
||||
|
||||
#### Behavior change for polygon labels
|
||||
|
||||
Polygon labels are now only rendered when the label does not exceed the polygon at the label position. To get the old behavior, configure your `ol.style.Text` with `exceedLength: true`.
|
||||
|
||||
#### Minor change for custom `tileLoadFunction` with `ol.source.VectorTile`
|
||||
|
||||
It is no longer necessary to set the projection on the tile. Instead, the `readFeatures` method must be called with the tile's extent as `extent` option and the view's projection as `featureProjection`.
|
||||
|
||||
Before:
|
||||
```js
|
||||
tile.setLoader(function() {
|
||||
var data = // ... fetch data
|
||||
var format = tile.getFormat();
|
||||
tile.setFeatures(format.readFeatures(data));
|
||||
tile.setProjection(format.readProjection(data));
|
||||
// uncomment the line below for ol.format.MVT only
|
||||
//tile.setExtent(format.getLastExtent());
|
||||
});
|
||||
```
|
||||
|
||||
After:
|
||||
```js
|
||||
tile.setLoader(function() {
|
||||
var data = // ... fetch data
|
||||
var format = tile.getFormat();
|
||||
tile.setFeatures(format.readFeatures(data, {
|
||||
featureProjection: map.getView().getProjection(),
|
||||
// uncomment the line below for ol.format.MVT only
|
||||
//extent: tile.getExtent()
|
||||
}));
|
||||
);
|
||||
```
|
||||
|
||||
#### Deprecation of `ol.DeviceOrientation`
|
||||
|
||||
`ol.DeviceOrientation` is deprecated and will be removed in the next major version.
|
||||
The device-orientation example has been updated to use the (gyronorm.js)[https://github.com/dorukeker/gyronorm.js] library.
|
||||
|
||||
|
||||
## Detailed changes
|
||||
|
||||
See below for the full list of changes.
|
||||
|
||||
|
||||
8
changelog/v4.4.1.md
Normal file
8
changelog/v4.4.1.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# 4.4.1
|
||||
|
||||
The v4.4.1 release includes a fix for the [`ol` package](https://www.npmjs.com/package/ol) and a fix for a tile rendering regression.
|
||||
|
||||
## Fixes
|
||||
|
||||
* [#7323](https://github.com/openlayers/openlayers/pull/7323) - Only clear the canvas when needed ([@tschaub](https://github.com/tschaub))
|
||||
* [#7313](https://github.com/openlayers/openlayers/pull/7313) - Use lowercase module identifiers until ol@5 ([@tschaub](https://github.com/tschaub))
|
||||
12
changelog/v4.4.2.md
Normal file
12
changelog/v4.4.2.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# 4.4.2
|
||||
|
||||
The v4.4.2 release fixes a number of rendering issues in the 4.4 releases.
|
||||
|
||||
## Fixes
|
||||
|
||||
* [#7327](https://github.com/openlayers/openlayers/pull/7327) - Prune the tile cache after updating a source's URL ([@tschaub](https://github.com/tschaub))
|
||||
* [#7341](https://github.com/openlayers/openlayers/pull/7341) - Proper rendering of raster sources when there is a tile transition ([@tschaub](https://github.com/tschaub))
|
||||
* [#7339](https://github.com/openlayers/openlayers/pull/7339) - Use correct text stroke on HiDPI devices ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7345](https://github.com/openlayers/openlayers/pull/7345) - Handle different lineWidth scaling in Safari ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7346](https://github.com/openlayers/openlayers/pull/7346) - Pre-render text images for configured scale ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7350](https://github.com/openlayers/openlayers/pull/7350) - Calculate correct text box size ([@ahocevar](https://github.com/ahocevar))
|
||||
127
changelog/v4.5.0.md
Normal file
127
changelog/v4.5.0.md
Normal file
@@ -0,0 +1,127 @@
|
||||
# 4.5.0
|
||||
|
||||
### Summary
|
||||
|
||||
The 4.5 release includes enhancements and fixes from 50 or so pull requests. Headlining this release, vector layers got a new `declutter` option that can be used to avoid overlapping labels. See the [street labels example](http://openlayers.org/en/latest/examples/street-labels.html) for a demonstration of this feature.
|
||||
|
||||
Please note that if you are using `closure-util` to build your OpenLayers based application, it is time to migrate to using the [`ol` package](https://www.npmjs.com/package/ol) and a module bundler like webpack. OpenLayers has not had a dependency on the Closure Library since the [3.19 release](https://github.com/openlayers/openlayers/releases/tag/v3.19.0); and with the 5.0 release we will be moving completely away from `goog.require` and `goog.provide`, dropping support for `closure-util`, and going with ES modules for our sources.
|
||||
|
||||
We will be adding details to the wiki about upcoming changes in 5.0 and tips on how to upgrade. We'll likely have a few more 4.x releases before the 5.0 release. But if you're interested in continuing to get feature enhancements in future releases, migrating to the `ol` package now will make the transition easier.
|
||||
|
||||
### Upgrade notes
|
||||
|
||||
#### Removed GeoJSON crs workaround for GeoServer
|
||||
|
||||
Previous version of GeoServer returned invalid crs in GeoJSON output. The workaround in `ol.format.GeoJSON` used to read this crs code is now removed.
|
||||
|
||||
#### Deprecation of `ol.Attribution`
|
||||
|
||||
`ol.Attribution` is deprecated and will be removed in the next major version. Instead, you can construct a source with a string attribution or an array of strings. For dynamic attributions, you can provide a function that gets called with the current frame state.
|
||||
|
||||
Before:
|
||||
```js
|
||||
var source = new ol.source.XYZ({
|
||||
attributions: [
|
||||
new ol.Attribution({html: 'some attribution'})
|
||||
]
|
||||
});
|
||||
```
|
||||
|
||||
After:
|
||||
```js
|
||||
var source = new ol.source.XYZ({
|
||||
attributions: 'some attribution'
|
||||
});
|
||||
```
|
||||
|
||||
In addition to passing a string or an array of strings for the `attributions` option, you can also pass a function that will get called with the current frame state.
|
||||
```js
|
||||
var source = new ol.source.XYZ({
|
||||
attributions: function(frameState) {
|
||||
// inspect the frame state and return attributions
|
||||
return 'some attribution'; // or ['multiple', 'attributions'] or null
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## Detailed changes
|
||||
|
||||
See below for the full list of changes.
|
||||
|
||||
* [#7456](https://github.com/openlayers/openlayers/pull/7456) - Retry if sauce connect fails ([@tschaub](https://github.com/tschaub))
|
||||
* [#7440](https://github.com/openlayers/openlayers/pull/7440) - Attempt to make font loading tests more stable ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7444](https://github.com/openlayers/openlayers/pull/7444) - Simpler style management ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7438](https://github.com/openlayers/openlayers/pull/7438) - Call getProjection() only once ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7430](https://github.com/openlayers/openlayers/pull/7430) - Add support for hex colors with alpha ([@tschaub](https://github.com/tschaub))
|
||||
* [#7431](https://github.com/openlayers/openlayers/pull/7431) - Avoid returning undefined zoom ([@tschaub](https://github.com/tschaub))
|
||||
* [#7436](https://github.com/openlayers/openlayers/pull/7436) - Always use source projection loading image tiles ([@pjeweb](https://github.com/pjeweb))
|
||||
* [#7433](https://github.com/openlayers/openlayers/pull/7433) - Don't use getHints if it's not needed ([@fredj](https://github.com/fredj))
|
||||
* [#7362](https://github.com/openlayers/openlayers/pull/7362) - Added option to the ol.format.GeoJSON to allow the reading of the geometry_name from the geojson ([@Alexandre27](https://github.com/Alexandre27))
|
||||
* [#7426](https://github.com/openlayers/openlayers/pull/7426) - Update InteractionOptions.prototype.handleEvent docs ([@glen-nu](https://github.com/glen-nu))
|
||||
* [#7423](https://github.com/openlayers/openlayers/pull/7423) - Get rendered features by coordinate when wrapping ([@tschaub](https://github.com/tschaub))
|
||||
* [#7421](https://github.com/openlayers/openlayers/pull/7421) - Keep longitude between -180 and 180 ([@tschaub](https://github.com/tschaub))
|
||||
* [#7420](https://github.com/openlayers/openlayers/pull/7420) - Fix MapGuide example resolves #7325 ([@TDesjardins](https://github.com/TDesjardins))
|
||||
* [#7340](https://github.com/openlayers/openlayers/pull/7340) - Clear label cache when fonts become available ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7414](https://github.com/openlayers/openlayers/pull/7414) - Only split text at line angle changes ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7411](https://github.com/openlayers/openlayers/pull/7411) - Add getLayers and setLayers functions to ol.format.WMSGetFeatureInfo ([@fredj](https://github.com/fredj))
|
||||
* [#7328](https://github.com/openlayers/openlayers/pull/7328) - Declutter text and images ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7406](https://github.com/openlayers/openlayers/pull/7406) - Add option to Zoomify source for setting custom extent ([@lasselaakkonen](https://github.com/lasselaakkonen))
|
||||
* [#7410](https://github.com/openlayers/openlayers/pull/7410) - Add getFeatureType and setFeatureType functions to ol.format.WFS ([@fredj](https://github.com/fredj))
|
||||
* [#7379](https://github.com/openlayers/openlayers/pull/7379) - Add support for custom tile size to Zoomify source ([@lasselaakkonen](https://github.com/lasselaakkonen))
|
||||
* [#7376](https://github.com/openlayers/openlayers/pull/7376) - changed visibility of overlay properties to protected ([@virtualcitySYSTEMS](https://github.com/virtualcitySYSTEMS))
|
||||
* [#7377](https://github.com/openlayers/openlayers/pull/7377) - Add support to specify CSS class name when creating ol.Overlay ([@notnotse](https://github.com/notnotse))
|
||||
* [#7383](https://github.com/openlayers/openlayers/pull/7383) - Handle null tile coordinates correctly ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7375](https://github.com/openlayers/openlayers/pull/7375) - Read 'Abstract', 'AccessConstraints' and 'Fees' in ol.format.OWS ([@fredj](https://github.com/fredj))
|
||||
* [#7378](https://github.com/openlayers/openlayers/pull/7378) - Fix incorrect docs about ol.source.Raster ([@notnotse](https://github.com/notnotse))
|
||||
* [#7371](https://github.com/openlayers/openlayers/pull/7371) - Add @api annotation to ol.VectorTile.getExtent ([@notnotse](https://github.com/notnotse))
|
||||
* [#7369](https://github.com/openlayers/openlayers/pull/7369) - Always request the Bing API with the 'culture' value ([@fredj](https://github.com/fredj))
|
||||
* [#7364](https://github.com/openlayers/openlayers/pull/7364) - Remove GeoJSON workaround for GeoServer ([@fredj](https://github.com/fredj))
|
||||
* [#7355](https://github.com/openlayers/openlayers/pull/7355) - Pass pixel tolerance as a parameter to constructor of ol.interaction.Extent ([@marcosox](https://github.com/marcosox))
|
||||
* [#7356](https://github.com/openlayers/openlayers/pull/7356) - Fix documentation for target option in the controls ([@EduardoNogueira](https://github.com/EduardoNogueira))
|
||||
* [#7359](https://github.com/openlayers/openlayers/pull/7359) - Rename entry to input - regarding options to rollup lib - Issue #7358 ([@akkumar](https://github.com/akkumar))
|
||||
* [#7357](https://github.com/openlayers/openlayers/pull/7357) - Release v4.4.2 ([@tschaub](https://github.com/tschaub))
|
||||
* [#7350](https://github.com/openlayers/openlayers/pull/7350) - Calculate correct text box size ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7349](https://github.com/openlayers/openlayers/pull/7349) - Do not use tileUrlFunction for renderer tile coordinates ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7305](https://github.com/openlayers/openlayers/pull/7305) - Fix #7304: Re-calculate the resolution when the WMS source is reprojected ([@oterral](https://github.com/oterral))
|
||||
* [#7346](https://github.com/openlayers/openlayers/pull/7346) - Pre-render text images for configured scale ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7345](https://github.com/openlayers/openlayers/pull/7345) - Handle different lineWidth scaling in Safari ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7344](https://github.com/openlayers/openlayers/pull/7344) - Make text height detection independent of css settings ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7341](https://github.com/openlayers/openlayers/pull/7341) - Proper rendering of raster sources when there is a tile transition ([@tschaub](https://github.com/tschaub))
|
||||
* [#7339](https://github.com/openlayers/openlayers/pull/7339) - Use correct text stroke on HiDPI devices ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7327](https://github.com/openlayers/openlayers/pull/7327) - Prune the tile cache after updating a source's URL ([@tschaub](https://github.com/tschaub))
|
||||
* [#7333](https://github.com/openlayers/openlayers/pull/7333) - Pluggable Map/Layers - function calls to handles and create ([@waxenegger](https://github.com/waxenegger))
|
||||
* [#7329](https://github.com/openlayers/openlayers/pull/7329) - Reworked attribution handling ([@tschaub](https://github.com/tschaub))
|
||||
* [#7337](https://github.com/openlayers/openlayers/pull/7337) - Always create a new blank image to avoid CSP violations ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7330](https://github.com/openlayers/openlayers/pull/7330) - Add upgrade notes to 4.4.0 changelog ([@tschaub](https://github.com/tschaub))
|
||||
* [#7321](https://github.com/openlayers/openlayers/pull/7321) - Release v4.4.1 ([@tschaub](https://github.com/tschaub))
|
||||
* [#7323](https://github.com/openlayers/openlayers/pull/7323) - Only clear the canvas when needed ([@tschaub](https://github.com/tschaub))
|
||||
* [#7313](https://github.com/openlayers/openlayers/pull/7313) - Use lowercase module identifiers until ol@5 ([@tschaub](https://github.com/tschaub))
|
||||
* [#7316](https://github.com/openlayers/openlayers/pull/7316) - fix copy-paste error in 4.4.0 changelog ([@mprins](https://github.com/mprins))
|
||||
* [#7315](https://github.com/openlayers/openlayers/pull/7315) - Add new ol.format.filter.Contains spatial operator ([@fredj](https://github.com/fredj))
|
||||
* [#7311](https://github.com/openlayers/openlayers/pull/7311) - Release v4.4.0 ([@tschaub](https://github.com/tschaub))
|
||||
|
||||
Additionally a number of updates where made to our dependencies:
|
||||
<details>
|
||||
<summary>Click to expand</summary>
|
||||
<ul>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7455">#7455</a> - Update eslint to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7447">#7447</a> - chore(package): update rollup-plugin-commonjs to version 8.2.6 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7448">#7448</a> - chore(package): update debounce to version 1.1.0 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7451">#7451</a> - chore(package): update karma to version 1.7.1 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7446">#7446</a> - fix(package): update rollup to version 0.51.3 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7428">#7428</a> - Update sinon to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7425">#7425</a> - Update async to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7418">#7418</a> - Update sinon to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7416">#7416</a> - Update sinon to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7417">#7417</a> - Update phantomjs-prebuilt to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7399">#7399</a> - Update eslint to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7395">#7395</a> - Update closure-util to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7392">#7392</a> - Update sinon to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7380">#7380</a> - Update rollup-plugin-cleanup to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7366">#7366</a> - Update handlebars to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7360">#7360</a> - Update eslint to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7354">#7354</a> - Update closure-util to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7319">#7319</a> - Update closure-util to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
<li><a href="https://github.com/openlayers/openlayers/pull/7314">#7314</a> - Update mocha to the latest version 🚀 (<a href="https://github.com/openlayers">@openlayers</a>)</li>
|
||||
</ul>
|
||||
</details>
|
||||
91
changelog/v4.6.0.md
Normal file
91
changelog/v4.6.0.md
Normal file
@@ -0,0 +1,91 @@
|
||||
# v4.6.0
|
||||
|
||||
### Summary
|
||||
|
||||
The 4.6 release includes enhancements and fixes from 30 or so pull requests. Headlining this release, vector layers got new `textBackgroundFill`, `textBackgroundStroke` and `padding` options that can be used to render background boxes for text. `ol.source.ImageVector` is now deprecated and replaced by a more convenient way to render vectors as images: by simply setting `renderMode: 'image'` on the vector layer.
|
||||
|
||||
Please note that if you are using `closure-util` to build your OpenLayers based application, it is time to migrate to using the [`ol` package](https://www.npmjs.com/package/ol) and a module bundler like webpack. OpenLayers has not had a dependency on the Closure Library since the [3.19 release](https://github.com/openlayers/openlayers/releases/tag/v3.19.0); and with the 5.0 release we will be moving completely away from `goog.require` and `goog.provide`, dropping support for `closure-util`, and going with ES modules for our sources.
|
||||
|
||||
See the [wiki](https://github.com/openlayers/openlayers/wiki/OpenLayers-v5.x) about upcoming changes in 5.0 and tips on how to upgrade. We likely won't have another 4.x release before the 5.0 release. If you're interested in continuing to get feature enhancements in future releases, migrating to the `ol` package now will make the transition easier.
|
||||
|
||||
|
||||
### Upgrade notes
|
||||
|
||||
#### Renamed `exceedLength` option of `ol.style.Text` to `overflow`
|
||||
|
||||
To update your applications, simply replace `exceedLength` with `overflow`.
|
||||
|
||||
#### Deprecation of `ol.source.ImageVector`
|
||||
|
||||
Rendering vector sources as image is now directly supported by `ol.layer.Vector` with the new `renderMode: 'image'` configuration option. Change code like this:
|
||||
|
||||
```js
|
||||
new ol.layer.Image({
|
||||
source: new ol.source.ImageVector({
|
||||
style: myStyle,
|
||||
source: new ol.source.Vector({
|
||||
url: 'my/data.json',
|
||||
format: new ol.format.GeoJSON()
|
||||
})
|
||||
})
|
||||
});
|
||||
```
|
||||
to:
|
||||
|
||||
```js
|
||||
new ol.layer.Vector({
|
||||
renderMode: 'image',
|
||||
style: myStyle,
|
||||
source: new ol.source.Vector({
|
||||
url: 'my/data.json',
|
||||
format: new ol.format.GeoJSON()
|
||||
})
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## Detailed changes
|
||||
|
||||
See below for the full list of changes.
|
||||
|
||||
* [#7538](https://github.com/openlayers/openlayers/pull/7538) - removeFromLoadedExtents to remove extents that failed to load ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7537](https://github.com/openlayers/openlayers/pull/7537) - Fix Draw.removeLastPoint exception when no points to remove ([@walkermatt](https://github.com/walkermatt))
|
||||
* [#7461](https://github.com/openlayers/openlayers/pull/7461) - Use the matrixSet projection by default ([@oterral](https://github.com/oterral))
|
||||
* [#5883](https://github.com/openlayers/openlayers/pull/5883) - Fixes setUrl() for WMTS sources (ol.source.WMTS) ([@bylexus](https://github.com/bylexus))
|
||||
* [#7531](https://github.com/openlayers/openlayers/pull/7531) - Update the ol package readme ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7372](https://github.com/openlayers/openlayers/pull/7372) - Add method to set max cache size in ol.style.IconImageCache ([@notnotse](https://github.com/notnotse))
|
||||
* [#7530](https://github.com/openlayers/openlayers/pull/7530) - Check forward/back 1 world if wrapping ([@raiyni](https://github.com/raiyni))
|
||||
* [#7526](https://github.com/openlayers/openlayers/pull/7526) - Allow clicks to be stopped while drawing ([@tschaub](https://github.com/tschaub))
|
||||
* [#7524](https://github.com/openlayers/openlayers/pull/7524) - Snap view center to pixel ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7521](https://github.com/openlayers/openlayers/pull/7521) - fix setMinZoom/setMaxZoom ([@cs09g](https://github.com/cs09g))
|
||||
* [#7519](https://github.com/openlayers/openlayers/pull/7519) - Reuse declutter tree for hit detection ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7499](https://github.com/openlayers/openlayers/pull/7499) - Remove attributions from olx.FrameState instances ([@openlayers](https://github.com/openlayers))
|
||||
* [#7501](https://github.com/openlayers/openlayers/pull/7501) - Option to render vector layers as images ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7516](https://github.com/openlayers/openlayers/pull/7516) - Deprecate exceedLength and replace with overflow ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7510](https://github.com/openlayers/openlayers/pull/7510) - Do not fade the states layer ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7513](https://github.com/openlayers/openlayers/pull/7513) - Make strokeKey safer ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7514](https://github.com/openlayers/openlayers/pull/7514) - Prune the label cache less aggressively ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7505](https://github.com/openlayers/openlayers/pull/7505) - Remove ol.DeviceOrientation link from API index ([@fredj](https://github.com/fredj))
|
||||
* [#7497](https://github.com/openlayers/openlayers/pull/7497) - Use getGeometry ([@nicholas-l](https://github.com/nicholas-l))
|
||||
* [#7495](https://github.com/openlayers/openlayers/pull/7495) - Remove layer renderers when viewport is removed ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7492](https://github.com/openlayers/openlayers/pull/7492) - Remove unneeded type cast from examples ([@fredj](https://github.com/fredj))
|
||||
* [#7489](https://github.com/openlayers/openlayers/pull/7489) - Allow string to be passed as ol.interaction.Draw type ([@fredj](https://github.com/fredj))
|
||||
* [#7445](https://github.com/openlayers/openlayers/pull/7445) - Load css rules from full-screen.css in examples ([@fredj](https://github.com/fredj))
|
||||
* [#7481](https://github.com/openlayers/openlayers/pull/7481) - Make zoom to extent control extensible ([@gberaudo](https://github.com/gberaudo))
|
||||
* [#7477](https://github.com/openlayers/openlayers/pull/7477) - Make text states available for replay time ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7482](https://github.com/openlayers/openlayers/pull/7482) - Reset rotation after rendering ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7480](https://github.com/openlayers/openlayers/pull/7480) - Create a new image when loading tile after an error ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7476](https://github.com/openlayers/openlayers/pull/7476) - Reset text measurements when available fonts change ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7454](https://github.com/openlayers/openlayers/pull/7454) - Add text background rendering and text padding ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7468](https://github.com/openlayers/openlayers/pull/7468) - Add new API-key for HERE example ([@chrismayer](https://github.com/chrismayer))
|
||||
* [#7465](https://github.com/openlayers/openlayers/pull/7465) - Export ol.proj.Projection#getAxisOrientation function ([@fredj](https://github.com/fredj))
|
||||
* [#7462](https://github.com/openlayers/openlayers/pull/7462) - Respect metersPerUnit in ScaleLine control ([@ahocevar](https://github.com/ahocevar))
|
||||
|
||||
|
||||
Additionally a number of updates where made to our dependencies:
|
||||
* [#7536](https://github.com/openlayers/openlayers/pull/7536) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7533](https://github.com/openlayers/openlayers/pull/7533) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7527](https://github.com/openlayers/openlayers/pull/7527) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7511](https://github.com/openlayers/openlayers/pull/7511) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7512](https://github.com/openlayers/openlayers/pull/7512) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7484](https://github.com/openlayers/openlayers/pull/7484) - Update closure-util to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
9
changelog/v4.6.1.md
Normal file
9
changelog/v4.6.1.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# 4.6.1
|
||||
|
||||
The v4.6.1 release fixes a number of issues in the 4.6 releases.
|
||||
|
||||
## Fixes
|
||||
|
||||
* [#7543](https://github.com/openlayers/openlayers/pull/7543) - Donut polygon labels do not get a chance to get rendered ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7542](https://github.com/openlayers/openlayers/pull/7542) - Still respect deprecated exceedLength option ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7541](https://github.com/openlayers/openlayers/pull/7541) - Fix case of vectorrendertype.js ([@ahocevar](https://github.com/ahocevar))
|
||||
7
changelog/v4.6.2.md
Normal file
7
changelog/v4.6.2.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# 4.6.2
|
||||
|
||||
The v4.6.2 release fixes a regression that could cause tremendous amounts of unneeded vector data to be fetched from the source.
|
||||
|
||||
## Fixes
|
||||
|
||||
* [#7546](https://github.com/openlayers/openlayers/pull/7546) - Do not request features for wrapped extent ([@ahocevar](https://github.com/ahocevar))
|
||||
7
changelog/v4.6.3.md
Normal file
7
changelog/v4.6.3.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# 4.6.3
|
||||
|
||||
The v4.6.3 release fixes a performance issue when `renderMode: 'image'` is set on an `ol.layer.Vector`.
|
||||
|
||||
## Fixes
|
||||
|
||||
* [#7554](https://github.com/openlayers/openlayers/pull/7554) - Only compose image vector frame when the replay group has changed ([@ahocevar](https://github.com/ahocevar))
|
||||
7
changelog/v4.6.4.md
Normal file
7
changelog/v4.6.4.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# 4.6.4
|
||||
|
||||
The v4.6.4 release fixes a feature selection issue when `renderMode: 'image'` is set on an `ol.layer.Vector`.
|
||||
|
||||
## Fixes
|
||||
|
||||
* [#7559](https://github.com/openlayers/openlayers/pull/7559) - Handle skipping and unskipping features with renderMode: 'image' ([@ahocevar](https://github.com/ahocevar))
|
||||
@@ -35,7 +35,7 @@ Interactions for [vector features](ol.Feature.html)
|
||||
<tr><td><p>All coordinates and extents need to be provided in view projection (default: EPSG:3857). To transform, use [ol.proj.transform()](ol.proj.html#.transform) and [ol.proj.transformExtent()](ol.proj.html#.transformExtent).</p>
|
||||
[ol.proj](ol.proj.html)</td>
|
||||
<td><p>Changes to all [ol.Objects](ol.Object.html) can be observed by calling the [object.on('propertychange')](ol.Object.html#on) method. Listeners receive an [ol.Object.Event](ol.Object.Event.html) with information on the changed property and old value.</p>
|
||||
<td>[ol.DeviceOrientation](ol.DeviceOrientation.html)<br>
|
||||
<td>
|
||||
[ol.Geolocation](ol.Geolocation.html)<br>
|
||||
[ol.Overlay](ol.Overlay.html)<br></td>
|
||||
</tr></table>
|
||||
|
||||
261
dist/ol-debug.css
vendored
Normal file
261
dist/ol-debug.css
vendored
Normal file
@@ -0,0 +1,261 @@
|
||||
.ol-box {
|
||||
box-sizing: border-box;
|
||||
border-radius: 2px;
|
||||
border: 2px solid blue;
|
||||
}
|
||||
|
||||
.ol-mouse-position {
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.ol-scale-line {
|
||||
background: rgba(0,60,136,0.3);
|
||||
border-radius: 4px;
|
||||
bottom: 8px;
|
||||
left: 8px;
|
||||
padding: 2px;
|
||||
position: absolute;
|
||||
}
|
||||
.ol-scale-line-inner {
|
||||
border: 1px solid #eee;
|
||||
border-top: none;
|
||||
color: #eee;
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
margin: 1px;
|
||||
will-change: contents, width;
|
||||
}
|
||||
.ol-overlay-container {
|
||||
will-change: left,right,top,bottom;
|
||||
}
|
||||
|
||||
.ol-unsupported {
|
||||
display: none;
|
||||
}
|
||||
.ol-viewport, .ol-unselectable {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
}
|
||||
.ol-selectable {
|
||||
-webkit-touch-callout: default;
|
||||
-webkit-user-select: auto;
|
||||
-moz-user-select: auto;
|
||||
-ms-user-select: auto;
|
||||
user-select: auto;
|
||||
}
|
||||
.ol-grabbing {
|
||||
cursor: -webkit-grabbing;
|
||||
cursor: -moz-grabbing;
|
||||
cursor: grabbing;
|
||||
}
|
||||
.ol-grab {
|
||||
cursor: move;
|
||||
cursor: -webkit-grab;
|
||||
cursor: -moz-grab;
|
||||
cursor: grab;
|
||||
}
|
||||
.ol-control {
|
||||
position: absolute;
|
||||
background-color: rgba(255,255,255,0.4);
|
||||
border-radius: 4px;
|
||||
padding: 2px;
|
||||
}
|
||||
.ol-control:hover {
|
||||
background-color: rgba(255,255,255,0.6);
|
||||
}
|
||||
.ol-zoom {
|
||||
top: .5em;
|
||||
left: .5em;
|
||||
}
|
||||
.ol-rotate {
|
||||
top: .5em;
|
||||
right: .5em;
|
||||
transition: opacity .25s linear, visibility 0s linear;
|
||||
}
|
||||
.ol-rotate.ol-hidden {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: opacity .25s linear, visibility 0s linear .25s;
|
||||
}
|
||||
.ol-zoom-extent {
|
||||
top: 4.643em;
|
||||
left: .5em;
|
||||
}
|
||||
.ol-full-screen {
|
||||
right: .5em;
|
||||
top: .5em;
|
||||
}
|
||||
@media print {
|
||||
.ol-control {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.ol-control button {
|
||||
display: block;
|
||||
margin: 1px;
|
||||
padding: 0;
|
||||
color: white;
|
||||
font-size: 1.14em;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
height: 1.375em;
|
||||
width: 1.375em;
|
||||
line-height: .4em;
|
||||
background-color: rgba(0,60,136,0.5);
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.ol-control button::-moz-focus-inner {
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
.ol-zoom-extent button {
|
||||
line-height: 1.4em;
|
||||
}
|
||||
.ol-compass {
|
||||
display: block;
|
||||
font-weight: normal;
|
||||
font-size: 1.2em;
|
||||
will-change: transform;
|
||||
}
|
||||
.ol-touch .ol-control button {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.ol-touch .ol-zoom-extent {
|
||||
top: 5.5em;
|
||||
}
|
||||
.ol-control button:hover,
|
||||
.ol-control button:focus {
|
||||
text-decoration: none;
|
||||
background-color: rgba(0,60,136,0.7);
|
||||
}
|
||||
.ol-zoom .ol-zoom-in {
|
||||
border-radius: 2px 2px 0 0;
|
||||
}
|
||||
.ol-zoom .ol-zoom-out {
|
||||
border-radius: 0 0 2px 2px;
|
||||
}
|
||||
|
||||
|
||||
.ol-attribution {
|
||||
text-align: right;
|
||||
bottom: .5em;
|
||||
right: .5em;
|
||||
max-width: calc(100% - 1.3em);
|
||||
}
|
||||
|
||||
.ol-attribution ul {
|
||||
margin: 0;
|
||||
padding: 0 .5em;
|
||||
font-size: .7rem;
|
||||
line-height: 1.375em;
|
||||
color: #000;
|
||||
text-shadow: 0 0 2px #fff;
|
||||
}
|
||||
.ol-attribution li {
|
||||
display: inline;
|
||||
list-style: none;
|
||||
line-height: inherit;
|
||||
}
|
||||
.ol-attribution li:not(:last-child):after {
|
||||
content: " ";
|
||||
}
|
||||
.ol-attribution img {
|
||||
max-height: 2em;
|
||||
max-width: inherit;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.ol-attribution ul, .ol-attribution button {
|
||||
display: inline-block;
|
||||
}
|
||||
.ol-attribution.ol-collapsed ul {
|
||||
display: none;
|
||||
}
|
||||
.ol-attribution.ol-logo-only ul {
|
||||
display: block;
|
||||
}
|
||||
.ol-attribution:not(.ol-collapsed) {
|
||||
background: rgba(255,255,255,0.8);
|
||||
}
|
||||
.ol-attribution.ol-uncollapsible {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
border-radius: 4px 0 0;
|
||||
height: 1.1em;
|
||||
line-height: 1em;
|
||||
}
|
||||
.ol-attribution.ol-logo-only {
|
||||
background: transparent;
|
||||
bottom: .4em;
|
||||
height: 1.1em;
|
||||
line-height: 1em;
|
||||
}
|
||||
.ol-attribution.ol-uncollapsible img {
|
||||
margin-top: -.2em;
|
||||
max-height: 1.6em;
|
||||
}
|
||||
.ol-attribution.ol-logo-only button,
|
||||
.ol-attribution.ol-uncollapsible button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ol-zoomslider {
|
||||
top: 4.5em;
|
||||
left: .5em;
|
||||
height: 200px;
|
||||
}
|
||||
.ol-zoomslider button {
|
||||
position: relative;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.ol-touch .ol-zoomslider {
|
||||
top: 5.5em;
|
||||
}
|
||||
|
||||
.ol-overviewmap {
|
||||
left: 0.5em;
|
||||
bottom: 0.5em;
|
||||
}
|
||||
.ol-overviewmap.ol-uncollapsible {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-radius: 0 4px 0 0;
|
||||
}
|
||||
.ol-overviewmap .ol-overviewmap-map,
|
||||
.ol-overviewmap button {
|
||||
display: inline-block;
|
||||
}
|
||||
.ol-overviewmap .ol-overviewmap-map {
|
||||
border: 1px solid #7b98bc;
|
||||
height: 150px;
|
||||
margin: 2px;
|
||||
width: 150px;
|
||||
}
|
||||
.ol-overviewmap:not(.ol-collapsed) button{
|
||||
bottom: 1px;
|
||||
left: 2px;
|
||||
position: absolute;
|
||||
}
|
||||
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
|
||||
.ol-overviewmap.ol-uncollapsible button {
|
||||
display: none;
|
||||
}
|
||||
.ol-overviewmap:not(.ol-collapsed) {
|
||||
background: rgba(255,255,255,0.8);
|
||||
}
|
||||
.ol-overviewmap-box {
|
||||
border: 2px dotted rgba(0,60,136,0.7);
|
||||
}
|
||||
|
||||
.ol-overviewmap .ol-overviewmap-box:hover {
|
||||
cursor: move;
|
||||
}
|
||||
96548
dist/ol-debug.js
vendored
Normal file
96548
dist/ol-debug.js
vendored
Normal file
File diff suppressed because one or more lines are too long
261
dist/ol.css
vendored
Normal file
261
dist/ol.css
vendored
Normal file
@@ -0,0 +1,261 @@
|
||||
.ol-box {
|
||||
box-sizing: border-box;
|
||||
border-radius: 2px;
|
||||
border: 2px solid blue;
|
||||
}
|
||||
|
||||
.ol-mouse-position {
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.ol-scale-line {
|
||||
background: rgba(0,60,136,0.3);
|
||||
border-radius: 4px;
|
||||
bottom: 8px;
|
||||
left: 8px;
|
||||
padding: 2px;
|
||||
position: absolute;
|
||||
}
|
||||
.ol-scale-line-inner {
|
||||
border: 1px solid #eee;
|
||||
border-top: none;
|
||||
color: #eee;
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
margin: 1px;
|
||||
will-change: contents, width;
|
||||
}
|
||||
.ol-overlay-container {
|
||||
will-change: left,right,top,bottom;
|
||||
}
|
||||
|
||||
.ol-unsupported {
|
||||
display: none;
|
||||
}
|
||||
.ol-viewport, .ol-unselectable {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
}
|
||||
.ol-selectable {
|
||||
-webkit-touch-callout: default;
|
||||
-webkit-user-select: auto;
|
||||
-moz-user-select: auto;
|
||||
-ms-user-select: auto;
|
||||
user-select: auto;
|
||||
}
|
||||
.ol-grabbing {
|
||||
cursor: -webkit-grabbing;
|
||||
cursor: -moz-grabbing;
|
||||
cursor: grabbing;
|
||||
}
|
||||
.ol-grab {
|
||||
cursor: move;
|
||||
cursor: -webkit-grab;
|
||||
cursor: -moz-grab;
|
||||
cursor: grab;
|
||||
}
|
||||
.ol-control {
|
||||
position: absolute;
|
||||
background-color: rgba(255,255,255,0.4);
|
||||
border-radius: 4px;
|
||||
padding: 2px;
|
||||
}
|
||||
.ol-control:hover {
|
||||
background-color: rgba(255,255,255,0.6);
|
||||
}
|
||||
.ol-zoom {
|
||||
top: .5em;
|
||||
left: .5em;
|
||||
}
|
||||
.ol-rotate {
|
||||
top: .5em;
|
||||
right: .5em;
|
||||
transition: opacity .25s linear, visibility 0s linear;
|
||||
}
|
||||
.ol-rotate.ol-hidden {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: opacity .25s linear, visibility 0s linear .25s;
|
||||
}
|
||||
.ol-zoom-extent {
|
||||
top: 4.643em;
|
||||
left: .5em;
|
||||
}
|
||||
.ol-full-screen {
|
||||
right: .5em;
|
||||
top: .5em;
|
||||
}
|
||||
@media print {
|
||||
.ol-control {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.ol-control button {
|
||||
display: block;
|
||||
margin: 1px;
|
||||
padding: 0;
|
||||
color: white;
|
||||
font-size: 1.14em;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
height: 1.375em;
|
||||
width: 1.375em;
|
||||
line-height: .4em;
|
||||
background-color: rgba(0,60,136,0.5);
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.ol-control button::-moz-focus-inner {
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
.ol-zoom-extent button {
|
||||
line-height: 1.4em;
|
||||
}
|
||||
.ol-compass {
|
||||
display: block;
|
||||
font-weight: normal;
|
||||
font-size: 1.2em;
|
||||
will-change: transform;
|
||||
}
|
||||
.ol-touch .ol-control button {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.ol-touch .ol-zoom-extent {
|
||||
top: 5.5em;
|
||||
}
|
||||
.ol-control button:hover,
|
||||
.ol-control button:focus {
|
||||
text-decoration: none;
|
||||
background-color: rgba(0,60,136,0.7);
|
||||
}
|
||||
.ol-zoom .ol-zoom-in {
|
||||
border-radius: 2px 2px 0 0;
|
||||
}
|
||||
.ol-zoom .ol-zoom-out {
|
||||
border-radius: 0 0 2px 2px;
|
||||
}
|
||||
|
||||
|
||||
.ol-attribution {
|
||||
text-align: right;
|
||||
bottom: .5em;
|
||||
right: .5em;
|
||||
max-width: calc(100% - 1.3em);
|
||||
}
|
||||
|
||||
.ol-attribution ul {
|
||||
margin: 0;
|
||||
padding: 0 .5em;
|
||||
font-size: .7rem;
|
||||
line-height: 1.375em;
|
||||
color: #000;
|
||||
text-shadow: 0 0 2px #fff;
|
||||
}
|
||||
.ol-attribution li {
|
||||
display: inline;
|
||||
list-style: none;
|
||||
line-height: inherit;
|
||||
}
|
||||
.ol-attribution li:not(:last-child):after {
|
||||
content: " ";
|
||||
}
|
||||
.ol-attribution img {
|
||||
max-height: 2em;
|
||||
max-width: inherit;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.ol-attribution ul, .ol-attribution button {
|
||||
display: inline-block;
|
||||
}
|
||||
.ol-attribution.ol-collapsed ul {
|
||||
display: none;
|
||||
}
|
||||
.ol-attribution.ol-logo-only ul {
|
||||
display: block;
|
||||
}
|
||||
.ol-attribution:not(.ol-collapsed) {
|
||||
background: rgba(255,255,255,0.8);
|
||||
}
|
||||
.ol-attribution.ol-uncollapsible {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
border-radius: 4px 0 0;
|
||||
height: 1.1em;
|
||||
line-height: 1em;
|
||||
}
|
||||
.ol-attribution.ol-logo-only {
|
||||
background: transparent;
|
||||
bottom: .4em;
|
||||
height: 1.1em;
|
||||
line-height: 1em;
|
||||
}
|
||||
.ol-attribution.ol-uncollapsible img {
|
||||
margin-top: -.2em;
|
||||
max-height: 1.6em;
|
||||
}
|
||||
.ol-attribution.ol-logo-only button,
|
||||
.ol-attribution.ol-uncollapsible button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ol-zoomslider {
|
||||
top: 4.5em;
|
||||
left: .5em;
|
||||
height: 200px;
|
||||
}
|
||||
.ol-zoomslider button {
|
||||
position: relative;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.ol-touch .ol-zoomslider {
|
||||
top: 5.5em;
|
||||
}
|
||||
|
||||
.ol-overviewmap {
|
||||
left: 0.5em;
|
||||
bottom: 0.5em;
|
||||
}
|
||||
.ol-overviewmap.ol-uncollapsible {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-radius: 0 4px 0 0;
|
||||
}
|
||||
.ol-overviewmap .ol-overviewmap-map,
|
||||
.ol-overviewmap button {
|
||||
display: inline-block;
|
||||
}
|
||||
.ol-overviewmap .ol-overviewmap-map {
|
||||
border: 1px solid #7b98bc;
|
||||
height: 150px;
|
||||
margin: 2px;
|
||||
width: 150px;
|
||||
}
|
||||
.ol-overviewmap:not(.ol-collapsed) button{
|
||||
bottom: 1px;
|
||||
left: 2px;
|
||||
position: absolute;
|
||||
}
|
||||
.ol-overviewmap.ol-collapsed .ol-overviewmap-map,
|
||||
.ol-overviewmap.ol-uncollapsible button {
|
||||
display: none;
|
||||
}
|
||||
.ol-overviewmap:not(.ol-collapsed) {
|
||||
background: rgba(255,255,255,0.8);
|
||||
}
|
||||
.ol-overviewmap-box {
|
||||
border: 2px dotted rgba(0,60,136,0.7);
|
||||
}
|
||||
|
||||
.ol-overviewmap .ol-overviewmap-box:hover {
|
||||
cursor: move;
|
||||
}
|
||||
1075
dist/ol.js
vendored
Normal file
1075
dist/ol.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -13,9 +13,9 @@ var map = new ol.Map({
|
||||
],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -22,9 +22,9 @@ var map = new ol.Map({
|
||||
],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: ol.proj.transform(
|
||||
|
||||
@@ -51,9 +51,9 @@ var map = new ol.Map({
|
||||
],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: view
|
||||
});
|
||||
|
||||
@@ -102,7 +102,8 @@ function xyz2rgb(x) {
|
||||
|
||||
var raster = new ol.source.Raster({
|
||||
sources: [new ol.source.Stamen({
|
||||
layer: 'watercolor'
|
||||
layer: 'watercolor',
|
||||
transition: 0
|
||||
})],
|
||||
operation: function(pixels, data) {
|
||||
var hcl = rgb2hcl(pixels[0]);
|
||||
|
||||
@@ -59,9 +59,9 @@ ol.inherits(app.RotateNorthControl, ol.control.Control);
|
||||
|
||||
var map = new ol.Map({
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}).extend([
|
||||
new app.RotateNorthControl()
|
||||
]),
|
||||
|
||||
@@ -92,8 +92,7 @@ app.Drag.prototype.handleDragEvent = function(evt) {
|
||||
var deltaX = evt.coordinate[0] - this.coordinate_[0];
|
||||
var deltaY = evt.coordinate[1] - this.coordinate_[1];
|
||||
|
||||
var geometry = /** @type {ol.geom.SimpleGeometry} */
|
||||
(this.feature_.getGeometry());
|
||||
var geometry = this.feature_.getGeometry();
|
||||
geometry.translate(deltaX, deltaY);
|
||||
|
||||
this.coordinate_[0] = evt.coordinate[0];
|
||||
|
||||
@@ -22,9 +22,9 @@ var map = new ol.Map({
|
||||
],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: view
|
||||
});
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Drag-and-Drop Image Vector
|
||||
shortdesc: Example of using the drag-and-drop interaction with a ol.source.ImageVector.
|
||||
shortdesc: Example of using the drag-and-drop interaction with image vector rendering.
|
||||
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 an `ol.layer.Vector` with `renderMode: 'image'``. 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:
|
||||
As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
|
||||
@@ -7,10 +7,9 @@ goog.require('ol.format.KML');
|
||||
goog.require('ol.format.TopoJSON');
|
||||
goog.require('ol.interaction');
|
||||
goog.require('ol.interaction.DragAndDrop');
|
||||
goog.require('ol.layer.Image');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.BingMaps');
|
||||
goog.require('ol.source.ImageVector');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Circle');
|
||||
goog.require('ol.style.Fill');
|
||||
@@ -115,11 +114,10 @@ dragAndDropInteraction.on('addfeatures', function(event) {
|
||||
var vectorSource = new ol.source.Vector({
|
||||
features: event.features
|
||||
});
|
||||
map.addLayer(new ol.layer.Image({
|
||||
source: new ol.source.ImageVector({
|
||||
map.addLayer(new ol.layer.Vector({
|
||||
renderMode: 'image',
|
||||
source: vectorSource,
|
||||
style: styleFunction
|
||||
})
|
||||
}));
|
||||
map.getView().fit(vectorSource.getExtent());
|
||||
});
|
||||
|
||||
@@ -54,7 +54,7 @@ var typeSelect = document.getElementById('type');
|
||||
function addInteractions() {
|
||||
draw = new ol.interaction.Draw({
|
||||
source: source,
|
||||
type: /** @type {ol.geom.GeometryType} */ (typeSelect.value)
|
||||
type: typeSelect.value
|
||||
});
|
||||
map.addInteraction(draw);
|
||||
snap = new ol.interaction.Snap({source: source});
|
||||
|
||||
@@ -33,7 +33,7 @@ function addInteraction() {
|
||||
if (value !== 'None') {
|
||||
draw = new ol.interaction.Draw({
|
||||
source: source,
|
||||
type: /** @type {ol.geom.GeometryType} */ (typeSelect.value)
|
||||
type: typeSelect.value
|
||||
});
|
||||
map.addInteraction(draw);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ function addInteraction() {
|
||||
if (value !== 'None') {
|
||||
draw = new ol.interaction.Draw({
|
||||
source: source,
|
||||
type: /** @type {ol.geom.GeometryType} */ (typeSelect.value),
|
||||
type: typeSelect.value,
|
||||
freehand: true
|
||||
});
|
||||
map.addInteraction(draw);
|
||||
|
||||
@@ -67,7 +67,7 @@ function addInteraction() {
|
||||
}
|
||||
draw = new ol.interaction.Draw({
|
||||
source: source,
|
||||
type: /** @type {ol.geom.GeometryType} */ (value),
|
||||
type: value,
|
||||
geometryFunction: geometryFunction
|
||||
});
|
||||
map.addInteraction(draw);
|
||||
|
||||
@@ -23,9 +23,9 @@ var map = new ol.Map({
|
||||
],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -30,9 +30,9 @@ var map = new ol.Map({
|
||||
layers: [raster, vector],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -24,9 +24,9 @@ var map = new ol.Map({
|
||||
})
|
||||
],
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
.map:-webkit-full-screen {
|
||||
height: 100%;
|
||||
}
|
||||
.map:-ms-fullscreen {
|
||||
height: 100%;
|
||||
}
|
||||
.map:fullscreen {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@@ -180,9 +180,9 @@ var map = new ol.Map({
|
||||
],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -23,9 +23,9 @@ var map = new ol.Map({
|
||||
],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: view
|
||||
});
|
||||
@@ -46,14 +46,14 @@ var positions = new ol.geom.LineString([],
|
||||
/** @type {ol.geom.GeometryLayout} */ ('XYZM'));
|
||||
|
||||
// Geolocation Control
|
||||
var geolocation = new ol.Geolocation(/** @type {olx.GeolocationOptions} */ ({
|
||||
var geolocation = new ol.Geolocation({
|
||||
projection: view.getProjection(),
|
||||
trackingOptions: {
|
||||
maximumAge: 10000,
|
||||
enableHighAccuracy: true,
|
||||
timeout: 600000
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
var deltaMean = 500; // the geolocation sampling period mean in ms
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ var map = new ol.Map({
|
||||
],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: view
|
||||
});
|
||||
|
||||
@@ -7,8 +7,8 @@ docs: >
|
||||
<p>Be sure to respect the <a href="https://legal.here.com/en/terms/serviceterms/us/">HERE Service Terms</a> when using their tile API.</p>
|
||||
tags: "here, here-maps, here-tile-api"
|
||||
cloak:
|
||||
a2qhegvZZFIuJDkkqjhQ: Your HERE Maps appId from https://developer.here.com/
|
||||
lPJ3iaFLJDhD8fIAyU582A: Your HERE Maps appCode from https://developer.here.com/
|
||||
kDm0Jq1K4Ak7Bwtn8uvk: Your HERE Maps appId from https://developer.here.com/
|
||||
xnmvc4dKZrDfGlvQHXSvwQ: Your HERE Maps appCode from https://developer.here.com/
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<select id="layer-select">
|
||||
|
||||
@@ -3,8 +3,8 @@ goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.XYZ');
|
||||
|
||||
var appId = 'a2qhegvZZFIuJDkkqjhQ';
|
||||
var appCode = 'lPJ3iaFLJDhD8fIAyU582A';
|
||||
var appId = 'kDm0Jq1K4Ak7Bwtn8uvk';
|
||||
var appCode = 'xnmvc4dKZrDfGlvQHXSvwQ';
|
||||
var hereLayers = [
|
||||
{
|
||||
base: 'base',
|
||||
|
||||
@@ -99,9 +99,9 @@ var map = new ol.Map({
|
||||
],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [703365.7089403362, 5714629.865071137],
|
||||
|
||||
@@ -3,9 +3,7 @@ layout: example.html
|
||||
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
|
||||
<code>ol.source.Vector</code> it's configured with, and draw these features to an HTML5 canvas element that
|
||||
is then used as the image of an image layer.</p>
|
||||
<p>This example uses <code>ol.layer.Vector</code> with `renderMode: 'image'`. This mode results in faster rendering during interaction and animations, at the cost of less accurate rendering.</p>
|
||||
tags: "vector, image"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -1,38 +1,37 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.format.GeoJSON');
|
||||
goog.require('ol.layer.Image');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.ImageVector');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
goog.require('ol.style.Text');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Image({
|
||||
source: new ol.source.ImageVector({
|
||||
source: new ol.source.Vector({
|
||||
url: 'data/geojson/countries.geojson',
|
||||
format: new ol.format.GeoJSON()
|
||||
}),
|
||||
style: new ol.style.Style({
|
||||
var style = new ol.style.Style({
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(255, 255, 255, 0.6)'
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#319FD3',
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
})
|
||||
}),
|
||||
text: new ol.style.Text()
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Vector({
|
||||
renderMode: 'image',
|
||||
source: new ol.source.Vector({
|
||||
url: 'data/geojson/countries.geojson',
|
||||
format: new ol.format.GeoJSON()
|
||||
}),
|
||||
style: function(feature) {
|
||||
style.getText().setText(feature.get('name'));
|
||||
return style;
|
||||
}
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
|
||||
@@ -22,9 +22,9 @@ if (!ol.has.WEBGL) {
|
||||
renderer: /** @type {Array<ol.renderer.Type>} */ (['webgl', 'canvas']),
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -12,9 +12,9 @@ var map = new ol.Map({
|
||||
layers: [osm],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -19,9 +19,9 @@ var map = new ol.Map({
|
||||
layers: [osm, bing],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -62,5 +62,5 @@ var map = new ol.Map({
|
||||
|
||||
map.addInteraction(new ol.interaction.Draw({
|
||||
source: source,
|
||||
type: /** @type {ol.geom.GeometryType} */ ('LineString')
|
||||
type: 'LineString'
|
||||
}));
|
||||
|
||||
@@ -35,9 +35,9 @@ var map = new ol.Map({
|
||||
],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
maxZoom: 18,
|
||||
|
||||
@@ -15,6 +15,7 @@ var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.VectorTile({
|
||||
declutter: true,
|
||||
source: new ol.source.VectorTile({
|
||||
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
||||
'© <a href="https://www.openstreetmap.org/copyright">' +
|
||||
|
||||
@@ -3,9 +3,9 @@ goog.require('ol.View');
|
||||
goog.require('ol.layer.Image');
|
||||
goog.require('ol.source.ImageMapGuide');
|
||||
|
||||
var mdf = 'Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition';
|
||||
var mdf = 'Library://Public/Samples/Sheboygan/Maps/Sheboygan.MapDefinition';
|
||||
var agentUrl =
|
||||
'http://data.mapguide.com/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous';
|
||||
'http://www.buoyshark.com/mapguide/mapagent/mapagent.fcgi?';
|
||||
var bounds = [
|
||||
-87.865114442365922,
|
||||
43.665065564837931,
|
||||
@@ -23,7 +23,9 @@ var map = new ol.Map({
|
||||
metersPerUnit: 111319.4908, //value returned from mapguide
|
||||
params: {
|
||||
MAPDEFINITION: mdf,
|
||||
FORMAT: 'PNG'
|
||||
FORMAT: 'PNG',
|
||||
USERNAME: 'OpenLayers',
|
||||
PASSWORD: 'OpenLayers'
|
||||
},
|
||||
ratio: 2
|
||||
})
|
||||
|
||||
@@ -179,7 +179,7 @@ function addInteraction() {
|
||||
var type = (typeSelect.value == 'area' ? 'Polygon' : 'LineString');
|
||||
draw = new ol.interaction.Draw({
|
||||
source: source,
|
||||
type: /** @type {ol.geom.GeometryType} */ (type),
|
||||
type: type,
|
||||
style: new ol.style.Style({
|
||||
fill: new ol.style.Fill({
|
||||
color: 'rgba(255, 255, 255, 0.2)'
|
||||
|
||||
@@ -27,9 +27,9 @@ var map = new ol.Map({
|
||||
],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [653600, 5723680],
|
||||
|
||||
@@ -18,9 +18,9 @@ var mousePositionControl = new ol.control.MousePosition({
|
||||
|
||||
var map = new ol.Map({
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}).extend([mousePositionControl]),
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
|
||||
@@ -15,9 +15,9 @@ var map = new ol.Map({
|
||||
],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -8,9 +8,9 @@ goog.require('ol.source.OSM');
|
||||
|
||||
var map = new ol.Map({
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}).extend([
|
||||
new ol.control.ZoomToExtent({
|
||||
extent: [
|
||||
|
||||
@@ -30,9 +30,9 @@ var map = new ol.Map({
|
||||
})
|
||||
],
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
|
||||
@@ -18,13 +18,13 @@ var closer = document.getElementById('popup-closer');
|
||||
/**
|
||||
* Create an overlay to anchor the popup to the map.
|
||||
*/
|
||||
var overlay = new ol.Overlay(/** @type {olx.OverlayOptions} */ ({
|
||||
var overlay = new ol.Overlay({
|
||||
element: container,
|
||||
autoPan: true,
|
||||
autoPanAnimation: {
|
||||
duration: 250
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,9 +13,9 @@ var map = new ol.Map({
|
||||
],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [14200000, 4130000],
|
||||
|
||||
@@ -10,9 +10,9 @@ var scaleLineControl = new ol.control.ScaleLine();
|
||||
|
||||
var map = new ol.Map({
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}).extend([
|
||||
scaleLineControl
|
||||
]),
|
||||
|
||||
@@ -26,7 +26,8 @@ function flood(pixels, data) {
|
||||
var key = 'pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg';
|
||||
var elevation = new ol.source.XYZ({
|
||||
url: 'https://api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}.pngraw?access_token=' + key,
|
||||
crossOrigin: 'anonymous'
|
||||
crossOrigin: 'anonymous',
|
||||
transition: 0
|
||||
});
|
||||
|
||||
var raster = new ol.source.Raster({
|
||||
|
||||
@@ -104,7 +104,8 @@ function shade(inputs, data) {
|
||||
|
||||
var elevation = new ol.source.XYZ({
|
||||
url: 'https://{a-d}.tiles.mapbox.com/v3/aj.sf-dem/{z}/{x}/{y}.png',
|
||||
crossOrigin: 'anonymous'
|
||||
crossOrigin: 'anonymous',
|
||||
transition: 0
|
||||
});
|
||||
|
||||
var raster = new ol.source.Raster({
|
||||
|
||||
@@ -86,19 +86,19 @@ var Draw = {
|
||||
},
|
||||
Point: new ol.interaction.Draw({
|
||||
source: vector.getSource(),
|
||||
type: /** @type {ol.geom.GeometryType} */ ('Point')
|
||||
type: 'Point'
|
||||
}),
|
||||
LineString: new ol.interaction.Draw({
|
||||
source: vector.getSource(),
|
||||
type: /** @type {ol.geom.GeometryType} */ ('LineString')
|
||||
type: 'LineString'
|
||||
}),
|
||||
Polygon: new ol.interaction.Draw({
|
||||
source: vector.getSource(),
|
||||
type: /** @type {ol.geom.GeometryType} */ ('Polygon')
|
||||
type: 'Polygon'
|
||||
}),
|
||||
Circle: new ol.interaction.Draw({
|
||||
source: vector.getSource(),
|
||||
type: /** @type {ol.geom.GeometryType} */ ('Circle')
|
||||
type: 'Circle'
|
||||
}),
|
||||
getActive: function() {
|
||||
return this.activeType ? this[this.activeType].getActive() : false;
|
||||
|
||||
@@ -28,6 +28,7 @@ var map = new ol.Map({
|
||||
imagerySet: 'Aerial'
|
||||
})
|
||||
}), new ol.layer.Vector({
|
||||
declutter: true,
|
||||
source: new ol.source.Vector({
|
||||
format: new ol.format.GeoJSON(),
|
||||
url: 'data/geojson/vienna-streets.geojson'
|
||||
|
||||
@@ -12,9 +12,9 @@ var map = new ol.Map({
|
||||
})
|
||||
],
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -64,7 +64,7 @@ var raster = new ol.layer.Tile({
|
||||
|
||||
var draw = new ol.interaction.Draw({
|
||||
source: vectorSource,
|
||||
type: /** @type {ol.geom.GeometryType} */ ('Polygon')
|
||||
type: 'Polygon'
|
||||
});
|
||||
|
||||
var select = new ol.interaction.Select();
|
||||
|
||||
@@ -4,10 +4,8 @@ title: Vector Label Decluttering
|
||||
shortdesc: Label decluttering with a custom renderer.
|
||||
resources:
|
||||
- https://cdn.polyfill.io/v2/polyfill.min.js?features=Set"
|
||||
- https://unpkg.com/rbush@2.0.1/rbush.min.js
|
||||
- https://unpkg.com/labelgun@0.1.1/lib/labelgun.min.js
|
||||
docs: >
|
||||
A custom `renderer` function is used instead of an `ol.style.Text` to label the countries of the world. Only texts that are not wider than their country's bounding box are considered and handed over to [Labelgun](https://github.com/Geovation/labelgun) for decluttering.
|
||||
tags: "vector, renderer, labelgun, label"
|
||||
Decluttering is used to avoid overlapping labels with `overflow: true` set on the text style. For MultiPolygon geometries, only the widest polygon is selected in a custom `geometry` function.
|
||||
tags: "vector, decluttering, labels"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// NOCOMPILE
|
||||
/* global labelgun */
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.extent');
|
||||
@@ -9,26 +7,7 @@ goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
// Style for labels
|
||||
function setStyle(context) {
|
||||
context.font = '12px Calibri,sans-serif';
|
||||
context.fillStyle = '#000';
|
||||
context.strokeStyle = '#fff';
|
||||
context.lineWidth = 3;
|
||||
context.textBaseline = 'hanging';
|
||||
context.textAlign = 'start';
|
||||
}
|
||||
|
||||
// A separate canvas context for measuring label width and height.
|
||||
var textMeasureContext = document.createElement('CANVAS').getContext('2d');
|
||||
setStyle(textMeasureContext);
|
||||
|
||||
// The label height is approximated by the width of the text 'WI'.
|
||||
var height = textMeasureContext.measureText('WI').width;
|
||||
|
||||
// A cache for reusing label images once they have been created.
|
||||
var textCache = {};
|
||||
goog.require('ol.style.Text');
|
||||
|
||||
var map = new ol.Map({
|
||||
target: 'map',
|
||||
@@ -38,30 +17,35 @@ var map = new ol.Map({
|
||||
})
|
||||
});
|
||||
|
||||
var emptyFn = function() {};
|
||||
var labelEngine = new labelgun['default'](emptyFn, emptyFn);
|
||||
|
||||
function createLabel(canvas, text, coord) {
|
||||
var halfWidth = canvas.width / 2;
|
||||
var halfHeight = canvas.height / 2;
|
||||
var bounds = {
|
||||
bottomLeft: [Math.round(coord[0] - halfWidth), Math.round(coord[1] - halfHeight)],
|
||||
topRight: [Math.round(coord[0] + halfWidth), Math.round(coord[1] + halfHeight)]
|
||||
};
|
||||
labelEngine.ingestLabel(bounds, coord.toString(), 1, canvas, text, false);
|
||||
}
|
||||
|
||||
// For multi-polygons, we only label the widest polygon. This is done by sorting
|
||||
// by extent width in descending order, and take the first from the array.
|
||||
function sortByWidth(a, b) {
|
||||
return ol.extent.getWidth(b.getExtent()) - ol.extent.getWidth(a.getExtent());
|
||||
}
|
||||
|
||||
var labelStyle = new ol.style.Style({
|
||||
renderer: function(coords, state) {
|
||||
var text = state.feature.get('name');
|
||||
createLabel(textCache[text], text, coords);
|
||||
geometry: function(feature) {
|
||||
var geometry = feature.getGeometry();
|
||||
if (geometry.getType() == 'MultiPolygon') {
|
||||
// Only render label for the widest polygon of a multipolygon
|
||||
var polygons = geometry.getPolygons();
|
||||
var widest = 0;
|
||||
for (var i = 0, ii = polygons.length; i < ii; ++i) {
|
||||
var polygon = polygons[i];
|
||||
var width = ol.extent.getWidth(polygon.getExtent());
|
||||
if (width > widest) {
|
||||
widest = width;
|
||||
geometry = polygon;
|
||||
}
|
||||
}
|
||||
}
|
||||
return geometry;
|
||||
},
|
||||
text: new ol.style.Text({
|
||||
font: '12px Calibri,sans-serif',
|
||||
overflow: true,
|
||||
fill: new ol.style.Fill({
|
||||
color: '#000'
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#fff',
|
||||
width: 3
|
||||
})
|
||||
})
|
||||
});
|
||||
var countryStyle = new ol.style.Style({
|
||||
fill: new ol.style.Fill({
|
||||
@@ -72,54 +56,18 @@ var countryStyle = new ol.style.Style({
|
||||
width: 1
|
||||
})
|
||||
});
|
||||
var styleWithLabel = [countryStyle, labelStyle];
|
||||
var styleWithoutLabel = [countryStyle];
|
||||
var style = [countryStyle, labelStyle];
|
||||
|
||||
var pixelRatio; // This is set by the map's precompose listener
|
||||
var vectorLayer = new ol.layer.Vector({
|
||||
source: new ol.source.Vector({
|
||||
url: 'data/geojson/countries.geojson',
|
||||
format: new ol.format.GeoJSON()
|
||||
}),
|
||||
style: function(feature, resolution) {
|
||||
var text = feature.get('name');
|
||||
var width = textMeasureContext.measureText(text).width;
|
||||
var geometry = feature.getGeometry();
|
||||
if (geometry.getType() == 'MultiPolygon') {
|
||||
geometry = geometry.getPolygons().sort(sortByWidth)[0];
|
||||
}
|
||||
var extentWidth = ol.extent.getWidth(geometry.getExtent());
|
||||
if (extentWidth / resolution > width) {
|
||||
// Only consider label when it fits its geometry's extent
|
||||
if (!(text in textCache)) {
|
||||
// Draw the label to its own canvas and cache it.
|
||||
var canvas = textCache[text] = document.createElement('CANVAS');
|
||||
canvas.width = width * pixelRatio;
|
||||
canvas.height = height * pixelRatio;
|
||||
var context = canvas.getContext('2d');
|
||||
context.scale(pixelRatio, pixelRatio);
|
||||
setStyle(context);
|
||||
context.strokeText(text, 0, 0);
|
||||
context.fillText(text, 0, 0);
|
||||
}
|
||||
labelStyle.setGeometry(geometry.getInteriorPoint());
|
||||
return styleWithLabel;
|
||||
} else {
|
||||
return styleWithoutLabel;
|
||||
}
|
||||
}
|
||||
});
|
||||
vectorLayer.on('precompose', function(e) {
|
||||
pixelRatio = e.frameState.pixelRatio;
|
||||
labelEngine.destroy();
|
||||
});
|
||||
vectorLayer.on('postcompose', function(e) {
|
||||
var labels = labelEngine.getShown();
|
||||
for (var i = 0, ii = labels.length; i < ii; ++i) {
|
||||
var label = labels[i];
|
||||
// Draw label to the map canvas
|
||||
e.context.drawImage(label.labelObject, label.minX, label.minY);
|
||||
}
|
||||
style: function(feature) {
|
||||
labelStyle.getText().setText(feature.get('name'));
|
||||
return style;
|
||||
},
|
||||
declutter: true
|
||||
});
|
||||
|
||||
map.addLayer(vectorLayer);
|
||||
|
||||
@@ -6,7 +6,8 @@ docs: >
|
||||
This example showcases a number of options that can be set on text styles.
|
||||
When "Text/Wrap" is chosen (for example for the line features), the label is
|
||||
wrapped by inserting the character `\n`, which will create a multi-line
|
||||
label.
|
||||
label. The "Open Sans" web font will be loaded on demand, to show dynamic font
|
||||
loading.
|
||||
tags: "geojson, vector, openstreetmap, label"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
@@ -69,8 +70,8 @@ tags: "geojson, vector, openstreetmap, label"
|
||||
<label>Font: </label>
|
||||
<select id="points-font">
|
||||
<option value="Arial" selected="selected">Arial</option>
|
||||
<option value="Courier New">Courier New</option>
|
||||
<option value="Quattrocento Sans">Quattrocento</option>
|
||||
<option value="'Courier New'">Courier New</option>
|
||||
<option value="'Open Sans'">Open Sans</option>
|
||||
<option value="Verdana">Verdana</option>
|
||||
</select>
|
||||
<br />
|
||||
@@ -94,7 +95,7 @@ tags: "geojson, vector, openstreetmap, label"
|
||||
</select>
|
||||
<br />
|
||||
<label>Exceed Len: </label>
|
||||
<select disabled id="points-exceedlength">
|
||||
<select disabled id="points-overflow">
|
||||
<option value="true">True</option>
|
||||
<option value="false" selected="selected">False</option>
|
||||
</select>
|
||||
@@ -178,8 +179,8 @@ tags: "geojson, vector, openstreetmap, label"
|
||||
<label>Font: </label>
|
||||
<select id="lines-font">
|
||||
<option value="Arial">Arial</option>
|
||||
<option value="Courier New" selected="selected">Courier New</option>
|
||||
<option value="Quattrocento Sans">Quattrocento</option>
|
||||
<option value="'Courier New'" selected="selected">Courier New</option>
|
||||
<option value="'Open Sans'">Open Sans</option>
|
||||
<option value="Verdana">Verdana</option>
|
||||
</select>
|
||||
<br />
|
||||
@@ -203,7 +204,7 @@ tags: "geojson, vector, openstreetmap, label"
|
||||
</select>
|
||||
<br />
|
||||
<label>Exceed Len: </label>
|
||||
<select id="lines-exceedlength">
|
||||
<select id="lines-overflow">
|
||||
<option value="true">True</option>
|
||||
<option value="false" selected="selected">False</option>
|
||||
</select>
|
||||
@@ -287,8 +288,8 @@ tags: "geojson, vector, openstreetmap, label"
|
||||
<label>Font: </label>
|
||||
<select id="polygons-font">
|
||||
<option value="Arial">Arial</option>
|
||||
<option value="Courier New">Courier New</option>
|
||||
<option value="Quattrocento Sans">Quattrocento</option>
|
||||
<option value="'Courier New'">Courier New</option>
|
||||
<option value="'Open Sans'">Open Sans</option>
|
||||
<option value="Verdana" selected="selected">Verdana</option>
|
||||
</select>
|
||||
<br />
|
||||
@@ -312,7 +313,7 @@ tags: "geojson, vector, openstreetmap, label"
|
||||
</select>
|
||||
<br />
|
||||
<label>Exceed Len: </label>
|
||||
<select id="polygons-exceedlength">
|
||||
<select id="polygons-overflow">
|
||||
<option value="true">True</option>
|
||||
<option value="false" selected="selected">False</option>
|
||||
</select>
|
||||
|
||||
@@ -11,6 +11,7 @@ goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
goog.require('ol.style.Text');
|
||||
|
||||
var openSansAdded = false;
|
||||
|
||||
var myDom = {
|
||||
points: {
|
||||
@@ -37,7 +38,7 @@ var myDom = {
|
||||
weight: document.getElementById('lines-weight'),
|
||||
placement: document.getElementById('lines-placement'),
|
||||
maxangle: document.getElementById('lines-maxangle'),
|
||||
exceedlength: document.getElementById('lines-exceedlength'),
|
||||
overflow: document.getElementById('lines-overflow'),
|
||||
size: document.getElementById('lines-size'),
|
||||
offsetX: document.getElementById('lines-offset-x'),
|
||||
offsetY: document.getElementById('lines-offset-y'),
|
||||
@@ -55,7 +56,7 @@ var myDom = {
|
||||
weight: document.getElementById('polygons-weight'),
|
||||
placement: document.getElementById('polygons-placement'),
|
||||
maxangle: document.getElementById('polygons-maxangle'),
|
||||
exceedlength: document.getElementById('polygons-exceedlength'),
|
||||
overflow: document.getElementById('polygons-overflow'),
|
||||
size: document.getElementById('polygons-size'),
|
||||
offsetX: document.getElementById('polygons-offset-x'),
|
||||
offsetY: document.getElementById('polygons-offset-y'),
|
||||
@@ -77,7 +78,7 @@ var getText = function(feature, resolution, dom) {
|
||||
text = '';
|
||||
} else if (type == 'shorten') {
|
||||
text = text.trunc(12);
|
||||
} else if (type == 'wrap') {
|
||||
} else if (type == 'wrap' && dom.placement.value != 'line') {
|
||||
text = stringDivider(text, 16, '\n');
|
||||
}
|
||||
|
||||
@@ -94,8 +95,15 @@ var createTextStyle = function(feature, resolution, dom) {
|
||||
var weight = dom.weight.value;
|
||||
var placement = dom.placement ? dom.placement.value : undefined;
|
||||
var maxAngle = dom.maxangle ? parseFloat(dom.maxangle.value) : undefined;
|
||||
var exceedLength = dom.exceedlength ? (dom.exceedlength.value == 'true') : undefined;
|
||||
var overflow = dom.overflow ? (dom.overflow.value == 'true') : undefined;
|
||||
var rotation = parseFloat(dom.rotation.value);
|
||||
if (dom.font.value == '\'Open Sans\'' && !openSansAdded) {
|
||||
var openSans = document.createElement('link');
|
||||
openSans.href = 'https://fonts.googleapis.com/css?family=Open+Sans';
|
||||
openSans.rel = 'stylesheet';
|
||||
document.getElementsByTagName('head')[0].appendChild(openSans);
|
||||
openSansAdded = true;
|
||||
}
|
||||
var font = weight + ' ' + size + ' ' + dom.font.value;
|
||||
var fillColor = dom.color.value;
|
||||
var outlineColor = dom.outline.value;
|
||||
@@ -112,7 +120,7 @@ var createTextStyle = function(feature, resolution, dom) {
|
||||
offsetY: offsetY,
|
||||
placement: placement,
|
||||
maxAngle: maxAngle,
|
||||
exceedLength: exceedLength,
|
||||
overflow: overflow,
|
||||
rotation: rotation
|
||||
});
|
||||
};
|
||||
|
||||
@@ -127,9 +127,9 @@ map = new ol.Map({
|
||||
layers: [raster, vector],
|
||||
target: document.getElementById('map'),
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [739218, 5906096],
|
||||
|
||||
16
examples/vector-tile-info.css
Normal file
16
examples/vector-tile-info.css
Normal file
@@ -0,0 +1,16 @@
|
||||
#map {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#info {
|
||||
z-index: 1;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
margin: 0;
|
||||
background: rgba(0,60,136,0.7);
|
||||
color: white;
|
||||
border: 0;
|
||||
transition: opacity 100ms ease-in;
|
||||
}
|
||||
11
examples/vector-tile-info.html
Normal file
11
examples/vector-tile-info.html
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Vector Tile Info
|
||||
shortdesc: Getting feature information from vector tiles.
|
||||
docs: >
|
||||
<p>Move your pointer over rendered features to display feature properties.</p>
|
||||
tags: "vector tiles"
|
||||
---
|
||||
<div id="map" class="map">
|
||||
<pre id="info"/>
|
||||
</div>
|
||||
34
examples/vector-tile-info.js
Normal file
34
examples/vector-tile-info.js
Normal file
@@ -0,0 +1,34 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.format.MVT');
|
||||
goog.require('ol.layer.VectorTile');
|
||||
goog.require('ol.source.VectorTile');
|
||||
|
||||
var map = new ol.Map({
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
}),
|
||||
layers: [new ol.layer.VectorTile({
|
||||
source: new ol.source.VectorTile({
|
||||
format: new ol.format.MVT(),
|
||||
url: 'https://basemaps.arcgis.com/v1/arcgis/rest/services/World_Basemap/VectorTileServer/tile/{z}/{y}/{x}.pbf'
|
||||
})
|
||||
})]
|
||||
});
|
||||
|
||||
map.on('pointermove', showInfo);
|
||||
|
||||
var info = document.getElementById('info');
|
||||
function showInfo(event) {
|
||||
var features = map.getFeaturesAtPixel(event.pixel);
|
||||
if (!features) {
|
||||
info.innerText = '';
|
||||
info.style.opacity = 0;
|
||||
return;
|
||||
}
|
||||
var properties = features[0].getProperties();
|
||||
info.innerText = JSON.stringify(properties, null, 2);
|
||||
info.style.opacity = 1;
|
||||
}
|
||||
@@ -41,7 +41,7 @@ var layers = [
|
||||
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
|
||||
'FORMAT': 'image/jpeg'
|
||||
},
|
||||
serverType: /** @type {ol.source.WMSServerType} */ ('mapserver')
|
||||
serverType: 'mapserver'
|
||||
})
|
||||
}),
|
||||
new ol.layer.Image({
|
||||
@@ -52,7 +52,7 @@ var layers = [
|
||||
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
'en/home.html">National parks / geo.admin.ch</a>',
|
||||
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
|
||||
serverType: /** @type {ol.source.WMSServerType} */ ('mapserver')
|
||||
serverType: 'mapserver'
|
||||
})
|
||||
})
|
||||
];
|
||||
|
||||
@@ -14,7 +14,9 @@ var layers = [
|
||||
source: new ol.source.TileWMS({
|
||||
url: 'https://ahocevar.com/geoserver/wms',
|
||||
params: {'LAYERS': 'topp:states', 'TILED': true},
|
||||
serverType: 'geoserver'
|
||||
serverType: 'geoserver',
|
||||
// Countries have transparency, so do not fade tiles:
|
||||
transition: 0
|
||||
})
|
||||
})
|
||||
];
|
||||
|
||||
@@ -23,11 +23,11 @@ var layers = [
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
extent: extent,
|
||||
source: new ol.source.TileWMS(/** @type {olx.source.TileWMSOptions} */ ({
|
||||
source: new ol.source.TileWMS({
|
||||
attributions: ['Iowa State University'],
|
||||
url: 'https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r-t.cgi',
|
||||
params: {'LAYERS': 'nexrad-n0r-wmst'}
|
||||
}))
|
||||
})
|
||||
})
|
||||
];
|
||||
var map = new ol.Map({
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
goog.require('ol.Attribution');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.control');
|
||||
@@ -12,9 +11,9 @@ goog.require('ol.tilegrid.WMTS');
|
||||
var map = new ol.Map({
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
zoom: 5,
|
||||
@@ -50,11 +49,9 @@ var ign_source = new ol.source.WMTS({
|
||||
projection: 'EPSG:3857',
|
||||
tileGrid: tileGrid,
|
||||
style: 'normal',
|
||||
attributions: [new ol.Attribution({
|
||||
html: '<a href="http://www.geoportail.fr/" target="_blank">' +
|
||||
attributions: '<a href="http://www.geoportail.fr/" target="_blank">' +
|
||||
'<img src="https://api.ign.fr/geoportail/api/js/latest/' +
|
||||
'theme/geoportal/img/logo_gp.gif"></a>'
|
||||
})]
|
||||
});
|
||||
|
||||
var ign = new ol.layer.Tile({
|
||||
|
||||
@@ -49,9 +49,9 @@ var map = new ol.Map({
|
||||
],
|
||||
target: 'map',
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
})
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [-11158582, 4813697],
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
goog.require('ol.Attribution');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.XYZ');
|
||||
|
||||
var attribution = new ol.Attribution({
|
||||
html: 'Copyright:© 2013 ESRI, i-cubed, GeoEye'
|
||||
});
|
||||
|
||||
var projection = ol.proj.get('EPSG:4326');
|
||||
|
||||
// The tile size supported by the ArcGIS tile service.
|
||||
@@ -22,7 +17,7 @@ var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.XYZ({
|
||||
attributions: [attribution],
|
||||
attributions: 'Copyright:© 2013 ESRI, i-cubed, GeoEye',
|
||||
maxZoom: 16,
|
||||
projection: projection,
|
||||
tileSize: tileSize,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
goog.require('ol.Attribution');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
@@ -6,17 +5,13 @@ goog.require('ol.proj');
|
||||
goog.require('ol.source.XYZ');
|
||||
|
||||
|
||||
var attribution = new ol.Attribution({
|
||||
html: 'Tiles © <a href="https://services.arcgisonline.com/ArcGIS/' +
|
||||
'rest/services/World_Topo_Map/MapServer">ArcGIS</a>'
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.XYZ({
|
||||
attributions: [attribution],
|
||||
attributions: 'Tiles © <a href="https://services.arcgisonline.com/ArcGIS/' +
|
||||
'rest/services/World_Topo_Map/MapServer">ArcGIS</a>',
|
||||
url: 'https://server.arcgisonline.com/ArcGIS/rest/services/' +
|
||||
'World_Topo_Map/MapServer/tile/{z}/{y}/{x}'
|
||||
})
|
||||
|
||||
@@ -46,33 +46,11 @@ GeoJSONCRS.prototype.type;
|
||||
|
||||
|
||||
/**
|
||||
* TODO: remove GeoJSONCRSCode when http://jira.codehaus.org/browse/GEOS-5996
|
||||
* is fixed and widely deployed.
|
||||
* @type {!GeoJSONCRSCode|!GeoJSONCRSName|!GeoJSONLink}
|
||||
* @type {!GeoJSONCRSName|!GeoJSONLink}
|
||||
*/
|
||||
GeoJSONCRS.prototype.properties;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* `GeoJSONCRSCode` is not part of the GeoJSON specification, but is generated
|
||||
* by GeoServer.
|
||||
* TODO: remove GeoJSONCRSCode when http://jira.codehaus.org/browse/GEOS-5996
|
||||
* is fixed and widely deployed.
|
||||
* @constructor
|
||||
*/
|
||||
var GeoJSONCRSCode = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* TODO: remove this when http://jira.codehaus.org/browse/GEOS-5996 is fixed
|
||||
* and widely deployed.
|
||||
* @type {string}
|
||||
*/
|
||||
GeoJSONCRSCode.prototype.code;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
@@ -140,6 +118,11 @@ GeoJSONFeature.prototype.id;
|
||||
GeoJSONFeature.prototype.properties;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
GeoJSONFeature.prototype.geometry_name;
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
|
||||
278
externs/olx.js
278
externs/olx.js
@@ -273,9 +273,10 @@ olx.interaction.InteractionOptions;
|
||||
|
||||
/**
|
||||
* Method called by the map to notify the interaction that a browser event was
|
||||
* dispatched to the map. The function may return `false` to prevent the
|
||||
* dispatched to the map. If the function returns a falsy value,
|
||||
* propagation of the event to other interactions in the map's interactions
|
||||
* chain.
|
||||
* chain will be prevented (this includes functions with no explicit return). See
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Glossary/Falsy}
|
||||
* @type {function(ol.MapBrowserEvent):boolean}
|
||||
* @api
|
||||
*/
|
||||
@@ -521,7 +522,8 @@ olx.AtPixelOptions.prototype.hitTolerance;
|
||||
* insertFirst: (boolean|undefined),
|
||||
* autoPan: (boolean|undefined),
|
||||
* autoPanAnimation: (olx.OverlayPanOptions|undefined),
|
||||
* autoPanMargin: (number|undefined)}}
|
||||
* autoPanMargin: (number|undefined),
|
||||
* className: (string|undefined)}}
|
||||
*/
|
||||
olx.OverlayOptions;
|
||||
|
||||
@@ -623,6 +625,12 @@ olx.OverlayOptions.prototype.autoPanAnimation;
|
||||
*/
|
||||
olx.OverlayOptions.prototype.autoPanMargin;
|
||||
|
||||
/**
|
||||
* CSS class name. Default is `ol-overlay-container ol-selectable`.
|
||||
* @type {string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.OverlayOptions.prototype.className;
|
||||
|
||||
/**
|
||||
* @typedef {{
|
||||
@@ -1174,7 +1182,7 @@ olx.control;
|
||||
* label: (string|Node|undefined),
|
||||
* collapseLabel: (string|Node|undefined),
|
||||
* render: (function(ol.MapEvent)|undefined),
|
||||
* target: (Element|undefined)}}
|
||||
* target: (Element|string|undefined)}}
|
||||
*/
|
||||
olx.control.AttributionOptions;
|
||||
|
||||
@@ -1188,8 +1196,9 @@ olx.control.AttributionOptions.prototype.className;
|
||||
|
||||
|
||||
/**
|
||||
* Target.
|
||||
* @type {Element|undefined}
|
||||
* Specify a target if you want the control to be rendered outside of the map's
|
||||
* viewport.
|
||||
* @type {Element|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.AttributionOptions.prototype.target;
|
||||
@@ -1349,7 +1358,7 @@ olx.control.DefaultsOptions.prototype.zoomOptions;
|
||||
* labelActive: (string|Node|undefined),
|
||||
* tipLabel: (string|undefined),
|
||||
* keys: (boolean|undefined),
|
||||
* target: (Element|undefined),
|
||||
* target: (Element|string|undefined),
|
||||
* source: (Element|string|undefined)}}
|
||||
*/
|
||||
olx.control.FullScreenOptions;
|
||||
@@ -1399,8 +1408,9 @@ olx.control.FullScreenOptions.prototype.keys;
|
||||
|
||||
|
||||
/**
|
||||
* Target.
|
||||
* @type {Element|undefined}
|
||||
* Specify a target if you want the control to be rendered outside of the map's
|
||||
* viewport.
|
||||
* @type {Element|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.FullScreenOptions.prototype.target;
|
||||
@@ -1417,7 +1427,7 @@ olx.control.FullScreenOptions.prototype.source;
|
||||
* coordinateFormat: (ol.CoordinateFormatType|undefined),
|
||||
* projection: ol.ProjectionLike,
|
||||
* render: (function(ol.MapEvent)|undefined),
|
||||
* target: (Element|undefined),
|
||||
* target: (Element|string|undefined),
|
||||
* undefinedHTML: (string|undefined)}}
|
||||
*/
|
||||
olx.control.MousePositionOptions;
|
||||
@@ -1457,8 +1467,9 @@ olx.control.MousePositionOptions.prototype.render;
|
||||
|
||||
|
||||
/**
|
||||
* Target.
|
||||
* @type {Element|undefined}
|
||||
* Specify a target if you want the control to be rendered outside of the map's
|
||||
* viewport.
|
||||
* @type {Element|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.MousePositionOptions.prototype.target;
|
||||
@@ -1479,7 +1490,7 @@ olx.control.MousePositionOptions.prototype.undefinedHTML;
|
||||
* label: (string|Node|undefined),
|
||||
* layers: (Array.<ol.layer.Layer>|ol.Collection.<ol.layer.Layer>|undefined),
|
||||
* render: (function(ol.MapEvent)|undefined),
|
||||
* target: (Element|undefined),
|
||||
* target: (Element|string|undefined),
|
||||
* tipLabel: (string|undefined),
|
||||
* view: (ol.View|undefined)}}
|
||||
*/
|
||||
@@ -1542,7 +1553,7 @@ olx.control.OverviewMapOptions.prototype.render;
|
||||
/**
|
||||
* Specify a target if you want the control to be rendered outside of the map's
|
||||
* viewport.
|
||||
* @type {Element|undefined}
|
||||
* @type {Element|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.OverviewMapOptions.prototype.target;
|
||||
@@ -1569,7 +1580,7 @@ olx.control.OverviewMapOptions.prototype.view;
|
||||
* @typedef {{className: (string|undefined),
|
||||
* minWidth: (number|undefined),
|
||||
* render: (function(ol.MapEvent)|undefined),
|
||||
* target: (Element|undefined),
|
||||
* target: (Element|string|undefined),
|
||||
* units: (ol.control.ScaleLineUnits|string|undefined)}}
|
||||
*/
|
||||
olx.control.ScaleLineOptions;
|
||||
@@ -1601,8 +1612,9 @@ olx.control.ScaleLineOptions.prototype.render;
|
||||
|
||||
|
||||
/**
|
||||
* Target.
|
||||
* @type {Element|undefined}
|
||||
* Specify a target if you want the control to be rendered outside of the map's
|
||||
* viewport.
|
||||
* @type {Element|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.ScaleLineOptions.prototype.target;
|
||||
@@ -1621,7 +1633,7 @@ olx.control.ScaleLineOptions.prototype.units;
|
||||
* className: (string|undefined),
|
||||
* label: (string|Element|undefined),
|
||||
* tipLabel: (string|undefined),
|
||||
* target: (Element|undefined),
|
||||
* target: (Element|string|undefined),
|
||||
* render: (function(ol.MapEvent)|undefined),
|
||||
* resetNorth: (function()|undefined),
|
||||
* autoHide: (boolean|undefined)}}
|
||||
@@ -1689,8 +1701,9 @@ olx.control.RotateOptions.prototype.resetNorth;
|
||||
|
||||
|
||||
/**
|
||||
* Target.
|
||||
* @type {Element|undefined}
|
||||
* Specify a target if you want the control to be rendered outside of the map's
|
||||
* viewport.
|
||||
* @type {Element|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.RotateOptions.prototype.target;
|
||||
@@ -1704,7 +1717,7 @@ olx.control.RotateOptions.prototype.target;
|
||||
* zoomInTipLabel: (string|undefined),
|
||||
* zoomOutTipLabel: (string|undefined),
|
||||
* delta: (number|undefined),
|
||||
* target: (Element|undefined)}}
|
||||
* target: (Element|string|undefined)}}
|
||||
*/
|
||||
olx.control.ZoomOptions;
|
||||
|
||||
@@ -1768,8 +1781,9 @@ olx.control.ZoomOptions.prototype.delta;
|
||||
|
||||
|
||||
/**
|
||||
* Target.
|
||||
* @type {Element|undefined}
|
||||
* Specify a target if you want the control to be rendered outside of the map's
|
||||
* viewport.
|
||||
* @type {Element|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.ZoomOptions.prototype.target;
|
||||
@@ -1828,7 +1842,7 @@ olx.control.ZoomSliderOptions.prototype.render;
|
||||
|
||||
/**
|
||||
* @typedef {{className: (string|undefined),
|
||||
* target: (Element|undefined),
|
||||
* target: (Element|string|undefined),
|
||||
* label: (string|Node|undefined),
|
||||
* tipLabel: (string|undefined),
|
||||
* extent: (ol.Extent|undefined)}}
|
||||
@@ -1845,8 +1859,9 @@ olx.control.ZoomToExtentOptions.prototype.className;
|
||||
|
||||
|
||||
/**
|
||||
* Target.
|
||||
* @type {Element|undefined}
|
||||
* Specify a target if you want the control to be rendered outside of the map's
|
||||
* viewport.
|
||||
* @type {Element|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.control.ZoomToExtentOptions.prototype.target;
|
||||
@@ -1987,6 +2002,7 @@ olx.format.WriteOptions.prototype.decimals;
|
||||
/**
|
||||
* @typedef {{defaultDataProjection: ol.ProjectionLike,
|
||||
* geometryName: (string|undefined),
|
||||
* extractGeometryName: (boolean|undefined),
|
||||
* featureProjection: ol.ProjectionLike}}
|
||||
*/
|
||||
olx.format.GeoJSONOptions;
|
||||
@@ -2017,6 +2033,18 @@ olx.format.GeoJSONOptions.prototype.featureProjection;
|
||||
olx.format.GeoJSONOptions.prototype.geometryName;
|
||||
|
||||
|
||||
/**
|
||||
* Certain GeoJSON providers include the geometry_name field in the feature
|
||||
* geoJSON. If set to `true` the geoJSON reader will look for that field to
|
||||
* set the geometry name. If both this field is set to `true` and a
|
||||
* `geometryName` is provided, the `geometryName` will take precedence.
|
||||
* Default is `false`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.format.GeoJSONOptions.prototype.extractGeometryName;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{geometryName: (string|undefined)}}
|
||||
*/
|
||||
@@ -2975,8 +3003,10 @@ olx.interaction.DragZoomOptions.prototype.out;
|
||||
* @typedef {{clickTolerance: (number|undefined),
|
||||
* features: (ol.Collection.<ol.Feature>|undefined),
|
||||
* source: (ol.source.Vector|undefined),
|
||||
* dragVertexDelay: (number|undefined),
|
||||
* snapTolerance: (number|undefined),
|
||||
* type: ol.geom.GeometryType,
|
||||
* type: (ol.geom.GeometryType|string),
|
||||
* stopClick: (boolean|undefined),
|
||||
* maxPoints: (number|undefined),
|
||||
* minPoints: (number|undefined),
|
||||
* finishCondition: (ol.EventsConditionType|undefined),
|
||||
@@ -3019,6 +3049,14 @@ olx.interaction.DrawOptions.prototype.features;
|
||||
olx.interaction.DrawOptions.prototype.source;
|
||||
|
||||
|
||||
/**
|
||||
* Delay in milliseconds after pointerdown before the current vertex can be
|
||||
* dragged to its exact position. Default is 500 ms.
|
||||
* @type {number|undefined}
|
||||
*/
|
||||
olx.interaction.DrawOptions.prototype.dragVertexDelay;
|
||||
|
||||
|
||||
/**
|
||||
* Pixel distance for snapping to the drawing finish. Default is `12`.
|
||||
* @type {number|undefined}
|
||||
@@ -3030,12 +3068,21 @@ olx.interaction.DrawOptions.prototype.snapTolerance;
|
||||
/**
|
||||
* Drawing type ('Point', 'LineString', 'Polygon', 'MultiPoint',
|
||||
* 'MultiLineString', 'MultiPolygon' or 'Circle').
|
||||
* @type {ol.geom.GeometryType}
|
||||
* @type {ol.geom.GeometryType|string}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.DrawOptions.prototype.type;
|
||||
|
||||
|
||||
/**
|
||||
* Stop click, singleclick, and doubleclick events from firing during drawing.
|
||||
* Default is `false`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.DrawOptions.prototype.stopClick;
|
||||
|
||||
|
||||
/**
|
||||
* The number of points that can be drawn before a polygon ring or line string
|
||||
* is finished. The default is no restriction.
|
||||
@@ -3131,6 +3178,7 @@ olx.interaction.DrawOptions.prototype.wrapX;
|
||||
/**
|
||||
* @typedef {{extent: (ol.Extent|undefined),
|
||||
* boxStyle: (ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined),
|
||||
* pixelTolerance: (number|undefined),
|
||||
* pointerStyle: (ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined),
|
||||
* wrapX: (boolean|undefined)}}
|
||||
* @api
|
||||
@@ -3152,6 +3200,14 @@ olx.interaction.ExtentOptions.prototype.extent;
|
||||
*/
|
||||
olx.interaction.ExtentOptions.prototype.boxStyle;
|
||||
|
||||
/**
|
||||
* Pixel tolerance for considering the pointer close enough to a segment or
|
||||
* vertex for editing. Default is `10`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.ExtentOptions.prototype.pixelTolerance;
|
||||
|
||||
/**
|
||||
* Style for the cursor used to draw the extent.
|
||||
* Defaults to ol.style.Style.createDefaultEditing()[ol.geom.GeometryType.POINT]
|
||||
@@ -4225,8 +4281,10 @@ olx.layer.TileOptions.prototype.zIndex;
|
||||
* maxResolution: (number|undefined),
|
||||
* opacity: (number|undefined),
|
||||
* renderBuffer: (number|undefined),
|
||||
* renderMode: (ol.layer.VectorRenderType|string|undefined),
|
||||
* source: (ol.source.Vector|undefined),
|
||||
* map: (ol.PluggableMap|undefined),
|
||||
* declutter: (boolean|undefined),
|
||||
* style: (ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined),
|
||||
* updateWhileAnimating: (boolean|undefined),
|
||||
* updateWhileInteracting: (boolean|undefined),
|
||||
@@ -4236,6 +4294,20 @@ olx.layer.TileOptions.prototype.zIndex;
|
||||
olx.layer.VectorOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Render mode for vector layers:
|
||||
* * `'image'`: Vector layers are rendered as images. Great performance, but
|
||||
* point symbols and texts are always rotated with the view and pixels are
|
||||
* scaled during zoom animations.
|
||||
* * `'vector'`: Vector layers are rendered as vectors. Most accurate rendering
|
||||
* even during animations, but slower performance.
|
||||
* Default is `vector`.
|
||||
* @type {ol.layer.VectorRenderType|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.layer.VectorOptions.prototype.renderMode;
|
||||
|
||||
|
||||
/**
|
||||
* Render order. Function to be used when sorting features before rendering. By
|
||||
* default features are drawn in the order that they are created. Use `null` to
|
||||
@@ -4309,6 +4381,16 @@ olx.layer.VectorOptions.prototype.renderBuffer;
|
||||
olx.layer.VectorOptions.prototype.source;
|
||||
|
||||
|
||||
/**
|
||||
* Declutter images and text. Decluttering is applied to all image and text
|
||||
* styles, and the priority is defined by the z-index of the style. Lower
|
||||
* z-index means higher priority. Default is `false`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.layer.VectorOptions.prototype.declutter;
|
||||
|
||||
|
||||
/**
|
||||
* Layer style. See {@link ol.style} for default style which will be used if
|
||||
* this is not defined.
|
||||
@@ -4366,6 +4448,7 @@ olx.layer.VectorOptions.prototype.zIndex;
|
||||
* renderMode: (ol.layer.VectorTileRenderType|string|undefined),
|
||||
* renderOrder: (ol.RenderOrderFunction|undefined),
|
||||
* source: (ol.source.VectorTile|undefined),
|
||||
* declutter: (boolean|undefined),
|
||||
* style: (ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined),
|
||||
* updateWhileAnimating: (boolean|undefined),
|
||||
* updateWhileInteracting: (boolean|undefined),
|
||||
@@ -4399,12 +4482,14 @@ olx.layer.VectorTileOptions.prototype.renderBuffer;
|
||||
* * `'vector'`: Vector tiles are rendered as vectors. Most accurate rendering
|
||||
* even during animations, but slower performance than the other options.
|
||||
*
|
||||
* The default is `'hybrid'`.
|
||||
* When `declutter` is set to `true`, `'hybrid'` will be used instead of
|
||||
* `'image'`. The default is `'hybrid'`.
|
||||
* @type {ol.layer.VectorTileRenderType|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.layer.VectorTileOptions.prototype.renderMode;
|
||||
|
||||
|
||||
/**
|
||||
* Render order. Function to be used when sorting features before rendering. By
|
||||
* default features are drawn in the order that they are created.
|
||||
@@ -4475,6 +4560,17 @@ olx.layer.VectorTileOptions.prototype.preload;
|
||||
olx.layer.VectorTileOptions.prototype.source;
|
||||
|
||||
|
||||
/**
|
||||
* Declutter images and text. Decluttering is applied to all image and text
|
||||
* styles, and the priority is defined by the z-index of the style. Lower
|
||||
* z-index means higher priority. When set to `true`, a `renderMode` of
|
||||
* `'image'` will be overridden with `'hybrid'`. Default is `false`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.layer.VectorTileOptions.prototype.declutter;
|
||||
|
||||
|
||||
/**
|
||||
* Layer style. See {@link ol.style} for default style which will be used if
|
||||
* this is not defined.
|
||||
@@ -4518,7 +4614,7 @@ olx.layer.VectorTileOptions.prototype.visible;
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.layer.VectorOptions.prototype.zIndex;
|
||||
olx.layer.VectorTileOptions.prototype.zIndex;
|
||||
|
||||
|
||||
/**
|
||||
@@ -5487,7 +5583,7 @@ olx.source.OSMOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* hidpi: (boolean|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
@@ -5503,7 +5599,7 @@ olx.source.ImageArcGISRestOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageArcGISRestOptions.prototype.attributions;
|
||||
@@ -6597,6 +6693,37 @@ olx.source.VectorOptions.prototype.format;
|
||||
* The loader function used to load features, from a remote source for example.
|
||||
* If this is not set and `url` is set, the source will create and use an XHR
|
||||
* feature loader.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```js
|
||||
* var vectorSource = new ol.source.Vector({
|
||||
* format: new ol.format.GeoJSON(),
|
||||
* loader: function(extent, resolution, projection) {
|
||||
* var proj = projection.getCode();
|
||||
* var url = 'https://ahocevar.com/geoserver/wfs?service=WFS&' +
|
||||
* 'version=1.1.0&request=GetFeature&typename=osm:water_areas&' +
|
||||
* 'outputFormat=application/json&srsname=' + proj + '&' +
|
||||
* 'bbox=' + extent.join(',') + ',' + proj;
|
||||
* var xhr = new XMLHttpRequest();
|
||||
* xhr.open('GET', url);
|
||||
* var onError = function() {
|
||||
* vectorSource.removeLoadedExtent(extent);
|
||||
* }
|
||||
* xhr.onerror = onError;
|
||||
* xhr.onload = function() {
|
||||
* if (xhr.status == 200) {
|
||||
* vectorSource.addFeatures(
|
||||
* vectorSource.getFormat().readFeatures(xhr.responseText));
|
||||
* } else {
|
||||
* onError();
|
||||
* }
|
||||
* }
|
||||
* xhr.send();
|
||||
* },
|
||||
* strategy: ol.loadingstrategy.bbox
|
||||
* });
|
||||
* ```
|
||||
* @type {ol.FeatureLoader|undefined}
|
||||
* @api
|
||||
*/
|
||||
@@ -7210,7 +7337,9 @@ olx.source.CartoDBOptions.prototype.account;
|
||||
* url: !string,
|
||||
* tierSizeCalculation: (string|undefined),
|
||||
* size: ol.Size,
|
||||
* transition: (number|undefined)}}
|
||||
* extent: (ol.Extent|undefined),
|
||||
* transition: (number|undefined),
|
||||
* tileSize: (number|undefined)}}
|
||||
*/
|
||||
olx.source.ZoomifyOptions;
|
||||
|
||||
@@ -7301,6 +7430,17 @@ olx.source.ZoomifyOptions.prototype.tierSizeCalculation;
|
||||
olx.source.ZoomifyOptions.prototype.size;
|
||||
|
||||
|
||||
/**
|
||||
* Extent for the TileGrid that is created. Default sets the TileGrid in the
|
||||
* fourth quadrant, meaning extent is `[0, -height, width, 0]`. To change the
|
||||
* extent to the first quadrant (the default for OpenLayers 2) set the extent
|
||||
* as `[0, 0, width, height]`.
|
||||
* @type {ol.Extent|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ZoomifyOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Duration of the opacity transition for rendering. To disable the opacity
|
||||
* transition, pass `transition: 0`.
|
||||
@@ -7310,6 +7450,15 @@ olx.source.ZoomifyOptions.prototype.size;
|
||||
olx.source.ZoomifyOptions.prototype.transition;
|
||||
|
||||
|
||||
/**
|
||||
* Tile size. Same tile size is used for all zoom levels. Default value is
|
||||
* `OpenLayers.DEFAULT_TILE_SIZE`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ZoomifyOptions.prototype.tileSize;
|
||||
|
||||
|
||||
/**
|
||||
* Namespace.
|
||||
* @type {Object}
|
||||
@@ -7770,6 +7919,7 @@ olx.style.StrokeOptions.prototype.width;
|
||||
* maxAngle: (number|undefined),
|
||||
* offsetX: (number|undefined),
|
||||
* offsetY: (number|undefined),
|
||||
* overflow: (boolean|undefined),
|
||||
* placement: (ol.style.TextPlacement|string|undefined),
|
||||
* scale: (number|undefined),
|
||||
* rotateWithView: (boolean|undefined),
|
||||
@@ -7778,16 +7928,22 @@ olx.style.StrokeOptions.prototype.width;
|
||||
* textAlign: (string|undefined),
|
||||
* textBaseline: (string|undefined),
|
||||
* fill: (ol.style.Fill|undefined),
|
||||
* stroke: (ol.style.Stroke|undefined)}}
|
||||
* stroke: (ol.style.Stroke|undefined),
|
||||
* backgroundFill: (ol.style.Fill|undefined),
|
||||
* backgroundStroke: (ol.style.Stroke|undefined),
|
||||
* padding: (Array.<number>|undefined)}}
|
||||
*/
|
||||
olx.style.TextOptions;
|
||||
|
||||
|
||||
/**
|
||||
* **Deprecated**. Use the `overflow` option instead.
|
||||
*
|
||||
* For polygon labels or when `placement` is set to `'line'`, allow text to
|
||||
* exceed the width of the polygon at the the label position or the length of
|
||||
* exceed the width of the polygon at the label position or the length of
|
||||
* the path that it follows. Default is `false`.
|
||||
* @type {boolean|undefined}
|
||||
* @deprecated
|
||||
* @api
|
||||
*/
|
||||
olx.style.TextOptions.prototype.exceedLength;
|
||||
@@ -7831,6 +7987,16 @@ olx.style.TextOptions.prototype.offsetX;
|
||||
olx.style.TextOptions.prototype.offsetY;
|
||||
|
||||
|
||||
/**
|
||||
* For polygon labels or when `placement` is set to `'line'`, allow text to
|
||||
* exceed the width of the polygon at the label position or the length of
|
||||
* the path that it follows. Default is `false`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.style.TextOptions.prototype.overflow;
|
||||
|
||||
|
||||
/**
|
||||
* Text placement.
|
||||
* @type {ol.style.TextPlacement|undefined}
|
||||
@@ -7907,6 +8073,34 @@ olx.style.TextOptions.prototype.fill;
|
||||
olx.style.TextOptions.prototype.stroke;
|
||||
|
||||
|
||||
/**
|
||||
* Fill style for the text background when `placement` is `'point'`. Default is
|
||||
* no fill.
|
||||
* @type {ol.style.Fill|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.style.TextOptions.prototype.backgroundFill;
|
||||
|
||||
|
||||
/**
|
||||
* Stroke style for the text background when `placement` is `'point'`. Default
|
||||
* is no stroke.
|
||||
* @type {ol.style.Stroke|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.style.TextOptions.prototype.backgroundStroke;
|
||||
|
||||
|
||||
/**
|
||||
* Padding in pixels around the text for decluttering and background. The order
|
||||
* of values in the array is `[top, right, bottom, left]`. Default is
|
||||
* `[0, 0, 0, 0]`.
|
||||
* @type {Array.<number>|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.style.TextOptions.prototype.padding;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{geometry: (undefined|string|ol.geom.Geometry|ol.StyleGeometryFunction),
|
||||
* fill: (ol.style.Fill|undefined),
|
||||
@@ -8329,7 +8523,6 @@ olx.view.FitOptions.prototype.callback;
|
||||
|
||||
/**
|
||||
* @typedef {{animate: boolean,
|
||||
* attributions: Object.<string, ol.Attribution>,
|
||||
* coordinateToPixelTransform: ol.Transform,
|
||||
* extent: (null|ol.Extent),
|
||||
* focus: ol.Coordinate,
|
||||
@@ -8341,7 +8534,7 @@ olx.view.FitOptions.prototype.callback;
|
||||
* pixelToCoordinateTransform: ol.Transform,
|
||||
* postRenderFunctions: Array.<ol.PostRenderFunction>,
|
||||
* size: ol.Size,
|
||||
* skippedFeatureUids: Object.<string, boolean>,
|
||||
* skippedFeatureUids: !Object.<string, boolean>,
|
||||
* tileQueue: ol.TileQueue,
|
||||
* time: number,
|
||||
* usedTiles: Object.<string, Object.<string, ol.TileRange>>,
|
||||
@@ -8377,7 +8570,8 @@ olx.FrameState.prototype.viewState;
|
||||
* @typedef {{center: ol.Coordinate,
|
||||
* projection: ol.proj.Projection,
|
||||
* resolution: number,
|
||||
* rotation: number}}
|
||||
* rotation: number,
|
||||
* zoom: number}}
|
||||
*/
|
||||
olx.ViewState;
|
||||
|
||||
@@ -8410,6 +8604,14 @@ olx.ViewState.prototype.resolution;
|
||||
olx.ViewState.prototype.rotation;
|
||||
|
||||
|
||||
/**
|
||||
* The current zoom level.
|
||||
* @type {number}
|
||||
* @api
|
||||
*/
|
||||
olx.ViewState.prototype.zoom;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{initialSize: (number|undefined),
|
||||
* maxSize: (number|undefined),
|
||||
|
||||
30
package.json
30
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openlayers",
|
||||
"version": "4.4.0",
|
||||
"version": "4.6.4-backports.2",
|
||||
"description": "Build tools and sources for developing OpenLayers based mapping applications",
|
||||
"keywords": [
|
||||
"map",
|
||||
@@ -38,17 +38,17 @@
|
||||
"css/ol.css"
|
||||
],
|
||||
"dependencies": {
|
||||
"async": "2.5.0",
|
||||
"closure-util": "1.24.0",
|
||||
"fs-extra": "4.0.2",
|
||||
"async": "2.6.0",
|
||||
"closure-util": "1.26.0",
|
||||
"fs-extra": "4.0.3",
|
||||
"jsdoc": "3.5.5",
|
||||
"nomnom": "1.8.1",
|
||||
"pbf": "3.1.0",
|
||||
"pixelworks": "1.1.0",
|
||||
"rbush": "2.0.1",
|
||||
"rollup": "^0.50.0",
|
||||
"rollup-plugin-cleanup": "^1.0.0",
|
||||
"rollup-plugin-commonjs": "^8.0.2",
|
||||
"rollup": "^0.52.0",
|
||||
"rollup-plugin-cleanup": "^2.0.0",
|
||||
"rollup-plugin-commonjs": "^8.2.6",
|
||||
"rollup-plugin-node-resolve": "^3.0.0",
|
||||
"temp": "0.8.3",
|
||||
"walk": "2.3.9"
|
||||
@@ -56,34 +56,34 @@
|
||||
"devDependencies": {
|
||||
"clean-css-cli": "4.1.10",
|
||||
"coveralls": "3.0.0",
|
||||
"debounce": "^1.0.0",
|
||||
"eslint": "4.8.0",
|
||||
"debounce": "^1.1.0",
|
||||
"eslint": "4.12.1",
|
||||
"eslint-config-openlayers": "7.0.0",
|
||||
"eslint-plugin-openlayers-internal": "^3.1.0",
|
||||
"expect.js": "0.3.1",
|
||||
"gaze": "^1.0.0",
|
||||
"glob": "7.1.1",
|
||||
"handlebars": "4.0.10",
|
||||
"handlebars": "4.0.11",
|
||||
"istanbul": "0.4.5",
|
||||
"jquery": "3.2.1",
|
||||
"jscodeshift": "^0.3.30",
|
||||
"karma": "^1.7.0",
|
||||
"karma": "^1.7.1",
|
||||
"karma-chrome-launcher": "^2.1.1",
|
||||
"karma-coverage": "^1.1.1",
|
||||
"karma-firefox-launcher": "^1.0.1",
|
||||
"karma-mocha": "^1.3.0",
|
||||
"karma-sauce-launcher": "^1.1.0",
|
||||
"marked": "0.3.6",
|
||||
"marked": "0.3.7",
|
||||
"metalsmith": "2.3.0",
|
||||
"metalsmith-layouts": "1.8.1",
|
||||
"mocha": "4.0.0",
|
||||
"mocha": "4.0.1",
|
||||
"mocha-phantomjs-core": "^2.1.0",
|
||||
"mustache": "2.3.0",
|
||||
"phantomjs-prebuilt": "2.1.15",
|
||||
"phantomjs-prebuilt": "2.1.16",
|
||||
"pixelmatch": "^4.0.2",
|
||||
"proj4": "2.4.4",
|
||||
"serve-files": "1.0.1",
|
||||
"sinon": "4.0.1",
|
||||
"sinon": "4.1.2",
|
||||
"slimerjs": "0.10.3",
|
||||
"url-polyfill": "^1.0.7"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ol",
|
||||
"version": "4.4.0",
|
||||
"version": "4.6.4",
|
||||
"description": "OpenLayers as ES2015 modules",
|
||||
"main": "index.js",
|
||||
"module": "index.js",
|
||||
|
||||
@@ -37,6 +37,7 @@ See the following examples for more detail on bundling OpenLayers with your appl
|
||||
* Using [Rollup & Uglify](https://gist.github.com/tschaub/8beb328ea72b36446fc2198d008287de)
|
||||
* Using [Rollup & Closure Compiler](https://gist.github.com/tschaub/32a5692bedac5254da24fa3b12072f35)
|
||||
* Using [Webpack & Uglify](https://gist.github.com/tschaub/79025aef325cd2837364400a105405b8)
|
||||
* Using [Webpack & Closure Compiler](https://gist.github.com/ahocevar/8ceafc6293455ba491dd9be12c15761f)
|
||||
* Using [Browserify & Uglify](https://gist.github.com/tschaub/4bfb209a8f809823f1495b2e4436018e)
|
||||
|
||||
## Module Identifiers
|
||||
@@ -46,7 +47,3 @@ The module identifiers above (e.g. `ol/map`) are like the `ol.Map` names in the
|
||||
Constructors are exported from dedicated modules. For example, the `ol/layer/tile` module exports the `Tile` layer constructor.
|
||||
|
||||
Utility functions are available as properties of the default export from utility modules. For example, the `getCenter` function is a property of the default export from the `ol/extent` utility module.
|
||||
|
||||
## Caveats
|
||||
|
||||
* The WebGL renderer is not available in this package.
|
||||
|
||||
@@ -22,6 +22,7 @@ goog.require('ol.tilegrid');
|
||||
* ..
|
||||
*
|
||||
* @constructor
|
||||
* @deprecated This class is deprecated and will removed in the next major release.
|
||||
* @param {olx.AttributionOptions} options Attribution options.
|
||||
* @struct
|
||||
* @api
|
||||
|
||||
@@ -5,12 +5,12 @@ goog.require('ol.math');
|
||||
|
||||
|
||||
/**
|
||||
* This RegExp matches # followed by 3 or 6 hex digits.
|
||||
* This RegExp matches # followed by 3, 4, 6, or 8 hex digits.
|
||||
* @const
|
||||
* @type {RegExp}
|
||||
* @private
|
||||
*/
|
||||
ol.color.HEX_COLOR_RE_ = /^#(?:[0-9a-f]{3}){1,2}$/i;
|
||||
ol.color.HEX_COLOR_RE_ = /^#(?:[0-9a-f]{3,4}){1,2}$/i;
|
||||
|
||||
|
||||
/**
|
||||
@@ -138,18 +138,30 @@ ol.color.fromStringInternal_ = function(s) {
|
||||
|
||||
if (ol.color.HEX_COLOR_RE_.exec(s)) { // hex
|
||||
var n = s.length - 1; // number of hex digits
|
||||
ol.asserts.assert(n == 3 || n == 6, 54); // Hex color should have 3 or 6 digits
|
||||
var d = n == 3 ? 1 : 2; // number of digits per channel
|
||||
var d; // number of digits per channel
|
||||
if (n <= 4) {
|
||||
d = 1;
|
||||
} else {
|
||||
d = 2;
|
||||
}
|
||||
var hasAlpha = n === 4 || n === 8;
|
||||
r = parseInt(s.substr(1 + 0 * d, d), 16);
|
||||
g = parseInt(s.substr(1 + 1 * d, d), 16);
|
||||
b = parseInt(s.substr(1 + 2 * d, d), 16);
|
||||
if (hasAlpha) {
|
||||
a = parseInt(s.substr(1 + 3 * d, d), 16);
|
||||
} else {
|
||||
a = 255;
|
||||
}
|
||||
if (d == 1) {
|
||||
r = (r << 4) + r;
|
||||
g = (g << 4) + g;
|
||||
b = (b << 4) + b;
|
||||
if (hasAlpha) {
|
||||
a = (a << 4) + a;
|
||||
}
|
||||
a = 1;
|
||||
color = [r, g, b, a];
|
||||
}
|
||||
color = [r, g, b, a / 255];
|
||||
} else if (s.indexOf('rgba(') == 0) { // rgba()
|
||||
parts = s.slice(5, -1).split(',').map(Number);
|
||||
color = ol.color.normalize(parts);
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
goog.provide('ol.control.Attribution');
|
||||
|
||||
goog.require('ol');
|
||||
goog.require('ol.dom');
|
||||
goog.require('ol.array');
|
||||
goog.require('ol.control.Control');
|
||||
goog.require('ol.css');
|
||||
goog.require('ol.dom');
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.events.EventType');
|
||||
goog.require('ol.layer.Layer');
|
||||
goog.require('ol.obj');
|
||||
|
||||
|
||||
@@ -116,24 +118,19 @@ ol.control.Attribution = function(opt_options) {
|
||||
target: options.target
|
||||
});
|
||||
|
||||
/**
|
||||
* A list of currently rendered resolutions.
|
||||
* @type {Array.<string>}
|
||||
* @private
|
||||
*/
|
||||
this.renderedAttributions_ = [];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.renderedVisible_ = true;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string, Element>}
|
||||
*/
|
||||
this.attributionElements_ = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string, boolean>}
|
||||
*/
|
||||
this.attributionElementRenderedVisible_ = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string, Element>}
|
||||
@@ -145,59 +142,62 @@ ol.inherits(ol.control.Attribution, ol.control.Control);
|
||||
|
||||
|
||||
/**
|
||||
* @param {?olx.FrameState} frameState Frame state.
|
||||
* @return {Array.<Object.<string, ol.Attribution>>} Attributions.
|
||||
* Get a list of visible attributions.
|
||||
* @param {olx.FrameState} frameState Frame state.
|
||||
* @return {Array.<string>} Attributions.
|
||||
* @private
|
||||
*/
|
||||
ol.control.Attribution.prototype.getSourceAttributions = function(frameState) {
|
||||
var i, ii, j, jj, tileRanges, source, sourceAttribution,
|
||||
sourceAttributionKey, sourceAttributions, sourceKey;
|
||||
var intersectsTileRange;
|
||||
ol.control.Attribution.prototype.getSourceAttributions_ = function(frameState) {
|
||||
/**
|
||||
* Used to determine if an attribution already exists.
|
||||
* @type {Object.<string, boolean>}
|
||||
*/
|
||||
var lookup = {};
|
||||
|
||||
/**
|
||||
* A list of visible attributions.
|
||||
* @type {Array.<string>}
|
||||
*/
|
||||
var visibleAttributions = [];
|
||||
|
||||
var layerStatesArray = frameState.layerStatesArray;
|
||||
/** @type {Object.<string, ol.Attribution>} */
|
||||
var attributions = ol.obj.assign({}, frameState.attributions);
|
||||
/** @type {Object.<string, ol.Attribution>} */
|
||||
var hiddenAttributions = {};
|
||||
var uniqueAttributions = {};
|
||||
var projection = /** @type {!ol.proj.Projection} */ (frameState.viewState.projection);
|
||||
for (i = 0, ii = layerStatesArray.length; i < ii; i++) {
|
||||
source = layerStatesArray[i].layer.getSource();
|
||||
var resolution = frameState.viewState.resolution;
|
||||
for (var i = 0, ii = layerStatesArray.length; i < ii; ++i) {
|
||||
var layerState = layerStatesArray[i];
|
||||
if (!ol.layer.Layer.visibleAtResolution(layerState, resolution)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var source = layerState.layer.getSource();
|
||||
if (!source) {
|
||||
continue;
|
||||
}
|
||||
sourceKey = ol.getUid(source).toString();
|
||||
sourceAttributions = source.getAttributions();
|
||||
if (!sourceAttributions) {
|
||||
|
||||
var attributionGetter = source.getAttributions2();
|
||||
if (!attributionGetter) {
|
||||
continue;
|
||||
}
|
||||
for (j = 0, jj = sourceAttributions.length; j < jj; j++) {
|
||||
sourceAttribution = sourceAttributions[j];
|
||||
sourceAttributionKey = ol.getUid(sourceAttribution).toString();
|
||||
if (sourceAttributionKey in attributions) {
|
||||
|
||||
var attributions = attributionGetter(frameState);
|
||||
if (!attributions) {
|
||||
continue;
|
||||
}
|
||||
tileRanges = frameState.usedTiles[sourceKey];
|
||||
if (tileRanges) {
|
||||
var tileGrid = /** @type {ol.source.Tile} */ (source).getTileGridForProjection(projection);
|
||||
intersectsTileRange = sourceAttribution.intersectsAnyTileRange(
|
||||
tileRanges, tileGrid, projection);
|
||||
} else {
|
||||
intersectsTileRange = false;
|
||||
|
||||
if (Array.isArray(attributions)) {
|
||||
for (var j = 0, jj = attributions.length; j < jj; ++j) {
|
||||
if (!(attributions[j] in lookup)) {
|
||||
visibleAttributions.push(attributions[j]);
|
||||
lookup[attributions[j]] = true;
|
||||
}
|
||||
if (intersectsTileRange) {
|
||||
if (sourceAttributionKey in hiddenAttributions) {
|
||||
delete hiddenAttributions[sourceAttributionKey];
|
||||
}
|
||||
var html = sourceAttribution.getHTML();
|
||||
if (!(html in uniqueAttributions)) {
|
||||
uniqueAttributions[html] = true;
|
||||
attributions[sourceAttributionKey] = sourceAttribution;
|
||||
}
|
||||
} else {
|
||||
hiddenAttributions[sourceAttributionKey] = sourceAttribution;
|
||||
if (!(attributions in lookup)) {
|
||||
visibleAttributions.push(attributions);
|
||||
lookup[attributions] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return [attributions, hiddenAttributions];
|
||||
return visibleAttributions;
|
||||
};
|
||||
|
||||
|
||||
@@ -217,7 +217,6 @@ ol.control.Attribution.render = function(mapEvent) {
|
||||
* @param {?olx.FrameState} frameState Frame state.
|
||||
*/
|
||||
ol.control.Attribution.prototype.updateElement_ = function(frameState) {
|
||||
|
||||
if (!frameState) {
|
||||
if (this.renderedVisible_) {
|
||||
this.element.style.display = 'none';
|
||||
@@ -226,65 +225,38 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
|
||||
return;
|
||||
}
|
||||
|
||||
var attributions = this.getSourceAttributions(frameState);
|
||||
/** @type {Object.<string, ol.Attribution>} */
|
||||
var visibleAttributions = attributions[0];
|
||||
/** @type {Object.<string, ol.Attribution>} */
|
||||
var hiddenAttributions = attributions[1];
|
||||
|
||||
var attributionElement, attributionKey;
|
||||
for (attributionKey in this.attributionElements_) {
|
||||
if (attributionKey in visibleAttributions) {
|
||||
if (!this.attributionElementRenderedVisible_[attributionKey]) {
|
||||
this.attributionElements_[attributionKey].style.display = '';
|
||||
this.attributionElementRenderedVisible_[attributionKey] = true;
|
||||
}
|
||||
delete visibleAttributions[attributionKey];
|
||||
} else if (attributionKey in hiddenAttributions) {
|
||||
if (this.attributionElementRenderedVisible_[attributionKey]) {
|
||||
this.attributionElements_[attributionKey].style.display = 'none';
|
||||
delete this.attributionElementRenderedVisible_[attributionKey];
|
||||
}
|
||||
delete hiddenAttributions[attributionKey];
|
||||
} else {
|
||||
ol.dom.removeNode(this.attributionElements_[attributionKey]);
|
||||
delete this.attributionElements_[attributionKey];
|
||||
delete this.attributionElementRenderedVisible_[attributionKey];
|
||||
}
|
||||
}
|
||||
for (attributionKey in visibleAttributions) {
|
||||
attributionElement = document.createElement('LI');
|
||||
attributionElement.innerHTML =
|
||||
visibleAttributions[attributionKey].getHTML();
|
||||
this.ulElement_.appendChild(attributionElement);
|
||||
this.attributionElements_[attributionKey] = attributionElement;
|
||||
this.attributionElementRenderedVisible_[attributionKey] = true;
|
||||
}
|
||||
for (attributionKey in hiddenAttributions) {
|
||||
attributionElement = document.createElement('LI');
|
||||
attributionElement.innerHTML =
|
||||
hiddenAttributions[attributionKey].getHTML();
|
||||
attributionElement.style.display = 'none';
|
||||
this.ulElement_.appendChild(attributionElement);
|
||||
this.attributionElements_[attributionKey] = attributionElement;
|
||||
var attributions = this.getSourceAttributions_(frameState);
|
||||
if (ol.array.equals(attributions, this.renderedAttributions_)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var renderVisible =
|
||||
!ol.obj.isEmpty(this.attributionElementRenderedVisible_) ||
|
||||
!ol.obj.isEmpty(frameState.logos);
|
||||
if (this.renderedVisible_ != renderVisible) {
|
||||
this.element.style.display = renderVisible ? '' : 'none';
|
||||
this.renderedVisible_ = renderVisible;
|
||||
// remove everything but the logo
|
||||
while (this.ulElement_.lastChild !== this.logoLi_) {
|
||||
this.ulElement_.removeChild(this.ulElement_.lastChild);
|
||||
}
|
||||
if (renderVisible &&
|
||||
ol.obj.isEmpty(this.attributionElementRenderedVisible_)) {
|
||||
|
||||
// append the attributions
|
||||
for (var i = 0, ii = attributions.length; i < ii; ++i) {
|
||||
var element = document.createElement('LI');
|
||||
element.innerHTML = attributions[i];
|
||||
this.ulElement_.appendChild(element);
|
||||
}
|
||||
|
||||
|
||||
if (attributions.length === 0 && this.renderedAttributions_.length > 0) {
|
||||
this.element.classList.add('ol-logo-only');
|
||||
} else {
|
||||
} else if (this.renderedAttributions_.length === 0 && attributions.length > 0) {
|
||||
this.element.classList.remove('ol-logo-only');
|
||||
}
|
||||
|
||||
this.insertLogos_(frameState);
|
||||
var visible = attributions.length > 0 || !ol.obj.isEmpty(frameState.logos);
|
||||
if (this.renderedVisible_ != visible) {
|
||||
this.element.style.display = visible ? '' : 'none';
|
||||
this.renderedVisible_ = visible;
|
||||
}
|
||||
|
||||
this.renderedAttributions_ = attributions;
|
||||
this.insertLogos_(frameState);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -174,6 +174,9 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
|
||||
ol.proj.Units.METERS;
|
||||
var pointResolution =
|
||||
ol.proj.getPointResolution(projection, viewState.resolution, center, pointResolutionUnits);
|
||||
if (units != ol.control.ScaleLineUnits.DEGREES) {
|
||||
pointResolution *= projection.getMetersPerUnit();
|
||||
}
|
||||
|
||||
var nominalCount = this.minWidth_ * pointResolution;
|
||||
var suffix = '';
|
||||
|
||||
@@ -22,9 +22,9 @@ ol.control.ZoomToExtent = function(opt_options) {
|
||||
|
||||
/**
|
||||
* @type {ol.Extent}
|
||||
* @private
|
||||
* @protected
|
||||
*/
|
||||
this.extent_ = options.extent ? options.extent : null;
|
||||
this.extent = options.extent ? options.extent : null;
|
||||
|
||||
var className = options.className !== undefined ? options.className :
|
||||
'ol-zoom-extent';
|
||||
@@ -62,16 +62,16 @@ ol.inherits(ol.control.ZoomToExtent, ol.control.Control);
|
||||
*/
|
||||
ol.control.ZoomToExtent.prototype.handleClick_ = function(event) {
|
||||
event.preventDefault();
|
||||
this.handleZoomToExtent_();
|
||||
this.handleZoomToExtent();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @protected
|
||||
*/
|
||||
ol.control.ZoomToExtent.prototype.handleZoomToExtent_ = function() {
|
||||
ol.control.ZoomToExtent.prototype.handleZoomToExtent = function() {
|
||||
var map = this.getMap();
|
||||
var view = map.getView();
|
||||
var extent = !this.extent_ ? view.getProjection().getExtent() : this.extent_;
|
||||
var extent = !this.extent ? view.getProjection().getExtent() : this.extent;
|
||||
view.fit(extent);
|
||||
};
|
||||
|
||||
@@ -43,3 +43,30 @@ ol.css.CLASS_UNSUPPORTED = 'ol-unsupported';
|
||||
* @type {string}
|
||||
*/
|
||||
ol.css.CLASS_CONTROL = 'ol-control';
|
||||
|
||||
|
||||
/**
|
||||
* Get the list of font families from a font spec. Note that this doesn't work
|
||||
* for font families that have commas in them.
|
||||
* @param {string} The CSS font property.
|
||||
* @return {Object.<string>} The font families (or null if the input spec is invalid).
|
||||
*/
|
||||
ol.css.getFontFamilies = (function() {
|
||||
var style;
|
||||
var cache = {};
|
||||
return function(font) {
|
||||
if (!style) {
|
||||
style = document.createElement('div').style;
|
||||
}
|
||||
if (!(font in cache)) {
|
||||
style.font = font;
|
||||
var family = style.fontFamily;
|
||||
style.font = '';
|
||||
if (!family) {
|
||||
return null;
|
||||
}
|
||||
cache[font] = family.split(/,\s?/);
|
||||
}
|
||||
return cache[font];
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -12,6 +12,8 @@ ol.events.EventType = {
|
||||
*/
|
||||
CHANGE: 'change',
|
||||
|
||||
CLEAR: 'clear',
|
||||
CONTEXTMENU: 'contextmenu',
|
||||
CLICK: 'click',
|
||||
DBLCLICK: 'dblclick',
|
||||
DRAGENTER: 'dragenter',
|
||||
|
||||
@@ -2,6 +2,7 @@ goog.provide('ol.format.filter');
|
||||
|
||||
goog.require('ol.format.filter.And');
|
||||
goog.require('ol.format.filter.Bbox');
|
||||
goog.require('ol.format.filter.Contains');
|
||||
goog.require('ol.format.filter.During');
|
||||
goog.require('ol.format.filter.EqualTo');
|
||||
goog.require('ol.format.filter.GreaterThan');
|
||||
@@ -71,6 +72,21 @@ ol.format.filter.bbox = function(geometryName, extent, opt_srsName) {
|
||||
return new ol.format.filter.Bbox(geometryName, extent, opt_srsName);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a `<Contains>` operator to test whether a geometry-valued property
|
||||
* contains a given geometry.
|
||||
*
|
||||
* @param {!string} geometryName Geometry name to use.
|
||||
* @param {!ol.geom.Geometry} geometry Geometry.
|
||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||
* set on geometries when this is not provided.
|
||||
* @returns {!ol.format.filter.Contains} `<Contains>` operator.
|
||||
* @api
|
||||
*/
|
||||
ol.format.filter.contains = function(geometryName, geometry, opt_srsName) {
|
||||
return new ol.format.filter.Contains(geometryName, geometry, opt_srsName);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a `<Intersects>` operator to test whether a geometry-valued property
|
||||
* intersects a given geometry.
|
||||
|
||||
25
src/ol/format/filter/contains.js
Normal file
25
src/ol/format/filter/contains.js
Normal file
@@ -0,0 +1,25 @@
|
||||
goog.provide('ol.format.filter.Contains');
|
||||
|
||||
goog.require('ol');
|
||||
goog.require('ol.format.filter.Spatial');
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a `<Contains>` operator to test whether a geometry-valued property
|
||||
* contains a given geometry.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} geometryName Geometry name to use.
|
||||
* @param {!ol.geom.Geometry} geometry Geometry.
|
||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||
* set on geometries when this is not provided.
|
||||
* @extends {ol.format.filter.Spatial}
|
||||
* @api
|
||||
*/
|
||||
ol.format.filter.Contains = function(geometryName, geometry, opt_srsName) {
|
||||
|
||||
ol.format.filter.Spatial.call(this, 'Contains', geometryName, geometry, opt_srsName);
|
||||
|
||||
};
|
||||
ol.inherits(ol.format.filter.Contains, ol.format.filter.Spatial);
|
||||
@@ -53,6 +53,13 @@ ol.format.GeoJSON = function(opt_options) {
|
||||
*/
|
||||
this.geometryName_ = options.geometryName;
|
||||
|
||||
/**
|
||||
* Look for the geometry name in the feature GeoJSON
|
||||
* @type {boolean|undefined}
|
||||
* @private
|
||||
*/
|
||||
this.extractGeometryName_ = options.extractGeometryName;
|
||||
|
||||
};
|
||||
ol.inherits(ol.format.GeoJSON, ol.format.JSONFeature);
|
||||
|
||||
@@ -377,6 +384,8 @@ ol.format.GeoJSON.prototype.readFeatureFromObject = function(
|
||||
var feature = new ol.Feature();
|
||||
if (this.geometryName_) {
|
||||
feature.setGeometryName(this.geometryName_);
|
||||
} else if (this.extractGeometryName_ && geoJSONFeature.geometry_name !== undefined) {
|
||||
feature.setGeometryName(geoJSONFeature.geometry_name);
|
||||
}
|
||||
feature.setGeometry(geometry);
|
||||
if (geoJSONFeature.id !== undefined) {
|
||||
@@ -457,12 +466,6 @@ ol.format.GeoJSON.prototype.readProjectionFromObject = function(object) {
|
||||
if (crs) {
|
||||
if (crs.type == 'name') {
|
||||
projection = ol.proj.get(crs.properties.name);
|
||||
} else if (crs.type == 'EPSG') {
|
||||
// 'EPSG' is not part of the GeoJSON specification, but is generated by
|
||||
// GeoServer.
|
||||
// TODO: remove this when http://jira.codehaus.org/browse/GEOS-5996
|
||||
// is fixed and widely deployed.
|
||||
projection = ol.proj.get('EPSG:' + crs.properties.code);
|
||||
} else {
|
||||
ol.asserts.assert(false, 36); // Unknown SRS type
|
||||
}
|
||||
|
||||
@@ -403,6 +403,9 @@ ol.format.OWS.SERVICE_CONTACT_PARSERS_ =
|
||||
ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_ =
|
||||
ol.xml.makeStructureNS(
|
||||
ol.format.OWS.NAMESPACE_URIS_, {
|
||||
'Abstract': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
|
||||
'AccessConstraints': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
|
||||
'Fees': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
|
||||
'Title': ol.xml.makeObjectPropertySetter(ol.format.XSD.readString),
|
||||
'ServiceTypeVersion': ol.xml.makeObjectPropertySetter(
|
||||
ol.format.XSD.readString),
|
||||
|
||||
@@ -116,6 +116,22 @@ ol.format.WFS.SCHEMA_LOCATIONS = {
|
||||
ol.format.WFS.DEFAULT_VERSION = '1.1.0';
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array.<string>|string|undefined} featureType
|
||||
*/
|
||||
ol.format.WFS.prototype.getFeatureType = function() {
|
||||
return this.featureType_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<string>|string|undefined} featureType Feature type(s) to parse.
|
||||
*/
|
||||
ol.format.WFS.prototype.setFeatureType = function(featureType) {
|
||||
this.featureType_ = featureType;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Read all features from a WFS FeatureCollection.
|
||||
*
|
||||
@@ -628,6 +644,21 @@ ol.format.WFS.writeBboxFilter_ = function(node, filter, objectStack) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {ol.format.filter.Contains} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.writeContainsFilter_ = function(node, filter, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
context['srsName'] = filter.srsName;
|
||||
|
||||
ol.format.WFS.writeOgcPropertyName_(node, filter.geometryName);
|
||||
ol.format.GML3.prototype.writeGeometryElement(node, filter.geometry, objectStack);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {ol.format.filter.Intersects} filter Filter.
|
||||
@@ -846,6 +877,7 @@ ol.format.WFS.GETFEATURE_SERIALIZERS_ = {
|
||||
'Or': ol.xml.makeChildAppender(ol.format.WFS.writeLogicalFilter_),
|
||||
'Not': ol.xml.makeChildAppender(ol.format.WFS.writeNotFilter_),
|
||||
'BBOX': ol.xml.makeChildAppender(ol.format.WFS.writeBboxFilter_),
|
||||
'Contains': ol.xml.makeChildAppender(ol.format.WFS.writeContainsFilter_),
|
||||
'Intersects': ol.xml.makeChildAppender(ol.format.WFS.writeIntersectsFilter_),
|
||||
'Within': ol.xml.makeChildAppender(ol.format.WFS.writeWithinFilter_),
|
||||
'PropertyIsEqualTo': ol.xml.makeChildAppender(ol.format.WFS.writeComparisonFilter_),
|
||||
|
||||
@@ -63,6 +63,22 @@ ol.format.WMSGetFeatureInfo.featureIdentifier_ = '_feature';
|
||||
ol.format.WMSGetFeatureInfo.layerIdentifier_ = '_layer';
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array.<string>} layers
|
||||
*/
|
||||
ol.format.WMSGetFeatureInfo.prototype.getLayers = function() {
|
||||
return this.layers_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<string>} layers Layers to parse.
|
||||
*/
|
||||
ol.format.WMSGetFeatureInfo.prototype.setLayers = function(layers) {
|
||||
this.layers_ = layers;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
|
||||
@@ -24,7 +24,8 @@ ol.geom.flat.interiorpoint.linearRings = function(flatCoordinates, offset,
|
||||
/** @type {Array.<number>} */
|
||||
var intersections = [];
|
||||
// Calculate intersections with the horizontal line
|
||||
var end = ends[0];
|
||||
for (var r = 0, rr = ends.length; r < rr; ++r) {
|
||||
var end = ends[r];
|
||||
x1 = flatCoordinates[end - stride];
|
||||
y1 = flatCoordinates[end - stride + 1];
|
||||
for (i = offset; i < end; i += stride) {
|
||||
@@ -37,6 +38,7 @@ ol.geom.flat.interiorpoint.linearRings = function(flatCoordinates, offset,
|
||||
x1 = x2;
|
||||
y1 = y2;
|
||||
}
|
||||
}
|
||||
// Find the longest segment of the horizontal line that has its center point
|
||||
// inside the linear ring.
|
||||
var pointX = NaN;
|
||||
|
||||
@@ -13,16 +13,12 @@ goog.require('ol.math');
|
||||
* width of the character passed as 1st argument.
|
||||
* @param {number} startM m along the path where the text starts.
|
||||
* @param {number} maxAngle Max angle between adjacent chars in radians.
|
||||
* @param {Array.<Array.<number>>=} opt_result Array that will be populated with the
|
||||
* result. Each entry consists of an array of x, y and z of the char to draw.
|
||||
* If provided, this array will not be truncated to the number of characters of
|
||||
* the `text`.
|
||||
* @return {Array.<Array.<number>>} The result array of null if `maxAngle` was
|
||||
* exceeded.
|
||||
* @return {Array.<Array.<*>>} The result array of null if `maxAngle` was
|
||||
* exceeded. Entries of the array are x, y, anchorX, angle, chunk.
|
||||
*/
|
||||
ol.geom.flat.textpath.lineString = function(
|
||||
flatCoordinates, offset, end, stride, text, measure, startM, maxAngle, opt_result) {
|
||||
var result = opt_result ? opt_result : [];
|
||||
flatCoordinates, offset, end, stride, text, measure, startM, maxAngle) {
|
||||
var result = [];
|
||||
|
||||
// Keep text upright
|
||||
var reverse = flatCoordinates[offset] > flatCoordinates[end - stride];
|
||||
@@ -37,11 +33,15 @@ ol.geom.flat.textpath.lineString = function(
|
||||
var segmentM = 0;
|
||||
var segmentLength = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
|
||||
|
||||
var index, previousAngle;
|
||||
var chunk = '';
|
||||
var chunkLength = 0;
|
||||
var data, index, previousAngle;
|
||||
for (var i = 0; i < numChars; ++i) {
|
||||
index = reverse ? numChars - i - 1 : i;
|
||||
var char = text[index];
|
||||
var charLength = measure(char);
|
||||
var char = text.charAt(index);
|
||||
chunk = reverse ? char + chunk : chunk + char;
|
||||
var charLength = measure(chunk) - chunkLength;
|
||||
chunkLength += charLength;
|
||||
var charM = startM + charLength / 2;
|
||||
while (offset < end - stride && segmentM + segmentLength < charM) {
|
||||
x1 = x2;
|
||||
@@ -64,11 +64,27 @@ ol.geom.flat.textpath.lineString = function(
|
||||
return null;
|
||||
}
|
||||
}
|
||||
previousAngle = angle;
|
||||
var interpolate = segmentPos / segmentLength;
|
||||
var x = ol.math.lerp(x1, x2, interpolate);
|
||||
var y = ol.math.lerp(y1, y2, interpolate);
|
||||
result[index] = [x, y, angle];
|
||||
if (previousAngle == angle) {
|
||||
if (reverse) {
|
||||
data[0] = x;
|
||||
data[1] = y;
|
||||
data[2] = charLength / 2;
|
||||
}
|
||||
data[4] = chunk;
|
||||
} else {
|
||||
chunk = char;
|
||||
chunkLength = charLength;
|
||||
data = [x, y, charLength / 2, angle, chunk];
|
||||
if (reverse) {
|
||||
result.unshift(data);
|
||||
} else {
|
||||
result.push(data);
|
||||
}
|
||||
previousAngle = angle;
|
||||
}
|
||||
startM += charLength;
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -14,16 +14,13 @@ goog.require('ol.extent');
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {number|undefined} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {Array.<ol.Attribution>} attributions Attributions.
|
||||
* @param {string} src Image source URI.
|
||||
* @param {?string} crossOrigin Cross origin.
|
||||
* @param {ol.ImageLoadFunctionType} imageLoadFunction Image load function.
|
||||
*/
|
||||
ol.Image = function(extent, resolution, pixelRatio, attributions, src,
|
||||
crossOrigin, imageLoadFunction) {
|
||||
ol.Image = function(extent, resolution, pixelRatio, src, crossOrigin, imageLoadFunction) {
|
||||
|
||||
ol.ImageBase.call(this, extent, resolution, pixelRatio, ol.ImageState.IDLE,
|
||||
attributions);
|
||||
ol.ImageBase.call(this, extent, resolution, pixelRatio, ol.ImageState.IDLE);
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -13,18 +13,11 @@ goog.require('ol.events.EventType');
|
||||
* @param {number|undefined} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.ImageState} state State.
|
||||
* @param {Array.<ol.Attribution>} attributions Attributions.
|
||||
*/
|
||||
ol.ImageBase = function(extent, resolution, pixelRatio, state, attributions) {
|
||||
ol.ImageBase = function(extent, resolution, pixelRatio, state) {
|
||||
|
||||
ol.events.EventTarget.call(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<ol.Attribution>}
|
||||
*/
|
||||
this.attributions_ = attributions;
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {ol.Extent}
|
||||
@@ -61,14 +54,6 @@ ol.ImageBase.prototype.changed = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array.<ol.Attribution>} Attributions.
|
||||
*/
|
||||
ol.ImageBase.prototype.getAttributions = function() {
|
||||
return this.attributions_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.Extent} Extent.
|
||||
*/
|
||||
|
||||
@@ -11,13 +11,11 @@ goog.require('ol.ImageState');
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {Array.<ol.Attribution>} attributions Attributions.
|
||||
* @param {HTMLCanvasElement} canvas Canvas.
|
||||
* @param {ol.ImageCanvasLoader=} opt_loader Optional loader function to
|
||||
* support asynchronous canvas drawing.
|
||||
*/
|
||||
ol.ImageCanvas = function(extent, resolution, pixelRatio, attributions,
|
||||
canvas, opt_loader) {
|
||||
ol.ImageCanvas = function(extent, resolution, pixelRatio, canvas, opt_loader) {
|
||||
|
||||
/**
|
||||
* Optional canvas loader function.
|
||||
@@ -29,7 +27,7 @@ ol.ImageCanvas = function(extent, resolution, pixelRatio, attributions,
|
||||
var state = opt_loader !== undefined ?
|
||||
ol.ImageState.IDLE : ol.ImageState.LOADED;
|
||||
|
||||
ol.ImageBase.call(this, extent, resolution, pixelRatio, state, attributions);
|
||||
ol.ImageBase.call(this, extent, resolution, pixelRatio, state);
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user