Compare commits
1 Commits
v5.0.1
...
v5.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
980ea4a977 |
9
.babelrc
Normal file
9
.babelrc
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"plugins": ["jsdoc-closure"],
|
||||
"parserOpts": {
|
||||
"parser": "recast"
|
||||
},
|
||||
"generatorOpts": {
|
||||
"generator": "recast"
|
||||
}
|
||||
}
|
||||
11
.github/ISSUE_TEMPLATE.md
vendored
11
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,9 +1,8 @@
|
||||
<!--
|
||||
Thank you for your interest in making OpenLayers better!
|
||||
|
||||
If you are reporting a bug, please link to an example that reproduces the problem. This will make it easier for people who may want to help you debug.
|
||||
To keep this project manageable for maintainers, we ask you to please check all boxes below before submitting an issue.
|
||||
|
||||
If you have a usage question, you might want to try Stack Overflow first: https://stackoverflow.com/questions/tagged/openlayers
|
||||
|
||||
Thanks
|
||||
-->
|
||||
- [ ] I am submitting a bug or feature request, not a usage question. Go to https://stackoverflow.com/questions/tagged/openlayers for questions.
|
||||
- [ ] I have searched GitHub to see if a similar bug or feature request has already been reported.
|
||||
- [ ] I have verified that the issue is present in the latest version of OpenLayers (see 'LATEST' on https://openlayers.org/).
|
||||
- [ ] If reporting a bug, I have created a [CodePen](https://codepen.io) or prepared a stack trace (using the latest version and unminified code, so e.g. `ol-debug.js`, not `ol.js`) that shows the issue.
|
||||
|
||||
15
.github/PULL_REQUEST_TEMPLATE.md
vendored
15
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,13 +1,8 @@
|
||||
<!--
|
||||
Thank you for your interest in making OpenLayers better!
|
||||
|
||||
Before submitting a pull request, it is best to open an issue describing the bug you are fixing or the feature you are proposing to add.
|
||||
In order to get your proposed changes merged into the master branch, we ask you to please make sure the following boxes are checked *before* submitting your pull request.
|
||||
|
||||
Here are some other tips that make pull requests easier to review:
|
||||
|
||||
* Commits in the branch are small and logically separated (with no unnecessary merge commits).
|
||||
* Commit messages are clear.
|
||||
* Existing tests pass, new functionality is covered by new tests, and fixes have regression tests.
|
||||
|
||||
Thanks
|
||||
-->
|
||||
- [ ] This pull request addresses an issue that has been marked with the 'Pull request accepted' label & I have added the link to that issue.
|
||||
- [ ] It contains one or more small, incremental, logically separate commits, with no merge commits.
|
||||
- [ ] I have used clear commit messages.
|
||||
- [ ] Existing tests pass for me locally & I have added or updated tests for new or changed functionality.
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,5 @@
|
||||
/build/
|
||||
/coverage/
|
||||
/dist/
|
||||
node_modules/
|
||||
/node_modules/
|
||||
src/index.js
|
||||
|
||||
@@ -19,6 +19,8 @@ Use one of the following methods to use OpenLayers in your project:
|
||||
|
||||
* If you just want to add a `<script>` tag to test things out, you can link directly to one of the full builds from [cdnjs](https://cdnjs.com/libraries/openlayers) (not recommended for production)
|
||||
|
||||
* For use with Closure Library (rare), install the [`openlayers` package](https://npmjs.com/package/openlayers) and read the [tutorial](http://openlayers.org/en/latest/doc/tutorials/closure.html).
|
||||
|
||||
## Supported Browsers
|
||||
|
||||
OpenLayers runs on all modern browsers that support [HTML5](https://html.spec.whatwg.org/multipage/) and [ECMAScript 5](http://www.ecma-international.org/ecma-262/5.1/). This includes Chrome, Firefox, Safari and Edge. For older browsers and platforms like Internet Explorer (down to version 9) and Android 4.x, [polyfills](http://polyfill.io) for `requestAnimationFrame` and `Element.prototype.classList` are required, and using the KML format requires a polyfill for `URL`.
|
||||
|
||||
@@ -1,22 +1,6 @@
|
||||
## Upgrade notes
|
||||
|
||||
### v5.0.0
|
||||
|
||||
#### Renamed `ol/source/TileUTFGrid` to `ol/source/UTFGrid`
|
||||
|
||||
The module name is now `ol/source/UTFGrid` (`ol.source.UTFGrid` in the full build).
|
||||
|
||||
#### Renaming of the `defaultDataProjection` in the options and property of the `ol/format/Feature` class and its subclasses
|
||||
|
||||
The `defaultDataProjection` option is now named `dataProjection`. The protected property available on the class is also renamed.
|
||||
|
||||
#### `transition` option of `ol/source/VectorTile` is ignored
|
||||
|
||||
The `transition` option to get an opacity transition to fade in tiles has been disabled for `ol/source/VectorTile`. Vector tiles are now always rendered without an opacity transition.
|
||||
|
||||
#### `ol/style/Fill` with `CanvasGradient` or `CanvasPattern`
|
||||
|
||||
The origin for gradients and patterns has changed from the top-left corner of the extent of the geometry being filled to 512 css pixel increments from map coordinate `[0, 0]`. This allows repeat patterns to be aligned properly with vector tiles. For seamless repeat patterns, width and height of the pattern image must be a factor of two (2, 4, 8, ..., 512).
|
||||
### Next release
|
||||
|
||||
#### Removal of the renderer option for maps
|
||||
|
||||
@@ -159,37 +143,14 @@ var poly = circularPolygon(center, radius);
|
||||
|
||||
#### Removal of optional this arguments.
|
||||
|
||||
The optional this (i.e. opt_this) arguments were removed from the following methods. 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).
|
||||
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
|
||||
* Map#forEachLayerAtPixel
|
||||
* source/TileUTFGrid#forDataAtCoordinateAndResolution
|
||||
* source/Vector#forEachFeature, #forEachFeatureInExtent, #forEachFeatureIntersectingExtent
|
||||
|
||||
|
||||
#### `Map#forEachLayerAtPixel` parameters have changed
|
||||
|
||||
If you are using the layer filter, please note that you now have to pass in the layer filter via an `AtPixelOptions` object. If you are not using the layer filter the usage has not changed.
|
||||
|
||||
Old syntax:
|
||||
```
|
||||
map.forEachLayerAtPixel(pixel, callback, callbackThis, layerFilterFn, layerFilterThis);
|
||||
```
|
||||
|
||||
New syntax:
|
||||
|
||||
```
|
||||
map.forEachLayerAtPixel(pixel, callback, {
|
||||
layerFilter: layerFilterFn
|
||||
});
|
||||
```
|
||||
|
||||
To bind a function to a this, please use the bind method of the function (See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
|
||||
|
||||
This change is due to the introduction of the `hitTolerance` parameter which can be passed in via this `AtPixelOptions` object, too.
|
||||
|
||||
### v4.6.0
|
||||
|
||||
#### Renamed `exceedLength` option of `ol.style.Text` to `overflow`
|
||||
|
||||
@@ -1,667 +0,0 @@
|
||||
# v5.0.0
|
||||
|
||||
The main theme of the v5.0.0 release is an improved developer/user experience with OpenLayers. Toward this end, we have reworked the library as a set of ES Modules, completely removing any dependency on the Closure Compiler, and improving compatibility with mainstream module bundlers.
|
||||
|
||||
See the [hosted examples](https://openlayers.org/en/latest/examples/), [API docs](https://openlayers.org/en/latest/apidoc/), and [bundle tutorial](https://openlayers.org/en/latest/doc/tutorials/bundle.html) for the new syntax, but basic usage looks like this:
|
||||
|
||||
```js
|
||||
import 'ol/ol.css';
|
||||
import {Map, View} from 'ol';
|
||||
import TileLayer from 'ol/layer/Tile';
|
||||
import OSM from 'ol/source/OSM';
|
||||
|
||||
const map = new Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new TileLayer({
|
||||
source: new OSM()
|
||||
})
|
||||
],
|
||||
view: new View({
|
||||
center: [0, 0],
|
||||
zoom: 0
|
||||
})
|
||||
});
|
||||
```
|
||||
|
||||
See below for specific notes on upgrading from 4.x releases. We'll be working on updating the website with improved documentation and examples. Take a look at the issue tracker if you're interested in contributing.
|
||||
|
||||
### Upgrade Notes
|
||||
|
||||
#### Renamed `ol/source/TileUTFGrid` to `ol/source/UTFGrid`
|
||||
|
||||
The module name is now `ol/source/UTFGrid` (`ol.source.UTFGrid` in the full build).
|
||||
|
||||
#### Renaming of the `defaultDataProjection` in the options and property of the `ol/format/Feature` class and its subclasses
|
||||
|
||||
The `defaultDataProjection` option is now named `dataProjection`. The protected property available on the class is also renamed.
|
||||
|
||||
#### `transition` option of `ol/source/VectorTile` is ignored
|
||||
|
||||
The `transition` option to get an opacity transition to fade in tiles has been disabled for `ol/source/VectorTile`. Vector tiles are now always rendered without an opacity transition.
|
||||
|
||||
#### `ol/style/Fill` with `CanvasGradient` or `CanvasPattern`
|
||||
|
||||
The origin for gradients and patterns has changed from the top-left corner of the extent of the geometry being filled to 512 css pixel increments from map coordinate `[0, 0]`. This allows repeat patterns to be aligned properly with vector tiles. For seamless repeat patterns, width and height of the pattern image must be a factor of two (2, 4, 8, ..., 512).
|
||||
|
||||
#### Removal of the renderer option for maps
|
||||
|
||||
The `renderer` option has been removed from the `Map` constructor. The purpose of this change is to avoid bundling code in your application that you do not need. Previously, code for both the Canvas and WebGL renderers was included in all applications - even though most people only use one renderer. The `Map` constructor now gives you a Canvas (2D) based renderer. If you want to try the WebGL renderer, you can import the constructor from `ol/WebGLMap`.
|
||||
|
||||
Old code:
|
||||
```js
|
||||
import Map from 'ol/Map';
|
||||
|
||||
const canvasMap = new Map({
|
||||
renderer: ['canvas']
|
||||
// other options...
|
||||
});
|
||||
|
||||
const webglMap = new Map({
|
||||
renderer: ['webgl']
|
||||
// other options...
|
||||
});
|
||||
```
|
||||
|
||||
New code:
|
||||
```js
|
||||
import Map from 'ol/Map';
|
||||
import WebGLMap from 'ol/WebGLMap';
|
||||
|
||||
const canvasMap = new Map({
|
||||
// options...
|
||||
});
|
||||
|
||||
const webglMap = new WebGLMap({
|
||||
// options...
|
||||
});
|
||||
```
|
||||
|
||||
#### Removal of ol.FeatureStyleFunction
|
||||
|
||||
The signature of the vector style function passed to the feature has changed. The function now always takes the `feature` and the `resolution` as arguments, the `feature` is no longer bound to `this`.
|
||||
|
||||
Old code:
|
||||
```js
|
||||
feature.setStyle(function(resolution) {
|
||||
var text = this.get('name');
|
||||
...
|
||||
});
|
||||
```
|
||||
|
||||
New code:
|
||||
```js
|
||||
feature.setStyle(function(feature, resolution) {
|
||||
var text = feature.get('name');
|
||||
...
|
||||
});
|
||||
```
|
||||
|
||||
#### 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 optional this (i.e. opt_this) arguments were removed from the following methods. 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
|
||||
* Map#forEachLayerAtPixel
|
||||
* source/TileUTFGrid#forDataAtCoordinateAndResolution
|
||||
* source/Vector#forEachFeature, #forEachFeatureInExtent, #forEachFeatureIntersectingExtent
|
||||
|
||||
|
||||
#### `Map#forEachLayerAtPixel` parameters have changed
|
||||
|
||||
If you are using the layer filter, please note that you now have to pass in the layer filter via an `AtPixelOptions` object. If you are not using the layer filter the usage has not changed.
|
||||
|
||||
Old syntax:
|
||||
```
|
||||
map.forEachLayerAtPixel(pixel, callback, callbackThis, layerFilterFn, layerFilterThis);
|
||||
```
|
||||
|
||||
New syntax:
|
||||
|
||||
```
|
||||
map.forEachLayerAtPixel(pixel, callback, {
|
||||
layerFilter: layerFilterFn
|
||||
});
|
||||
```
|
||||
|
||||
To bind a function to a this, please use the bind method of the function (See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
|
||||
|
||||
This change is due to the introduction of the `hitTolerance` parameter which can be passed in via this `AtPixelOptions` object, too.
|
||||
|
||||
### New Features and Fixes
|
||||
|
||||
* [#8314](https://github.com/openlayers/openlayers/pull/8314) - Accept hitTolerance in map.forEachLayerAtPixel() ([@simonseyock](https://github.com/simonseyock))
|
||||
* [#7750](https://github.com/openlayers/openlayers/pull/7750) - Don't assume fill for canvas polygon hit detection. ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8305](https://github.com/openlayers/openlayers/pull/8305) - Update quickstart and tutorials for v5 ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8301](https://github.com/openlayers/openlayers/pull/8301) - Do not render vectors in image mode ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8302](https://github.com/openlayers/openlayers/pull/8302) - Ignore node_modules everywhere ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8299](https://github.com/openlayers/openlayers/pull/8299) - Make classes in ol/ available as named exports from ol ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8298](https://github.com/openlayers/openlayers/pull/8298) - Add README for ol package ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8295](https://github.com/openlayers/openlayers/pull/8295) - Prepare for building/publishing v5 ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8296](https://github.com/openlayers/openlayers/pull/8296) - Fix style documentation ([@fredj](https://github.com/fredj))
|
||||
* [#8294](https://github.com/openlayers/openlayers/pull/8294) - Remove non-functional type checks from testing ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8292](https://github.com/openlayers/openlayers/pull/8292) - Remove now unneeded single quotes in examples ([@fredj](https://github.com/fredj))
|
||||
* [#8291](https://github.com/openlayers/openlayers/pull/8291) - Graticule code cleanup ([@fredj](https://github.com/fredj))
|
||||
* [#8287](https://github.com/openlayers/openlayers/pull/8287) - Rename ol/source/TileUTFGrid to ol/source/UTFGrid ([@fredj](https://github.com/fredj))
|
||||
* [#8286](https://github.com/openlayers/openlayers/pull/8286) - Fix class name property in Overlay documentation ([@fredj](https://github.com/fredj))
|
||||
* [#8281](https://github.com/openlayers/openlayers/pull/8281) - Rename default data projection ([@gberaudo](https://github.com/gberaudo))
|
||||
* [#8283](https://github.com/openlayers/openlayers/pull/8283) - Remove references to tutorials/custom-builds.html ([@fredj](https://github.com/fredj))
|
||||
* [#8280](https://github.com/openlayers/openlayers/pull/8280) - Add missing property in VectorTile options, remove params from createRenderer ([@fredj](https://github.com/fredj))
|
||||
* [#8277](https://github.com/openlayers/openlayers/pull/8277) - Fix code block in comment ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8273](https://github.com/openlayers/openlayers/pull/8273) - Remove the externs/ directory ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8246](https://github.com/openlayers/openlayers/pull/8246) - Don't go back to not moving when dragging ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8258](https://github.com/openlayers/openlayers/pull/8258) - Use Webpack 4 for tests (and examples) ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8250](https://github.com/openlayers/openlayers/pull/8250) - Fix various jsdoc types ([@fredj](https://github.com/fredj))
|
||||
* [#8245](https://github.com/openlayers/openlayers/pull/8245) - Fix vector tile docs and types ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8233](https://github.com/openlayers/openlayers/pull/8233) - Use rollup instead of webpack for the full build ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8231](https://github.com/openlayers/openlayers/pull/8231) - Fix JSTS usage with OL classes injected ([@bjornharrtell](https://github.com/bjornharrtell))
|
||||
* [#8229](https://github.com/openlayers/openlayers/pull/8229) - Support layers instead of renderers for ol/source/Raster ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8227](https://github.com/openlayers/openlayers/pull/8227) - Better vectortile experience ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8225](https://github.com/openlayers/openlayers/pull/8225) - renderMode: 'image' fixes for ol/layer/Vector ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8226](https://github.com/openlayers/openlayers/pull/8226) - Accept renderers as sources for the Raster source ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8210](https://github.com/openlayers/openlayers/pull/8210) - Align patterns and gradients to a grid ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8201](https://github.com/openlayers/openlayers/pull/8201) - Remove babelrc, transform using babel-core ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8203](https://github.com/openlayers/openlayers/pull/8203) - Type checking complete ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8204](https://github.com/openlayers/openlayers/pull/8204) - Document ol/control~defaults in the right place ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8200](https://github.com/openlayers/openlayers/pull/8200) - Set textAlign to the canvas context ([@fredj](https://github.com/fredj))
|
||||
* [#8194](https://github.com/openlayers/openlayers/pull/8194) - miscellaneous code cleanup ([@fredj](https://github.com/fredj))
|
||||
* [#8189](https://github.com/openlayers/openlayers/pull/8189) - More apidoc fixes ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8191](https://github.com/openlayers/openlayers/pull/8191) - Do not scale text outline width ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8187](https://github.com/openlayers/openlayers/pull/8187) - Hide attribution control if there are no attributions ([@tschaub](https://github.com/tschaub))
|
||||
* [#8186](https://github.com/openlayers/openlayers/pull/8186) - Updates to get the examples building ([@tschaub](https://github.com/tschaub))
|
||||
* [#8180](https://github.com/openlayers/openlayers/pull/8180) - Fix some JSDoc issues ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8175](https://github.com/openlayers/openlayers/pull/8175) - More typing fixes ([@fredj](https://github.com/fredj))
|
||||
* [#8177](https://github.com/openlayers/openlayers/pull/8177) - Remove documentation related to the closure compiler ([@gberaudo](https://github.com/gberaudo))
|
||||
* [#8174](https://github.com/openlayers/openlayers/pull/8174) - Fix typo in ol/style/Image~Options typedef ([@fredj](https://github.com/fredj))
|
||||
* [#8172](https://github.com/openlayers/openlayers/pull/8172) - Ignore 'this' type in function typedef ([@fredj](https://github.com/fredj))
|
||||
* [#8173](https://github.com/openlayers/openlayers/pull/8173) - Fix typing in ol/xml module ([@fredj](https://github.com/fredj))
|
||||
* [#8169](https://github.com/openlayers/openlayers/pull/8169) - Shorter module paths for default exports ([@fredj](https://github.com/fredj))
|
||||
* [#8171](https://github.com/openlayers/openlayers/pull/8171) - Remove wrong override tags ([@fredj](https://github.com/fredj))
|
||||
* [#8170](https://github.com/openlayers/openlayers/pull/8170) - Basic apidocs ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8167](https://github.com/openlayers/openlayers/pull/8167) - Remove externs/oli.js ([@tschaub](https://github.com/tschaub))
|
||||
* [#8166](https://github.com/openlayers/openlayers/pull/8166) - Updated type annotations ([@tschaub](https://github.com/tschaub))
|
||||
* [#8165](https://github.com/openlayers/openlayers/pull/8165) - Update linter config ([@tschaub](https://github.com/tschaub))
|
||||
* [#8163](https://github.com/openlayers/openlayers/pull/8163) - Fix type syntax ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8161](https://github.com/openlayers/openlayers/pull/8161) - Fix skipping of texts with background ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8156](https://github.com/openlayers/openlayers/pull/8156) - fix assert 36 on error documentation #8147 ([@mainakae](https://github.com/mainakae))
|
||||
* [#8143](https://github.com/openlayers/openlayers/pull/8143) - Shorter module paths for default exports ([@openlayers](https://github.com/openlayers))
|
||||
* [#8137](https://github.com/openlayers/openlayers/pull/8137) - Avoid `this` at top level of modules ([@tschaub](https://github.com/tschaub))
|
||||
* [#8138](https://github.com/openlayers/openlayers/pull/8138) - Update tasks to use native async/await ([@tschaub](https://github.com/tschaub))
|
||||
* [#8139](https://github.com/openlayers/openlayers/pull/8139) - Add @module annotation for ol/control/util ([@tschaub](https://github.com/tschaub))
|
||||
* [#8135](https://github.com/openlayers/openlayers/pull/8135) - Break the circular dependency: overview map, map, controls, overview map ([@tschaub](https://github.com/tschaub))
|
||||
* [#8132](https://github.com/openlayers/openlayers/pull/8132) - Add minZoom to the createResolutionConstraint function return type ([@fredj](https://github.com/fredj))
|
||||
* [#8129](https://github.com/openlayers/openlayers/pull/8129) - Fix some types ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8127](https://github.com/openlayers/openlayers/pull/8127) - Move RasterOperationType into ol/source/Raster ([@fredj](https://github.com/fredj))
|
||||
* [#8123](https://github.com/openlayers/openlayers/pull/8123) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
|
||||
* [#8125](https://github.com/openlayers/openlayers/pull/8125) - Shorter module paths for default exports ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8122](https://github.com/openlayers/openlayers/pull/8122) - Remove unused 'format' options from Cluster source constructor ([@fredj](https://github.com/fredj))
|
||||
* [#8121](https://github.com/openlayers/openlayers/pull/8121) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
|
||||
* [#8117](https://github.com/openlayers/openlayers/pull/8117) - Re-export style constructors from ol/style ([@tschaub](https://github.com/tschaub))
|
||||
* [#8115](https://github.com/openlayers/openlayers/pull/8115) - Re-export layer constructors from ol/layer ([@tschaub](https://github.com/tschaub))
|
||||
* [#8114](https://github.com/openlayers/openlayers/pull/8114) - Re-export interaction constructors from ol/interaction ([@tschaub](https://github.com/tschaub))
|
||||
* [#8116](https://github.com/openlayers/openlayers/pull/8116) - Re-export source constructors from ol/source ([@tschaub](https://github.com/tschaub))
|
||||
* [#8113](https://github.com/openlayers/openlayers/pull/8113) - Re-export geometry constructors from ol/geom ([@tschaub](https://github.com/tschaub))
|
||||
* [#8112](https://github.com/openlayers/openlayers/pull/8112) - Re-export format constructors from ol/format ([@tschaub](https://github.com/tschaub))
|
||||
* [#8111](https://github.com/openlayers/openlayers/pull/8111) - Re-export control constructors ([@tschaub](https://github.com/tschaub))
|
||||
* [#8118](https://github.com/openlayers/openlayers/pull/8118) - Use list for cloak entries ([@tschaub](https://github.com/tschaub))
|
||||
* [#8109](https://github.com/openlayers/openlayers/pull/8109) - Make any falsey undefinedHTML retain the mouse position ([@tschaub](https://github.com/tschaub))
|
||||
* [#8103](https://github.com/openlayers/openlayers/pull/8103) - Fix some jsdoc path types ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7784](https://github.com/openlayers/openlayers/pull/7784) - Adds option to retain MousePosition when pointer leaves viewport ([@pedros007](https://github.com/pedros007))
|
||||
* [#8101](https://github.com/openlayers/openlayers/pull/8101) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
|
||||
* [#7908](https://github.com/openlayers/openlayers/pull/7908) - ScaleLine fix for non-degree based units ([@hyperknot](https://github.com/hyperknot))
|
||||
* [#8099](https://github.com/openlayers/openlayers/pull/8099) - More Jsdoc module fixes ([@openlayers](https://github.com/openlayers))
|
||||
* [#8098](https://github.com/openlayers/openlayers/pull/8098) - Remove externs/olx.js and src/ol/typedefs.js ([@tschaub](https://github.com/tschaub))
|
||||
* [#8096](https://github.com/openlayers/openlayers/pull/8096) - Fix rotation default ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8081](https://github.com/openlayers/openlayers/pull/8081) - Move olx.render.* and related typedefs to ol/render/* ([@pfirpfel](https://github.com/pfirpfel))
|
||||
* [#8087](https://github.com/openlayers/openlayers/pull/8087) - Move various typedefs out of typdefs.js ([@pfirpfel](https://github.com/pfirpfel))
|
||||
* [#8052](https://github.com/openlayers/openlayers/pull/8052) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
|
||||
* [#8048](https://github.com/openlayers/openlayers/pull/8048) - Remove all comments from shaders ([@fredj](https://github.com/fredj))
|
||||
* [#8089](https://github.com/openlayers/openlayers/pull/8089) - Allow unprefixed WMTS tileMatrix identifiers ([@fredj](https://github.com/fredj))
|
||||
* [#8088](https://github.com/openlayers/openlayers/pull/8088) - Correct type for TextPlacement (jsdoc) ([@camptocamp](https://github.com/camptocamp))
|
||||
* [#8083](https://github.com/openlayers/openlayers/pull/8083) - Move structs typedefs to ol/structs/* ([@pfirpfel](https://github.com/pfirpfel))
|
||||
* [#8077](https://github.com/openlayers/openlayers/pull/8077) - Add hasFeature method to ol.source.Vector ([@icholy](https://github.com/icholy))
|
||||
* [#8080](https://github.com/openlayers/openlayers/pull/8080) - #8079 Mark functions setRotateWithView and setSnapToPixel of ol/style/Image with @api ([@iagafonov](https://github.com/iagafonov))
|
||||
* [#8084](https://github.com/openlayers/openlayers/pull/8084) - Move ol.Reproj* typedefs to ol/reproj ([@pfirpfel](https://github.com/pfirpfel))
|
||||
* [#8082](https://github.com/openlayers/openlayers/pull/8082) - Remove unused typedefs ([@pfirpfel](https://github.com/pfirpfel))
|
||||
* [#8076](https://github.com/openlayers/openlayers/pull/8076) - Move olx.style.* and ol.Style* to ol/style/* ([@pfirpfel](https://github.com/pfirpfel))
|
||||
* [#8075](https://github.com/openlayers/openlayers/pull/8075) - Move olx.tilegrid.* to ol/tilegrid/* ([@pfirpfel](https://github.com/pfirpfel))
|
||||
* [#8073](https://github.com/openlayers/openlayers/pull/8073) - Remove dependency on deprecated sinon@5 ([@tschaub](https://github.com/tschaub))
|
||||
* [#7994](https://github.com/openlayers/openlayers/pull/7994) - Explicit renderer dependencies ([@tschaub](https://github.com/tschaub))
|
||||
* [#7863](https://github.com/openlayers/openlayers/pull/7863) - Add note about null geom in VectorSource.forEachFeature ([@fredj](https://github.com/fredj))
|
||||
* [#8055](https://github.com/openlayers/openlayers/pull/8055) - Mark optional property with square brackets ([@fredj](https://github.com/fredj))
|
||||
* [#8054](https://github.com/openlayers/openlayers/pull/8054) - Generate correct includes list for `build-index` script on windows hosts. ([@lilliputten](https://github.com/lilliputten))
|
||||
* [#8053](https://github.com/openlayers/openlayers/pull/8053) - Don't import from 'functions' multiple times ([@fredj](https://github.com/fredj))
|
||||
* [#8041](https://github.com/openlayers/openlayers/pull/8041) - Remove olx typedefs ol/source ([@fgravin](https://github.com/fgravin))
|
||||
* [#8026](https://github.com/openlayers/openlayers/pull/8026) - [doc] dispatchChangeEvent -> changed ([@nyurik](https://github.com/nyurik))
|
||||
* [#8003](https://github.com/openlayers/openlayers/pull/8003) - Add an example showing Chaikins smoothing algorithm ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#8044](https://github.com/openlayers/openlayers/pull/8044) - Rename constructor options typedef to 'Options' ([@fredj](https://github.com/fredj))
|
||||
* [#8042](https://github.com/openlayers/openlayers/pull/8042) - Only process loaded tiles ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8036](https://github.com/openlayers/openlayers/pull/8036) - Move the temporary arrays to the module level ([@fredj](https://github.com/fredj))
|
||||
* [#8032](https://github.com/openlayers/openlayers/pull/8032) - Start removing externs for `ol/source` ([@romanzoller](https://github.com/romanzoller))
|
||||
* [#8038](https://github.com/openlayers/openlayers/pull/8038) - Fix ZoomToExtent default tipLabel value ([@fredj](https://github.com/fredj))
|
||||
* [#8034](https://github.com/openlayers/openlayers/pull/8034) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
|
||||
* [#8029](https://github.com/openlayers/openlayers/pull/8029) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
|
||||
* [#8030](https://github.com/openlayers/openlayers/pull/8030) - Set `user-select: text` for .ol-selectable ([@walkermatt](https://github.com/walkermatt))
|
||||
* [#8025](https://github.com/openlayers/openlayers/pull/8025) - Move olx.layer.* to ol/layer/* ([@romanzoller](https://github.com/romanzoller))
|
||||
* [#8023](https://github.com/openlayers/openlayers/pull/8023) - Module type changes for ol.webgl ([@fredj](https://github.com/fredj))
|
||||
* [#8021](https://github.com/openlayers/openlayers/pull/8021) - Move olx.ViewState to ol/View ([@fredj](https://github.com/fredj))
|
||||
* [#8012](https://github.com/openlayers/openlayers/pull/8012) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
|
||||
* [#8015](https://github.com/openlayers/openlayers/pull/8015) - Remove some typedefs from src/ol/typedefs.js ([@fredj](https://github.com/fredj))
|
||||
* [#8016](https://github.com/openlayers/openlayers/pull/8016) - Move olx.layer.BaseOptions to ol/layer/Base ([@romanzoller](https://github.com/romanzoller))
|
||||
* [#8005](https://github.com/openlayers/openlayers/pull/8005) - Add vector tile selection example ([@chrismayer](https://github.com/chrismayer))
|
||||
* [#7999](https://github.com/openlayers/openlayers/pull/7999) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
|
||||
* [#7998](https://github.com/openlayers/openlayers/pull/7998) - More Jsdoc module fixes ([@fredj](https://github.com/fredj))
|
||||
* [#7992](https://github.com/openlayers/openlayers/pull/7992) - Fix freeze on export PDF example ([@trenneman](https://github.com/trenneman))
|
||||
* [#7997](https://github.com/openlayers/openlayers/pull/7997) - Jsdoc module ([@fredj](https://github.com/fredj))
|
||||
* [#7986](https://github.com/openlayers/openlayers/pull/7986) - Use module syntax for type annotations ([@fredj](https://github.com/fredj))
|
||||
* [#7996](https://github.com/openlayers/openlayers/pull/7996) - 4.6.5 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7993](https://github.com/openlayers/openlayers/pull/7993) - Module types ([@tschaub](https://github.com/tschaub))
|
||||
* [#7989](https://github.com/openlayers/openlayers/pull/7989) - Redistribute olx types for ol/interaction ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7991](https://github.com/openlayers/openlayers/pull/7991) - Fix some type paths ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7985](https://github.com/openlayers/openlayers/pull/7985) - Use path type instead of ol.tilegrid ([@fredj](https://github.com/fredj))
|
||||
* [#7983](https://github.com/openlayers/openlayers/pull/7983) - Use path type instead of ol.Extent ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7980](https://github.com/openlayers/openlayers/pull/7980) - Use module syntax for type annotations ([@fredj](https://github.com/fredj))
|
||||
* [#7979](https://github.com/openlayers/openlayers/pull/7979) - Mark optional property with square brackets ([@fredj](https://github.com/fredj))
|
||||
* [#7975](https://github.com/openlayers/openlayers/pull/7975) - Mark optional property with square brackets ([@fredj](https://github.com/fredj))
|
||||
* [#7960](https://github.com/openlayers/openlayers/pull/7960) - Fix memory leak in CanvasImageRenderer ([@PetroDE](https://github.com/PetroDE))
|
||||
* [#7974](https://github.com/openlayers/openlayers/pull/7974) - Fix spelling ([@fredj](https://github.com/fredj))
|
||||
* [#7973](https://github.com/openlayers/openlayers/pull/7973) - Remove setAttributeNS function from ol/xml ([@fredj](https://github.com/fredj))
|
||||
* [#7971](https://github.com/openlayers/openlayers/pull/7971) - Use module syntax for type annotations ([@tschaub](https://github.com/tschaub))
|
||||
* [#7968](https://github.com/openlayers/openlayers/pull/7968) - More types in the right places ([@tschaub](https://github.com/tschaub))
|
||||
* [#7966](https://github.com/openlayers/openlayers/pull/7966) - Remove namespaces from olx.js ([@tschaub](https://github.com/tschaub))
|
||||
* [#7965](https://github.com/openlayers/openlayers/pull/7965) - Redistribute types from externs/olx.js ([@tschaub](https://github.com/tschaub))
|
||||
* [#7608](https://github.com/openlayers/openlayers/pull/7608) - Facilitate the removal of externs/olx.js ([@tschaub](https://github.com/tschaub))
|
||||
* [#7964](https://github.com/openlayers/openlayers/pull/7964) - Coordinate type typo ([@tschaub](https://github.com/tschaub))
|
||||
* [#7961](https://github.com/openlayers/openlayers/pull/7961) - Correct type for style ([@tschaub](https://github.com/tschaub))
|
||||
* [#7958](https://github.com/openlayers/openlayers/pull/7958) - miscellaneous fixes to the types annotation ([@fredj](https://github.com/fredj))
|
||||
* [#7953](https://github.com/openlayers/openlayers/pull/7953) - Get rid of externs/olx.js and src/ol/typedefs.js typedefs for ol/ and ol/events/ ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7956](https://github.com/openlayers/openlayers/pull/7956) - Make sure namespaces are populated after they were created ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7952](https://github.com/openlayers/openlayers/pull/7952) - Fix typo in jsdoc type ([@fredj](https://github.com/fredj))
|
||||
* [#7948](https://github.com/openlayers/openlayers/pull/7948) - Better type definition ([@fredj](https://github.com/fredj))
|
||||
* [#7946](https://github.com/openlayers/openlayers/pull/7946) - New typedef syntax and module path types for some modules ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7944](https://github.com/openlayers/openlayers/pull/7944) - Make wrap work with points in the vector-labels example ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7933](https://github.com/openlayers/openlayers/pull/7933) - Better code indentation ([@fredj](https://github.com/fredj))
|
||||
* [#7930](https://github.com/openlayers/openlayers/pull/7930) - Use listen function instead of on ([@openlayers](https://github.com/openlayers))
|
||||
* [#7929](https://github.com/openlayers/openlayers/pull/7929) - Remove unused devDependencies ([@openlayers](https://github.com/openlayers))
|
||||
* [#7927](https://github.com/openlayers/openlayers/pull/7927) - Remove unused deps, unused tasks, and outdated info ([@tschaub](https://github.com/tschaub))
|
||||
* [#7923](https://github.com/openlayers/openlayers/pull/7923) - Fix exports and use of constants ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7914](https://github.com/openlayers/openlayers/pull/7914) - Some easy window cleanups ([@gberaudo](https://github.com/gberaudo))
|
||||
* [#7915](https://github.com/openlayers/openlayers/pull/7915) - Untie feature loader and XML code ([@gberaudo](https://github.com/gberaudo))
|
||||
* [#7918](https://github.com/openlayers/openlayers/pull/7918) - Move the nullFunction to ol/functions ([@fredj](https://github.com/fredj))
|
||||
* [#7910](https://github.com/openlayers/openlayers/pull/7910) - Better code indentation ([@fredj](https://github.com/fredj))
|
||||
* [#7904](https://github.com/openlayers/openlayers/pull/7904) - Add focus condition, e.g. for wheel zoom ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7902](https://github.com/openlayers/openlayers/pull/7902) - Add a unicode symbol for symbol font detection ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7899](https://github.com/openlayers/openlayers/pull/7899) - Use nomnom@1.8.1 ([@tschaub](https://github.com/tschaub))
|
||||
* [#7897](https://github.com/openlayers/openlayers/pull/7897) - Better variables scoping ([@fredj](https://github.com/fredj))
|
||||
* [#7894](https://github.com/openlayers/openlayers/pull/7894) - More named exports, fewer static members ([@tschaub](https://github.com/tschaub))
|
||||
* [#7881](https://github.com/openlayers/openlayers/pull/7881) - Better variables scoping ([@fredj](https://github.com/fredj))
|
||||
* [#7888](https://github.com/openlayers/openlayers/pull/7888) - Rework away static members from pointer related classes ([@bjornharrtell](https://github.com/bjornharrtell))
|
||||
* [#7880](https://github.com/openlayers/openlayers/pull/7880) - Named exports from ol/style/Style ([@tschaub](https://github.com/tschaub))
|
||||
* [#7872](https://github.com/openlayers/openlayers/pull/7872) - More named export ([@fredj](https://github.com/fredj))
|
||||
* [#7874](https://github.com/openlayers/openlayers/pull/7874) - Cleaning up exports ([@tschaub](https://github.com/tschaub))
|
||||
* [#7871](https://github.com/openlayers/openlayers/pull/7871) - Memory optimization ([@fredj](https://github.com/fredj))
|
||||
* [#7870](https://github.com/openlayers/openlayers/pull/7870) - Use exported function from ol/webgl ([@fredj](https://github.com/fredj))
|
||||
* [#7868](https://github.com/openlayers/openlayers/pull/7868) - Named export ([@fredj](https://github.com/fredj))
|
||||
* [#7861](https://github.com/openlayers/openlayers/pull/7861) - Named exports from ol/structs/PriorityQueue ([@fredj](https://github.com/fredj))
|
||||
* [#7860](https://github.com/openlayers/openlayers/pull/7860) - Don't export private constant from ol/webgl ([@openlayers](https://github.com/openlayers))
|
||||
* [#7855](https://github.com/openlayers/openlayers/pull/7855) - More named exports ([@tschaub](https://github.com/tschaub))
|
||||
* [#7851](https://github.com/openlayers/openlayers/pull/7851) - Replacing static functions with named exports ([@tschaub](https://github.com/tschaub))
|
||||
* [#7852](https://github.com/openlayers/openlayers/pull/7852) - Rename extent ([@nicholas-l](https://github.com/nicholas-l))
|
||||
* [#7840](https://github.com/openlayers/openlayers/pull/7840) - More export renaming ([@raiyni](https://github.com/raiyni))
|
||||
* [#7843](https://github.com/openlayers/openlayers/pull/7843) - Better code indentation ([@fredj](https://github.com/fredj))
|
||||
* [#7842](https://github.com/openlayers/openlayers/pull/7842) - Allow setting the label cache size ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7791](https://github.com/openlayers/openlayers/pull/7791) - Named exports from ol/tilecoord ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7835](https://github.com/openlayers/openlayers/pull/7835) - Add and use a constant for the collapsed CSS class ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7834](https://github.com/openlayers/openlayers/pull/7834) - Named exports from ol/transform ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7831](https://github.com/openlayers/openlayers/pull/7831) - Add new maxTilesLoading option to ol/PluggableMap ([@fredj](https://github.com/fredj))
|
||||
* [#7833](https://github.com/openlayers/openlayers/pull/7833) - Fix createEmptyTexture function call in ol/webgl/Context ([@fredj](https://github.com/fredj))
|
||||
* [#7832](https://github.com/openlayers/openlayers/pull/7832) - Webgl Layer and Context named exports ([@fgravin](https://github.com/fgravin))
|
||||
* [#7826](https://github.com/openlayers/openlayers/pull/7826) - Better code indentation and modules renaming ([@fredj](https://github.com/fredj))
|
||||
* [#7828](https://github.com/openlayers/openlayers/pull/7828) - Refactor constraints static methods to module functions ([@bjornharrtell](https://github.com/bjornharrtell))
|
||||
* [#7827](https://github.com/openlayers/openlayers/pull/7827) - Named exports from ol/render/canvas ([@tschaub](https://github.com/tschaub))
|
||||
* [#7823](https://github.com/openlayers/openlayers/pull/7823) - Replace static members with named exports ([@fredj](https://github.com/fredj))
|
||||
* [#7820](https://github.com/openlayers/openlayers/pull/7820) - ol/geom/flat/* exports ([@raiyni](https://github.com/raiyni))
|
||||
* [#7824](https://github.com/openlayers/openlayers/pull/7824) - Fix code indentation ([@fredj](https://github.com/fredj))
|
||||
* [#7821](https://github.com/openlayers/openlayers/pull/7821) - Add new canvas instruction array in ol/render/canvas/Instruction ([@fredj](https://github.com/fredj))
|
||||
* [#7817](https://github.com/openlayers/openlayers/pull/7817) - Remove more private static members ([@tschaub](https://github.com/tschaub))
|
||||
* [#7814](https://github.com/openlayers/openlayers/pull/7814) - Remove more private static members ([@tschaub](https://github.com/tschaub))
|
||||
* [#7816](https://github.com/openlayers/openlayers/pull/7816) - Use toString instead of asString in asColorLike ([@openlayers](https://github.com/openlayers))
|
||||
* [#7811](https://github.com/openlayers/openlayers/pull/7811) - Remove ol.FeatureStyleFunction support ([@fredj](https://github.com/fredj))
|
||||
* [#7815](https://github.com/openlayers/openlayers/pull/7815) - Remove private statics from webgl related modules ([@bjornharrtell](https://github.com/bjornharrtell))
|
||||
* [#7803](https://github.com/openlayers/openlayers/pull/7803) - Remove private static members from constructors ([@tschaub](https://github.com/tschaub))
|
||||
* [#7808](https://github.com/openlayers/openlayers/pull/7808) - Make sure the requested image size matches the desired ratio ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7807](https://github.com/openlayers/openlayers/pull/7807) - Run typecheck after tests, because of its current verbosity ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7805](https://github.com/openlayers/openlayers/pull/7805) - Remove private static members from constructors ([@fredj](https://github.com/fredj))
|
||||
* [#7806](https://github.com/openlayers/openlayers/pull/7806) - Fix rotate import ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7800](https://github.com/openlayers/openlayers/pull/7800) - More named exports ([@tschaub](https://github.com/tschaub))
|
||||
* [#7741](https://github.com/openlayers/openlayers/pull/7741) - Type checking and full build creation ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7797](https://github.com/openlayers/openlayers/pull/7797) - Better default export names for WebGL modules ([@tschaub](https://github.com/tschaub))
|
||||
* [#7794](https://github.com/openlayers/openlayers/pull/7794) - Call animation callback in a timeout ([@tschaub](https://github.com/tschaub))
|
||||
* [#7793](https://github.com/openlayers/openlayers/pull/7793) - More renaming of default exports ([@tschaub](https://github.com/tschaub))
|
||||
* [#7799](https://github.com/openlayers/openlayers/pull/7799) - Use tmpSize to reduce garbage generation ([@fredj](https://github.com/fredj))
|
||||
* [#7788](https://github.com/openlayers/openlayers/pull/7788) - Fix shaders generation ([@fredj](https://github.com/fredj))
|
||||
* [#7789](https://github.com/openlayers/openlayers/pull/7789) - Use STATIC_DRAW as default WebGL buffer usage ([@fredj](https://github.com/fredj))
|
||||
* [#7787](https://github.com/openlayers/openlayers/pull/7787) - More renaming ([@fredj](https://github.com/fredj))
|
||||
* [#7782](https://github.com/openlayers/openlayers/pull/7782) - Named exports from specific proj modules ([@tschaub](https://github.com/tschaub))
|
||||
* [#7780](https://github.com/openlayers/openlayers/pull/7780) - More named exports ([@tschaub](https://github.com/tschaub))
|
||||
* [#7783](https://github.com/openlayers/openlayers/pull/7783) - Named exports from ol/xml ([@raiyni](https://github.com/raiyni))
|
||||
* [#7774](https://github.com/openlayers/openlayers/pull/7774) - Pass destination extent to avoid garbage generation ([@fredj](https://github.com/fredj))
|
||||
* [#7771](https://github.com/openlayers/openlayers/pull/7771) - Named exports from loadingstrategy ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7772](https://github.com/openlayers/openlayers/pull/7772) - Named exports from filter module ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7770](https://github.com/openlayers/openlayers/pull/7770) - Rename _ol_render_Box_ to RenderBox ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7763](https://github.com/openlayers/openlayers/pull/7763) - Use the temporary extent in VectorTileLayer ([@fredj](https://github.com/fredj))
|
||||
* [#7765](https://github.com/openlayers/openlayers/pull/7765) - Named exports from events condition ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7767](https://github.com/openlayers/openlayers/pull/7767) - Transformation functions: Fix spelling and use the symbol × ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7764](https://github.com/openlayers/openlayers/pull/7764) - Named exports from ol/has ([@tschaub](https://github.com/tschaub))
|
||||
* [#7761](https://github.com/openlayers/openlayers/pull/7761) - Rename _ol_render_canvas_Instruction_ to CanvasInstruction ([@fredj](https://github.com/fredj))
|
||||
* [#7749](https://github.com/openlayers/openlayers/pull/7749) - Check if the sketch feature is defined in finishDrawing ([@fredj](https://github.com/fredj))
|
||||
* [#7745](https://github.com/openlayers/openlayers/pull/7745) - More named exports ([@fredj](https://github.com/fredj))
|
||||
* [#7743](https://github.com/openlayers/openlayers/pull/7743) - Set enableHighAccuracy in geolocation example ([@fredj](https://github.com/fredj))
|
||||
* [#7738](https://github.com/openlayers/openlayers/pull/7738) - Named exports from ol/events ([@tschaub](https://github.com/tschaub))
|
||||
* [#7724](https://github.com/openlayers/openlayers/pull/7724) - Update prism library ([@fredj](https://github.com/fredj))
|
||||
* [#7727](https://github.com/openlayers/openlayers/pull/7727) - Deactivate transition effect for semi transparent layer example ([@fredj](https://github.com/fredj))
|
||||
* [#7726](https://github.com/openlayers/openlayers/pull/7726) - Named exports from ol/string ([@fredj](https://github.com/fredj))
|
||||
* [#7725](https://github.com/openlayers/openlayers/pull/7725) - Remove extra comment ([@fredj](https://github.com/fredj))
|
||||
* [#7721](https://github.com/openlayers/openlayers/pull/7721) - More renaming ([@fredj](https://github.com/fredj))
|
||||
* [#7716](https://github.com/openlayers/openlayers/pull/7716) - Better variables scoping ([@fredj](https://github.com/fredj))
|
||||
* [#7698](https://github.com/openlayers/openlayers/pull/7698) - Fix for loop in color test ([@fredj](https://github.com/fredj))
|
||||
* [#7703](https://github.com/openlayers/openlayers/pull/7703) - Improved drawing experience on touch devices ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7713](https://github.com/openlayers/openlayers/pull/7713) - Better variables scoping ([@fredj](https://github.com/fredj))
|
||||
* [#7711](https://github.com/openlayers/openlayers/pull/7711) - Do not use (I)CLA anymore ([@bartvde](https://github.com/bartvde))
|
||||
* [#7709](https://github.com/openlayers/openlayers/pull/7709) - More named export ([@fredj](https://github.com/fredj))
|
||||
* [#7705](https://github.com/openlayers/openlayers/pull/7705) - More renaming ([@fredj](https://github.com/fredj))
|
||||
* [#7700](https://github.com/openlayers/openlayers/pull/7700) - Fix ScaleLine control for Projections in degrees ([@pedros007](https://github.com/pedros007))
|
||||
* [#7697](https://github.com/openlayers/openlayers/pull/7697) - Use const and let ([@tschaub](https://github.com/tschaub))
|
||||
* [#7695](https://github.com/openlayers/openlayers/pull/7695) - More renaming ([@tschaub](https://github.com/tschaub))
|
||||
* [#7693](https://github.com/openlayers/openlayers/pull/7693) - More import renaming ([@fredj](https://github.com/fredj))
|
||||
* [#7678](https://github.com/openlayers/openlayers/pull/7678) - Add jsDelivr hits badge ([@LukasDrgon](https://github.com/LukasDrgon))
|
||||
* [#7686](https://github.com/openlayers/openlayers/pull/7686) - More import renaming ([@tschaub](https://github.com/tschaub))
|
||||
* [#7669](https://github.com/openlayers/openlayers/pull/7669) - Use declutter tree only for text and image replays ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7683](https://github.com/openlayers/openlayers/pull/7683) - Move IGCZ enum to src/ol/format/IGC.js ([@fredj](https://github.com/fredj))
|
||||
* [#7682](https://github.com/openlayers/openlayers/pull/7682) - Add new condition to MouseWheelZoom interaction ([@fredj](https://github.com/fredj))
|
||||
* [#7676](https://github.com/openlayers/openlayers/pull/7676) - Check fonts against two reference fonts ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7668](https://github.com/openlayers/openlayers/pull/7668) - Hit detect text background ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7661](https://github.com/openlayers/openlayers/pull/7661) - Background fill stroke ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7654](https://github.com/openlayers/openlayers/pull/7654) - Add named export for transformWithOptions function ([@fredj](https://github.com/fredj))
|
||||
* [#7652](https://github.com/openlayers/openlayers/pull/7652) - More renaming ([@fredj](https://github.com/fredj))
|
||||
* [#7649](https://github.com/openlayers/openlayers/pull/7649) - Named Map export for ol/Map ([@raiyni](https://github.com/raiyni))
|
||||
* [#7646](https://github.com/openlayers/openlayers/pull/7646) - Named export for Polyline format and SimpleGeometry ([@openlayers](https://github.com/openlayers))
|
||||
* [#7650](https://github.com/openlayers/openlayers/pull/7650) - Rename _ol_PluggableMap_ to PluggableMap ([@fredj](https://github.com/fredj))
|
||||
* [#7642](https://github.com/openlayers/openlayers/pull/7642) - Don't store private function into GPX ([@fredj](https://github.com/fredj))
|
||||
* [#7643](https://github.com/openlayers/openlayers/pull/7643) - Replace ol/Sphere with ol/sphere ([@tschaub](https://github.com/tschaub))
|
||||
* [#7644](https://github.com/openlayers/openlayers/pull/7644) - Named exports from ol/math module ([@raiyni](https://github.com/raiyni))
|
||||
* [#7636](https://github.com/openlayers/openlayers/pull/7636) - Named exports from the ol/array module ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7614](https://github.com/openlayers/openlayers/pull/7614) - Remove opt_this from the API ([@KlausBenndorf](https://github.com/KlausBenndorf))
|
||||
* [#7640](https://github.com/openlayers/openlayers/pull/7640) - Remove unneeded and already skipped test ([@openlayers](https://github.com/openlayers))
|
||||
* [#7637](https://github.com/openlayers/openlayers/pull/7637) - Named exports from the ol/color module ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7639](https://github.com/openlayers/openlayers/pull/7639) - Don't store private function into GeoJSON ([@fredj](https://github.com/fredj))
|
||||
* [#7635](https://github.com/openlayers/openlayers/pull/7635) - More module renaming ([@fredj](https://github.com/fredj))
|
||||
* [#7632](https://github.com/openlayers/openlayers/pull/7632) - Named exports from ol/css module ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7634](https://github.com/openlayers/openlayers/pull/7634) - Rename _ol_layer_Tile_ to TileLayer ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7633](https://github.com/openlayers/openlayers/pull/7633) - Import assert function directly ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7631](https://github.com/openlayers/openlayers/pull/7631) - More named export and rename ([@fredj](https://github.com/fredj))
|
||||
* [#7627](https://github.com/openlayers/openlayers/pull/7627) - Nicer import name ([@fredj](https://github.com/fredj))
|
||||
* [#7622](https://github.com/openlayers/openlayers/pull/7622) - Named export ([@fredj](https://github.com/fredj))
|
||||
* [#7624](https://github.com/openlayers/openlayers/pull/7624) - Remove eslint-plugin-openlayers-internal rules ([@fredj](https://github.com/fredj))
|
||||
* [#7625](https://github.com/openlayers/openlayers/pull/7625) - Named export for ol/control and ol/interaction ([@fredj](https://github.com/fredj))
|
||||
* [#7623](https://github.com/openlayers/openlayers/pull/7623) - Named export for ol/tileurlfunction ([@fredj](https://github.com/fredj))
|
||||
* [#7621](https://github.com/openlayers/openlayers/pull/7621) - Replace ZeroClipboard with Clipboard.js ([@fredj](https://github.com/fredj))
|
||||
* [#7620](https://github.com/openlayers/openlayers/pull/7620) - Rename variables in format modules ([@tschaub](https://github.com/tschaub))
|
||||
* [#7619](https://github.com/openlayers/openlayers/pull/7619) - More variable renaming ([@fredj](https://github.com/fredj))
|
||||
* [#7612](https://github.com/openlayers/openlayers/pull/7612) - Better import name for _ol_ext_* import ([@fredj](https://github.com/fredj))
|
||||
* [#7611](https://github.com/openlayers/openlayers/pull/7611) - Change olx.SphereMetricOptions to SphereMetricOptions ([@fredj](https://github.com/fredj))
|
||||
* [#7615](https://github.com/openlayers/openlayers/pull/7615) - Remove logos ([@tschaub](https://github.com/tschaub))
|
||||
* [#7610](https://github.com/openlayers/openlayers/pull/7610) - More variable renaming ([@fredj](https://github.com/fredj))
|
||||
* [#7609](https://github.com/openlayers/openlayers/pull/7609) - Redistribute a few types and docs ([@tschaub](https://github.com/tschaub))
|
||||
* [#7598](https://github.com/openlayers/openlayers/pull/7598) - Modular proj4 integration ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7607](https://github.com/openlayers/openlayers/pull/7607) - Rename interaction variables ([@tschaub](https://github.com/tschaub))
|
||||
* [#7599](https://github.com/openlayers/openlayers/pull/7599) - Rename event variables ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7605](https://github.com/openlayers/openlayers/pull/7605) - Better import and class name in ol/format/filter/ ([@fredj](https://github.com/fredj))
|
||||
* [#7604](https://github.com/openlayers/openlayers/pull/7604) - Named exports from ol/functions ([@fredj](https://github.com/fredj))
|
||||
* [#7603](https://github.com/openlayers/openlayers/pull/7603) - Simplify default export ([@fredj](https://github.com/fredj))
|
||||
* [#7602](https://github.com/openlayers/openlayers/pull/7602) - Remove now unused DEVICE_ORIENTATION ([@fredj](https://github.com/fredj))
|
||||
* [#7597](https://github.com/openlayers/openlayers/pull/7597) - More es6 named export ([@fredj](https://github.com/fredj))
|
||||
* [#7600](https://github.com/openlayers/openlayers/pull/7600) - Simplify default export of ol/events/KeyCode ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#7594](https://github.com/openlayers/openlayers/pull/7594) - Rename control variables ([@tschaub](https://github.com/tschaub))
|
||||
* [#7593](https://github.com/openlayers/openlayers/pull/7593) - Simplify default export ([@tschaub](https://github.com/tschaub))
|
||||
* [#7591](https://github.com/openlayers/openlayers/pull/7591) - Rename geometry variables ([@tschaub](https://github.com/tschaub))
|
||||
* [#7586](https://github.com/openlayers/openlayers/pull/7586) - Named exports from ol/dom ([@fredj](https://github.com/fredj))
|
||||
* [#7581](https://github.com/openlayers/openlayers/pull/7581) - Named exports from ol/proj ([@tschaub](https://github.com/tschaub))
|
||||
* [#7585](https://github.com/openlayers/openlayers/pull/7585) - Remove leftovers olx.animation typedefs ([@fredj](https://github.com/fredj))
|
||||
* [#7584](https://github.com/openlayers/openlayers/pull/7584) - Named exports from ol/easing ([@fredj](https://github.com/fredj))
|
||||
* [#7582](https://github.com/openlayers/openlayers/pull/7582) - Remove default export from ol/extent ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7580](https://github.com/openlayers/openlayers/pull/7580) - No default export from lowercase modules ([@tschaub](https://github.com/tschaub))
|
||||
* [#7575](https://github.com/openlayers/openlayers/pull/7575) - Add named exports for extent ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7579](https://github.com/openlayers/openlayers/pull/7579) - VectorImageTile: call changed() before removing listeners on dispose ([@mbleichner](https://github.com/mbleichner))
|
||||
* [#7578](https://github.com/openlayers/openlayers/pull/7578) - Remove deprecated functionality from 4.x ([@tschaub](https://github.com/tschaub))
|
||||
* [#7577](https://github.com/openlayers/openlayers/pull/7577) - Redistribute things in ol/index.js ([@tschaub](https://github.com/tschaub))
|
||||
* [#7576](https://github.com/openlayers/openlayers/pull/7576) - Named exports from ol/index.js ([@tschaub](https://github.com/tschaub))
|
||||
* [#7570](https://github.com/openlayers/openlayers/pull/7570) - Transform sources to ES modules ([@tschaub](https://github.com/tschaub))
|
||||
* [#7569](https://github.com/openlayers/openlayers/pull/7569) - Remove unnecessary require ([@tschaub](https://github.com/tschaub))
|
||||
* [#7568](https://github.com/openlayers/openlayers/pull/7568) - Remove unneeded configs from test ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7566](https://github.com/openlayers/openlayers/pull/7566) - Proper projection construction ([@tschaub](https://github.com/tschaub))
|
||||
* [#7565](https://github.com/openlayers/openlayers/pull/7565) - Release v4.6.4 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7563](https://github.com/openlayers/openlayers/pull/7563) - Use full precision for the declutter box ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7559](https://github.com/openlayers/openlayers/pull/7559) - Handle skipping and unskipping features with renderMode: 'image' ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7562](https://github.com/openlayers/openlayers/pull/7562) - Remove unused, confusing projection code ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7555](https://github.com/openlayers/openlayers/pull/7555) - Release v4.6.3 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7554](https://github.com/openlayers/openlayers/pull/7554) - Only compose image vector frame when the replay group has changed ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7550](https://github.com/openlayers/openlayers/pull/7550) - Update examples to d3.js v4 ([@fredj](https://github.com/fredj))
|
||||
* [#7548](https://github.com/openlayers/openlayers/pull/7548) - Fix pull request link ([@openlayers](https://github.com/openlayers))
|
||||
* [#7547](https://github.com/openlayers/openlayers/pull/7547) - Release v4.6.2 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7546](https://github.com/openlayers/openlayers/pull/7546) - Do not request features for wrapped extent ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#7545](https://github.com/openlayers/openlayers/pull/7545) - Release v4.6.1 ([@openlayers](https://github.com/openlayers))
|
||||
* [#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))
|
||||
|
||||
|
||||
<details>
|
||||
<summary>Dependency Updates</summary>
|
||||
|
||||
* [#8315](https://github.com/openlayers/openlayers/pull/8315) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8309](https://github.com/openlayers/openlayers/pull/8309) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8311](https://github.com/openlayers/openlayers/pull/8311) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8310](https://github.com/openlayers/openlayers/pull/8310) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8297](https://github.com/openlayers/openlayers/pull/8297) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8293](https://github.com/openlayers/openlayers/pull/8293) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8285](https://github.com/openlayers/openlayers/pull/8285) - Update google-closure-compiler to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8275](https://github.com/openlayers/openlayers/pull/8275) - Update serve to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8271](https://github.com/openlayers/openlayers/pull/8271) - chore(package): update google-closure-compiler to version 20180610.0.1 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8270](https://github.com/openlayers/openlayers/pull/8270) - chore(package): update rollup to version 0.60.7 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8266](https://github.com/openlayers/openlayers/pull/8266) - chore(package): update rollup to version 0.60.4 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8261](https://github.com/openlayers/openlayers/pull/8261) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8260](https://github.com/openlayers/openlayers/pull/8260) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8252](https://github.com/openlayers/openlayers/pull/8252) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8248](https://github.com/openlayers/openlayers/pull/8248) - Update serve to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8247](https://github.com/openlayers/openlayers/pull/8247) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8241](https://github.com/openlayers/openlayers/pull/8241) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8230](https://github.com/openlayers/openlayers/pull/8230) - Update serve to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8208](https://github.com/openlayers/openlayers/pull/8208) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8205](https://github.com/openlayers/openlayers/pull/8205) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8179](https://github.com/openlayers/openlayers/pull/8179) - Update google-closure-compiler to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8146](https://github.com/openlayers/openlayers/pull/8146) - Update coveralls to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8145](https://github.com/openlayers/openlayers/pull/8145) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8140](https://github.com/openlayers/openlayers/pull/8140) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8131](https://github.com/openlayers/openlayers/pull/8131) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8130](https://github.com/openlayers/openlayers/pull/8130) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8128](https://github.com/openlayers/openlayers/pull/8128) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8124](https://github.com/openlayers/openlayers/pull/8124) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8102](https://github.com/openlayers/openlayers/pull/8102) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8095](https://github.com/openlayers/openlayers/pull/8095) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8094](https://github.com/openlayers/openlayers/pull/8094) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8093](https://github.com/openlayers/openlayers/pull/8093) - chore(package): update serve to version 6.5.5 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8090](https://github.com/openlayers/openlayers/pull/8090) - chore(package): update url-polyfill to version 1.0.13 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8091](https://github.com/openlayers/openlayers/pull/8091) - chore(package): update karma-firefox-launcher to version 1.1.0 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8085](https://github.com/openlayers/openlayers/pull/8085) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8071](https://github.com/openlayers/openlayers/pull/8071) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8060](https://github.com/openlayers/openlayers/pull/8060) - Update google-closure-compiler to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8039](https://github.com/openlayers/openlayers/pull/8039) - Update google-closure-compiler to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8028](https://github.com/openlayers/openlayers/pull/8028) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8019](https://github.com/openlayers/openlayers/pull/8019) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8017](https://github.com/openlayers/openlayers/pull/8017) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8018](https://github.com/openlayers/openlayers/pull/8018) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8014](https://github.com/openlayers/openlayers/pull/8014) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8009](https://github.com/openlayers/openlayers/pull/8009) - chore(package): update sinon to version 5.0.0 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8008](https://github.com/openlayers/openlayers/pull/8008) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8000](https://github.com/openlayers/openlayers/pull/8000) - Update karma-webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7990](https://github.com/openlayers/openlayers/pull/7990) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7984](https://github.com/openlayers/openlayers/pull/7984) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7981](https://github.com/openlayers/openlayers/pull/7981) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7977](https://github.com/openlayers/openlayers/pull/7977) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7972](https://github.com/openlayers/openlayers/pull/7972) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7963](https://github.com/openlayers/openlayers/pull/7963) - chore(package): update url-polyfill to version 1.0.11 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7962](https://github.com/openlayers/openlayers/pull/7962) - chore(package): update serve to version 6.5.2 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7959](https://github.com/openlayers/openlayers/pull/7959) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7957](https://github.com/openlayers/openlayers/pull/7957) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7950](https://github.com/openlayers/openlayers/pull/7950) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7945](https://github.com/openlayers/openlayers/pull/7945) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7943](https://github.com/openlayers/openlayers/pull/7943) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7940](https://github.com/openlayers/openlayers/pull/7940) - Update babel-plugin-jsdoc-closure to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7938](https://github.com/openlayers/openlayers/pull/7938) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7925](https://github.com/openlayers/openlayers/pull/7925) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7921](https://github.com/openlayers/openlayers/pull/7921) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7916](https://github.com/openlayers/openlayers/pull/7916) - chore(package): update html-webpack-plugin to version 3.0.1 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7905](https://github.com/openlayers/openlayers/pull/7905) - Update karma-webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7903](https://github.com/openlayers/openlayers/pull/7903) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7901](https://github.com/openlayers/openlayers/pull/7901) - Update karma-webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7898](https://github.com/openlayers/openlayers/pull/7898) - chore(package): update karma-webpack to version 2.0.11 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7893](https://github.com/openlayers/openlayers/pull/7893) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7891](https://github.com/openlayers/openlayers/pull/7891) - chore(package): update recast to version 0.14.4 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7886](https://github.com/openlayers/openlayers/pull/7886) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7882](https://github.com/openlayers/openlayers/pull/7882) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7876](https://github.com/openlayers/openlayers/pull/7876) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7877](https://github.com/openlayers/openlayers/pull/7877) - Update webpack-merge to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7865](https://github.com/openlayers/openlayers/pull/7865) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7866](https://github.com/openlayers/openlayers/pull/7866) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7867](https://github.com/openlayers/openlayers/pull/7867) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7858](https://github.com/openlayers/openlayers/pull/7858) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7850](https://github.com/openlayers/openlayers/pull/7850) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7849](https://github.com/openlayers/openlayers/pull/7849) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7848](https://github.com/openlayers/openlayers/pull/7848) - Update nomnom to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7847](https://github.com/openlayers/openlayers/pull/7847) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7845](https://github.com/openlayers/openlayers/pull/7845) - chore(package): update marked to version 0.3.14 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7841](https://github.com/openlayers/openlayers/pull/7841) - Greenkeeper/babel plugin jsdoc closure 1.2.0 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7822](https://github.com/openlayers/openlayers/pull/7822) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7813](https://github.com/openlayers/openlayers/pull/7813) - Update recast to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7809](https://github.com/openlayers/openlayers/pull/7809) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7812](https://github.com/openlayers/openlayers/pull/7812) - chore(package): update sinon to version 4.3.0 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7777](https://github.com/openlayers/openlayers/pull/7777) - Update babel-minify-webpack-plugin to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7759](https://github.com/openlayers/openlayers/pull/7759) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7746](https://github.com/openlayers/openlayers/pull/7746) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7735](https://github.com/openlayers/openlayers/pull/7735) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7729](https://github.com/openlayers/openlayers/pull/7729) - Update jquery to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7732](https://github.com/openlayers/openlayers/pull/7732) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7731](https://github.com/openlayers/openlayers/pull/7731) - Update webpack-dev-server to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7728](https://github.com/openlayers/openlayers/pull/7728) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7720](https://github.com/openlayers/openlayers/pull/7720) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7712](https://github.com/openlayers/openlayers/pull/7712) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7702](https://github.com/openlayers/openlayers/pull/7702) - Update webpack-dev-server to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7701](https://github.com/openlayers/openlayers/pull/7701) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7691](https://github.com/openlayers/openlayers/pull/7691) - Update webpack-dev-server to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7688](https://github.com/openlayers/openlayers/pull/7688) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7685](https://github.com/openlayers/openlayers/pull/7685) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7681](https://github.com/openlayers/openlayers/pull/7681) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7680](https://github.com/openlayers/openlayers/pull/7680) - Update webpack-dev-server to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7667](https://github.com/openlayers/openlayers/pull/7667) - Update mocha to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7656](https://github.com/openlayers/openlayers/pull/7656) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7655](https://github.com/openlayers/openlayers/pull/7655) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7651](https://github.com/openlayers/openlayers/pull/7651) - Update karma to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7647](https://github.com/openlayers/openlayers/pull/7647) - Update rbush to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7596](https://github.com/openlayers/openlayers/pull/7596) - Update karma-webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7589](https://github.com/openlayers/openlayers/pull/7589) - chore(package): update karma-webpack to version 2.0.8 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7571](https://github.com/openlayers/openlayers/pull/7571) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7567](https://github.com/openlayers/openlayers/pull/7567) - Update fs-extra to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7558](https://github.com/openlayers/openlayers/pull/7558) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7552](https://github.com/openlayers/openlayers/pull/7552) - Update jscodeshift to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#7551](https://github.com/openlayers/openlayers/pull/7551) - Update sinon to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
|
||||
</details>
|
||||
@@ -1,8 +0,0 @@
|
||||
# 5.0.1
|
||||
|
||||
The v5.0.1 release helps reduce bundle sizes for bundlers that support the `"sideEffects": "false"`option in `package.json`, and fixes website documentation regarding cdn locations and debug build which has been replaced by source maps.
|
||||
|
||||
## Fixes
|
||||
|
||||
* [#8341](https://github.com/openlayers/openlayers/pull/8341) - Set sideEffects: false flag ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8342](https://github.com/openlayers/openlayers/pull/8342) - Fix links and description in quickstart tutorial ([@ahocevar](https://github.com/ahocevar))
|
||||
@@ -1,36 +1,37 @@
|
||||
{
|
||||
"opts": {
|
||||
"recurse": true,
|
||||
"template": "config/jsdoc/api/template"
|
||||
},
|
||||
"tags": {
|
||||
"allowUnknownTags": true
|
||||
},
|
||||
"source": {
|
||||
"includePattern": ".+\\.js(doc)?$",
|
||||
"excludePattern": "(^|\\/|\\\\)_",
|
||||
"include": [
|
||||
"src/ol"
|
||||
]
|
||||
},
|
||||
"plugins": [
|
||||
"plugins/markdown",
|
||||
"config/jsdoc/api/plugins/normalize-exports",
|
||||
"config/jsdoc/api/plugins/inline-options",
|
||||
"config/jsdoc/api/plugins/events",
|
||||
"config/jsdoc/api/plugins/observable",
|
||||
"config/jsdoc/api/plugins/api"
|
||||
],
|
||||
"markdown": {
|
||||
"parser": "gfm"
|
||||
},
|
||||
"templates": {
|
||||
"cleverLinks": true,
|
||||
"monospaceLinks": true,
|
||||
"default": {
|
||||
"outputSourceFiles": false
|
||||
"opts": {
|
||||
"recurse": true,
|
||||
"template": "config/jsdoc/api/template"
|
||||
},
|
||||
"applicationName": "OpenLayers"
|
||||
},
|
||||
"jsVersion": 180
|
||||
"tags": {
|
||||
"allowUnknownTags": true
|
||||
},
|
||||
"source": {
|
||||
"includePattern": ".+\\.js(doc)?$",
|
||||
"excludePattern": "(^|\\/|\\\\)_",
|
||||
"include": [
|
||||
"src",
|
||||
"externs/oli.js"
|
||||
]
|
||||
},
|
||||
"plugins": [
|
||||
"plugins/markdown",
|
||||
"config/jsdoc/api/plugins/inheritdoc",
|
||||
"config/jsdoc/api/plugins/typedefs",
|
||||
"config/jsdoc/api/plugins/events",
|
||||
"config/jsdoc/api/plugins/observable",
|
||||
"config/jsdoc/api/plugins/api"
|
||||
],
|
||||
"markdown": {
|
||||
"parser": "gfm"
|
||||
},
|
||||
"templates": {
|
||||
"cleverLinks": true,
|
||||
"monospaceLinks": true,
|
||||
"default": {
|
||||
"outputSourceFiles": false
|
||||
},
|
||||
"applicationName": "OpenLayers"
|
||||
},
|
||||
"jsVersion": 180
|
||||
}
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
<table><tr>
|
||||
<th width="33.3%">Map</th><th width="33.3%">View</th><th width="33.3%">Layers</th>
|
||||
</tr><tr>
|
||||
<td><p>A [map](module-ol_Map-Map.html) is made of [layers](module-ol_layer_Base-BaseLayer.html), a [view](module-ol_View-View.html) to visualize them, [interactions](module-ol_interaction_Interaction-Interaction.html) to modify map content and [controls](module-ol_control_Control-Control.html) with UI components.</p>
|
||||
[Overview](module-ol_Map-Map.html)<br>
|
||||
[Creation](module-ol_Map-Map.html#Map)<br>
|
||||
[Events](module-ol_MapBrowserEvent-MapBrowserEvent.html)</td>
|
||||
<td><p>A [map](ol.Map.html) is made of [layers](ol.layer.html), a [view](ol.View.html) to visualize them, [interactions](ol.interaction.html) to modify map content and [controls](ol.control.html) with UI components.</p>
|
||||
[Overview](ol.Map.html)<br>
|
||||
[Creation](ol.Map.html#Map)<br>
|
||||
[Events](ol.MapBrowserEvent.html)</td>
|
||||
<td><p>The view manages the visual parameters of the map view, like resolution or rotation.</p>
|
||||
[View](module-ol_View-View.html) with center, projection, resolution and rotation</td>
|
||||
<td><p>Layers are lightweight containers that get their data from [sources](module-ol_source_Source-Source.html).</p>
|
||||
[layer/Tile](module-ol_layer_Tile-TileLayer.html)<br>
|
||||
[layer/Image](module-ol_layer_Image-ImageLayer.html)<br>
|
||||
[layer/Vector](module-ol_layer_Vector-VectorLayer.html)<br>
|
||||
[layer/VectorTile](module-ol_layer_VectorTile-VectorTileLayer.html)</td>
|
||||
[ol.View](ol.View.html) with center, projection, resolution and rotation</td>
|
||||
<td><p>Layers are lightweight containers that get their data from [sources](ol.source.html).</p>
|
||||
[ol.layer.Tile](ol.layer.Tile.html)<br>
|
||||
[ol.layer.Image](ol.layer.Image.html)<br>
|
||||
[ol.layer.Vector](ol.layer.Vector.html)<br>
|
||||
[ol.layer.VectorTile](ol.layer.VectorTile.html)</td>
|
||||
</tr><tr>
|
||||
<th>Controls</th><th>Interactions</th><th>Sources and formats</th>
|
||||
</tr><tr>
|
||||
<td>[Map default controls](module-ol_control_util.html#.defaults)<br>
|
||||
[All controls](module-ol_control_Control-Control.html)
|
||||
<td>[Map default controls](ol.control.html#.defaults)<br>
|
||||
[All controls](ol.control.html)
|
||||
</td>
|
||||
<td>
|
||||
[Map default interactions](module-ol_interaction.html#~defaults)<br>
|
||||
Interactions for [vector features](module-ol_Feature-Feature.html)
|
||||
<ul><li>[interaction/Select](module-ol_interaction_Select-Select.html)</li>
|
||||
<li>[interaction/Draw](module-ol_interaction_Draw-Draw.html)</li>
|
||||
<li>[interaction/Modify](module-ol_interaction_Modify-Modify.html)</li></ul>
|
||||
[All interactions](module-ol_interaction_Interaction-Interaction.html)</td>
|
||||
<td>[Tile sources](module-ol_source_Tile-TileSource.html) for [layer/Tile](module-ol_layer_Tile-TileLayer.html)
|
||||
<br>[Image sources](module-ol_source_Image-ImageSource.html) for [layer/Image](module-ol_layer_Image-ImageLayer.html)
|
||||
<br>[Vector sources](module-ol_source_Vector-VectorSource.html) for [layer/Vector](module-ol_layer_Vector-VectorLayer.html)
|
||||
<br>[Vector tile sources](module-ol_source_VectorTile-VectorTile.html) for [layer/VectorTile](module-ol_layer_VectorTile-VectorTileLayer.html)
|
||||
<br>[Formats](module-ol_format_Feature-FeatureFormat.html) for reading/writing vector data
|
||||
<br>[format/WMSCapabilities](module-ol_format_WMSCapabilities-WMSCapabilities.html)</td></tr>
|
||||
[Map default interactions](ol.interaction.html#.defaults)<br>
|
||||
Interactions for [vector features](ol.Feature.html)
|
||||
<ul><li>[ol.interaction.Select](ol.interaction.Select.html)</li>
|
||||
<li>[ol.interaction.Draw](ol.interaction.Draw.html)</li>
|
||||
<li>[ol.interaction.Modify](ol.interaction.Modify.html)</li></ul>
|
||||
[All interactions](ol.interaction.html)</td>
|
||||
<td>[Tile sources](ol.source.Tile.html) for [ol.layer.Tile](ol.layer.Tile.html)
|
||||
<br>[Image sources](ol.source.Image.html) for [ol.layer.Image](ol.layer.Image.html)
|
||||
<br>[Vector sources](ol.source.Vector.html) for [ol.layer.Vector](ol.layer.Vector.html)
|
||||
<br>[Vector tile sources](ol.source.VectorTile.html) for [ol.layer.VectorTile](ol.layer.VectorTile.html)
|
||||
<br>[Formats](ol.format.Feature.html) for reading/writing vector data
|
||||
<br>[ol.format.WMSCapabilities](ol.format.WMSCapabilities.html)</td></tr>
|
||||
<tr><th>Projections</th><th>Observable objects</th><th>Other components</th></tr>
|
||||
<tr><td><p>All coordinates and extents need to be provided in view projection (default: EPSG:3857). To transform, use [proj.transform()](module-ol_proj.html#.transform) and [proj.transformExtent()](module-ol_proj.html#.transformExtent).</p>
|
||||
[ol/proj](module-ol_proj.html)</td>
|
||||
<td><p>Changes to all [ol/Object](module-ol_Object-BaseObject.html)s can be observed by calling the [object.on('propertychange')](module-ol_Object-BaseObject.html#on) method. Listeners receive an [ol/Object~ObjectEvent](module-ol_Object-ObjectEvent.html) with information on the changed property and old value.</p>
|
||||
<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/Geolocation](module-ol_Geolocation.html)<br>
|
||||
[ol/Overlay](module-ol_Overlay-Overlay.html)<br></td>
|
||||
[ol.Geolocation](ol.Geolocation.html)<br>
|
||||
[ol.Overlay](ol.Overlay.html)<br></td>
|
||||
</tr></table>
|
||||
|
||||
|
||||
@@ -52,4 +52,11 @@ The OpenLayers API consists of
|
||||
|
||||
Within a major release series, the API will not be changed. Any changes to the API will be accompanied by a new major release.
|
||||
|
||||
*Note*: The API change policy does not cover CSS class names that are used to style the OpenLayers UI. It also does not cover any typedefs and enums.
|
||||
*Note*: The API change policy does not cover CSS class names that are used to style the
|
||||
OpenLayers UI.
|
||||
|
||||
*Note for Closure Compiler users compiling their application code together with OpenLayers*:
|
||||
The names of types other than those in the list above (e.g. `ol.Coordinate`) are subject to change. It
|
||||
is therefore recommended to either use the resolved type as listed in the API docs (e.g.
|
||||
`Array.<number>` instead of `ol.Coordinate`), or pay attention to the upgrade notes, which will list
|
||||
the changes for those types.
|
||||
|
||||
@@ -24,7 +24,6 @@ exports.defineTags = function(dictionary) {
|
||||
const api = [];
|
||||
const classes = {};
|
||||
const types = {};
|
||||
const modules = {};
|
||||
|
||||
function hasApiMembers(doclet) {
|
||||
return doclet.longname.split('#')[0] == this.longname;
|
||||
@@ -58,8 +57,10 @@ function includeAugments(doclet) {
|
||||
}
|
||||
});
|
||||
}
|
||||
cls._hideConstructor = true;
|
||||
delete cls.undocumented;
|
||||
if (cls.longname.indexOf('oli.') !== 0) {
|
||||
cls._hideConstructor = true;
|
||||
delete cls.undocumented;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,21 +70,20 @@ function extractTypes(item) {
|
||||
item.type.names.forEach(function(type) {
|
||||
const match = type.match(/^(.*<)?([^>]*)>?$/);
|
||||
if (match) {
|
||||
modules[match[2]] = true;
|
||||
types[match[2]] = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function includeTypes(doclet) {
|
||||
if (doclet.params) {
|
||||
if (doclet.params && doclet.kind != 'class') {
|
||||
doclet.params.forEach(extractTypes);
|
||||
}
|
||||
if (doclet.returns) {
|
||||
doclet.returns.forEach(extractTypes);
|
||||
}
|
||||
if (doclet.properties) {
|
||||
doclet.properties.forEach(extractTypes);
|
||||
if (doclet.isEnum) {
|
||||
types[doclet.meta.code.name] = true;
|
||||
}
|
||||
if (doclet.type && doclet.meta.code.type == 'MemberExpression') {
|
||||
extractTypes(doclet);
|
||||
@@ -95,7 +95,6 @@ exports.handlers = {
|
||||
newDoclet: function(e) {
|
||||
const doclet = e.doclet;
|
||||
if (doclet.stability) {
|
||||
modules[doclet.longname.split('~').shift()] = true;
|
||||
api.push(doclet);
|
||||
}
|
||||
// Mark explicity defined namespaces - needed in parseComplete to keep
|
||||
@@ -104,7 +103,6 @@ exports.handlers = {
|
||||
doclet.namespace_ = true;
|
||||
}
|
||||
if (doclet.kind == 'class') {
|
||||
modules[doclet.longname.split('~').shift()] = true;
|
||||
classes[doclet.longname] = doclet;
|
||||
}
|
||||
},
|
||||
@@ -130,13 +128,6 @@ exports.handlers = {
|
||||
// Always document namespaces and items with stability annotation
|
||||
continue;
|
||||
}
|
||||
if (doclet.kind == 'module' && doclet.longname in modules) {
|
||||
// Document all modules that are referenced by the API
|
||||
continue;
|
||||
}
|
||||
if (doclet.isEnum || doclet.kind == 'typedef') {
|
||||
continue;
|
||||
}
|
||||
if (doclet.kind == 'class' && api.some(hasApiMembers, doclet)) {
|
||||
// Mark undocumented classes with documented members as unexported.
|
||||
// This is used in ../template/tmpl/container.tmpl to hide the
|
||||
|
||||
109
config/jsdoc/api/plugins/inheritdoc.js
Normal file
109
config/jsdoc/api/plugins/inheritdoc.js
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* This is a hack to prevent inheritDoc tags from entirely removing
|
||||
* documentation of the method that inherits the documentation.
|
||||
*
|
||||
* TODO: Remove this hack when https://github.com/jsdoc3/jsdoc/issues/53
|
||||
* is addressed.
|
||||
*/
|
||||
|
||||
|
||||
exports.defineTags = function(dictionary) {
|
||||
dictionary.defineTag('inheritDoc', {
|
||||
mustHaveValue: false,
|
||||
canHaveType: false,
|
||||
canHaveName: false,
|
||||
onTagged: function(doclet, tag) {
|
||||
doclet.inheritdoc = true;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
const lookup = {};
|
||||
const incompleteByClass = {};
|
||||
const keepKeys = ['comment', 'meta', 'name', 'memberof', 'longname', 'augment',
|
||||
'stability'];
|
||||
|
||||
exports.handlers = {
|
||||
|
||||
newDoclet: function(e) {
|
||||
const doclet = e.doclet;
|
||||
let incompletes;
|
||||
if (!(doclet.longname in lookup)) {
|
||||
lookup[doclet.longname] = [];
|
||||
}
|
||||
lookup[doclet.longname].push(doclet);
|
||||
if (doclet.inheritdoc) {
|
||||
if (!(doclet.memberof in incompleteByClass)) {
|
||||
incompleteByClass[doclet.memberof] = [];
|
||||
}
|
||||
incompletes = incompleteByClass[doclet.memberof];
|
||||
if (incompletes.indexOf(doclet.name) == -1) {
|
||||
incompletes.push(doclet.name);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
parseComplete: function(e) {
|
||||
let ancestors, candidate, candidates, doclet, i, j, k, l, key;
|
||||
let incompleteDoclet, stability, incomplete, incompletes;
|
||||
const doclets = e.doclets;
|
||||
for (i = doclets.length - 1; i >= 0; --i) {
|
||||
doclet = doclets[i];
|
||||
if (doclet.augments) {
|
||||
ancestors = [].concat(doclet.augments);
|
||||
}
|
||||
incompletes = incompleteByClass[doclet.longname];
|
||||
if (ancestors && incompletes) {
|
||||
// collect ancestors from the whole hierarchy
|
||||
for (j = 0; j < ancestors.length; ++j) {
|
||||
candidates = lookup[ancestors[j]];
|
||||
if (candidates) {
|
||||
for (k = candidates.length - 1; k >= 0; --k) {
|
||||
candidate = candidates[k];
|
||||
if (candidate.augments) {
|
||||
ancestors = ancestors.concat(candidate.augments);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// walk through all inheritDoc members
|
||||
for (j = incompletes.length - 1; j >= 0; --j) {
|
||||
incomplete = incompletes[j];
|
||||
candidates = lookup[doclet.longname + '#' + incomplete];
|
||||
if (candidates) {
|
||||
// get the incomplete doclet that needs to be augmented
|
||||
for (k = candidates.length - 1; k >= 0; --k) {
|
||||
incompleteDoclet = candidates[k];
|
||||
if (incompleteDoclet.inheritdoc) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// find the documented ancestor
|
||||
for (k = ancestors.length - 1; k >= 0; --k) {
|
||||
candidates = lookup[ancestors[k] + '#' + incomplete];
|
||||
if (candidates) {
|
||||
for (l = candidates.length - 1; l >= 0; --l) {
|
||||
candidate = candidates[l];
|
||||
if (candidate && !candidate.inheritdoc) {
|
||||
stability = candidate.stability || incompleteDoclet.stability;
|
||||
if (stability) {
|
||||
incompleteDoclet.stability = stability;
|
||||
for (key in candidate) {
|
||||
if (candidate.hasOwnProperty(key) &&
|
||||
keepKeys.indexOf(key) == -1) {
|
||||
incompleteDoclet[key] = candidate[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
/**
|
||||
* @filedesc
|
||||
* Inlines option params from typedefs
|
||||
*/
|
||||
|
||||
const properties = {};
|
||||
|
||||
exports.handlers = {
|
||||
|
||||
/**
|
||||
* Collects all typedefs, keyed by longname
|
||||
* @param {Object} e Event object.
|
||||
*/
|
||||
newDoclet: function(e) {
|
||||
if (e.doclet.kind == 'typedef' && e.doclet.properties) {
|
||||
properties[e.doclet.longname] = e.doclet.properties;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds `options.*` params for options that match the longname of one of the
|
||||
* collected typedefs.
|
||||
* @param {Object} e Event object.
|
||||
*/
|
||||
parseComplete: function(e) {
|
||||
const doclets = e.doclets;
|
||||
for (let i = 0, ii = doclets.length; i < ii; ++i) {
|
||||
const doclet = doclets[i];
|
||||
if (doclet.params) {
|
||||
const params = doclet.params;
|
||||
for (let j = 0, jj = params.length; j < jj; ++j) {
|
||||
const param = params[j];
|
||||
if (param.type && param.type.names) {
|
||||
const type = param.type.names[0];
|
||||
if (type in properties) {
|
||||
param.type.names[0] = type;
|
||||
params.push.apply(params, properties[type].map(p => {
|
||||
const property = Object.assign({}, p);
|
||||
property.name = `${param.name}.${property.name}`;
|
||||
return property;
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -1,106 +0,0 @@
|
||||
/**
|
||||
* @filedesc
|
||||
* Expands module path type to point to default export when no name is given
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
let moduleRoot;
|
||||
|
||||
function addDefaultExportPath(obj) {
|
||||
if (!Array.isArray(obj)) {
|
||||
obj = obj.names;
|
||||
}
|
||||
obj.forEach((name, index) => {
|
||||
const matches = name.match(/module\:([^>|),\.<]|)+/g);
|
||||
if (matches) {
|
||||
matches.forEach(module => {
|
||||
if (!/[~\.]/.test(module)) {
|
||||
const checkFile = path.resolve(moduleRoot, module.replace(/^module\:/, ''));
|
||||
const file = fs.readFileSync(require.resolve(checkFile), 'utf-8');
|
||||
const lines = file.split('\n');
|
||||
let hasDefaultExport = false;
|
||||
for (let i = 0, ii = lines.length; i < ii; ++i) {
|
||||
hasDefaultExport = hasDefaultExport || /^export default [^\{]/.test(lines[i]);
|
||||
const match = lines[i].match(/^export default ([A-Za-z_$][A-Za-z0-9_$]+);$/);
|
||||
if (match) {
|
||||
// Use variable name if default export is assigned to a variable.
|
||||
obj[index] = name = name.replace(module, `${module}~${match[1]}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (hasDefaultExport) {
|
||||
// Duplicate last part if default export is not assigned to a variable.
|
||||
obj[index] = name = name.replace(module, `${module}~${module.split('/').pop()}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function replaceLinks(comment) {
|
||||
const matches = comment.match(/\{@link [^\} #]+}/g);
|
||||
if (matches) {
|
||||
const modules = matches.map(m => {
|
||||
const mm = m.match(/(module:[^\}]+)}$/);
|
||||
if (mm) {
|
||||
return mm[1];
|
||||
}
|
||||
}).filter(m => !!m);
|
||||
const newModules = modules.concat();
|
||||
addDefaultExportPath(newModules);
|
||||
modules.forEach((module, i) => {
|
||||
comment = comment.replace(module, newModules[i]);
|
||||
});
|
||||
}
|
||||
return comment;
|
||||
}
|
||||
|
||||
exports.handlers = {
|
||||
|
||||
/**
|
||||
* Adds default export to module path types without name
|
||||
* @param {Object} e Event object.
|
||||
*/
|
||||
newDoclet: function(e) {
|
||||
const doclet = e.doclet;
|
||||
if (doclet.kind == 'module') {
|
||||
const levelsUp = doclet.longname.replace(/^module\:/, '').split('/');
|
||||
if (doclet.meta.filename != 'index.js') {
|
||||
levelsUp.pop();
|
||||
}
|
||||
const pathArgs = [doclet.meta.path].concat(levelsUp.map(() => '../'));
|
||||
moduleRoot = path.resolve.apply(null, pathArgs);
|
||||
} else {
|
||||
if (doclet.description) {
|
||||
doclet.description = replaceLinks(doclet.description);
|
||||
}
|
||||
if (doclet.classdesc) {
|
||||
doclet.classdesc = replaceLinks(doclet.classdesc);
|
||||
}
|
||||
|
||||
const module = doclet.longname.split('#').shift();
|
||||
if (module.indexOf('module:') == 0 && module.indexOf('.') !== -1) {
|
||||
doclet.longname = doclet.longname.replace(module, module.replace('.', '~'));
|
||||
}
|
||||
if (doclet.augments) {
|
||||
addDefaultExportPath(doclet.augments);
|
||||
}
|
||||
if (doclet.params) {
|
||||
doclet.params.forEach(p => addDefaultExportPath(p.type));
|
||||
}
|
||||
if (doclet.returns) {
|
||||
doclet.returns.forEach(r => addDefaultExportPath(r.type));
|
||||
}
|
||||
if (doclet.properties) {
|
||||
doclet.properties.forEach(p => addDefaultExportPath(p.type));
|
||||
}
|
||||
if (doclet.type) {
|
||||
addDefaultExportPath(doclet.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -47,7 +47,7 @@ exports.handlers = {
|
||||
if (!cls.fires) {
|
||||
cls.fires = [];
|
||||
}
|
||||
event = 'module:ol/Object~ObjectEvent#event:change:' + name;
|
||||
event = 'ol.Object.Event#event:change:' + name;
|
||||
if (cls.fires.indexOf(event) == -1) {
|
||||
cls.fires.push(event);
|
||||
}
|
||||
|
||||
@@ -47,6 +47,21 @@ ol.MapBrowserEventType = {
|
||||
```
|
||||
Note the value of the `@event` annotation. The text before the hash refers to the event class that the event belongs to, and the text after the hash is the type of the event.
|
||||
|
||||
To export event properties, they need to be defined in `externs/oli.js` (also see `readme.md` in `externs/`) and marked with an @api annotation:
|
||||
```js
|
||||
/** @interface */
|
||||
oli.MapBrowserEvent;
|
||||
|
||||
/**
|
||||
* @type {ol.Coordinate}
|
||||
* @api
|
||||
*/
|
||||
oli.MapBrowserEvent.prototype.coordinate;
|
||||
|
||||
// ...
|
||||
|
||||
};
|
||||
```
|
||||
To document which events are fired by a class or method, the `@fires` annotation is used:
|
||||
```js
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
/*global env: true */
|
||||
|
||||
const hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
|
||||
// Work around an issue with hasOwnProperty in JSDoc's templateHelper.js.
|
||||
//TODO Fix in JSDoc.
|
||||
Object.prototype.hasOwnProperty = function(property) {
|
||||
return property in this;
|
||||
};
|
||||
|
||||
const template = require('jsdoc/lib/jsdoc/template');
|
||||
const fs = require('jsdoc/lib/jsdoc/fs');
|
||||
const path = require('jsdoc/lib/jsdoc/path');
|
||||
@@ -18,12 +9,9 @@ const _ = require('underscore');
|
||||
const htmlsafe = helper.htmlsafe;
|
||||
const linkto = helper.linkto;
|
||||
const resolveAuthorLinks = helper.resolveAuthorLinks;
|
||||
const hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
const outdir = env.opts.destination;
|
||||
|
||||
// Work around an issue with hasOwnProperty in JSDoc's templateHelper.js.
|
||||
//TODO Fix in JSDoc.
|
||||
Object.prototype.hasOwnProperty = hasOwnProp;
|
||||
|
||||
let view;
|
||||
let data;
|
||||
|
||||
@@ -204,7 +192,7 @@ function attachModuleSymbols(doclets, modules) {
|
||||
function buildNav(members) {
|
||||
const nav = [];
|
||||
// merge namespaces and classes, then sort
|
||||
const merged = members.modules.concat(members.classes);
|
||||
const merged = members.namespaces.concat(members.classes);
|
||||
merged.sort(function(a, b) {
|
||||
if (a.longname > b.longname) {
|
||||
return 1;
|
||||
@@ -217,9 +205,9 @@ function buildNav(members) {
|
||||
_.each(merged, function(v) {
|
||||
// exclude interfaces from sidebar
|
||||
if (v.interface !== true) {
|
||||
if (v.kind == 'module') {
|
||||
if (v.kind == 'namespace') {
|
||||
nav.push({
|
||||
type: 'module',
|
||||
type: 'namespace',
|
||||
longname: v.longname,
|
||||
name: v.name,
|
||||
members: find({
|
||||
|
||||
@@ -85,7 +85,7 @@ $(function () {
|
||||
var srcLinks = $('div.tag-source');
|
||||
srcLinks.each(function(i, el) {
|
||||
var textParts = el.innerHTML.trim().split(', ');
|
||||
var link = 'https://github.com/openlayers/openlayers/blob/v' + currentVersion + '/src/ol/' +
|
||||
var link = 'https://github.com/openlayers/openlayers/blob/v' + currentVersion + '/' +
|
||||
textParts[0];
|
||||
el.innerHTML = '<a href="' + link + '">' + textParts[0] + '</a>, ' +
|
||||
'<a href="' + link + textParts[1].replace('line ', '#L') + '">' +
|
||||
|
||||
@@ -20,10 +20,12 @@
|
||||
<br>
|
||||
<?js if (doc.stability || doc.kind == 'namespace') {
|
||||
var ancestors = doc.ancestors.map(a => a.replace(/>\./g, '>').replace(/\.</g, '<')).join('/');
|
||||
var name = doc.name.toLowerCase();
|
||||
var parts = [];
|
||||
if (ancestors) {
|
||||
parts.push(ancestors.split('~').shift());
|
||||
parts.push(ancestors);
|
||||
}
|
||||
parts.push(name);
|
||||
var importPath = parts.join('/');
|
||||
?>
|
||||
<pre class="prettyprint source"><code>import <?js= doc.name ?> from '<?js= importPath ?>';</code></pre>
|
||||
|
||||
@@ -11,7 +11,7 @@ var self = this;
|
||||
?>
|
||||
<li class="item" data-name="<?js= item.longname ?>">
|
||||
<span class="title">
|
||||
<?js= self.linkto(item.longname, item.longname.replace('module:', '')) ?>
|
||||
<?js= self.linkto(item.longname, item.longname) ?>
|
||||
<?js if (item.type === 'namespace' &&
|
||||
(item.members.length + item.typedefs.length + item.methods.length +
|
||||
item.events.length > 0)) { ?>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Settable</th>
|
||||
<th><a href="module-ol_Object-ObjectEvent.html">ol/Object~ObjectEvent</a> type</th>
|
||||
<th><a href="ol.Object.Event.html">ol.Object.Event</a> type</th>
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
// Rollup configuration for the full build
|
||||
|
||||
import noderesolve from 'rollup-plugin-node-resolve';
|
||||
import commonjs from 'rollup-plugin-commonjs';
|
||||
import {uglify} from 'rollup-plugin-uglify';
|
||||
import buble from 'rollup-plugin-buble';
|
||||
import sourcemaps from 'rollup-plugin-sourcemaps';
|
||||
|
||||
export default {
|
||||
input: 'src/index.js',
|
||||
output: [
|
||||
{file: 'build/ol.js', format: 'iife', sourcemap: true}
|
||||
],
|
||||
plugins: [
|
||||
noderesolve(),
|
||||
commonjs(),
|
||||
buble(),
|
||||
uglify(),
|
||||
sourcemaps()
|
||||
]
|
||||
};
|
||||
14
config/webpack.js
Normal file
14
config/webpack.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const webpack = require('webpack');
|
||||
const MinifyPlugin = require('babel-minify-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
entry: './src/index.js',
|
||||
output: {
|
||||
filename: 'build/ol.js'
|
||||
},
|
||||
devtool: 'source-map',
|
||||
plugins: [
|
||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||
new MinifyPlugin()
|
||||
]
|
||||
};
|
||||
251
css/ol.css
Normal file
251
css/ol.css
Normal file
@@ -0,0 +1,251 @@
|
||||
.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: text;
|
||||
-moz-user-select: text;
|
||||
-ms-user-select: text;
|
||||
user-select: text;
|
||||
}
|
||||
.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: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-uncollapsible img {
|
||||
margin-top: -.2em;
|
||||
max-height: 1.6em;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
37
doc/faq.md
37
doc/faq.md
@@ -21,6 +21,9 @@ Table of contents:
|
||||
* [Why aren't there any features in my source?](#why-aren-t-there-any-features-in-my-source-)
|
||||
* [How do I force a re-render of the map?](#how-do-i-force-a-re-render-of-the-map-)
|
||||
* [Why are my features not found?](#why-are-my-features-not-found-)
|
||||
* [How do I create a custom build of OpenLayers?](#how-do-i-create-a-custom-build-of-openlayers-)
|
||||
* [Do I need to write my own code using Closure library?](#do-i-need-to-write-my-own-code-using-closure-library-)
|
||||
* [Do I need to compress my code with Closure compiler?](#do-i-need-to-compress-my-code-with-closure-compiler-)
|
||||
|
||||
|
||||
## What projection is OpenLayers using?
|
||||
@@ -332,3 +335,37 @@ var vectorLayer = new ol.layer.Vector({
|
||||
```
|
||||
|
||||
The recommended value is the size of the largest symbol, line width or label.
|
||||
|
||||
## How do I create a custom build of OpenLayers?
|
||||
|
||||
Please refer to the [official create custom builds tutorial](tutorials/custom-builds.html)
|
||||
which explains how to create a custom build of OpenLayers with just those parts
|
||||
included that you want.
|
||||
|
||||
|
||||
## Do I need to write my own code using Closure library?
|
||||
|
||||
OpenLayers is built on top of the [Google Closure JavaScript
|
||||
library](https://developers.google.com/closure/library/), but this
|
||||
does not mean that you must use that library in your application code.
|
||||
|
||||
OpenLayers should play well with all sorts of JavaScript libraries out there,
|
||||
and you are in no way forced to use a specific one. Choose one that looks
|
||||
right for you.
|
||||
|
||||
|
||||
## Do I need to compress my code with Closure compiler?
|
||||
|
||||
No, you don't need to do compress your code with the [Google Closure
|
||||
compiler](https://developers.google.com/closure/compiler/).
|
||||
|
||||
It may be a good choice though, because when your application code and the
|
||||
OpenLayers source code is compiled together using closure compiler, the
|
||||
resulting build will most probably be the smallest in terms of byte-size. For
|
||||
more details refer to the
|
||||
[compile application and OpenLayers together tutorial](tutorials/closure.html).
|
||||
|
||||
If you don't want to use the closure compiler, or you can't, you are not at all
|
||||
forced to use it.
|
||||
|
||||
|
||||
|
||||
@@ -5,11 +5,6 @@ layout: doc.hbs
|
||||
|
||||
# Quick Start
|
||||
|
||||
This primer shows you how to put a simple map on a web page.
|
||||
|
||||
**For production, we strongly recommend bundling the application together with its dependencies, as explained in the [Building an OpenLayers Application](./tutorials/bundle.html) tutorial.**
|
||||
|
||||
|
||||
## Put a map on a page
|
||||
|
||||
Below you'll find a complete working example. Create a new file, copy in the contents below, and open in a browser:
|
||||
@@ -18,14 +13,14 @@ Below you'll find a complete working example. Create a new file, copy in the co
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/{{ latest }}/css/ol.css" type="text/css">
|
||||
<link rel="stylesheet" href="https://openlayers.org/en/{{ latest }}/css/ol.css" type="text/css">
|
||||
<style>
|
||||
.map {
|
||||
height: 400px;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/{{ latest }}/build/ol.js"></script>
|
||||
<script src="https://openlayers.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
|
||||
<title>OpenLayers example</title>
|
||||
</head>
|
||||
<body>
|
||||
@@ -60,7 +55,7 @@ To include a map a web page you will need 3 things:
|
||||
### Include OpenLayers
|
||||
|
||||
```xml
|
||||
<script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/{{ latest }}/build/ol.js"></script>
|
||||
<script src="https://openlayers.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
|
||||
```
|
||||
|
||||
The first part is to include the JavaScript library. For the purpose of this tutorial, here we simply point to the openlayers.org website to get the whole library. In a production environment, we would build a custom version of the library including only the module needed for our application.
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
---
|
||||
title: Introduction
|
||||
layout: doc.hbs
|
||||
---
|
||||
|
||||
# Introduction
|
||||
|
||||
## Objectives
|
||||
|
||||
OpenLayers is a modular, high-performance, feature-packed library for displaying and interacting with maps and geospatial data.
|
||||
|
||||
The library comes with built-in support for a wide range of commercial and free image and vector tile sources, and the most popular open and proprietary vector data formats. With OpenLayers's map projection support, data can be in any projection.
|
||||
|
||||
## Public API
|
||||
|
||||
OpenLayers is available as [`ol` npm package](https://npmjs.com/package/ol), which provides all modules of the officially supported [API](../../apidoc).
|
||||
|
||||
## Renderers and Browser Support
|
||||
|
||||
By default, OpenLayers uses a performance optimized Canvas renderer. An experimental WebGL renderer (without text rendering support) is also avaialble.
|
||||
|
||||
OpenLayers runs on all modern browsers that support [HTML5](https://html.spec.whatwg.org/multipage/) and [ECMAScript 5](http://www.ecma-international.org/ecma-262/5.1/). This includes Chrome, Firefox, Safari and Edge. For older browsers and platforms like Internet Explorer (down to version 9) and Android 4.x, [polyfills](http://polyfill.io), the application bundle needs to be transpiled (e.g. using [Babel](https://babeljs.io)) and bundled with polyfills for `requestAnimationFrame`, `Element.prototype.classList` and `URL`.
|
||||
|
||||
The library is intended for use on both desktop/laptop and mobile devices, and supports pointer and touch interactions.
|
||||
|
||||
## Module and Naming Conventions
|
||||
|
||||
OpenLayers modules with CamelCase names provide classes as default exports, and may contain additional constants or functions as named exports:
|
||||
|
||||
```js
|
||||
import Map from 'ol/Map';
|
||||
import View from 'ol/View';
|
||||
```
|
||||
|
||||
Class hierarchies grouped by their parent are provided in a subfolder of the package, e.g. `layer/`.
|
||||
|
||||
For convenience, these are also available as named exports, e.g.
|
||||
|
||||
```js
|
||||
import {Map, View} from `ol`;
|
||||
import {Tile, Vector} from `ol/layer`;
|
||||
```
|
||||
|
||||
In addition to these re-exported classes, modules with lowercase names also provide constants or functions as named exports:
|
||||
|
||||
```js
|
||||
import {inherits} from `ol`;
|
||||
import {fromLonLat} from `ol/proj`;
|
||||
```
|
||||
87
doc/tutorials/browserify.md
Normal file
87
doc/tutorials/browserify.md
Normal file
@@ -0,0 +1,87 @@
|
||||
---
|
||||
title: Basic project setup using NPM and Browserify
|
||||
layout: doc.hbs
|
||||
---
|
||||
|
||||
# Introduction
|
||||
|
||||
When going beyond modifying existing examples you might be looking for a way to setup your own code with dependency management together with external dependencies like OpenLayers.
|
||||
|
||||
This tutorial serves as a suggested project setup using NPM and Browserify for the most basic needs. There are several other options, and in particular you might be interested in a more modern one (ES2015) [using Webpack with OpenLayers](https://gist.github.com/tschaub/79025aef325cd2837364400a105405b8).
|
||||
|
||||
## Initial steps
|
||||
|
||||
Create a new empty directory for your project and navigate to it by running `mkdir new-project && cd new-project`. Initialize your project using `npm init` and answer the questions asked.
|
||||
|
||||
Add OpenLayers as dependency to your application with `npm install --save ol`.
|
||||
|
||||
At this point you can ask NPM to add required development dependencies by running
|
||||
```
|
||||
npm install --save-dev cssify browserify cssify http-server uglify-js watchify
|
||||
npm install --save-dev babelify babel-plugin-transform-es2015-modules-commonjs
|
||||
```
|
||||
We will be using `cssify` to include the css definitions required by OpenLayers in our bundle. `watchify`, `http-server` and `uglify-js` are used to monitor for changes and to build into a minified bundle. `babelify` and `babel-plugin-transform-es2015-modules-commonjs` are used to make the `ol` package, which was created using ES2015 modules, work with CommonJS.
|
||||
|
||||
## Application code and index.html
|
||||
|
||||
Place your application code in `index.js`. Here is a simple starting point:
|
||||
|
||||
```js
|
||||
require('ol/ol.css');
|
||||
var ol_Map = require('ol/map').default;
|
||||
var ol_layer_Tile = require('ol/layer/tile').default;
|
||||
var ol_source_OSM = require('ol/source/osm').default;
|
||||
var ol_View = require('ol/view').default;
|
||||
|
||||
var map = new ol_Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new ol_layer_Tile({
|
||||
source: new ol_source_OSM()
|
||||
})
|
||||
],
|
||||
view: new ol_View({
|
||||
center: [0, 0],
|
||||
zoom: 0
|
||||
})
|
||||
});
|
||||
```
|
||||
|
||||
You will also need an `ìndex.html` file that will use your bundle. Here is a simple example:
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Using Browserify with OpenLayers</title>
|
||||
<style>
|
||||
#map {
|
||||
width: 400px;
|
||||
height: 250px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<script src="bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
## Creating a bundle
|
||||
|
||||
With simple scripts you can introduce the commands `npm run build` and `npm start` to manually build your bundle and watch for changes, respectively. Add the following to the script section in `package.json`:
|
||||
|
||||
```json
|
||||
"scripts": {
|
||||
"start": "watchify index.js -g cssify --outfile bundle.js & http-server",
|
||||
"build": "browserify -g cssify index.js | uglifyjs --compress --output bundle.js"
|
||||
}
|
||||
```
|
||||
Now to test your application open http://localhost:8080/ in your browser. `watchify` will update `bundle.js` whenever you change something. You simply need to reload the page in your browser to see the changes.
|
||||
```
|
||||
$ npm start
|
||||
```
|
||||
|
||||
Note that `bundle.js` will contain your application code and all dependencies used in your application. From OpenLayers, it only contains the required components.
|
||||
@@ -1,93 +0,0 @@
|
||||
---
|
||||
title: Basic project setup using NPM and Parcel
|
||||
layout: doc.hbs
|
||||
---
|
||||
|
||||
# Introduction
|
||||
|
||||
Modern JavaScript works best when using and authoring modules. The recommended way of using OpenLayers is installing the [`ol`](https://npmjs.com/package/ol) package. This tutorial walks you through setting up a simple dev environment, which requires [node](https://nodejs.org) for everything to work.
|
||||
|
||||
In this tutorial, we will be using [Parcel](https://parceljs.org) to bundle our application. There are several other options, some of which are linked from the [README](https://npmjs.com/package/ol).
|
||||
|
||||
## Initial steps
|
||||
|
||||
Create a new empty directory for your project and navigate to it by running `mkdir new-project && cd new-project`. Initialize your project using `npm init` and answer the questions asked.
|
||||
|
||||
Add OpenLayers as dependency to your application with
|
||||
|
||||
npm install ol
|
||||
|
||||
At this point you can ask NPM to add required development dependencies by running
|
||||
|
||||
npm install --save-dev parcel-bundler
|
||||
|
||||
## Application code and index.html
|
||||
|
||||
Place your application code in `index.js`. Here is a simple starting point:
|
||||
|
||||
```js
|
||||
import 'ol/ol.css';
|
||||
import {Map, View} from 'ol';
|
||||
import TileLayer from 'ol/layer/Tile';
|
||||
import OSM from 'ol/source/OSM';
|
||||
|
||||
const map = new Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new TileLayer({
|
||||
source: new OSM()
|
||||
})
|
||||
],
|
||||
view: new View({
|
||||
center: [0, 0],
|
||||
zoom: 0
|
||||
})
|
||||
});
|
||||
```
|
||||
|
||||
You will also need an `ìndex.html` file that will use your bundle. Here is a simple example:
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Using Parcel with OpenLayers</title>
|
||||
<style>
|
||||
#map {
|
||||
width: 400px;
|
||||
height: 250px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<script src="./index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
## Creating a bundle
|
||||
|
||||
With simple scripts you can introduce the commands `npm run build` and `npm start` to manually build your bundle and watch for changes, respectively. Add the following to the script section in `package.json`:
|
||||
|
||||
```json
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "parcel index.html",
|
||||
"build": "parcel build --public-url . index.html"
|
||||
}
|
||||
```
|
||||
That's it. Now to run your application, enter
|
||||
|
||||
npm start
|
||||
|
||||
in your console. To test your application, open http://localhost:1234/ in your browser. Whenever you change something, the page will reload automatically to show the result of your changes.
|
||||
|
||||
Note that a single JavaScript file with all your application code and all dependencies used in your application has been created. From the OpenLayers package, it only contains the required components.
|
||||
|
||||
To create a production bundle of your application, simply type
|
||||
|
||||
npm run build
|
||||
|
||||
and copy the `dist/` folder to your production server.
|
||||
301
doc/tutorials/closure.md
Normal file
301
doc/tutorials/closure.md
Normal file
@@ -0,0 +1,301 @@
|
||||
---
|
||||
title: Compiling Application with Closure Compiler
|
||||
layout: doc.hbs
|
||||
---
|
||||
|
||||
# Compiling Application with Closure Compiler
|
||||
|
||||
**Note**: When building an application with dependencies that are available as [npm](https://npmjs.com/) packages, it will probably be easier to use the [ol](https://npmjs.com/package/ol) package and follow the instructions there.
|
||||
|
||||
The OpenLayers code uses the Closure Library, and it is compiled with the
|
||||
Closure Compiler. Using OpenLayers in an application does not require using
|
||||
Closure. But using Closure in an OpenLayers application is possible. And this
|
||||
is what this tutorial is about.
|
||||
|
||||
When you want to include OpenLayers as separate script without bundling with your application, follow the [Creating custom builds](./custom-builds.html) tutorial instead.
|
||||
|
||||
This tutorial will teach you how to set up an OpenLayers application based on
|
||||
the [`closure-util`](https://github.com/openlayers/closure-util) node package,
|
||||
which provides utilities for working with Closure. Using `closure-util` is one
|
||||
way to use Closure in a web application, but there are others. This tutorial
|
||||
just covers the "`closure-util`" way.
|
||||
|
||||
The `closure-util` documentation is available on the [`closure-util` readme
|
||||
page](https://github.com/openlayers/closure-util/blob/master/readme.md). You
|
||||
don't need to read the `closure-util` documentation to follow this tutorial,
|
||||
but it's available in `closure-util`'s [readme
|
||||
file](https://github.com/openlayers/closure-util/blob/master/readme.md) if you
|
||||
need it.
|
||||
|
||||
Also, the sample application built in this tutorial is
|
||||
[available](https://github.com/openlayers/openlayers-closure-application) on
|
||||
GitHub.
|
||||
|
||||
## Advantages of using Closure
|
||||
|
||||
This tutorial will show you how to use the Closure Compiler to compile an
|
||||
application and OpenLayers together. Compiling the application code together
|
||||
with the OpenLayers code has a number of advantages.
|
||||
|
||||
First of all, it allows you to only "pay" for the OpenLayers code your
|
||||
application uses, as the compiler will exclude the OpenLayers code that the
|
||||
application doesn't use. And there is no need to write and maintain a list of
|
||||
"exports", which is necessary when creating custom builds of OpenLayers.
|
||||
|
||||
Also, compiling the application and OpenLayers together allows using
|
||||
OpenLayers functions and objects that are not part of the official OpenLayers
|
||||
3 API. Using non-API functions and objects may be risky, but it is mitigated by
|
||||
the fact that the compiler will complain if you use functions or objects
|
||||
that are not in OpenLayers anymore.
|
||||
|
||||
## Setting up the Application
|
||||
|
||||
First, create a directory for the application. We will name that directory
|
||||
`openlayers-closure-application` in this tutorial.
|
||||
|
||||
$ mkdir openlayers-closure-application
|
||||
|
||||
Now change to that directory:
|
||||
|
||||
$ cd openlayers-closure-application
|
||||
|
||||
Our application will be a `node` application, and the `openlayers` and
|
||||
`closure-util` node packages will be downloaded from the node package registry
|
||||
using the `npm` command line tool.
|
||||
|
||||
So we're going to create a `package.json` file for the application, which every
|
||||
node application includes. This file basically includes metadata for the
|
||||
application.
|
||||
|
||||
Create the application's `package.json` file:
|
||||
|
||||
$ npm init
|
||||
|
||||
You can pretty much use the default answers to the questions `npm init` asks
|
||||
you.
|
||||
|
||||
Now install OpenLayers using:
|
||||
|
||||
$ npm install openlayers --save
|
||||
|
||||
The `--save` flag persists the `openlayers` dependency in the application's
|
||||
`package.json` file. You can edit `package.json` to verify that the dependency
|
||||
was added.
|
||||
|
||||
`closure-util` is a dependency of the `openlayers` package, so it should have
|
||||
been installed with `openlayers`. Use the following to verify that
|
||||
`closure-util` is installed:
|
||||
|
||||
$ ./node_modules/openlayers/node_modules/.bin/closure-util
|
||||
|
||||
command argument is required
|
||||
|
||||
Usage: node closure-util <command> [options]
|
||||
|
||||
command
|
||||
update-compiler Update the Compiler
|
||||
update-library Update the Library
|
||||
update Update both the Library and the Compiler
|
||||
build Build with Closure Compiler
|
||||
serve Start the development server
|
||||
|
||||
Options:
|
||||
-l LEVEL, --loglevel LEVEL Log level [info]
|
||||
|
||||
|
||||
## Create an OpenLayers map
|
||||
|
||||
You're now going to create a JavaScript file that creates an OpenLayers map.
|
||||
This is the file that we will define the application's entry point.
|
||||
|
||||
First of all create an `src` directory at the root of the application:
|
||||
|
||||
$ mkdir src
|
||||
|
||||
Now add a file `main.js` to `src`, with the following content:
|
||||
|
||||
```js
|
||||
goog.provide('app');
|
||||
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.PluggableMap}
|
||||
*/
|
||||
app.map = new ol.Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 4
|
||||
})
|
||||
});
|
||||
```
|
||||
|
||||
`goog.provide('app')` creates the namespace `app` for the application. The
|
||||
`goog.require` statements that follow define the OpenLayers constructors and
|
||||
namespaces that the application uses. The rest of the code just creates the
|
||||
OpenLayers map as you would do in any OpenLayers application.
|
||||
|
||||
## Compiling the Application
|
||||
|
||||
We're now going to compile the application and OpenLayers together, using the
|
||||
Closure Compiler and `closure-util`. For this we need to create a JSON config
|
||||
file, that we will then pass as an input file to the `closure-util` command.
|
||||
|
||||
The minimum config file looks like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"lib": [
|
||||
"node_modules/openlayers/src/**/*.js",
|
||||
"node_modules/openlayers/build/ol.ext/**/*.js",
|
||||
"src/**/*.js"
|
||||
],
|
||||
"compile": {
|
||||
"closure_entry_point": "app",
|
||||
"externs": [
|
||||
"node_modules/openlayers/externs/bingmaps.js",
|
||||
"node_modules/openlayers/externs/cartodb.js",
|
||||
"node_modules/openlayers/externs/closure-compiler.js",
|
||||
"node_modules/openlayers/externs/esrijson.js",
|
||||
"node_modules/openlayers/externs/geojson.js",
|
||||
"node_modules/openlayers/externs/proj4js.js",
|
||||
"node_modules/openlayers/externs/tilejson.js",
|
||||
"node_modules/openlayers/externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"ol.ENABLE_WEBGL=false"
|
||||
],
|
||||
"js": [
|
||||
"node_modules/openlayers/externs/oli.js"
|
||||
],
|
||||
"extra_annotation_name": [
|
||||
"api", "observable"
|
||||
],
|
||||
"rewrite_polyfills": "false",
|
||||
"compilation_level": "ADVANCED",
|
||||
"warning_level": "VERBOSE",
|
||||
"output_wrapper": "(function(){%output%})();",
|
||||
"use_types_for_optimization": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Create a `config.json` file with the above content at the root of the
|
||||
application directory.
|
||||
|
||||
We can now use `closure-util` to compile the code:
|
||||
|
||||
$ ./node_modules/openlayers/node_modules/.bin/closure-util build config.json app.js
|
||||
|
||||
The resulting `app.js` file, which you can view in your editor if you're
|
||||
curious, includes a minified version of the application code (`main.js`), and
|
||||
the OpenLayers code that the application code uses.
|
||||
|
||||
Here is a version of `config.json` with more compilation checks enabled:
|
||||
|
||||
```json
|
||||
{
|
||||
"lib": [
|
||||
"node_modules/openlayers/src/**/*.js",
|
||||
"node_modules/openlayers/build/ol.ext/**/*.js",
|
||||
"src/**/*.js"
|
||||
],
|
||||
"compile": {
|
||||
"closure_entry_point": "app",
|
||||
"externs": [
|
||||
"node_modules/openlayers/externs/bingmaps.js",
|
||||
"node_modules/openlayers/externs/cartodb.js",
|
||||
"node_modules/openlayers/externs/closure-compiler.js",
|
||||
"node_modules/openlayers/externs/esrijson.js",
|
||||
"node_modules/openlayers/externs/geojson.js",
|
||||
"node_modules/openlayers/externs/proj4js.js",
|
||||
"node_modules/openlayers/externs/tilejson.js",
|
||||
"node_modules/openlayers/externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"ol.ENABLE_WEBGL=false"
|
||||
],
|
||||
"js": [
|
||||
"node_modules/openlayers/externs/oli.js"
|
||||
],
|
||||
"jscomp_error": [
|
||||
"*"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"unknownDefines",
|
||||
"lintChecks",
|
||||
"analyzerChecks"
|
||||
],
|
||||
"extra_annotation_name": [
|
||||
"api", "observable"
|
||||
],
|
||||
"compilation_level": "ADVANCED",
|
||||
"warning_level": "VERBOSE",
|
||||
"output_wrapper": "(function(){%output%})();",
|
||||
"use_types_for_optimization": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Create an HTML file for the Application
|
||||
|
||||
You can now go ahead and create a simple HTML for the application. Create
|
||||
a `index.html` file with the following content at the root the application
|
||||
directory:
|
||||
|
||||
```html
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||
<link rel="stylesheet" href="node_modules/openlayers/css/ol.css" type="text/css">
|
||||
<title>Simple example</title>
|
||||
<style>
|
||||
#map {
|
||||
width: 600px;
|
||||
height: 400px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<script src="app.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
Note that the page includes a `script` tag referencing the `app.js` file,
|
||||
which is the file resulting from the compilation.
|
||||
|
||||
You are done!
|
||||
|
||||
## Run Application in Debug Mode
|
||||
|
||||
As a bonus, we're going to show how to use `closure-util` to run the
|
||||
application in "debug" mode, where the original application and OpenLayers
|
||||
scripts are loaded one by one in the page.
|
||||
|
||||
Start the `closure-util` development server:
|
||||
|
||||
$ ./node_modules/openlayers/node_modules/.bin/closure-util serve config.json
|
||||
|
||||
Now change the `script` tag to the following in the `index.html` file:
|
||||
|
||||
```html
|
||||
<script src="@?main=src/main.js" type="text/javascript"></script>
|
||||
```
|
||||
|
||||
Reload the page in your browser and you should see that scripts are now loaded
|
||||
individually, making debugging much easier.
|
||||
@@ -6,58 +6,48 @@ layout: doc.hbs
|
||||
# Basic Concepts
|
||||
|
||||
## Map
|
||||
The core component of OpenLayers is the map (`Map`). It is rendered to a `target` container (e.g. a `div` element on the web page that contains the map). All map properties can either be configured at construction time, or by using setter methods, e.g. `setTarget()`.
|
||||
The core component of OpenLayers is the map (`ol.Map`). It is rendered to a `target` container (e.g. a `div` element on the web page that contains the map). All map properties can either be configured at construction time, or by using setter methods, e.g. `setTarget()`.
|
||||
|
||||
```xml
|
||||
<div id="map" style="width: 100%, height: 400px"></div>
|
||||
<script>
|
||||
import Map from 'ol/Map';
|
||||
|
||||
var map = new Map({target: 'map'});
|
||||
var map = new ol.Map({target: 'map'});
|
||||
</script>
|
||||
```
|
||||
|
||||
## View
|
||||
`Map` is not responsible for things like center, zoom level and projection of the map. Instead, these are properties of a `View` instance.
|
||||
`ol.Map` is not responsible for things like center, zoom level and projection of the map. Instead, these are properties of an `ol.View` instance.
|
||||
|
||||
```js
|
||||
import View from 'ol/View';
|
||||
|
||||
map.setView(new View({
|
||||
map.setView(new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
}));
|
||||
```
|
||||
|
||||
A `View` also has a `projection`. The projection determines the coordinate system of the `center` and the units for map resolution calculations. If not specified (like in the above snippet), the default projection is Spherical Mercator (EPSG:3857), with meters as map units.
|
||||
An `ol.View` also has a `projection`. The projection determines the coordinate system of the `center` and the units for map resolution calculations. If not specified (like in the above snippet), the default projection is Spherical Mercator (EPSG:3857), with meters as map units.
|
||||
|
||||
The `zoom` option is a convenient way to specify the map resolution. The available zoom levels are determined by `maxZoom` (default: 28), `zoomFactor` (default: 2) and `maxResolution` (default is calculated in such a way that the projection's validity extent fits in a 256x256 pixel tile). Starting at zoom level 0 with a resolution of `maxResolution` units per pixel, subsequent zoom levels are calculated by dividing the previous zoom level's resolution by `zoomFactor`, until zoom level `maxZoom` is reached.
|
||||
|
||||
|
||||
## Source
|
||||
To get remote data for a layer, OpenLayers uses `source/Source` subclasses. These are available for free and commercial map tile services like OpenStreetMap or Bing, for OGC sources like WMS or WMTS, and for vector data in formats like GeoJSON or KML.
|
||||
To get remote data for a layer, OpenLayers uses `ol.source.Source` subclasses. These are available for free and commercial map tile services like OpenStreetMap or Bing, for OGC sources like WMS or WMTS, and for vector data in formats like GeoJSON or KML.
|
||||
|
||||
```js
|
||||
import OSM from 'ol/source/OSM';
|
||||
|
||||
var osmSource = OSM();
|
||||
var osmSource = new ol.source.OSM();
|
||||
```
|
||||
|
||||
## Layer
|
||||
A layer is a visual representation of data from a `source`. OpenLayers has four basic types of layers: `layer/Tile`, `layer/Image`, `layer/Vector` and `layer/VectorTile`.
|
||||
A layer is a visual representation of data from a `source`. OpenLayers has three basic types of layers: `ol.layer.Tile`, `ol.layer.Image` and `ol.layer.Vector`.
|
||||
|
||||
`layer/Tile` is for layer sources that provide pre-rendered, tiled images in grids that are organized by zoom levels for specific resolutions.
|
||||
`ol.layer.Tile` is for layer sources that provide pre-rendered, tiled images in grids that are organized by zoom levels for specific resolutions.
|
||||
|
||||
`layer/Image` is for server rendered images that are available for arbitrary extents and resolutions.
|
||||
`ol.layer.Image` is for server rendered images that are available for arbitrary extents and resolutions.
|
||||
|
||||
`layer/Vector` is for vector data that is rendered client-side.
|
||||
|
||||
`layer/VectorTile` is for tiled vector data that is rendered client-side.
|
||||
`ol.layer.Vector` is for vector data that is rendered client-side.
|
||||
|
||||
```js
|
||||
import TileLayer from 'ol/layer/Tile';
|
||||
|
||||
var osmLayer = new TileLayer({source: osmSource});
|
||||
var osmLayer = new ol.layer.Tile({source: osmSource});
|
||||
map.addLayer(osmLayer);
|
||||
```
|
||||
|
||||
@@ -69,16 +59,11 @@ The above snippets can be conflated to a self contained map configuration with v
|
||||
```xml
|
||||
<div id="map" style="width: 100%, height: 400px"></div>
|
||||
<script>
|
||||
import Map from 'ol/Map';
|
||||
import View from 'ol/View';
|
||||
import OSM from 'ol/source/OSM';
|
||||
import TileLayer from 'ol/source/Tile';
|
||||
|
||||
new Map({
|
||||
new ol.Map({
|
||||
layers: [
|
||||
new TileLayer({source: new ol.source.OSM()})
|
||||
new ol.layer.Tile({source: new ol.source.OSM()})
|
||||
],
|
||||
view: new View({
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
}),
|
||||
|
||||
233
doc/tutorials/custom-builds.md
Normal file
233
doc/tutorials/custom-builds.md
Normal file
@@ -0,0 +1,233 @@
|
||||
---
|
||||
title: Custom builds
|
||||
layout: doc.hbs
|
||||
---
|
||||
|
||||
# Creating custom builds
|
||||
|
||||
OpenLayers is a big library providing a lot of functionality. So it is unlikely that an application will need and use all the functionality OpenLayers provides. This is why creating application-specific OpenLayers builds, with just the functionality your application needs, is often a good idea.
|
||||
|
||||
An alternative to creating custom builds is to compile your application code together with OpenLayers. See the [Compiling Application with Closure Compiler](closure.html) tutorial for more information.
|
||||
|
||||
This particular tutorial explains how to create custom builds of OpenLayers.
|
||||
|
||||
## Requirements
|
||||
|
||||
OpenLayers's build tools use Node and Java, so you need to have Node and Java installed on your machine. You can run `node --version` and `java -version` to test that Node and Java are installed, respectively. See [developing guide](https://github.com/openlayers/openlayers/blob/master/DEVELOPING.md) for minimum version numbers required.
|
||||
|
||||
## Download OpenLayers
|
||||
|
||||
Obviously, creating a custom build requires the OpenLayers source and specific build scripts.
|
||||
|
||||
To get the OpenLayers source and the build scripts you can clone the openlayers [repository](https://github.com/openlayers/openlayers), or you can download one of the release archives. You can also download the `openlayers` Node package from the Node package registry, using NPM (the Node Package Manager). This is the method we are going to use in this tutorial.
|
||||
|
||||
Create a directory:
|
||||
|
||||
$ mkdir openlayers
|
||||
|
||||
Download the OpenLayers distribution using NPM:
|
||||
|
||||
$ npm install openlayers
|
||||
|
||||
This will download the latest stable version of OpenLayers, and install it under `node_modules`. You can list the content of `node_modules` to verify that it effectively contains a directory named "openlayers".
|
||||
|
||||
The Node packages onto which the `openlayers` package depends are installed under `node_modules/openlayers/node_modules`. That directory should, for example, include `closure-util`, which is the utility library OpenLayers uses for Closure.
|
||||
|
||||
You should now have everything you need to create custom builds of OpenLayers!
|
||||
|
||||
## Create a build configuration file
|
||||
|
||||
Creating a custom build requires writing a build configuration file. The format of build configuration files is JSON. Here is a simple example of a build configuration file:
|
||||
|
||||
```json
|
||||
{
|
||||
"exports": [
|
||||
"ol.Map",
|
||||
"ol.View",
|
||||
"ol.control.defaults",
|
||||
"ol.layer.Tile",
|
||||
"ol.source.OSM"
|
||||
],
|
||||
"compile": {
|
||||
"externs": [
|
||||
"externs/bingmaps.js",
|
||||
"externs/cartodb.js",
|
||||
"externs/closure-compiler.js",
|
||||
"externs/esrijson.js",
|
||||
"externs/geojson.js",
|
||||
"externs/oli.js",
|
||||
"externs/proj4js.js",
|
||||
"externs/tilejson.js",
|
||||
"externs/topojson.js"
|
||||
],
|
||||
"extra_annotation_name": [
|
||||
"api", "observable"
|
||||
],
|
||||
"compilation_level": "ADVANCED",
|
||||
"manage_closure_dependencies": true,
|
||||
"rewrite_polyfills": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Create a file named `ol-custom.json` with that content, and save it under the `node_modules/openlayers/build` directory. (You can save it to any location really.)
|
||||
|
||||
The most relevant part of this configuration object is the `"exports"` array. This array declares the functions/constructors you use in your JavaScript code. For example, the above configuration file is what you'd use for the following JavaScript code:
|
||||
|
||||
```js
|
||||
var map = new ol.Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
controls: ol.control.defaults({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 4
|
||||
})
|
||||
});
|
||||
```
|
||||
|
||||
Note that this JavaScript code corresponds to OpenLayers's [`simple`](https://openlayers.org/en/master/examples/simple.html) example.
|
||||
|
||||
You are now ready to create your first OpenLayers build. Use the following command to create the build:
|
||||
|
||||
$ cd node_modules/openlayers
|
||||
$ node tasks/build.js build/ol-custom.json build/ol-custom.js
|
||||
|
||||
The build command may take some time, but it should end with an output in the console such as the following:
|
||||
|
||||
info ol Parsing dependencies
|
||||
info ol Compiling 364 sources
|
||||
|
||||
The build command should have created an `ol-custom.js` file in the `node_modules/openlayers/build` directory. You can verify that the file was created. You can even open it in your editor if you're curious.
|
||||
|
||||
As a test, you can use the following HTML file to verify that your custom build works as expected:
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>OpenLayers example</title>
|
||||
<link rel="stylesheet" href="node_modules/openlayers/css/ol.css" />
|
||||
<style>
|
||||
#map {
|
||||
width: 600px;
|
||||
height: 400px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<script src="node_modules/openlayers/build/ol-custom.js"></script>
|
||||
<script>
|
||||
var map = new ol.Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 4
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
## More on the config file
|
||||
|
||||
### `define`'s
|
||||
|
||||
Closure allows you to define constants that can be set at compile time. The OpenLayers code defines several such values.
|
||||
|
||||
Setting some of these to `false` means that the portions of the code relating to this setting become "dead", i.e. are never executed. As Closure Compiler's `ADVANCED` mode removes dead code, this makes the size of the advanced compiled file smaller.
|
||||
|
||||
You might have noticed that the build file you've just created is considerably smaller than the full build, but it can be reduced further. This is because both renderers and other optional code are included by default. We only need one renderer, and we do not use the optional code, so can exclude what we don't use by setting properties with `define`s. So add a define section to the config above:
|
||||
```
|
||||
"define": [
|
||||
"ol.ENABLE_WEBGL=false",
|
||||
"ol.ENABLE_PROJ4JS=false",
|
||||
"ol.ENABLE_RASTER_REPROJECTION=false"
|
||||
],
|
||||
```
|
||||
|
||||
and re-run the build script. The build size should now be smaller.
|
||||
|
||||
### Externs
|
||||
|
||||
The Closure documentation explains that "externs" are for external names used in the code being compiled. The compiler includes externs for built-ins such as `document`. The `externs` directory of the OpenLayers code includes files for all those used in some part of the library. For example, if you use Bing Maps, you should include the Bing externs file in the `externs` section of the config file.
|
||||
|
||||
### Other compiler options
|
||||
|
||||
There are a couple of other compiler options in the config file above. `manage_closure_dependencies` and `rewrite_polyfills` should always be used.
|
||||
|
||||
You can specify any of the other compiler options here as needed, such as the renaming reports, output manifest, or source maps. There is a full list of available options in [closure-util](https://github.com/openlayers/closure-util/blob/master/compiler-options.txt).
|
||||
|
||||
Note that `build.js` currently requires you to enter an output file and will write the output from the compiler to it; it does not use the `js_output_file` compiler option. If you specify this in the config file, there will be no compiler output, so `build.js`'s output file will be empty.
|
||||
|
||||
## A more complicated example
|
||||
|
||||
Now let's try a more complicated example: [`heatmaps-earthquakes`](https://openlayers.org/en/master/examples/heatmap-earthquakes.html). The build configuration file looks like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"exports": [
|
||||
"ol.layer.Heatmap",
|
||||
"ol.source.Vector",
|
||||
"ol.format.KML",
|
||||
"ol.layer.Heatmap#getSource",
|
||||
"ol.source.Vector#on",
|
||||
"ol.source.Vector.Event#feature",
|
||||
"ol.Feature#get",
|
||||
"ol.Feature#set",
|
||||
"ol.layer.Tile",
|
||||
"ol.source.Stamen",
|
||||
"ol.Map",
|
||||
"ol.View",
|
||||
"ol.layer.Heatmap#setRadius",
|
||||
"ol.layer.Heatmap#setBlur"
|
||||
],
|
||||
"compile": {
|
||||
"externs": [
|
||||
"externs/bingmaps.js",
|
||||
"externs/cartodb.js",
|
||||
"externs/closure-compiler.js",
|
||||
"externs/esrijson.js",
|
||||
"externs/geojson.js",
|
||||
"externs/oli.js",
|
||||
"externs/proj4js.js",
|
||||
"externs/tilejson.js",
|
||||
"externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"ol.ENABLE_WEBGL=false",
|
||||
"ol.ENABLE_PROJ4JS=false",
|
||||
"ol.ENABLE_RASTER_REPROJECTION=false"
|
||||
],
|
||||
"compilation_level": "ADVANCED",
|
||||
"manage_closure_dependencies": true,
|
||||
"rewrite_polyfills": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The exports are given here in the order in which they occur in the `heatmaps-earthquakes` example's JavaScript code. In this example we not only use the `ol.` functions and constructors, but also `prototype` methods where the `ol` namespace is not directly used. In the code, we have for example `vector.getSource().on()`. This means we are using the `getSource` method of `layer.Heatmap` and the `on` method of `source.KML`, so this is what has to be exported. Similarly, `event.feature.get()` means we are using the `feature` property of `source.Vector.Event` and the `get` method of `Feature`. If any of these names are left out, the compile will complete successfully, but the missing names will be obfuscated and you will get a 'property undefined' error when you try and run the script.
|
||||
|
||||
## Maintaining the code
|
||||
|
||||
If you installed OpenLayers from the Node package, you can use `npm` to upgrade to the latest version. If you cloned the Github repo, simply pulling in the latest code may not be enough, as some of the packages used, for example, the compiler, may need upgrading too. Do this by using `npm install` rather than `npm update`.
|
||||
|
||||
## Conclusion
|
||||
|
||||
This tutorial should have given you the information you need to create custom builds, i.e. builds tailored to your application. See the [tasks readme](https://github.com/openlayers/openlayers/tree/master/tasks/readme.md) for more information on the build scripts and the properties you can use in the build configuration file.
|
||||
@@ -5,7 +5,9 @@ layout: doc.hbs
|
||||
|
||||
# Tutorials
|
||||
|
||||
* [Building an OpenLayers Application](bundle.html)
|
||||
* [Introduction to OpenLayers](introduction.html)
|
||||
* [Basic Concepts](concepts.html)
|
||||
* [Some Background on OpenLayers](background.html)
|
||||
* [Create Custom Builds](custom-builds.html)
|
||||
* [Bundle Application and OpenLayers using Browserify](browserify.html)
|
||||
* [Compile Application and OpenLayers together](closure.html)
|
||||
* [Raster Reprojection](raster-reprojection.html)
|
||||
|
||||
42
doc/tutorials/introduction.md
Normal file
42
doc/tutorials/introduction.md
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
title: Introduction
|
||||
layout: doc.hbs
|
||||
---
|
||||
|
||||
# Introduction
|
||||
|
||||
## Objectives
|
||||
With version 3, the OpenLayers web mapping library was fundamentally redesigned. The widely used version 2 dates from the early days of Javascript development, and was increasingly showing its age. So it has been rewritten from the ground up to use modern design patterns.
|
||||
|
||||
The initial release aims to support much of the functionality provided by version 2, with support for a wide range of commercial and free tile sources, and the most popular open-source vector data formats. As with version 2, data can be in any projection. The initial release also adds some additional functionality, such as the ability to easily rotate or animate maps.
|
||||
|
||||
It is also designed such that major new features, such as displaying 3D maps, or using WebGL to quickly display large vector data sets, can be added in later releases.
|
||||
|
||||
## Google Closure
|
||||
OpenLayers was written in a way so it can be compiled with [__Closure Compiler__](https://developers.google.com/closure/compiler/). Its 'advanced' compilation mode offers a level of compression that exceeds anything else available.
|
||||
|
||||
## Public API
|
||||
Using the advanced optimizations of the Closure Compiler means that properties and methods are renamed – `longMeaningfulName` might become `xB` – and so are effectively unusable in applications using the library. To be usable, they have to be explicitly `exported`. This means the exported names, those not renamed, effectively become the public API of the library. These __exportable__ properties and methods are marked in the source, and documented in the [API docs](../../apidoc). This is the officially supported API of the library. A build containing all these exportable names is known as a __full build__. A hosted version of this is available, which can be used by any application.
|
||||
|
||||
## Custom Builds
|
||||
Unlike in, say, Node, where a module's exports are fixed in the source, with Closure Compiler, exports can be defined at compile time. This makes it easy to create builds that are customized to the needs of a particular site or application: a __custom build__ only exports those properties and methods needed by the site or application. As the full build is large, and will probably become larger as new features are added to the API, it's recommended that sites create a custom build for production software.
|
||||
|
||||
## Renderers and Browser Support
|
||||
The library currently includes two renderers: Canvas and WebGL. Both of them support both raster data from tile/image servers, and vector data; WebGL however does not support labels. Clearly only those browsers that [support Canvas](http://caniuse.com/canvas) can use the Canvas renderer. Equally, the WebGL renderer can only be used on those devices and [browsers](http://caniuse.com/webgl) that support WebGL.
|
||||
|
||||
OpenLayers runs on all modern browsers that support [HTML5](https://html.spec.whatwg.org/multipage/) and [ECMAScript 5](http://www.ecma-international.org/ecma-262/5.1/). This includes Chrome, Firefox, Safari and Edge. For older browsers and platforms like Internet Explorer (down to version 9) and Android 4.x, [polyfills](http://polyfill.io) for `requestAnimationFrame` and `Element.prototype.classList` are required, and using the KML format requires a polyfill for `URL`.
|
||||
|
||||
The library is intended for use on both desktop/laptop and mobile devices.
|
||||
|
||||
## Objects and Naming Conventions
|
||||
The top-level namespace is `ol` (basically, `var ol = {};`). Subdivisions of this are:
|
||||
|
||||
* further namespaces, such as `ol.layer`; these have a lower-case initial
|
||||
* simple objects containing static properties and methods, such as `ol.easing`; these also have a lower-case initial
|
||||
* types, which have an upper-case initial. These are mainly 'classes', which here means a constructor function with prototypal inheritance, such as `ol.Map` or `ol.layer.Vector` (the Vector class within the layer namespace). There are however other, simpler, types, such as `ol.Extent`, which is an array.
|
||||
|
||||
Class namespaces, such as `ol.layer` have a base class type with the same name, such as `ol.layer.Layer`. These are mainly abstract classes, from which the other subclasses inherit.
|
||||
|
||||
Source files are similarly organised, with a directory for each class namespace. Names are however all lower-case, for example, `ol/layer/vector.js`.
|
||||
|
||||
OpenLayers follows the convention that the names of private properties and methods, that is, those that are not part of the API, end in an underscore. In general, instance properties are private and accessed using accessors.
|
||||
@@ -10,22 +10,18 @@ Transformation of the map projections of the image happens directly in a web bro
|
||||
The view in any Proj4js supported coordinate reference system is possible and previously incompatible layers can now be combined and overlaid.
|
||||
|
||||
# Usage
|
||||
The API usage is very simple. Just specify proper projection (e.g. using [EPSG](https://epsg.io) code) on `ol/View`:
|
||||
```js
|
||||
import {Map, View} from `ol`;
|
||||
import TileLayer from `ol/layer/Tile`;
|
||||
import TileWMS from `ol/source/TileWMS`;
|
||||
|
||||
var map = new Map({
|
||||
The API usage is very simple. Just specify proper projection (using [EPSG](https://epsg.io) code) on `ol.View`:
|
||||
``` javascript
|
||||
var map = new ol.Map({
|
||||
target: 'map',
|
||||
view: new View({
|
||||
view: new ol.View({
|
||||
projection: 'EPSG:3857', //HERE IS THE VIEW PROJECTION
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
}),
|
||||
layers: [
|
||||
new TileLayer({
|
||||
source: new TileWMS({
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.TileWMS({
|
||||
projection: 'EPSG:4326', //HERE IS THE DATA SOURCE PROJECTION
|
||||
url: 'http://demo.boundlessgeo.com/geoserver/wms',
|
||||
params: {
|
||||
@@ -36,7 +32,7 @@ var map = new Map({
|
||||
]
|
||||
});
|
||||
```
|
||||
If a source (based on `ol/source/TileImage` or `ol/source/Image`) has a projection different from the current `ol/View`’s projection then the reprojection happens automatically under the hood.
|
||||
If a source (based on `ol.source.TileImage` or `ol.source.Image`) has a projection different from the current `ol.View`’s projection then the reprojection happens automatically under the hood.
|
||||
|
||||
### Examples
|
||||
- [Raster reprojection demo](https://openlayers.org/en/master/examples/reprojection.html)
|
||||
@@ -45,29 +41,26 @@ If a source (based on `ol/source/TileImage` or `ol/source/Image`) has a projecti
|
||||
- [Image reprojection](https://openlayers.org/en/master/examples/reprojection-image.html)
|
||||
|
||||
### Custom projection
|
||||
The easiest way to use a custom projection is to add the [Proj4js](http://proj4js.org/) library to your project and then define the projection using a proj4 definition string. It can be installed with
|
||||
|
||||
npm install proj4
|
||||
|
||||
The easiest way to use a custom projection is to add the [Proj4js](http://proj4js.org/) library to your project and then define the projection using a proj4 definition string.
|
||||
Following example shows definition of a [British National Grid](https://epsg.io/27700):
|
||||
|
||||
```js
|
||||
import proj4 from 'proj4';
|
||||
import {get as getProjection, register} from 'ol/proj';
|
||||
``` html
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.4.4/proj4.js"></script>
|
||||
```
|
||||
|
||||
``` javascript
|
||||
proj4.defs('EPSG:27700', '+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 ' +
|
||||
'+x_0=400000 +y_0=-100000 +ellps=airy ' +
|
||||
'+towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 ' +
|
||||
'+units=m +no_defs');
|
||||
register(proj4);
|
||||
var proj27700 = getProjection('EPSG:27700');
|
||||
var proj27700 = ol.proj.get('EPSG:27700');
|
||||
proj27700.setExtent([0, 0, 700000, 1300000]);
|
||||
```
|
||||
|
||||
### Change of the view projection
|
||||
To switch the projection used to display the map you have to set a new `ol/View` with selected projection on the `ol/Map`:
|
||||
To switch the projection used to display the map you have to set a new `ol.View` with selected projection on the `ol.Map`:
|
||||
``` javascript
|
||||
map.setView(new View({
|
||||
map.setView(new ol.View({
|
||||
projection: 'EPSG:27700',
|
||||
center: [400000, 650000],
|
||||
zoom: 4
|
||||
@@ -76,16 +69,16 @@ map.setView(new View({
|
||||
|
||||
## TileGrid and Extents
|
||||
When reprojection is needed, new tiles (in the target projection) are under the hood created from the original source tiles.
|
||||
The TileGrid of the reprojected tiles is by default internally constructed using `ol/tilegrid~getForProjection(projection)`.
|
||||
The TileGrid of the reprojected tiles is by default internally constructed using `ol.tilegrid.getForProjection(projection)`.
|
||||
The projection should have extent defined (see above) for this to work properly.
|
||||
|
||||
Alternatively, a custom target TileGrid can be constructed manually and set on the source instance using `ol/source/TileImage~setTileGridForProjection(projection, tilegrid)`.
|
||||
Alternatively, a custom target TileGrid can be constructed manually and set on the source instance using `ol.source.TileImage#setTileGridForProjection(projection, tilegrid)`.
|
||||
This TileGrid will then be used when reprojecting to the specified projection instead of creating the default one.
|
||||
In certain cases, this can be used to optimize performance (by tweaking tile sizes) or visual quality (by specifying resolutions).
|
||||
|
||||
# How it works
|
||||
|
||||
The reprojection process is based on triangles -- the target raster is divided into a limited number of triangles with vertices transformed using `ol/proj` capabilities ([proj4js](http://proj4js.org/) is usually utilized to define custom transformations).
|
||||
The reprojection process is based on triangles -- the target raster is divided into a limited number of triangles with vertices transformed using `ol.proj` capabilities ([proj4js](http://proj4js.org/) is usually utilized to define custom transformations).
|
||||
The reprojection of pixels inside the triangle is approximated with an affine transformation (with rendering hardware-accelerated by the canvas 2d context):
|
||||
|
||||
<img src="raster-reprojection-resources/how-it-works.jpg" alt="How it works" width="600" />
|
||||
@@ -109,6 +102,10 @@ For debugging, rendering of the reprojection edges can be enabled by `ol.source.
|
||||
|
||||
# Advanced
|
||||
|
||||
### Disabling reprojection
|
||||
In case you are creating a custom build of OpenLayers and do not need the reprojection code, you can reduce the build size by setting `ol.ENABLE_RASTER_REPROJECTION` to `false`, which completely disables the reprojection support.
|
||||
See [Custom builds](custom-builds.html#defines) tutorial on how to do this.
|
||||
|
||||
### Triangulation precision threshold
|
||||
The default [triangulation error threshold](#dynamic-triangulation) in pixels is given by `ERROR_THRESHOLD` (0.5 pixel).
|
||||
In case a different threshold needs to be defined for different sources, the `reprojectionErrorThreshold` option can be passed when constructing the tile image source.
|
||||
@@ -129,7 +126,7 @@ Setting such a limit is demonstrated in the [reprojection demo example](https://
|
||||
|
||||
### Resolution calculation
|
||||
When determining source tiles to load, the ideal source resolution needs to be calculated.
|
||||
The `ol/reproj~calculateSourceResolution(sourceProj, targetProj, targetCenter, targetResolution)` function calculates the ideal value in order to achieve pixel mapping as close as possible to 1:1 during reprojection, which is then used to select proper zoom level from the source.
|
||||
The `ol.reproj.calculateSourceResolution(sourceProj, targetProj, targetCenter, targetResolution)` function calculates the ideal value in order to achieve pixel mapping as close as possible to 1:1 during reprojection, which is then used to select proper zoom level from the source.
|
||||
|
||||
It is, however, generally not practical to use the same source zoom level for the whole target zoom level -- different projections can have significantly different resolutions in different parts of the world (e.g. polar regions in EPSG:3857 vs EPSG:4326) and enforcing a single resolution for the whole zoom level would result in some tiles being scaled up/down, possibly requiring a huge number of source tiles to be loaded.
|
||||
Therefore, the resolution mapping is calculated separately for each reprojected tile (in the middle of the tile extent).
|
||||
|
||||
@@ -3,11 +3,10 @@ layout: example.html
|
||||
title: Styling feature with CanvasGradient or CanvasPattern
|
||||
shortdesc: Example showing the countries vector layer styled with patterns and gradients.
|
||||
docs: >
|
||||
This example creates a [`CanvasPattern`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern)
|
||||
First this example creates a reusable [`CanvasPattern`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern)
|
||||
and a [`CanvasGradient`](https://developer.mozilla.org/en/docs/Web/API/CanvasGradient). The countries are loaded from
|
||||
a GeoJSON file. A style function determines for each country whether to use a fill with the
|
||||
CanvasGradient (rainbow colors) or a CanvasPattern (repeating stacked circles). **Note**: For seamless repeat patterns,
|
||||
image width and height of the pattern image must be a factor of two (2, 4, 8, ..., 512).
|
||||
a GeoJSON file. A style function determines for each country whether to use a fill with the pregenerated
|
||||
CanvasGradient (rainbow colors) or a CanvasPattern (repeating stacked circles).
|
||||
tags: "canvas, gradient, pattern, style"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {getWidth} from '../src/ol/extent.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import {DEVICE_PIXEL_RATIO} from '../src/ol/has.js';
|
||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||
@@ -15,8 +16,14 @@ const context = canvas.getContext('2d');
|
||||
const pixelRatio = DEVICE_PIXEL_RATIO;
|
||||
|
||||
// Generate a rainbow gradient
|
||||
const gradient = (function() {
|
||||
const grad = context.createLinearGradient(0, 0, 512 * pixelRatio, 0);
|
||||
function gradient(feature, resolution) {
|
||||
const extent = feature.getGeometry().getExtent();
|
||||
// Gradient starts on the left edge of each feature, and ends on the right.
|
||||
// Coordinate origin is the top-left corner of the extent of the geometry, so
|
||||
// we just divide the geometry's extent width by resolution and multiply with
|
||||
// pixelRatio to match the renderer's pixel coordinate system.
|
||||
const grad = context.createLinearGradient(0, 0,
|
||||
getWidth(extent) / resolution * pixelRatio, 0);
|
||||
grad.addColorStop(0, 'red');
|
||||
grad.addColorStop(1 / 6, 'orange');
|
||||
grad.addColorStop(2 / 6, 'yellow');
|
||||
@@ -25,24 +32,24 @@ const gradient = (function() {
|
||||
grad.addColorStop(5 / 6, 'blue');
|
||||
grad.addColorStop(1, 'purple');
|
||||
return grad;
|
||||
})();
|
||||
}
|
||||
|
||||
// Generate a canvasPattern with two circles on white background
|
||||
const pattern = (function() {
|
||||
canvas.width = 8 * pixelRatio;
|
||||
canvas.height = 8 * pixelRatio;
|
||||
canvas.width = 11 * pixelRatio;
|
||||
canvas.height = 11 * pixelRatio;
|
||||
// white background
|
||||
context.fillStyle = 'white';
|
||||
context.fillRect(0, 0, canvas.width, canvas.height);
|
||||
// outer circle
|
||||
context.fillStyle = 'rgba(102, 0, 102, 0.5)';
|
||||
context.beginPath();
|
||||
context.arc(4 * pixelRatio, 4 * pixelRatio, 3 * pixelRatio, 0, 2 * Math.PI);
|
||||
context.arc(5 * pixelRatio, 5 * pixelRatio, 4 * pixelRatio, 0, 2 * Math.PI);
|
||||
context.fill();
|
||||
// inner circle
|
||||
context.fillStyle = 'rgb(55, 0, 170)';
|
||||
context.beginPath();
|
||||
context.arc(4 * pixelRatio, 4 * pixelRatio, 1.5 * pixelRatio, 0, 2 * Math.PI);
|
||||
context.arc(5 * pixelRatio, 5 * pixelRatio, 2 * pixelRatio, 0, 2 * Math.PI);
|
||||
context.fill();
|
||||
return context.createPattern(canvas, 'repeat');
|
||||
}());
|
||||
@@ -62,11 +69,12 @@ const style = new Style({
|
||||
* which either contains the aboove gradient or pattern.
|
||||
*
|
||||
* @param {module:ol/Feature~Feature} feature The feature to style.
|
||||
* @param {number} resolution Resolution.
|
||||
* @return {module:ol/style/Style} The style to use for the feature.
|
||||
*/
|
||||
const getStackedStyle = function(feature) {
|
||||
const getStackedStyle = function(feature, resolution) {
|
||||
const id = feature.getId();
|
||||
fill.setColor(id > 'J' ? gradient : pattern);
|
||||
fill.setColor(id > 'J' ? gradient(feature, resolution) : pattern);
|
||||
return style;
|
||||
};
|
||||
|
||||
@@ -86,7 +94,7 @@ const map = new Map({
|
||||
],
|
||||
target: 'map',
|
||||
view: new View({
|
||||
center: fromLonLat([16, 48]),
|
||||
center: fromLonLat([7, 52]),
|
||||
zoom: 3
|
||||
})
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// NOCOMPILE
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import ImageLayer from '../src/ol/layer/Image.js';
|
||||
|
||||
1
examples/d3.js
vendored
1
examples/d3.js
vendored
@@ -1,3 +1,4 @@
|
||||
// NOCOMPILE
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {getWidth, getCenter} from '../src/ol/extent.js';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// NOCOMPILE
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// NOCOMPILE
|
||||
// this example uses FileSaver.js for which we don't have an externs file.
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// NOCOMPILE
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// NOCOMPILE
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// NOCOMPILE
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
|
||||
@@ -42,7 +42,8 @@ map.addOverlay(marker);
|
||||
// LineString to store the different geolocation positions. This LineString
|
||||
// is time aware.
|
||||
// The Z dimension is actually used to store the rotation (heading).
|
||||
const positions = new LineString([], /** @type {module:ol/geom/GeometryLayout} */ ('XYZM'));
|
||||
const positions = new LineString([],
|
||||
/** @type {module:ol/geom/GeometryLayout~GeometryLayout} */ ('XYZM'));
|
||||
|
||||
// Geolocation Control
|
||||
const geolocation = new Geolocation({
|
||||
|
||||
@@ -71,9 +71,9 @@ map.on('click', function(evt) {
|
||||
const coordinates = feature.getGeometry().getCoordinates();
|
||||
popup.setPosition(coordinates);
|
||||
$(element).popover({
|
||||
placement: 'top',
|
||||
html: true,
|
||||
content: feature.get('name')
|
||||
'placement': 'top',
|
||||
'html': true,
|
||||
'content': feature.get('name')
|
||||
});
|
||||
$(element).popover('show');
|
||||
} else {
|
||||
|
||||
@@ -7,6 +7,6 @@ docs: >
|
||||
with OpenLayers.
|
||||
tags: "vector, jsts, buffer"
|
||||
resources:
|
||||
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/1.6.0/jsts.min.js
|
||||
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/1.4.0/jsts.min.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// NOCOMPILE
|
||||
// this example uses JSTS for which we don't have an externs file.
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
@@ -5,8 +7,7 @@ import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||
import {fromLonLat} from '../src/ol/proj.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import VectorSource from '../src/ol/source/Vector.js';
|
||||
import LinearRing from '../src/ol/geom/LinearRing.js';
|
||||
import {Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon} from '../src/ol/geom.js';
|
||||
|
||||
|
||||
const source = new VectorSource();
|
||||
fetch('data/geojson/roads-seoul.geojson').then(function(response) {
|
||||
@@ -16,7 +17,6 @@ fetch('data/geojson/roads-seoul.geojson').then(function(response) {
|
||||
const features = format.readFeatures(json, {featureProjection: 'EPSG:3857'});
|
||||
|
||||
const parser = new jsts.io.OL3Parser();
|
||||
parser.inject(Point, LineString, LinearRing, Polygon, MultiPoint, MultiLineString, MultiPolygon);
|
||||
|
||||
for (let i = 0; i < features.length; i++) {
|
||||
const feature = features[i];
|
||||
|
||||
@@ -51,11 +51,12 @@ map.on('click', function(evt) {
|
||||
|
||||
$(element).popover('destroy');
|
||||
popup.setPosition(coordinate);
|
||||
// the keys are quoted to prevent renaming in ADVANCED mode.
|
||||
$(element).popover({
|
||||
placement: 'top',
|
||||
animation: false,
|
||||
html: true,
|
||||
content: '<p>The location you clicked was:</p><code>' + hdms + '</code>'
|
||||
'placement': 'top',
|
||||
'animation': false,
|
||||
'html': true,
|
||||
'content': '<p>The location you clicked was:</p><code>' + hdms + '</code>'
|
||||
});
|
||||
$(element).popover('show');
|
||||
});
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// NOCOMPILE
|
||||
// this example uses d3 for which we don't have an externs file.
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {Image as ImageLayer, Tile as TileLayer} from '../src/ol/layer.js';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// NOCOMPILE
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {Image as ImageLayer, Tile as TileLayer} from '../src/ol/layer.js';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// NOCOMPILE
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {Image as ImageLayer, Tile as TileLayer} from '../src/ol/layer.js';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// NOCOMPILE
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {Image as ImageLayer, Tile as TileLayer} from '../src/ol/layer.js';
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="./resources/prism/prism.css" type="text/css">
|
||||
<link rel="stylesheet" href="./css/ol.css" type="text/css">
|
||||
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
|
||||
{{{ extraHead.local }}}
|
||||
{{{ css.tag }}}
|
||||
@@ -58,7 +58,7 @@
|
||||
<div class="row-fluid">
|
||||
<div id="source-controls">
|
||||
<a id="copy-button" data-clipboard-target="#example-source"><i class="fa fa-clipboard"></i> Copy</a>
|
||||
<!-- <a id="codepen-button"><i class="fa fa-codepen"></i> Edit</a> -->
|
||||
<a id="codepen-button"><i class="fa fa-codepen"></i> Edit</a>
|
||||
</div>
|
||||
<form method="POST" id="codepen-form" target="_blank" action="https://codepen.io/pen/define/">
|
||||
<textarea class="hidden" name="title">{{ title }}</textarea>
|
||||
@@ -66,6 +66,7 @@
|
||||
<textarea class="hidden" name="js">{{ js.source }}</textarea>
|
||||
<textarea class="hidden" name="css">{{ css.source }}</textarea>
|
||||
<textarea class="hidden" name="html">{{ contents }}</textarea>
|
||||
<input type="hidden" name="resources" value="https://openlayers.org/en/v{{ olVersion }}/css/ol.css,https://openlayers.org/en/v{{ olVersion }}/build/ol.js{{ extraResources }}">
|
||||
<input type="hidden" name="data">
|
||||
</form>
|
||||
<pre><code id="example-source" class="language-markup"><!DOCTYPE html>
|
||||
@@ -75,7 +76,7 @@
|
||||
<link rel="stylesheet" href="https://openlayers.org/en/v{{ olVersion }}/css/ol.css" type="text/css">
|
||||
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
|
||||
{{#if extraHead.remote}}
|
||||
<script src="https://openlayers.org/en/v{{ olVersion }}/build/ol.js"></script>{{#if extraHead.remote}}
|
||||
{{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}}
|
||||
<style>
|
||||
{{ indent css.source spaces=6 }} </style>{{/if}}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: UTFGrid
|
||||
shortdesc: This example shows how to read data from a UTFGrid source.
|
||||
title: Tiled UTFGrid
|
||||
shortdesc: This example shows how to read data from a TileUTFGrid layer.
|
||||
docs: >
|
||||
<p>Point to a country to see its name and flag.</p>
|
||||
Tiles made with [TileMill](http://tilemill.com). Hosting on MapBox.com or with open-source [TileServer](https://github.com/klokantech/tileserver-php/).
|
||||
tags: "utfgrid, tilejson"
|
||||
tags: "utfgrid, tileutfgrid, tilejson"
|
||||
cloak:
|
||||
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg
|
||||
value: Your Mapbox access token from http://mapbox.com/ here
|
||||
@@ -3,7 +3,7 @@ import Overlay from '../src/ol/Overlay.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import TileJSON from '../src/ol/source/TileJSON.js';
|
||||
import UTFGrid from '../src/ol/source/UTFGrid.js';
|
||||
import UTFGrid from '../src/ol/source/TileUTFGrid.js';
|
||||
|
||||
const key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// NOCOMPILE
|
||||
// this example uses topolis and toastr for which we don't have an externs file.
|
||||
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// NOCOMPILE
|
||||
// this example uses turf.js for which we don't have an externs file.
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
const MinifyPlugin = require('babel-minify-webpack-plugin');
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
const ExampleBuilder = require('./example-builder');
|
||||
const fs = require('fs');
|
||||
const merge = require('webpack-merge');
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
|
||||
const src = path.join(__dirname, '..');
|
||||
|
||||
@@ -14,27 +17,21 @@ examples.forEach(example => {
|
||||
entry[example] = `./${example}.js`;
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
const main = {
|
||||
context: src,
|
||||
target: 'web',
|
||||
entry: entry,
|
||||
optimization: {
|
||||
runtimeChunk: {
|
||||
name: 'common'
|
||||
},
|
||||
splitChunks: {
|
||||
name: 'common',
|
||||
chunks: 'initial',
|
||||
minChunks: 2
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'common',
|
||||
minChunks: 2
|
||||
}),
|
||||
new ExampleBuilder({
|
||||
templates: path.join(__dirname, '..', 'templates'),
|
||||
common: 'common'
|
||||
}),
|
||||
new CopyPlugin([
|
||||
{from: '../src/ol/ol.css', to: 'css'},
|
||||
{from: '../css', to: 'css'},
|
||||
{from: 'data', to: 'data'},
|
||||
{from: 'resources', to: 'resources'},
|
||||
{from: 'Jugl.js', to: 'Jugl.js'},
|
||||
@@ -47,3 +44,39 @@ module.exports = {
|
||||
path: path.join(__dirname, '..', '..', 'build', 'examples')
|
||||
}
|
||||
};
|
||||
|
||||
// configuration specific to the dev environment
|
||||
const dev = {
|
||||
plugins: [
|
||||
new webpack.EnvironmentPlugin(
|
||||
Object.assign({NODE_ENV: 'development'}, process.env)
|
||||
)
|
||||
]
|
||||
};
|
||||
|
||||
// configuration specific to the prod environment
|
||||
const prod = {
|
||||
plugins: [
|
||||
new webpack.EnvironmentPlugin(
|
||||
Object.assign({NODE_ENV: 'production'}, process.env)
|
||||
),
|
||||
new MinifyPlugin()
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
module.exports = env => {
|
||||
let config;
|
||||
|
||||
switch (env) {
|
||||
case 'prod': {
|
||||
config = merge(main, prod);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
config = merge(main, dev);
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
};
|
||||
|
||||
@@ -5,7 +5,6 @@ const marked = require('marked');
|
||||
const path = require('path');
|
||||
const pkg = require('../../package.json');
|
||||
const promisify = require('util').promisify;
|
||||
const RawSource = require('webpack-sources').RawSource;
|
||||
|
||||
const readFile = promisify(fs.readFile);
|
||||
const isCssRegEx = /\.css$/;
|
||||
@@ -61,28 +60,6 @@ function createWordIndex(exampleData) {
|
||||
return index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the source for the chunk that matches the jsPath
|
||||
* @param {Object} chunk Chunk.
|
||||
* @param {string} jsPath Path of the file.
|
||||
* @return {string} The source.
|
||||
*/
|
||||
function getJsSource(chunk, jsPath) {
|
||||
let jsSource;
|
||||
for (let i = 0, ii = chunk.modules.length; i < ii; ++i) {
|
||||
const module = chunk.modules[i];
|
||||
if (module.modules) {
|
||||
jsSource = getJsSource(module, jsPath);
|
||||
if (jsSource) {
|
||||
return jsSource;
|
||||
}
|
||||
}
|
||||
if (module.identifier == jsPath) {
|
||||
return module.source;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A webpack plugin that builds the html files for our examples.
|
||||
* @param {Object} config Plugin configuration. Requires a `templates` property
|
||||
@@ -100,7 +77,7 @@ function ExampleBuilder(config) {
|
||||
* @param {Object} compiler The webpack compiler.
|
||||
*/
|
||||
ExampleBuilder.prototype.apply = function(compiler) {
|
||||
compiler.hooks.emit.tapPromise('ExampleBuilder', async (compilation) => {
|
||||
compiler.plugin('emit', async (compilation, callback) => {
|
||||
const chunks = compilation.getStats().toJson().chunks
|
||||
.filter(chunk => chunk.names[0] !== this.common);
|
||||
|
||||
@@ -117,11 +94,19 @@ ExampleBuilder.prototype.apply = function(compiler) {
|
||||
});
|
||||
|
||||
for (const file in assets) {
|
||||
compilation.assets[file] = new RawSource(assets[file]);
|
||||
compilation.assets[file] = {
|
||||
source: () => assets[file],
|
||||
size: () => assets[file].length
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
await Promise.all(promises);
|
||||
try {
|
||||
await Promise.all(promises);
|
||||
} catch (err) {
|
||||
callback(err);
|
||||
return;
|
||||
}
|
||||
|
||||
const info = {
|
||||
examples: exampleData,
|
||||
@@ -129,7 +114,12 @@ ExampleBuilder.prototype.apply = function(compiler) {
|
||||
};
|
||||
|
||||
const indexSource = `var info = ${JSON.stringify(info)}`;
|
||||
compilation.assets['index.js'] = new RawSource(indexSource);
|
||||
compilation.assets['index.js'] = {
|
||||
source: () => indexSource,
|
||||
size: () => indexSource.length
|
||||
};
|
||||
|
||||
callback();
|
||||
});
|
||||
};
|
||||
|
||||
@@ -152,8 +142,14 @@ ExampleBuilder.prototype.render = async function(dir, chunk) {
|
||||
// add in script tag
|
||||
const jsName = `${name}.js`;
|
||||
const jsPath = path.join(dir, jsName);
|
||||
let jsSource = getJsSource(chunk, jsPath);
|
||||
jsSource = jsSource.replace(/'\.\.\/src\//g, '\'');
|
||||
let jsSource;
|
||||
for (let i = 0, ii = chunk.modules.length; i < ii; ++i) {
|
||||
const module = chunk.modules[i];
|
||||
if (module.identifier == jsPath) {
|
||||
jsSource = module.source;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (data.cloak) {
|
||||
for (const entry of data.cloak) {
|
||||
jsSource = jsSource.replace(new RegExp(entry.key, 'g'), entry.value);
|
||||
|
||||
165
externs/bingmaps.js
Normal file
165
externs/bingmaps.js
Normal file
@@ -0,0 +1,165 @@
|
||||
/**
|
||||
* @externs
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var BingMapsCoverageArea = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {Array.<number>}
|
||||
*/
|
||||
BingMapsCoverageArea.prototype.bbox;
|
||||
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
BingMapsCoverageArea.prototype.zoomMax;
|
||||
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
BingMapsCoverageArea.prototype.zoomMin;
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var BingMapsImageryProvider = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
BingMapsImageryProvider.prototype.attribution;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Array.<BingMapsCoverageArea>}
|
||||
*/
|
||||
BingMapsImageryProvider.prototype.coverageAreas;
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var BingMapsImageryMetadataResponse = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
BingMapsImageryMetadataResponse.prototype.authenticationResultCode;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
BingMapsImageryMetadataResponse.prototype.copyright;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Array.<BingMapsResourceSet>}
|
||||
*/
|
||||
BingMapsImageryMetadataResponse.prototype.resourceSets;
|
||||
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
BingMapsImageryMetadataResponse.prototype.statusCode;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
BingMapsImageryMetadataResponse.prototype.statusDescription;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
BingMapsImageryMetadataResponse.prototype.traceId;
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var BingMapsResource = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
BingMapsResource.prototype.imageHeight;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
BingMapsResource.prototype.imageUrl;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Array.<string>}
|
||||
*/
|
||||
BingMapsResource.prototype.imageUrlSubdomains;
|
||||
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
BingMapsResource.prototype.imageWidth;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Array.<BingMapsImageryProvider>}
|
||||
*/
|
||||
BingMapsResource.prototype.imageryProviders;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
BingMapsResource.prototype.vintageEnd;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
BingMapsResource.prototype.vintageStart;
|
||||
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
BingMapsResource.prototype.zoomMax;
|
||||
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
BingMapsResource.prototype.zoomMin;
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var BingMapsResourceSet = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
BingMapsResourceSet.prototype.estimatedTotal;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Array.<BingMapsResource>}
|
||||
*/
|
||||
BingMapsResourceSet.prototype.resources;
|
||||
20
externs/bootstrap.js
vendored
Normal file
20
externs/bootstrap.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @fileoverview Externs for bootstrap.js
|
||||
*
|
||||
* @see http://twitter.github.com/bootstrap/javascript.html
|
||||
* @externs
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @param {string|Object.<string,*>=} opt_option
|
||||
* @return {!jQuery}
|
||||
*/
|
||||
jQuery.prototype.popover = function(opt_option) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string|Object.<string,*>=} opt_option
|
||||
* @return {!jQuery}
|
||||
*/
|
||||
jQuery.prototype.tooltip = function(opt_option) {};
|
||||
34
externs/cartodb.js
Normal file
34
externs/cartodb.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @externs
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var CartoDBLayerInfo = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
CartoDBLayerInfo.prototype.layergroupid;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
CartoDBLayerInfo.prototype.updated_at;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
CartoDBLayerInfo.prototype.metadata;
|
||||
|
||||
|
||||
/**
|
||||
* @type {{http: string, https: string}}
|
||||
*/
|
||||
CartoDBLayerInfo.prototype.cdn_url;
|
||||
9
externs/closure-compiler.js
Normal file
9
externs/closure-compiler.js
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* @fileoverview Definitions for externs that are either missing or incorrect
|
||||
* in the current release version of the closure compiler we use.
|
||||
*
|
||||
* The entries must be removed once they are available/correct in the
|
||||
* version we use.
|
||||
*
|
||||
* @externs
|
||||
*/
|
||||
198
externs/esrijson.js
Normal file
198
externs/esrijson.js
Normal file
@@ -0,0 +1,198 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Externs for EsriJSON.
|
||||
* @see http://resources.arcgis.com/en/help/rest/apiref/geometry.html
|
||||
* @externs
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var EsriJSONObject = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!EsriJSONCRS}
|
||||
*/
|
||||
EsriJSONObject.prototype.spatialReference;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var EsriJSONCRS = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* CRS well know identifier.
|
||||
* @type {number}
|
||||
*/
|
||||
EsriJSONCRS.prototype.wkid;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {EsriJSONObject}
|
||||
*/
|
||||
var EsriJSONPoint = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* M value of point.
|
||||
* @type {number}
|
||||
*/
|
||||
EsriJSONPoint.prototype.m;
|
||||
|
||||
|
||||
/**
|
||||
* X coordinate of point.
|
||||
* @type {number}
|
||||
*/
|
||||
EsriJSONPoint.prototype.x;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Y coordinate of point.
|
||||
* @type {number}
|
||||
*/
|
||||
EsriJSONPoint.prototype.y;
|
||||
|
||||
|
||||
/**
|
||||
* Z coordinate of point.
|
||||
* @type {number|undefined}
|
||||
*/
|
||||
EsriJSONPoint.prototype.z;
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {EsriJSONObject}
|
||||
*/
|
||||
var EsriJSONMultipoint = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* Does Multipoint have M values?
|
||||
* @type {boolean|undefined}
|
||||
*/
|
||||
EsriJSONMultipoint.prototype.hasM;
|
||||
|
||||
|
||||
/**
|
||||
* Does Multipoint have Z values?
|
||||
* @type {boolean|undefined}
|
||||
*/
|
||||
EsriJSONMultipoint.prototype.hasZ;
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<!Array.<number>>}
|
||||
*/
|
||||
EsriJSONMultipoint.prototype.points;
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {EsriJSONObject}
|
||||
*/
|
||||
var EsriJSONPolyline = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* Does Polyline have M values?
|
||||
* @type {boolean|undefined}
|
||||
*/
|
||||
EsriJSONPolyline.prototype.hasM;
|
||||
|
||||
|
||||
/**
|
||||
* Does Polyline have Z values?
|
||||
* @type {boolean|undefined}
|
||||
*/
|
||||
EsriJSONPolyline.prototype.hasZ;
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<!Array.<!Array.<number>>>}
|
||||
*/
|
||||
EsriJSONPolyline.prototype.paths;
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {EsriJSONObject}
|
||||
*/
|
||||
var EsriJSONPolygon = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* Does Polygon have M values?
|
||||
* @type {boolean|undefined}
|
||||
*/
|
||||
EsriJSONPolygon.prototype.hasM;
|
||||
|
||||
|
||||
/**
|
||||
* Does Polygon have Z values?
|
||||
* @type {boolean|undefined}
|
||||
*/
|
||||
EsriJSONPolygon.prototype.hasZ;
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<!Array.<!Array.<number>>>}
|
||||
*/
|
||||
EsriJSONPolygon.prototype.rings;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {(EsriJSONPoint|EsriJSONMultipoint|EsriJSONPolyline|
|
||||
EsriJSONPolygon)}
|
||||
*/
|
||||
var EsriJSONGeometry;
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {EsriJSONObject}
|
||||
*/
|
||||
var EsriJSONFeature = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {EsriJSONGeometry}
|
||||
*/
|
||||
EsriJSONFeature.prototype.geometry;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, *>}
|
||||
*/
|
||||
EsriJSONFeature.prototype.attributes;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {EsriJSONObject}
|
||||
*/
|
||||
var EsriJSONFeatureCollection = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<EsriJSONFeature>}
|
||||
*/
|
||||
EsriJSONFeatureCollection.prototype.features;
|
||||
|
||||
|
||||
/**
|
||||
* The name of the attribute that contains ids.
|
||||
* @type {string}
|
||||
*/
|
||||
EsriJSONFeatureCollection.prototype.objectIdFieldName;
|
||||
23
externs/example.js
Normal file
23
externs/example.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
let common;
|
||||
|
||||
|
||||
/**
|
||||
* @param {string=} opt_default Default renderer.
|
||||
* @return {string} Renderer type.
|
||||
*/
|
||||
common.getRendererFromQueryString = function(opt_default) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {function(new:ol.style.Style, module:ol/style/Style~Options=)} Style Style constructor.
|
||||
* @param {function(new:ol.style.Fill, module:ol/style/Fill~Options=)} Fill Fill constructor.
|
||||
* @param {function(new:ol.style.Stroke, module:ol/style/Stroke~Options=)} Stroke Stroke constructor.
|
||||
* @param {function(new:ol.style.Icon, module:ol/style/Icon~Options=)} Icon Icon constructor.
|
||||
* @param {function(new:ol.style.Text, module:ol/style/Text~Options=)} Text Text constructor.
|
||||
* @return {function((module:ol/Feature~Feature|ol.render.Feature), number):
|
||||
* Array.<ol.style.Style>}
|
||||
*/
|
||||
const createMapboxStreetsV6Style = function(Style, Fill, Stroke, Icon, Text) {};
|
||||
155
externs/geojson.js
Normal file
155
externs/geojson.js
Normal file
@@ -0,0 +1,155 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Externs for GeoJSON.
|
||||
* @see http://geojson.org/geojson-spec.html
|
||||
* @externs
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var GeoJSONObject = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<number>|undefined}
|
||||
*/
|
||||
GeoJSONObject.prototype.bbox;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
GeoJSONObject.prototype.type;
|
||||
|
||||
|
||||
/**
|
||||
* @type {!GeoJSONCRS|undefined}
|
||||
*/
|
||||
GeoJSONObject.prototype.crs;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var GeoJSONCRS = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* CRS type. One of `link` or `name`.
|
||||
* @type {string}
|
||||
*/
|
||||
GeoJSONCRS.prototype.type;
|
||||
|
||||
|
||||
/**
|
||||
* @type {!GeoJSONCRSName|!GeoJSONLink}
|
||||
*/
|
||||
GeoJSONCRS.prototype.properties;
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var GeoJSONCRSName = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
GeoJSONCRSName.prototype.name;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {GeoJSONObject}
|
||||
*/
|
||||
var GeoJSONGeometry = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<number>|!Array.<!Array.<number>>|
|
||||
* !Array.<!Array.<!Array.<number>>>}
|
||||
*/
|
||||
GeoJSONGeometry.prototype.coordinates;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {GeoJSONObject}
|
||||
*/
|
||||
var GeoJSONGeometryCollection = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<GeoJSONGeometry>}
|
||||
*/
|
||||
GeoJSONGeometryCollection.prototype.geometries;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {GeoJSONObject}
|
||||
*/
|
||||
var GeoJSONFeature = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {GeoJSONGeometry|GeoJSONGeometryCollection}
|
||||
*/
|
||||
GeoJSONFeature.prototype.geometry;
|
||||
|
||||
|
||||
/**
|
||||
* @type {number|string|undefined}
|
||||
*/
|
||||
GeoJSONFeature.prototype.id;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, *>}
|
||||
*/
|
||||
GeoJSONFeature.prototype.properties;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
GeoJSONFeature.prototype.geometry_name;
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {GeoJSONObject}
|
||||
*/
|
||||
var GeoJSONFeatureCollection = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<GeoJSONFeature>}
|
||||
*/
|
||||
GeoJSONFeatureCollection.prototype.features;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var GeoJSONLink = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
GeoJSONLink.prototype.href;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
GeoJSONLink.prototype.type;
|
||||
1828
externs/jquery-1.9.js
vendored
Normal file
1828
externs/jquery-1.9.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
385
externs/oli.js
Normal file
385
externs/oli.js
Normal file
@@ -0,0 +1,385 @@
|
||||
/**
|
||||
* @externs
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
let oli;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.AssertionError = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
oli.AssertionError.prototype.code;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.events.Event = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
oli.events.Event.prototype.target;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
oli.events.Event.prototype.type;
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
oli.events.Event.prototype.preventDefault = function() {};
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
oli.events.Event.prototype.stopPropagation = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.Collection.Event = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {*}
|
||||
*/
|
||||
oli.Collection.Event.prototype.element;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.DragBoxEvent = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.Coordinate}
|
||||
*/
|
||||
oli.DragBoxEvent.prototype.coordinate;
|
||||
|
||||
|
||||
/**
|
||||
* @type {module:ol/MapBrowserEvent~MapBrowserEvent}
|
||||
*/
|
||||
oli.DragBoxEvent.prototype.mapBrowserEvent;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.DrawEvent = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {module:ol/Feature~Feature}
|
||||
*/
|
||||
oli.DrawEvent.prototype.feature;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.ExtentEvent = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.Extent}
|
||||
*/
|
||||
oli.ExtentEvent.prototype.extent;
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.ModifyEvent = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.Collection.<module:ol/Feature~Feature>}
|
||||
*/
|
||||
oli.ModifyEvent.prototype.features;
|
||||
|
||||
|
||||
/**
|
||||
* @type {module:ol/MapBrowserEvent~MapBrowserEvent}
|
||||
*/
|
||||
oli.ModifyEvent.prototype.mapBrowserEvent;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
oli.Object;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.Object.Event = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
oli.Object.Event.prototype.key;
|
||||
|
||||
|
||||
/**
|
||||
* @type {*}
|
||||
*/
|
||||
oli.Object.Event.prototype.oldValue;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.MapBrowserEvent = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.Coordinate}
|
||||
*/
|
||||
oli.MapBrowserEvent.prototype.coordinate;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Event}
|
||||
*/
|
||||
oli.MapBrowserEvent.prototype.originalEvent;
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.Pixel}
|
||||
*/
|
||||
oli.MapBrowserEvent.prototype.pixel;
|
||||
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
oli.MapBrowserEvent.prototype.dragging;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.MapEvent = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.PluggableMap}
|
||||
*/
|
||||
oli.MapEvent.prototype.map;
|
||||
|
||||
|
||||
/**
|
||||
* @type {module:ol/PluggableMap~FrameState}
|
||||
*/
|
||||
oli.MapEvent.prototype.frameState;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.SelectEvent = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/Feature~Feature>}
|
||||
*/
|
||||
oli.SelectEvent.prototype.deselected;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/Feature~Feature>}
|
||||
*/
|
||||
oli.SelectEvent.prototype.selected;
|
||||
|
||||
|
||||
/**
|
||||
* @type {module:ol/MapBrowserEvent~MapBrowserEvent}
|
||||
*/
|
||||
oli.SelectEvent.prototype.mapBrowserEvent;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
oli.control;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.control.Control = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.PluggableMap} map Map.
|
||||
* @return {undefined} Undefined.
|
||||
*/
|
||||
oli.control.Control.prototype.setMap = function(map) {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
oli.interaction;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.interaction.DragAndDropEvent = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/Feature~Feature>|undefined}
|
||||
*/
|
||||
oli.interaction.DragAndDropEvent.prototype.features;
|
||||
|
||||
|
||||
/**
|
||||
* @type {module:ol/proj/Projection~Projection|undefined}
|
||||
*/
|
||||
oli.interaction.DragAndDropEvent.prototype.projection;
|
||||
|
||||
|
||||
/**
|
||||
* @type {File}
|
||||
*/
|
||||
oli.interaction.DragAndDropEvent.prototype.file;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.interaction.TranslateEvent = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.Collection.<module:ol/Feature~Feature>}
|
||||
*/
|
||||
oli.interaction.TranslateEvent.prototype.features;
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.Coordinate}
|
||||
*/
|
||||
oli.interaction.TranslateEvent.prototype.coordinate;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
oli.render;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.render.Event = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {CanvasRenderingContext2D|null|undefined}
|
||||
*/
|
||||
oli.render.Event.prototype.context;
|
||||
|
||||
|
||||
/**
|
||||
* @type {module:ol/PluggableMap~FrameState|undefined}
|
||||
*/
|
||||
oli.render.Event.prototype.frameState;
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.webgl.Context|null|undefined}
|
||||
*/
|
||||
oli.render.Event.prototype.glContext;
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.render.VectorContext|undefined}
|
||||
*/
|
||||
oli.render.Event.prototype.vectorContext;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
oli.source;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.source.ImageEvent = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.Image}
|
||||
*/
|
||||
oli.source.ImageEvent.prototype.image;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.source.RasterEvent = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.Extent}
|
||||
*/
|
||||
oli.source.RasterEvent.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
oli.source.RasterEvent.prototype.resolution;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
oli.source.RasterEvent.prototype.data;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.source.Tile.Event = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.Tile}
|
||||
*/
|
||||
oli.source.Tile.Event.prototype.tile;
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.source.Vector.Event = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {module:ol/Feature~Feature|undefined}
|
||||
*/
|
||||
oli.source.Vector.Event.prototype.feature;
|
||||
37
externs/proj4js.js
Normal file
37
externs/proj4js.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @externs
|
||||
* @see http://proj4js.org/
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var Proj4 = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Coordinate} coordinates
|
||||
* @return {ol.Coordinate}
|
||||
*/
|
||||
Proj4.prototype.forward = function(coordinates) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Coordinate} coordinates
|
||||
* @return {ol.Coordinate}
|
||||
*/
|
||||
Proj4.prototype.inverse = function(coordinates) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @param {(string|Object)=} opt_def
|
||||
* @return {undefined|Object.<string, Object.<{axis: string, units: string, to_meter: number}>>}
|
||||
*/
|
||||
Proj4.prototype.defs = function(name, opt_def) {};
|
||||
|
||||
/**
|
||||
* @type {Proj4}
|
||||
*/
|
||||
var proj4;
|
||||
84
externs/readme.md
Normal file
84
externs/readme.md
Normal file
@@ -0,0 +1,84 @@
|
||||
# Externs
|
||||
|
||||
This directory contains externs files, which tell the Closure compiler about symbols and properties that it should not rename.
|
||||
|
||||
## oli.js
|
||||
|
||||
These are special externs that belong to OpenLayers, and this document explains their purpose and how they are used.
|
||||
|
||||
### Prevent class properties from being renamed
|
||||
|
||||
For events, we make properties available to the application. Methods can be made available by just marking them with the `@api` annotation directly where they are defined; properties should also be added to `oli.js`:
|
||||
|
||||
```js
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.MapBrowserEvent = function() {};
|
||||
|
||||
/**
|
||||
* @type {ol.Coordinate}
|
||||
*/
|
||||
oli.MapBrowserEvent.prototype.coordinate;
|
||||
```
|
||||
In the source file (`src/ol/MapBrowserEvent.js`), the class needs to implement this interface:
|
||||
```js
|
||||
/**
|
||||
* ...
|
||||
* @constructor
|
||||
* @implements {oli.MapBrowserEvent}
|
||||
*/
|
||||
ol.MapBrowserEvent = function(type, map, originalEvent, opt_frameState) {
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* @type {ol.Coordinate}
|
||||
* @api
|
||||
*/
|
||||
this.coordinate = map.getEventCoordinate(this.originalEvent);
|
||||
|
||||
// ...
|
||||
|
||||
};
|
||||
```
|
||||
|
||||
### Override methods in custom classes
|
||||
|
||||
For custom subclasses in applications, which can be created using `ol.inherits`, the API may want to make certain methods available to override. In addition to marking such methods as `@api`, they should also be added to an interface in `oli.js`:
|
||||
```js
|
||||
/**
|
||||
* @interface
|
||||
*/
|
||||
oli.control.Control = function() {};
|
||||
|
||||
/**
|
||||
* @param {ol.PluggableMap} map Map.
|
||||
* @return {undefined} Undefined.
|
||||
*/
|
||||
oli.control.Control.prototype.setMap = function(map) {};
|
||||
|
||||
```
|
||||
This interface must be implemented by the class in the source file (`src/ol/control/control.js`):
|
||||
```js
|
||||
/**
|
||||
* ...
|
||||
* @constructor
|
||||
* @implements {oli.control.Control}
|
||||
*/
|
||||
ol.control.Control = function(options) {
|
||||
// ...
|
||||
};
|
||||
|
||||
// ...
|
||||
|
||||
/**
|
||||
* Application subclasses may override this.
|
||||
* @param {ol.PluggableMap} map Map.
|
||||
* @api
|
||||
*/
|
||||
ol.control.Control.prototype.setMap = function(map) {
|
||||
// ...
|
||||
};
|
||||
```
|
||||
See Custom controls example for an example of how this can be used.
|
||||
120
externs/tilejson.js
Normal file
120
externs/tilejson.js
Normal file
@@ -0,0 +1,120 @@
|
||||
/**
|
||||
* @externs
|
||||
* @see https://github.com/mapbox/tilejson-spec
|
||||
* @see https://github.com/mapbox/utfgrid-spec
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var TileJSON = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
TileJSON.prototype.tilejson;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
TileJSON.prototype.name;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
TileJSON.prototype.description;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
TileJSON.prototype.version;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
TileJSON.prototype.attribution;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
TileJSON.prototype.template;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
TileJSON.prototype.legend;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
TileJSON.prototype.scheme;
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<string>}
|
||||
*/
|
||||
TileJSON.prototype.tiles;
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<string>|undefined}
|
||||
*/
|
||||
TileJSON.prototype.grids;
|
||||
|
||||
|
||||
/**
|
||||
* @type {number|undefined}
|
||||
*/
|
||||
TileJSON.prototype.minzoom;
|
||||
|
||||
|
||||
/**
|
||||
* @type {number|undefined}
|
||||
*/
|
||||
TileJSON.prototype.maxzoom;
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<number>|undefined}
|
||||
*/
|
||||
TileJSON.prototype.bounds;
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<number>|undefined}
|
||||
*/
|
||||
TileJSON.prototype.center;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var UTFGridJSON = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<string>}
|
||||
*/
|
||||
UTFGridJSON.prototype.grid;
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<string>}
|
||||
*/
|
||||
UTFGridJSON.prototype.keys;
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Object.<string, Object>|undefined}
|
||||
*/
|
||||
UTFGridJSON.prototype.data;
|
||||
177
externs/topojson.js
Normal file
177
externs/topojson.js
Normal file
@@ -0,0 +1,177 @@
|
||||
|
||||
/**
|
||||
* @fileoverview Externs for TopoJSON.
|
||||
* @see https://github.com/mbostock/topojson/wiki/Specification
|
||||
* @externs
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var TopoJSONTopology = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
TopoJSONTopology.prototype.type;
|
||||
|
||||
|
||||
/**
|
||||
* @type {TopoJSONTransform|undefined}
|
||||
*/
|
||||
TopoJSONTopology.prototype.transform;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, (TopoJSONGeometry|TopoJSONGeometryCollection)>}
|
||||
*/
|
||||
TopoJSONTopology.prototype.objects;
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<Array.<Array.<number>>>}
|
||||
*/
|
||||
TopoJSONTopology.prototype.arcs;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var TopoJSONTransform = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<number>}
|
||||
*/
|
||||
TopoJSONTransform.prototype.scale;
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<number>}
|
||||
*/
|
||||
TopoJSONTransform.prototype.translate;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var TopoJSONGeometry = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
TopoJSONGeometry.prototype.type;
|
||||
|
||||
|
||||
/**
|
||||
* @type {string|number|undefined}
|
||||
*/
|
||||
TopoJSONGeometry.prototype.id;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, *>|undefined}
|
||||
*/
|
||||
TopoJSONGeometry.prototype.properties;
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
var TopoJSONGeometryCollection = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {Array.<TopoJSONGeometry>}
|
||||
*/
|
||||
TopoJSONGeometryCollection.prototype.geometries;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {TopoJSONGeometry}
|
||||
*/
|
||||
var TopoJSONPoint = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<number>}
|
||||
*/
|
||||
TopoJSONPoint.prototype.coordinates;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {TopoJSONGeometry}
|
||||
*/
|
||||
var TopoJSONLineString = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<number>}
|
||||
*/
|
||||
TopoJSONLineString.prototype.arcs;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {TopoJSONGeometry}
|
||||
*/
|
||||
var TopoJSONPolygon = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<Array.<number>>}
|
||||
*/
|
||||
TopoJSONPolygon.prototype.arcs;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {TopoJSONGeometry}
|
||||
*/
|
||||
var TopoJSONMultiPoint = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<Array.<number>>}
|
||||
*/
|
||||
TopoJSONMultiPoint.prototype.coordinates;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {TopoJSONGeometry}
|
||||
*/
|
||||
var TopoJSONMultiLineString = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<Array.<number>>}
|
||||
*/
|
||||
TopoJSONMultiLineString.prototype.arcs;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {TopoJSONGeometry}
|
||||
*/
|
||||
var TopoJSONMultiPolygon = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {!Array.<Array.<Array.<number>>>}
|
||||
*/
|
||||
TopoJSONMultiPolygon.prototype.arcs;
|
||||
59
package.json
59
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "openlayers",
|
||||
"version": "5.0.1",
|
||||
"description": "OpenLayers mapping library",
|
||||
"version": "4.6.5",
|
||||
"description": "Build tools and sources for developing OpenLayers based mapping applications",
|
||||
"keywords": [
|
||||
"map",
|
||||
"mapping",
|
||||
@@ -11,20 +11,18 @@
|
||||
"scripts": {
|
||||
"lint": "eslint tasks test src/ol examples config",
|
||||
"pretest": "npm run lint",
|
||||
"posttest": "npm run typecheck",
|
||||
"test": "npm run karma -- --single-run",
|
||||
"karma": "karma start test/karma.config.js",
|
||||
"serve-examples": "webpack-dev-server --config examples/webpack/config.js --mode development --watch",
|
||||
"build-examples": "webpack --config examples/webpack/config.js --mode production",
|
||||
"build-index": "node tasks/generate-index",
|
||||
"set-version": "node tasks/set-version",
|
||||
"prebuild": "npm run set-version && npm run build-index",
|
||||
"prepare": "npm run set-version",
|
||||
"build": "rollup --config config/rollup.js && cleancss --source-map src/ol/ol.css -o build/ol.css",
|
||||
"serve-examples": "mkdir -p build/examples && webpack --config examples/webpack/config.js --watch & serve build/examples",
|
||||
"build-examples": "webpack --config examples/webpack/config.js --env=prod",
|
||||
"build-index": "node tasks/generate-index.js",
|
||||
"prebuild": "npm run build-index",
|
||||
"build": "webpack --config config/webpack.js",
|
||||
"presrc-closure": "npm run prebuild",
|
||||
"src-closure": "node tasks/transform-types",
|
||||
"src-closure": "babel -q --out-dir build/src-closure src/",
|
||||
"pretypecheck": "npm run src-closure",
|
||||
"typecheck": "node tasks/typecheck",
|
||||
"apidoc": "jsdoc config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -P package.json -d build/apidoc"
|
||||
"typecheck": "node tasks/typecheck"
|
||||
},
|
||||
"main": "src/ol/index.js",
|
||||
"repository": {
|
||||
@@ -45,20 +43,21 @@
|
||||
"rbush": "2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-cli": "6.26.0",
|
||||
"babel-minify-webpack-plugin": "^0.3.0",
|
||||
"babel-plugin-jsdoc-closure": "1.5.1",
|
||||
"chaikin-smooth": "^1.0.4",
|
||||
"chaikin-smooth": "1.0.4",
|
||||
"clean-css-cli": "4.1.11",
|
||||
"copy-webpack-plugin": "^4.4.1",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"coveralls": "3.0.1",
|
||||
"eslint": "5.0.1",
|
||||
"eslint": "4.19.1",
|
||||
"eslint-config-openlayers": "^9.2.0",
|
||||
"expect.js": "0.3.1",
|
||||
"front-matter": "^2.1.2",
|
||||
"fs-extra": "^6.0.0",
|
||||
"glob": "^7.1.2",
|
||||
"google-closure-compiler": "20180610.0.2",
|
||||
"google-closure-compiler": "20180402.0.0",
|
||||
"handlebars": "4.0.11",
|
||||
"html-webpack-plugin": "^3.0.1",
|
||||
"istanbul": "0.4.5",
|
||||
"jquery": "3.3.1",
|
||||
"jsdoc": "3.5.5",
|
||||
@@ -68,27 +67,19 @@
|
||||
"karma-firefox-launcher": "^1.1.0",
|
||||
"karma-mocha": "1.3.0",
|
||||
"karma-sauce-launcher": "1.2.0",
|
||||
"karma-sourcemap-loader": "^0.3.7",
|
||||
"karma-webpack": "4.0.0-beta.0",
|
||||
"marked": "0.4.0",
|
||||
"mocha": "5.2.0",
|
||||
"karma-webpack": "3.0.0",
|
||||
"marked": "0.3.19",
|
||||
"mocha": "5.1.1",
|
||||
"mustache": "^2.3.0",
|
||||
"pixelmatch": "^4.0.2",
|
||||
"proj4": "2.4.4",
|
||||
"recast": "0.15.1",
|
||||
"rollup": "0.62.0",
|
||||
"rollup-plugin-buble": "0.19.2",
|
||||
"rollup-plugin-commonjs": "9.1.3",
|
||||
"rollup-plugin-node-resolve": "3.3.0",
|
||||
"rollup-plugin-sourcemaps": "0.4.2",
|
||||
"rollup-plugin-uglify": "4.0.0",
|
||||
"sinon": "^6.0.0",
|
||||
"uglifyjs-webpack-plugin": "^1.2.5",
|
||||
"recast": "0.14.7",
|
||||
"serve": "^6.5.5",
|
||||
"sinon": "^5.0.1",
|
||||
"url-polyfill": "^1.0.13",
|
||||
"walk": "^2.3.9",
|
||||
"webpack": "4.14.0",
|
||||
"webpack-cli": "^3.0.3",
|
||||
"webpack-dev-server": "^3.1.4"
|
||||
"webpack": "3.11.0",
|
||||
"webpack-merge": "4.1.2"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "openlayers"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/AssertionError
|
||||
*/
|
||||
import {VERSION, inherits} from './util.js';
|
||||
import {VERSION, inherits} from './index.js';
|
||||
|
||||
/**
|
||||
* Error object thrown when an assertion failed. This is an ECMA-262 Error,
|
||||
@@ -9,11 +9,12 @@ import {VERSION, inherits} from './util.js';
|
||||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error}
|
||||
* @constructor
|
||||
* @extends {Error}
|
||||
* @implements {oli.AssertionError}
|
||||
* @param {number} code Error code.
|
||||
*/
|
||||
const AssertionError = function(code) {
|
||||
|
||||
const path = VERSION.split('-')[0];
|
||||
const path = VERSION ? VERSION.split('-')[0] : 'latest';
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/Collection
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import AssertionError from './AssertionError.js';
|
||||
import CollectionEventType from './CollectionEventType.js';
|
||||
import BaseObject from './Object.js';
|
||||
@@ -24,6 +24,7 @@ const Property = {
|
||||
*
|
||||
* @constructor
|
||||
* @extends {module:ol/events/Event}
|
||||
* @implements {oli.CollectionEvent}
|
||||
* @param {module:ol/CollectionEventType} type Type.
|
||||
* @param {*=} opt_element Element.
|
||||
*/
|
||||
@@ -115,7 +116,8 @@ Collection.prototype.clear = function() {
|
||||
* @api
|
||||
*/
|
||||
Collection.prototype.extend = function(arr) {
|
||||
for (let i = 0, ii = arr.length; i < ii; ++i) {
|
||||
let i, ii;
|
||||
for (i = 0, ii = arr.length; i < ii; ++i) {
|
||||
this.push(arr[i]);
|
||||
}
|
||||
return this;
|
||||
@@ -224,7 +226,8 @@ Collection.prototype.push = function(elem) {
|
||||
*/
|
||||
Collection.prototype.remove = function(elem) {
|
||||
const arr = this.array_;
|
||||
for (let i = 0, ii = arr.length; i < ii; ++i) {
|
||||
let i, ii;
|
||||
for (i = 0, ii = arr.length; i < ii; ++i) {
|
||||
if (arr[i] === elem) {
|
||||
return this.removeAt(i);
|
||||
}
|
||||
@@ -268,7 +271,8 @@ Collection.prototype.setAt = function(index, elem) {
|
||||
this.dispatchEvent(
|
||||
new CollectionEvent(CollectionEventType.ADD, elem));
|
||||
} else {
|
||||
for (let j = n; j < index; ++j) {
|
||||
let j;
|
||||
for (j = n; j < index; ++j) {
|
||||
this.insertAt(j, undefined);
|
||||
}
|
||||
this.insertAt(index, elem);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {assert} from './asserts.js';
|
||||
import {listen, unlisten, unlistenByKey} from './events.js';
|
||||
import EventType from './events/EventType.js';
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import BaseObject, {getChangeEventType} from './Object.js';
|
||||
import Geometry from './geom/Geometry.js';
|
||||
import Style from './style/Style.js';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/Geolocation
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import GeolocationProperty from './GeolocationProperty.js';
|
||||
import BaseObject, {getChangeEventType} from './Object.js';
|
||||
import {listen} from './events.js';
|
||||
|
||||
@@ -61,10 +61,6 @@ const INTERVALS = [
|
||||
* longitudes. This function is called with the longitude as argument, and
|
||||
* should return a formatted string representing the longitude. By default,
|
||||
* labels are formatted as degrees, minutes, seconds and hemisphere.
|
||||
* @property {function(number):string} [latLabelFormatter] Label formatter for
|
||||
* latitudes. This function is called with the latitude as argument, and
|
||||
* should return a formatted string representing the latitude. By default,
|
||||
* labels are formatted as degrees, minutes, seconds and hemisphere.
|
||||
* @property {number} [lonLabelPosition=0] Longitude label position in fractions
|
||||
* (0..1) of view extent. 0 means at the bottom of the viewport, 1 means at the
|
||||
* top.
|
||||
@@ -89,7 +85,7 @@ const INTERVALS = [
|
||||
* Note that the default's `textBaseline` configuration will not work well for
|
||||
* `lonLabelPosition` configurations that position labels close to the top of
|
||||
* the viewport.
|
||||
* @property {module:ol/style/Text} [latLabelStyle] Latitude label text style.
|
||||
* @param {module:ol/style/Text} [latLabelStyle] Latitude label text style.
|
||||
* If not provided, the following style will be used:
|
||||
* ```js
|
||||
* new Text({
|
||||
@@ -245,20 +241,21 @@ const Graticule = function(opt_options) {
|
||||
this.parallelsLabels_ = null;
|
||||
|
||||
if (options.showLabels == true) {
|
||||
const degreesToString = degreesToStringHDMS;
|
||||
|
||||
/**
|
||||
* @type {null|function(number):string}
|
||||
* @private
|
||||
*/
|
||||
this.lonLabelFormatter_ = options.lonLabelFormatter == undefined ?
|
||||
degreesToStringHDMS.bind(this, 'EW') : options.lonLabelFormatter;
|
||||
degreesToString.bind(this, 'EW') : options.lonLabelFormatter;
|
||||
|
||||
/**
|
||||
* @type {function(number):string}
|
||||
* @private
|
||||
*/
|
||||
this.latLabelFormatter_ = options.latLabelFormatter == undefined ?
|
||||
degreesToStringHDMS.bind(this, 'NS') : options.latLabelFormatter;
|
||||
degreesToString.bind(this, 'NS') : options.latLabelFormatter;
|
||||
|
||||
/**
|
||||
* Longitude label position in fractions (0..1) of view extent. 0 means
|
||||
@@ -519,20 +516,21 @@ Graticule.prototype.getInterval_ = function(resolution) {
|
||||
const centerLon = this.projectionCenterLonLat_[0];
|
||||
const centerLat = this.projectionCenterLonLat_[1];
|
||||
let interval = -1;
|
||||
let i, ii, delta, dist;
|
||||
const target = Math.pow(this.targetSize_ * resolution, 2);
|
||||
/** @type {Array.<number>} **/
|
||||
const p1 = [];
|
||||
/** @type {Array.<number>} **/
|
||||
const p2 = [];
|
||||
for (let i = 0, ii = INTERVALS.length; i < ii; ++i) {
|
||||
const delta = INTERVALS[i] / 2;
|
||||
for (i = 0, ii = INTERVALS.length; i < ii; ++i) {
|
||||
delta = INTERVALS[i] / 2;
|
||||
p1[0] = centerLon - delta;
|
||||
p1[1] = centerLat - delta;
|
||||
p2[0] = centerLon + delta;
|
||||
p2[1] = centerLat + delta;
|
||||
this.fromLonLatTransform_(p1, p1);
|
||||
this.fromLonLatTransform_(p2, p2);
|
||||
const dist = Math.pow(p2[0] - p1[0], 2) + Math.pow(p2[1] - p1[1], 2);
|
||||
dist = Math.pow(p2[0] - p1[0], 2) + Math.pow(p2[1] - p1[1], 2);
|
||||
if (dist <= target) {
|
||||
break;
|
||||
}
|
||||
@@ -669,24 +667,36 @@ Graticule.prototype.handlePostCompose_ = function(e) {
|
||||
Graticule.prototype.updateProjectionInfo_ = function(projection) {
|
||||
const epsg4326Projection = getProjection('EPSG:4326');
|
||||
|
||||
const extent = projection.getExtent();
|
||||
const worldExtent = projection.getWorldExtent();
|
||||
const worldExtentP = transformExtent(worldExtent, epsg4326Projection, projection);
|
||||
|
||||
this.maxLat_ = worldExtent[3];
|
||||
this.maxLon_ = worldExtent[2];
|
||||
this.minLat_ = worldExtent[1];
|
||||
this.minLon_ = worldExtent[0];
|
||||
const maxLat = worldExtent[3];
|
||||
const maxLon = worldExtent[2];
|
||||
const minLat = worldExtent[1];
|
||||
const minLon = worldExtent[0];
|
||||
|
||||
const maxLatP = worldExtentP[3];
|
||||
const maxLonP = worldExtentP[2];
|
||||
const minLatP = worldExtentP[1];
|
||||
const minLonP = worldExtentP[0];
|
||||
|
||||
this.maxLat_ = maxLat;
|
||||
this.maxLon_ = maxLon;
|
||||
this.minLat_ = minLat;
|
||||
this.minLon_ = minLon;
|
||||
|
||||
this.maxLatP_ = maxLatP;
|
||||
this.maxLonP_ = maxLonP;
|
||||
this.minLatP_ = minLatP;
|
||||
this.minLonP_ = minLonP;
|
||||
|
||||
this.maxLatP_ = worldExtentP[3];
|
||||
this.maxLonP_ = worldExtentP[2];
|
||||
this.minLatP_ = worldExtentP[1];
|
||||
this.minLonP_ = worldExtentP[0];
|
||||
|
||||
this.fromLonLatTransform_ = getTransform(epsg4326Projection, projection);
|
||||
|
||||
this.toLonLatTransform_ = getTransform(projection, epsg4326Projection);
|
||||
|
||||
this.projectionCenterLonLat_ = this.toLonLatTransform_(getCenter(projection.getExtent()));
|
||||
this.projectionCenterLonLat_ = this.toLonLatTransform_(getCenter(extent));
|
||||
|
||||
this.projection_ = projection;
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/Image
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import ImageBase from './ImageBase.js';
|
||||
import ImageState from './ImageState.js';
|
||||
import {listenOnce, unlistenByKey} from './events.js';
|
||||
@@ -23,7 +23,7 @@ import {getHeight} from './extent.js';
|
||||
* post requests or - in general - through XHR requests, where the src of the
|
||||
* image element would be set to a data URI when the content is loaded.
|
||||
*
|
||||
* @typedef {function(module:ol/Image, string)} LoadFunction
|
||||
* @typedef {function(module:ol/Image~Image, string)} LoadFunction
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -50,7 +50,7 @@ const ImageWrapper = function(extent, resolution, pixelRatio, src, crossOrigin,
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement}
|
||||
* @type {HTMLCanvasElement|Image|HTMLVideoElement}
|
||||
*/
|
||||
this.image_ = new Image();
|
||||
if (crossOrigin !== null) {
|
||||
@@ -139,7 +139,7 @@ ImageWrapper.prototype.load = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @param {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} image Image.
|
||||
* @param {HTMLCanvasElement|Image|HTMLVideoElement} image Image.
|
||||
*/
|
||||
ImageWrapper.prototype.setImage = function(image) {
|
||||
this.image_ = image;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/ImageBase
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import EventTarget from './events/EventTarget.js';
|
||||
import EventType from './events/EventType.js';
|
||||
|
||||
@@ -65,7 +65,7 @@ ImageBase.prototype.getExtent = function() {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image.
|
||||
* @return {HTMLCanvasElement|Image|HTMLVideoElement} Image.
|
||||
*/
|
||||
ImageBase.prototype.getImage = function() {};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/ImageCanvas
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import ImageBase from './ImageBase.js';
|
||||
import ImageState from './ImageState.js';
|
||||
|
||||
@@ -94,7 +94,7 @@ ImageCanvas.prototype.load = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @return {HTMLCanvasElement} Canvas element.
|
||||
* @inheritDoc
|
||||
*/
|
||||
ImageCanvas.prototype.getImage = function() {
|
||||
return this.canvas_;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/ImageTile
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import Tile from './Tile.js';
|
||||
import TileState from './TileState.js';
|
||||
import {createCanvasContext2D} from './dom.js';
|
||||
@@ -44,7 +44,7 @@ const ImageTile = function(tileCoord, state, src, crossOrigin, tileLoadFunction,
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {HTMLImageElement|HTMLCanvasElement}
|
||||
* @type {Image|HTMLCanvasElement}
|
||||
*/
|
||||
this.image_ = new Image();
|
||||
if (crossOrigin !== null) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/Map
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import PluggableMap from './PluggableMap.js';
|
||||
import {defaults as defaultControls} from './control/util.js';
|
||||
import {defaults as defaultInteractions} from './interaction.js';
|
||||
@@ -35,7 +35,7 @@ import CanvasVectorTileLayerRenderer from './renderer/canvas/VectorTileLayer.js'
|
||||
* target: 'map'
|
||||
* });
|
||||
*
|
||||
* The above snippet creates a map using a {@link module:ol/layer/Tile} to
|
||||
* The above snippet creates a map using a {@link module:ol/layer/Tile~Tile} to
|
||||
* display {@link module:ol/source/OSM~OSM} OSM data and render it to a DOM
|
||||
* element with the id `map`.
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/MapBrowserEvent
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import MapEvent from './MapEvent.js';
|
||||
|
||||
/**
|
||||
@@ -11,6 +11,7 @@ import MapEvent from './MapEvent.js';
|
||||
*
|
||||
* @constructor
|
||||
* @extends {module:ol/MapEvent}
|
||||
* @implements {oli.MapBrowserEvent}
|
||||
* @param {string} type Event type.
|
||||
* @param {module:ol/PluggableMap} map Map.
|
||||
* @param {Event} browserEvent Browser event.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/MapBrowserEventHandler
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import {DEVICE_PIXEL_RATIO} from './has.js';
|
||||
import MapBrowserEventType from './MapBrowserEventType.js';
|
||||
import MapBrowserPointerEvent from './MapBrowserPointerEvent.js';
|
||||
@@ -301,8 +301,7 @@ MapBrowserEventHandler.prototype.relayEvent_ = function(pointerEvent) {
|
||||
* @private
|
||||
*/
|
||||
MapBrowserEventHandler.prototype.isMoving_ = function(pointerEvent) {
|
||||
return this.dragging_ ||
|
||||
Math.abs(pointerEvent.clientX - this.down_.clientX) > this.moveTolerance_ ||
|
||||
return Math.abs(pointerEvent.clientX - this.down_.clientX) > this.moveTolerance_ ||
|
||||
Math.abs(pointerEvent.clientY - this.down_.clientY) > this.moveTolerance_;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/MapBrowserPointerEvent
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import MapBrowserEvent from './MapBrowserEvent.js';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/MapEvent
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import Event from './events/Event.js';
|
||||
|
||||
/**
|
||||
@@ -11,6 +11,7 @@ import Event from './events/Event.js';
|
||||
*
|
||||
* @constructor
|
||||
* @extends {module:ol/events/Event}
|
||||
* @implements {oli.MapEvent}
|
||||
* @param {string} type Event type.
|
||||
* @param {module:ol/PluggableMap} map Map.
|
||||
* @param {?module:ol/PluggableMap~FrameState=} opt_frameState Frame state.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/Object
|
||||
*/
|
||||
import {getUid, inherits} from './util.js';
|
||||
import {getUid, inherits} from './index.js';
|
||||
import ObjectEventType from './ObjectEventType.js';
|
||||
import Observable from './Observable.js';
|
||||
import Event from './events/Event.js';
|
||||
@@ -17,6 +17,7 @@ import {assign} from './obj.js';
|
||||
* @param {string} key The property name.
|
||||
* @param {*} oldValue The old value for `key`.
|
||||
* @extends {module:ol/events/Event}
|
||||
* @implements {oli.Object.Event}
|
||||
* @constructor
|
||||
*/
|
||||
const ObjectEvent = function(type, key, oldValue) {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
export default {
|
||||
/**
|
||||
* Triggered when a property is changed.
|
||||
* @event module:ol/Object~ObjectEvent#propertychange
|
||||
* @event module:ol/Object~Event#propertychange
|
||||
* @api
|
||||
*/
|
||||
PROPERTYCHANGE: 'propertychange'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/Observable
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import {listen, unlistenByKey, unlisten, listenOnce} from './events.js';
|
||||
import EventTarget from './events/EventTarget.js';
|
||||
import EventType from './events/EventType.js';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/Overlay
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import MapEventType from './MapEventType.js';
|
||||
import BaseObject, {getChangeEventType} from './Object.js';
|
||||
import OverlayPositioning from './OverlayPositioning.js';
|
||||
@@ -15,7 +15,7 @@ import {containsExtent} from './extent.js';
|
||||
* @typedef {Object} Options
|
||||
* @property {number|string} [id] Set the overlay id. The overlay id can be used
|
||||
* with the {@link module:ol/Map~Map#getOverlayById} method.
|
||||
* @property {HTMLElement} [element] The overlay element.
|
||||
* @property {Element} [element] The overlay element.
|
||||
* @property {Array.<number>} [offset=[0, 0]] Offsets in pixels used when positioning
|
||||
* the overlay. The first element in the
|
||||
* array is the horizontal offset. A positive value shifts the overlay right.
|
||||
@@ -32,7 +32,7 @@ import {containsExtent} from './extent.js';
|
||||
* viewport should be stopped. If `true` the overlay is placed in the same
|
||||
* container as that of the controls (CSS class name
|
||||
* `ol-overlaycontainer-stopevent`); if `false` it is placed in the container
|
||||
* with CSS class name specified by the `className` property.
|
||||
* with CSS class name `ol-overlaycontainer`.
|
||||
* @property {boolean} [insertFirst=true] Whether the overlay is inserted first
|
||||
* in the overlay container, or appended. If the overlay is placed in the same
|
||||
* container as that of the controls (see the `stopEvent` option) you will
|
||||
@@ -129,7 +129,7 @@ const Overlay = function(options) {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {HTMLElement}
|
||||
* @type {Element}
|
||||
*/
|
||||
this.element = document.createElement('DIV');
|
||||
this.element.className = options.className !== undefined ?
|
||||
@@ -218,12 +218,12 @@ inherits(Overlay, BaseObject);
|
||||
|
||||
/**
|
||||
* Get the DOM element of this overlay.
|
||||
* @return {HTMLElement|undefined} The Element containing the overlay.
|
||||
* @return {Element|undefined} The Element containing the overlay.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
Overlay.prototype.getElement = function() {
|
||||
return /** @type {HTMLElement|undefined} */ (this.get(Property.ELEMENT));
|
||||
return /** @type {Element|undefined} */ (this.get(Property.ELEMENT));
|
||||
};
|
||||
|
||||
|
||||
@@ -364,7 +364,7 @@ Overlay.prototype.handlePositioningChanged = function() {
|
||||
|
||||
/**
|
||||
* Set the DOM element to be associated with this overlay.
|
||||
* @param {HTMLElement|undefined} element The Element containing the overlay.
|
||||
* @param {Element|undefined} element The Element containing the overlay.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
@@ -422,7 +422,7 @@ Overlay.prototype.panIntoView = function() {
|
||||
}
|
||||
|
||||
const mapRect = this.getRect(map.getTargetElement(), map.getSize());
|
||||
const element = this.getElement();
|
||||
const element = /** @type {!Element} */ (this.getElement());
|
||||
const overlayRect = this.getRect(element, [outerWidth(element), outerHeight(element)]);
|
||||
|
||||
const margin = this.autoPanMargin;
|
||||
@@ -469,7 +469,7 @@ Overlay.prototype.panIntoView = function() {
|
||||
|
||||
/**
|
||||
* Get the extent of an element relative to the document
|
||||
* @param {HTMLElement|undefined} element The element.
|
||||
* @param {Element|undefined} element The element.
|
||||
* @param {module:ol/size~Size|undefined} size The size of the element.
|
||||
* @return {module:ol/extent~Extent} The extent.
|
||||
* @protected
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/PluggableMap
|
||||
*/
|
||||
import {getUid, inherits} from './util.js';
|
||||
import {getUid, inherits} from './index.js';
|
||||
import Collection from './Collection.js';
|
||||
import CollectionEventType from './CollectionEventType.js';
|
||||
import MapBrowserEvent from './MapBrowserEvent.js';
|
||||
@@ -76,7 +76,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
* @typedef {Object} MapOptionsInternal
|
||||
* @property {module:ol/Collection.<module:ol/control/Control>} [controls]
|
||||
* @property {module:ol/Collection.<module:ol/interaction/Interaction>} [interactions]
|
||||
* @property {HTMLElement|Document} keyboardEventTarget
|
||||
* @property {Element|Document} keyboardEventTarget
|
||||
* @property {module:ol/Collection.<module:ol/Overlay>} overlays
|
||||
* @property {Object.<string, *>} values
|
||||
*/
|
||||
@@ -87,13 +87,13 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
* @typedef {Object} MapOptions
|
||||
* @property {module:ol/Collection.<module:ol/control/Control>|Array.<module:ol/control/Control>} [controls]
|
||||
* Controls initially added to the map. If not specified,
|
||||
* {@link module:ol/control/util~defaults} is used.
|
||||
* {@link module:ol/control~defaults} is used.
|
||||
* @property {number} [pixelRatio=window.devicePixelRatio] The ratio between
|
||||
* physical pixels and device-independent pixels (dips) on the device.
|
||||
* @property {module:ol/Collection.<module:ol/interaction/Interaction>|Array.<module:ol/interaction/Interaction>} [interactions]
|
||||
* Interactions that are initially added to the map. If not specified,
|
||||
* {@link module:ol/interaction~defaults} is used.
|
||||
* @property {HTMLElement|Document|string} [keyboardEventTarget] The element to
|
||||
* @property {Element|Document|string} [keyboardEventTarget] The element to
|
||||
* listen to keyboard events on. This determines when the `KeyboardPan` and
|
||||
* `KeyboardZoom` interactions trigger. For example, if this option is set to
|
||||
* `document` the keyboard interactions will always trigger. If this option is
|
||||
@@ -120,7 +120,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
* Increasing this value can make it easier to click on the map.
|
||||
* @property {module:ol/Collection.<module:ol/Overlay>|Array.<module:ol/Overlay>} [overlays]
|
||||
* Overlays initially added to the map. By default, no overlays are added.
|
||||
* @property {HTMLElement|string} [target] The container for the map, either the
|
||||
* @property {Element|string} [target] The container for the map, either the
|
||||
* element itself or the `id` of the element. If not specified at construction
|
||||
* time, {@link module:ol/Map~Map#setTarget} must be called for the map to be
|
||||
* rendered.
|
||||
@@ -240,7 +240,7 @@ const PluggableMap = function(options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!HTMLElement}
|
||||
* @type {Element}
|
||||
*/
|
||||
this.viewport_ = document.createElement('DIV');
|
||||
this.viewport_.className = 'ol-viewport' + (TOUCH ? ' ol-touch' : '');
|
||||
@@ -254,7 +254,7 @@ const PluggableMap = function(options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!HTMLElement}
|
||||
* @type {!Element}
|
||||
*/
|
||||
this.overlayContainer_ = document.createElement('DIV');
|
||||
this.overlayContainer_.className = 'ol-overlaycontainer';
|
||||
@@ -262,7 +262,7 @@ const PluggableMap = function(options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!HTMLElement}
|
||||
* @type {!Element}
|
||||
*/
|
||||
this.overlayContainerStopEvent_ = document.createElement('DIV');
|
||||
this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent';
|
||||
@@ -293,7 +293,7 @@ const PluggableMap = function(options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {HTMLElement|Document}
|
||||
* @type {Element|Document}
|
||||
*/
|
||||
this.keyboardEventTarget_ = optionsInternal.keyboardEventTarget;
|
||||
|
||||
@@ -303,9 +303,12 @@ const PluggableMap = function(options) {
|
||||
*/
|
||||
this.keyHandlerKeys_ = null;
|
||||
|
||||
listen(this.viewport_, EventType.CONTEXTMENU, this.handleBrowserEvent, this);
|
||||
listen(this.viewport_, EventType.WHEEL, this.handleBrowserEvent, this);
|
||||
listen(this.viewport_, EventType.MOUSEWHEEL, this.handleBrowserEvent, this);
|
||||
listen(this.viewport_, EventType.CONTEXTMENU,
|
||||
this.handleBrowserEvent, this);
|
||||
listen(this.viewport_, EventType.WHEEL,
|
||||
this.handleBrowserEvent, this);
|
||||
listen(this.viewport_, EventType.MOUSEWHEEL,
|
||||
this.handleBrowserEvent, this);
|
||||
|
||||
/**
|
||||
* @type {module:ol/Collection.<module:ol/control/Control>}
|
||||
@@ -336,7 +339,7 @@ const PluggableMap = function(options) {
|
||||
* @type {module:ol/renderer/Map}
|
||||
* @private
|
||||
*/
|
||||
this.renderer_ = this.createRenderer();
|
||||
this.renderer_ = this.createRenderer(this.viewport_, this);
|
||||
|
||||
/**
|
||||
* @type {function(Event)|undefined}
|
||||
@@ -390,9 +393,9 @@ const PluggableMap = function(options) {
|
||||
* @param {module:ol/control/Control} control Control.
|
||||
* @this {module:ol/PluggableMap}
|
||||
*/
|
||||
(function(control) {
|
||||
function(control) {
|
||||
control.setMap(this);
|
||||
}).bind(this));
|
||||
}.bind(this));
|
||||
|
||||
listen(this.controls, CollectionEventType.ADD,
|
||||
/**
|
||||
@@ -415,9 +418,9 @@ const PluggableMap = function(options) {
|
||||
* @param {module:ol/interaction/Interaction} interaction Interaction.
|
||||
* @this {module:ol/PluggableMap}
|
||||
*/
|
||||
(function(interaction) {
|
||||
function(interaction) {
|
||||
interaction.setMap(this);
|
||||
}).bind(this));
|
||||
}.bind(this));
|
||||
|
||||
listen(this.interactions, CollectionEventType.ADD,
|
||||
/**
|
||||
@@ -612,22 +615,29 @@ PluggableMap.prototype.getFeaturesAtPixel = function(pixel, opt_options) {
|
||||
* [R, G, B, A] pixel values (0 - 255) and will be `null` for layer types
|
||||
* that do not currently support this argument. To stop detection, callback
|
||||
* functions can return a truthy value.
|
||||
* @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Configuration options.
|
||||
* @param {S=} opt_this Value to use as `this` when executing `callback`.
|
||||
* @param {(function(this: U, module:ol/layer/Layer): boolean)=} opt_layerFilter Layer
|
||||
* filter function. The filter function will receive one argument, the
|
||||
* {@link module:ol/layer/Layer layer-candidate} and it should return a boolean
|
||||
* value. Only layers which are visible and for which this function returns
|
||||
* `true` will be tested for features. By default, all visible layers will
|
||||
* be tested.
|
||||
* @param {U=} opt_this2 Value to use as `this` when executing `layerFilter`.
|
||||
* @return {T|undefined} Callback result, i.e. the return value of last
|
||||
* callback execution, or the first truthy callback return value.
|
||||
* @template S,T
|
||||
* @template S,T,U
|
||||
* @api
|
||||
*/
|
||||
PluggableMap.prototype.forEachLayerAtPixel = function(pixel, callback, opt_options) {
|
||||
PluggableMap.prototype.forEachLayerAtPixel = function(pixel, callback, opt_this, opt_layerFilter, opt_this2) {
|
||||
if (!this.frameState_) {
|
||||
return;
|
||||
}
|
||||
const options = opt_options || {};
|
||||
const hitTolerance = options.hitTolerance !== undefined ?
|
||||
opt_options.hitTolerance * this.frameState_.pixelRatio : 0;
|
||||
const layerFilter = options.layerFilter || TRUE;
|
||||
const thisArg = opt_this !== undefined ? opt_this : null;
|
||||
const layerFilter = opt_layerFilter !== undefined ? opt_layerFilter : TRUE;
|
||||
const thisArg2 = opt_this2 !== undefined ? opt_this2 : null;
|
||||
return this.renderer_.forEachLayerAtPixel(
|
||||
pixel, this.frameState_, hitTolerance, callback, null, layerFilter, null);
|
||||
pixel, this.frameState_, callback, thisArg,
|
||||
layerFilter, thisArg2);
|
||||
};
|
||||
|
||||
|
||||
@@ -685,13 +695,13 @@ PluggableMap.prototype.getEventPixel = function(event) {
|
||||
* Get the target in which this map is rendered.
|
||||
* Note that this returns what is entered as an option or in setTarget:
|
||||
* if that was an element, it returns an element; if a string, it returns that.
|
||||
* @return {HTMLElement|string|undefined} The Element or id of the Element that the
|
||||
* @return {Element|string|undefined} The Element or id of the Element that the
|
||||
* map is rendered in.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
PluggableMap.prototype.getTarget = function() {
|
||||
return /** @type {HTMLElement|string|undefined} */ (this.get(MapProperty.TARGET));
|
||||
return /** @type {Element|string|undefined} */ (this.get(MapProperty.TARGET));
|
||||
};
|
||||
|
||||
|
||||
@@ -699,7 +709,7 @@ PluggableMap.prototype.getTarget = function() {
|
||||
* Get the DOM element into which this map is rendered. In contrast to
|
||||
* `getTarget` this method always return an `Element`, or `null` if the
|
||||
* map has no target.
|
||||
* @return {HTMLElement} The element that the map is rendered in.
|
||||
* @return {Element} The element that the map is rendered in.
|
||||
* @api
|
||||
*/
|
||||
PluggableMap.prototype.getTargetElement = function() {
|
||||
@@ -780,13 +790,13 @@ PluggableMap.prototype.getInteractions = function() {
|
||||
|
||||
/**
|
||||
* Get the layergroup associated with this map.
|
||||
* @return {module:ol/layer/Group} A layer group containing the layers in this map.
|
||||
* @return {module:ol/layer/Group~Group} A layer group containing the layers in this map.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
PluggableMap.prototype.getLayerGroup = function() {
|
||||
return (
|
||||
/** @type {module:ol/layer/Group} */ (this.get(MapProperty.LAYERGROUP))
|
||||
/** @type {module:ol/layer/Group~Group} */ (this.get(MapProperty.LAYERGROUP))
|
||||
);
|
||||
};
|
||||
|
||||
@@ -857,7 +867,7 @@ PluggableMap.prototype.getView = function() {
|
||||
|
||||
/**
|
||||
* Get the element that serves as the map viewport.
|
||||
* @return {HTMLElement} Viewport.
|
||||
* @return {Element} Viewport.
|
||||
* @api
|
||||
*/
|
||||
PluggableMap.prototype.getViewport = function() {
|
||||
@@ -870,7 +880,7 @@ PluggableMap.prototype.getViewport = function() {
|
||||
* this container will let mousedown and touchstart events through to the map,
|
||||
* so clicks and gestures on an overlay will trigger {@link module:ol/MapBrowserEvent~MapBrowserEvent}
|
||||
* events.
|
||||
* @return {!HTMLElement} The map's overlay container.
|
||||
* @return {!Element} The map's overlay container.
|
||||
*/
|
||||
PluggableMap.prototype.getOverlayContainer = function() {
|
||||
return this.overlayContainer_;
|
||||
@@ -882,7 +892,7 @@ PluggableMap.prototype.getOverlayContainer = function() {
|
||||
* event propagation. Elements added to this container won't let mousedown and
|
||||
* touchstart events through to the map, so clicks and gestures on an overlay
|
||||
* don't trigger any {@link module:ol/MapBrowserEvent~MapBrowserEvent}.
|
||||
* @return {!HTMLElement} The map's overlay container that stops events.
|
||||
* @return {!Element} The map's overlay container that stops events.
|
||||
*/
|
||||
PluggableMap.prototype.getOverlayContainerStopEvent = function() {
|
||||
return this.overlayContainerStopEvent_;
|
||||
@@ -1300,7 +1310,8 @@ PluggableMap.prototype.renderFrame_ = function(time) {
|
||||
|
||||
/**
|
||||
* Sets the layergroup of this map.
|
||||
* @param {module:ol/layer/Group} layerGroup A layer group containing the layers in this map.
|
||||
* @param {module:ol/layer/Group~Group} layerGroup A layer group containing the layers in
|
||||
* this map.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
@@ -1322,7 +1333,7 @@ PluggableMap.prototype.setSize = function(size) {
|
||||
|
||||
/**
|
||||
* Set the target element to render this map into.
|
||||
* @param {HTMLElement|string|undefined} target The Element or id of the Element
|
||||
* @param {Element|string|undefined} target The Element or id of the Element
|
||||
* that the map is rendered in.
|
||||
* @observable
|
||||
* @api
|
||||
@@ -1398,7 +1409,7 @@ PluggableMap.prototype.unskipFeature = function(feature) {
|
||||
function createOptionsInternal(options) {
|
||||
|
||||
/**
|
||||
* @type {HTMLElement|Document}
|
||||
* @type {Element|Document}
|
||||
*/
|
||||
let keyboardEventTarget = null;
|
||||
if (options.keyboardEventTarget !== undefined) {
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
# ol
|
||||
|
||||
OpenLayers as ES modules.
|
||||
|
||||
## Usage
|
||||
|
||||
Add the `ol` package as a dependency to your project.
|
||||
|
||||
npm install ol --save
|
||||
|
||||
Import just what you need for your application:
|
||||
|
||||
```js
|
||||
import Map from 'ol/Map';
|
||||
import View from 'ol/View';
|
||||
import TileLayer from 'ol/layer/Tile';
|
||||
import XYZ from 'ol/source/XYZ';
|
||||
|
||||
new Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new TileLayer({
|
||||
source: new XYZ({
|
||||
url: 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'
|
||||
})
|
||||
})
|
||||
],
|
||||
view: new View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
})
|
||||
});
|
||||
```
|
||||
|
||||
See the following examples for more detail on bundling OpenLayers with your application:
|
||||
|
||||
* Using [Rollup](https://github.com/openlayers/ol-rollup)
|
||||
* Using [Webpack](https://github.com/openlayers/ol-webpack)
|
||||
* Using [Parcel](https://github.com/openlayers/ol-parcel)
|
||||
|
||||
## Module Identifiers
|
||||
|
||||
The module identifiers shown in the above snippet (e.g. `ol/Map`, note the CamelCase module name) are default exports of constructors. There are also modules like 'ol/proj' (note the lowercase module name), which provide named exports for utility functions and constants, e.g.
|
||||
|
||||
```js
|
||||
import {fromLonLat} from 'ol/proj';
|
||||
|
||||
map.setCenter(fromLonLat([16, 48]));
|
||||
```
|
||||
See the [API documentation](http://openlayers.org/en/latest/apidoc/) for a reference of all modules, and just keep in mind: CamelCase modules provide a default export, lowercase modules provide named exports.
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/Tile
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import TileState from './TileState.js';
|
||||
import {easeIn} from './easing.js';
|
||||
import EventTarget from './events/EventTarget.js';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/TileCache
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import LRUCache from './structs/LRUCache.js';
|
||||
import {fromKey, getKey} from './tilecoord.js';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/TileQueue
|
||||
*/
|
||||
import {inherits} from './util.js';
|
||||
import {inherits} from './index.js';
|
||||
import TileState from './TileState.js';
|
||||
import {listen, unlisten} from './events.js';
|
||||
import EventType from './events/EventType.js';
|
||||
@@ -27,18 +27,20 @@ const TileQueue = function(tilePriorityFunction, tileChangeCallback) {
|
||||
PriorityQueue.call(
|
||||
this,
|
||||
/**
|
||||
* @param {Array} element Element.
|
||||
* @return {number} Priority.
|
||||
*/
|
||||
* @param {Array} element Element.
|
||||
* @return {number} Priority.
|
||||
*/
|
||||
function(element) {
|
||||
return tilePriorityFunction.apply(null, element);
|
||||
},
|
||||
/**
|
||||
* @param {Array} element Element.
|
||||
* @return {string} Key.
|
||||
*/
|
||||
* @param {Array} element Element.
|
||||
* @return {string} Key.
|
||||
*/
|
||||
function(element) {
|
||||
return (/** @type {module:ol/Tile} */ (element[0]).getKey());
|
||||
return (
|
||||
/** @type {module:ol/Tile} */ (element[0]).getKey()
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -71,7 +73,8 @@ TileQueue.prototype.enqueue = function(element) {
|
||||
const added = PriorityQueue.prototype.enqueue.call(this, element);
|
||||
if (added) {
|
||||
const tile = element[0];
|
||||
listen(tile, EventType.CHANGE, this.handleTileChange, this);
|
||||
listen(tile, EventType.CHANGE,
|
||||
this.handleTileChange, this);
|
||||
}
|
||||
return added;
|
||||
};
|
||||
@@ -94,7 +97,8 @@ TileQueue.prototype.handleTileChange = function(event) {
|
||||
const state = tile.getState();
|
||||
if (state === TileState.LOADED || state === TileState.ERROR ||
|
||||
state === TileState.EMPTY || state === TileState.ABORT) {
|
||||
unlisten(tile, EventType.CHANGE, this.handleTileChange, this);
|
||||
unlisten(tile, EventType.CHANGE,
|
||||
this.handleTileChange, this);
|
||||
const tileKey = tile.getKey();
|
||||
if (tileKey in this.tilesLoadingKeys_) {
|
||||
delete this.tilesLoadingKeys_[tileKey];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/VectorImageTile
|
||||
*/
|
||||
import {getUid, inherits} from './util.js';
|
||||
import {getUid, inherits} from './index.js';
|
||||
import Tile from './Tile.js';
|
||||
import TileState from './TileState.js';
|
||||
import {createCanvasContext2D} from './dom.js';
|
||||
@@ -9,7 +9,6 @@ import {listen, unlistenByKey} from './events.js';
|
||||
import {getHeight, getIntersection, getWidth} from './extent.js';
|
||||
import EventType from './events/EventType.js';
|
||||
import {loadFeaturesXhr} from './featureloader.js';
|
||||
import {UNDEFINED} from './functions.js';
|
||||
|
||||
|
||||
/**
|
||||
@@ -41,13 +40,13 @@ import {UNDEFINED} from './functions.js';
|
||||
* instantiate for source tiles.
|
||||
* @param {function(this: module:ol/source/VectorTile, module:ol/events/Event)} handleTileChange
|
||||
* Function to call when a source tile's state changes.
|
||||
* @param {number} zoom Integer zoom to render the tile for.
|
||||
* @param {module:ol/Tile~Options=} opt_options Tile options.
|
||||
*/
|
||||
const VectorImageTile = function(tileCoord, state, sourceRevision, format,
|
||||
tileLoadFunction, urlTileCoord, tileUrlFunction, sourceTileGrid, tileGrid,
|
||||
sourceTiles, pixelRatio, projection, tileClass, handleTileChange, zoom) {
|
||||
sourceTiles, pixelRatio, projection, tileClass, handleTileChange, opt_options) {
|
||||
|
||||
Tile.call(this, tileCoord, state, {transition: 0});
|
||||
Tile.call(this, tileCoord, state, opt_options);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -79,11 +78,6 @@ const VectorImageTile = function(tileCoord, state, sourceRevision, format,
|
||||
*/
|
||||
this.tileKeys = [];
|
||||
|
||||
/**
|
||||
* @type {module:ol/extent~Extent}
|
||||
*/
|
||||
this.extent = null;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
@@ -105,11 +99,9 @@ const VectorImageTile = function(tileCoord, state, sourceRevision, format,
|
||||
this.sourceTileListenerKeys_ = [];
|
||||
|
||||
if (urlTileCoord) {
|
||||
const extent = this.extent = tileGrid.getTileCoordExtent(urlTileCoord);
|
||||
const resolution = tileGrid.getResolution(zoom);
|
||||
const extent = tileGrid.getTileCoordExtent(urlTileCoord);
|
||||
const resolution = tileGrid.getResolution(tileCoord[0]);
|
||||
const sourceZ = sourceTileGrid.getZForResolution(resolution);
|
||||
const useLoadedOnly = zoom != tileCoord[0];
|
||||
let loadCount = 0;
|
||||
sourceTileGrid.forEachTileCoord(extent, sourceZ, function(sourceTileCoord) {
|
||||
let sharedExtent = getIntersection(extent,
|
||||
sourceTileGrid.getTileCoordExtent(sourceTileCoord));
|
||||
@@ -120,10 +112,9 @@ const VectorImageTile = function(tileCoord, state, sourceRevision, format,
|
||||
if (getWidth(sharedExtent) / resolution >= 0.5 &&
|
||||
getHeight(sharedExtent) / resolution >= 0.5) {
|
||||
// only include source tile if overlap is at least 1 pixel
|
||||
++loadCount;
|
||||
const sourceTileKey = sourceTileCoord.toString();
|
||||
let sourceTile = sourceTiles[sourceTileKey];
|
||||
if (!sourceTile && !useLoadedOnly) {
|
||||
if (!sourceTile) {
|
||||
const tileUrl = tileUrlFunction(sourceTileCoord, pixelRatio, projection);
|
||||
sourceTile = sourceTiles[sourceTileKey] = new tileClass(sourceTileCoord,
|
||||
tileUrl == undefined ? TileState.EMPTY : TileState.IDLE,
|
||||
@@ -132,29 +123,10 @@ const VectorImageTile = function(tileCoord, state, sourceRevision, format,
|
||||
this.sourceTileListenerKeys_.push(
|
||||
listen(sourceTile, EventType.CHANGE, handleTileChange));
|
||||
}
|
||||
if (sourceTile && (!useLoadedOnly || sourceTile.getState() == TileState.LOADED)) {
|
||||
sourceTile.consumers++;
|
||||
this.tileKeys.push(sourceTileKey);
|
||||
}
|
||||
sourceTile.consumers++;
|
||||
this.tileKeys.push(sourceTileKey);
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
if (useLoadedOnly && loadCount == this.tileKeys.length) {
|
||||
this.finishLoading_();
|
||||
}
|
||||
|
||||
if (zoom <= tileCoord[0] && this.state != TileState.LOADED) {
|
||||
while (zoom > tileGrid.getMinZoom()) {
|
||||
const tile = new VectorImageTile(tileCoord, state, sourceRevision,
|
||||
format, tileLoadFunction, urlTileCoord, tileUrlFunction,
|
||||
sourceTileGrid, tileGrid, sourceTiles, pixelRatio, projection,
|
||||
tileClass, UNDEFINED, --zoom);
|
||||
if (tile.state == TileState.LOADED) {
|
||||
this.interimTile = tile;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/VectorTile
|
||||
*/
|
||||
import {getUid, inherits} from './util.js';
|
||||
import {getUid, inherits} from './index.js';
|
||||
import Tile from './Tile.js';
|
||||
import TileState from './TileState.js';
|
||||
|
||||
@@ -59,7 +59,7 @@ const VectorTile = function(tileCoord, state, src, format, tileLoadFunction, opt
|
||||
* @private
|
||||
* @type {module:ol/proj/Projection}
|
||||
*/
|
||||
this.projection_ = null;
|
||||
this.projection_;
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user