Compare commits

..

96 Commits

Author SHA1 Message Date
Andreas Hocevar
f515c86f54 Merge pull request #6489 from openlayers/release-v4.0.1
Release v4.0.1
2017-02-14 10:23:04 +01:00
Andreas Hocevar
87eaa1fba4 Update ol package version to 4.0.1-beta.1 2017-02-14 10:22:06 +01:00
Andreas Hocevar
032ce16519 Update package version to 4.0.1 2017-02-14 10:21:18 +01:00
Andreas Hocevar
ea190e2009 Changelog for v4.0.1 2017-02-14 10:20:43 +01:00
Andreas Hocevar
fbd954ac7c Merge pull request #6486 from ahocevar/reset-on-pointer-count-change
Do not set center when touches count has changed
2017-02-14 01:29:11 +01:00
Andreas Hocevar
676dda7ca6 Reset kinetic when number of touches changes 2017-02-14 01:15:16 +01:00
Andreas Hocevar
186935c147 Only update kinetic when number of touches has not changed 2017-02-14 00:48:59 +01:00
Andreas Hocevar
8e35b7a1ad Do not set center when touches count has changed 2017-02-13 22:30:51 +01:00
Andreas Hocevar
0c159cf0f7 Update ol package version to v4.0.0-beta.1 2017-02-10 18:14:30 +00:00
Andreas Hocevar
6f54f6c113 Merge pull request #6482 from openlayers/release-v4.0.0
Release v4.0.0
2017-02-10 18:00:41 +00:00
Andreas Hocevar
d7eda2c69f Update package version to 4.0.0 2017-02-10 17:44:28 +00:00
Andreas Hocevar
d6adbfd8fa Changelog for v4.0.0 2017-02-10 17:43:42 +00:00
Andreas Hocevar
e6944c6664 Merge pull request #6477 from ahocevar/rotate-restore
Save and restore context when rotating
2017-02-10 16:58:18 +00:00
Frédéric Junod
e58f173c78 Merge pull request #6475 from fredj/zoomify_url_template
Use an url template for ol.source.Zoomify
2017-02-10 12:13:37 +01:00
Andreas Hocevar
f8d5401ccf Merge pull request #6478 from openlayers/greenkeeper/clean-css-cli-4.0.6
Update clean-css-cli to the latest version 🚀
2017-02-10 11:05:24 +00:00
Andreas Hocevar
da4ddccad9 Allow Zoomify url without TileGroup, z, x and y placeholder 2017-02-10 12:01:56 +01:00
greenkeeper[bot]
afd51801f8 chore(package): update clean-css-cli to version 4.0.6
https://greenkeeper.io/
2017-02-10 10:50:58 +00:00
Andreas Hocevar
e561504d27 Save and restore context when rotating 2017-02-10 10:05:07 +00:00
Frederic Junod
a4a8d01bac Use an url template for ol.source.Zoomify 2017-02-09 17:06:23 +01:00
Andreas Hocevar
abb3bad108 Merge pull request #6472 from ahocevar/hittolerance-test
Use fixed pixel ratio for hit tolerance tests
2017-02-08 18:45:59 +01:00
Andreas Hocevar
8581e17593 Use fixed pixel ratio for hit tolerance tests 2017-02-08 16:30:16 +01:00
Frédéric Junod
310a0069f2 Merge pull request #6468 from fredj/rm_console.assert
Remove console.assert in ol.structs.PriorityQueue tests
2017-02-08 13:59:33 +01:00
Frederic Junod
e9fb061704 Remove no-console eslint rule 2017-02-08 13:45:40 +01:00
Frederic Junod
04deaa3032 Remove console.assert in ol.structs.PriorityQueue tests 2017-02-08 13:45:40 +01:00
Frédéric Junod
facd36f683 Merge pull request #6467 from fredj/round_dpi
Round the DPI value in ol.source.ImageArcGISRest
2017-02-08 13:42:48 +01:00
Frédéric Junod
6301de4739 Merge pull request #6466 from tchandelle/kml-test
Small XML error in KML test
2017-02-08 13:40:41 +01:00
Frederic Junod
c260e927a0 Round the DPI value in ol.source.ImageArcGISRest 2017-02-08 13:32:57 +01:00
Thomas Chandelle
998e1705fa Small XML error in KML test 2017-02-08 13:29:26 +01:00
Andreas Hocevar
c1af0de860 Merge pull request #6410 from rjackson64840/fix-toStringHDMS
fixed the degreesToStringHDMS_() function to promote a seconds value …
2017-02-08 11:36:25 +01:00
Andreas Hocevar
ddeb9c84e2 Merge pull request #6461 from tchandelle/codepen
Add button to edit examples in CodePen
2017-02-08 11:24:46 +01:00
Thomas Chandelle
89dd4af9cb Remove JSFiddle 2017-02-08 09:04:16 +01:00
Andreas Hocevar
284e6c0b80 Merge pull request #6320 from ahocevar/stackoverflow
Use the 'openlayers' tag instead of 'openlayers-3'
2017-02-08 08:52:30 +01:00
Frédéric Junod
7175270fb1 Merge pull request #6460 from fredj/rm_unByKey
Remove ol.Observable#unByKey
2017-02-08 08:25:08 +01:00
Frederic Junod
a6e17318d3 Remove ol.Observable#unByKey 2017-02-07 16:58:44 +01:00
Frederic Junod
92ba2c1e36 Use the 'openlayers' tag instead of 'openlayers-3' 2017-02-07 14:14:43 +01:00
Frédéric Junod
32a154a114 Merge pull request #6463 from openlayers/greenkeeper/clean-css-cli-4.0.5
chore(package): update clean-css-cli to version 4.0.5
2017-02-07 14:13:15 +01:00
greenkeeper[bot]
23ae1b5af7 chore(package): update clean-css-cli to version 4.0.5
Closes #6462

https://greenkeeper.io/
2017-02-07 11:37:33 +00:00
Frédéric Junod
7ca246a20f Merge pull request #6459 from fredj/ol.coordinate.distance
Use ol.coordinate.distance
2017-02-07 09:36:06 +01:00
Frederic Junod
5c731176b9 Use ol.coordinate.distance 2017-02-07 08:25:19 +01:00
Andreas Hocevar
bff6a14a16 Merge pull request #6457 from tst-ppenev/add-circle-support
Add Circle Modification
2017-02-06 21:14:49 +01:00
Tim Schaub
ac84e560bc Merge pull request #6455 from tschaub/stable
Make all @api annotations imply stability
2017-02-06 12:46:47 -07:00
Andreas Hocevar
6a9cbf11f3 Add tests 2017-02-06 14:45:54 -05:00
Pavel Penev
bf86c31f8d Add Circles to <draw-and-modify-features> example 2017-02-06 14:45:54 -05:00
Pavel Penev
7dde3d5cff Add circle support to {ol.interaction.Modify}
Circles are broken into two modifiable line segments: center and
circumference.

Method {@link ol.interaction.Modify#writeCircleGeometry_} has been
added for adding a circle to the R*-bush of modifiable segments.

Methods {handleDownEvent_}, {handleDragEvent_}, {handleUpEvent_} and
{handlePointerAtPixel_} have been updated to support circle segments.

Helper static methods
{@link ol.interaction.Modify.pointDistanceToSegmentDataSquared_} and
{@link ol.interaction.Modify.closestOnSegmentData_} with support for
circle line segments have been added.

Constants {@link ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CENTER_INDEX}
and
{@link ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX}
have been added.

Conflicts:
	src/ol/interaction/modify.js
2017-02-06 14:43:20 -05:00
Pavel Penev
8c6d15b877 Add an ol.coordinate.distance() helper method.
The method is a companion to {@link ol.coordinate.squaredDistance}.
The new method returns the Cartesian distance, instead of its square.

Conflicts:
	src/ol/coordinate.js
2017-02-06 14:43:20 -05:00
Tim Schaub
8066b89abf Merge pull request #6452 from tschaub/deprecated
Remove deprecated methods
2017-02-06 12:08:13 -07:00
Tim Schaub
f5aea97d3b All @api annotations imply stability 2017-02-06 09:22:05 -07:00
Tim Schaub
8f39960427 Document removal of deprecated methods 2017-02-06 08:53:07 -07:00
Tim Schaub
d96c7032ea Remove deprecated map.beforeRender() method 2017-02-06 08:48:49 -07:00
Tim Schaub
79fdbab70f Remove deprecated ol.animation functions 2017-02-06 08:44:09 -07:00
Andreas Hocevar
ca23c7337f Merge pull request #6361 from tchandelle/canvas-margin
Remove "margin" at the bottom of the canvas
2017-02-06 14:47:16 +01:00
Frederic Junod
20c039135b Move updateSize test in the rendering tests 2017-02-06 14:25:55 +01:00
Andreas Hocevar
b69ed3a3de Merge pull request #6450 from openlayers/greenkeeper/coveralls-2.11.16
Update coveralls to the latest version 🚀
2017-02-06 00:22:31 +01:00
greenkeeper[bot]
743627e578 chore(package): update coveralls to version 2.11.16
https://greenkeeper.io/
2017-02-05 20:43:13 +00:00
Tim Schaub
47bba9f698 Merge pull request #6302 from tschaub/mod
Publish a package for use with ES module bundlers
2017-02-05 06:32:17 -07:00
Tim Schaub
629d295e7a Additional package documentation 2017-02-04 16:53:35 -07:00
Tim Schaub
c9365d8cd9 Merge pull request #6446 from openlayers/greenkeeper/eslint-3.15.0
Update eslint to the latest version 🚀
2017-02-03 20:14:20 -07:00
Tim Schaub
b59342b567 Note that the WebGL renderer is not available 2017-02-03 17:08:17 -07:00
Tim Schaub
490f42d528 Avoid extra assignment for default export 2017-02-03 17:05:30 -07:00
Tim Schaub
3eaa0f412e Opinionated defines 2017-02-03 17:05:30 -07:00
Tim Schaub
b2a4b69d13 Transform all defines 2017-02-03 17:05:30 -07:00
Tim Schaub
b73ab8914a Replace define assignment with variable declaration 2017-02-03 17:05:30 -07:00
Tim Schaub
91c1857d83 Update transform to generate ES-2015 modules 2017-02-03 17:05:30 -07:00
Tim Schaub
d17e809039 Rewrite boolean defines as globals 2017-02-03 17:05:30 -07:00
Tim Schaub
ea04523bb9 Sort and replace provide and requires in one pass 2017-02-03 17:05:29 -07:00
Tim Schaub
329ec70836 Handle ol provide 2017-02-03 17:05:29 -07:00
Tim Schaub
04639842f2 Safer relative paths 2017-02-03 17:05:29 -07:00
Tim Schaub
d20e9ca8df Add a readme 2017-02-03 17:05:29 -07:00
Tim Schaub
815af723ea Require ol.ext dependencies directly 2017-02-03 17:05:29 -07:00
Tim Schaub
386f94e0d4 Codemod for CommonJS package 2017-02-03 17:05:29 -07:00
Tim Schaub
35d254902f Merge pull request #6445 from tschaub/fix-pinch
Fix pinch zooming
2017-02-03 15:04:59 -07:00
greenkeeper[bot]
10fd0141ce chore(package): update eslint to version 3.15.0
https://greenkeeper.io/
2017-02-03 22:00:46 +00:00
Tim Schaub
67e2d02046 Resetting kinetic after one pointer up 2017-02-03 14:10:56 -07:00
Tim Schaub
14222e68e7 Removing side effects from logical expression 2017-02-03 14:10:56 -07:00
Thomas Chandelle
54c8beef4e Stop handling down/up sequence when all fingers have been removed 2017-02-03 14:10:56 -07:00
Tim Schaub
bbf4c449e6 Merge pull request #6444 from tschaub/zoom-limits
Disallow pinch zooming beyond min/max resolution
2017-02-03 14:10:37 -07:00
Tim Schaub
d713c9fea6 Disallow pinch zooming beyond min/max resolution 2017-02-03 12:56:03 -07:00
Thomas Chandelle
ade0b7898b Remove "margin" at the bottom of the canvas 2017-02-03 16:54:29 +01:00
Frédéric Junod
259fc356bc Merge pull request #6443 from openlayers/goog.require
goog.require cleanup
2017-02-03 14:56:53 +01:00
Andreas Hocevar
a0e77dd955 Merge pull request #6439 from ahocevar/tile-render-performance
Improve tile render performance
2017-02-03 13:26:35 +01:00
Frederic Junod
9d263629e6 Add missing goog.require 2017-02-03 12:47:13 +01:00
Frederic Junod
5763e1d145 Remove unused goog.require 2017-02-03 12:40:53 +01:00
Frédéric Junod
265a83c389 Merge pull request #6442 from fredj/goog.require
Fix missing goog.require
2017-02-03 11:10:49 +01:00
Frederic Junod
17fb40f5e6 Fix missing goog.require 2017-02-03 10:29:05 +01:00
Frédéric Junod
d2cd01e024 Merge pull request #6441 from openlayers/greenkeeper/metalsmith-layouts-1.8.0
Update metalsmith-layouts to the latest version 🚀
2017-02-03 10:24:09 +01:00
greenkeeper[bot]
f82e00595f fix(package): update metalsmith-layouts to version 1.8.0
https://greenkeeper.io/
2017-02-03 08:55:25 +00:00
Andreas Hocevar
ec8d8228cf Less redraws while zooming in 2017-02-02 22:14:01 +01:00
Andreas Hocevar
72af545a4a Avoid oversampling when view resolution lower than tile resolution 2017-02-02 22:13:25 +01:00
Andreas Hocevar
9af1000874 Merge pull request #6437 from tchandelle/fit-circle2
Fit on circle
2017-02-02 11:40:55 +01:00
Thomas Chandelle
c69efeb8ea Fit on circle 2017-02-02 10:34:57 +01:00
Andreas Hocevar
da10988ffd Restore test values 2017-01-28 16:08:23 +01:00
alfred.jackson
419c3752d2 fixed the degreesToStringHDMS_() function to promote a seconds value of 60 up to the next minute; fixed test to account for the padding for minutes and seconds 2017-01-27 17:48:02 -06:00
alfred.jackson
eebcccab66 fixed the degreesToStringHDMS_() function to promote a seconds value of 60 up to the next minute; fixed calculation of components 2017-01-27 17:32:21 -06:00
alfred.jackson
2001244b88 fixed the degreesToStringHDMS_() function to promote a seconds value of 60 up to the next minute 2017-01-27 14:43:41 -06:00
Thomas Chandelle
0850e612c5 Add link to codepen in examples 2017-01-16 11:58:58 +01:00
Andreas Hocevar
63535940fe Use the 'openlayers' tag instead of 'openlayers-3' 2017-01-13 15:49:29 +01:00
177 changed files with 1791 additions and 1166 deletions

View File

@@ -4,7 +4,7 @@ Thanks for your interest in contributing to OpenLayers.
## Asking Questions
Please ask questions about using the library on [stackoverflow using the tag 'openlayers-3'](http://stackoverflow.com/questions/tagged/openlayers-3).
Please ask questions about using the library on [Stack Overflow using the tag 'openlayers'](http://stackoverflow.com/questions/tagged/openlayers).
When you want to get involved and discuss new features or changes, please use [the mailing list](https://groups.google.com/forum/#!forum/openlayers-dev).

View File

@@ -103,6 +103,7 @@ clean:
rm -f build/test_rendering_requires.js
rm -rf build/examples
rm -rf build/compiled-examples
rm -rf build/package
rm -rf $(BUILD_HOSTED)
.PHONY: cleanall
@@ -300,3 +301,11 @@ build/test_rendering_requires.js: $(SPEC_RENDERING_JS)
%shader.js: %shader.glsl src/ol/webgl/shader.mustache bin/pyglslunit.py build/timestamps/node-modules-timestamp
@python bin/pyglslunit.py --input $< | ./node_modules/.bin/mustache - src/ol/webgl/shader.mustache > $@
.PHONY: package
package:
@rm -rf build/package
@cp -r package build
@cd ./src && cp -r ol/* ../build/package
@rm build/package/typedefs.js
./node_modules/.bin/jscodeshift --transform transforms/module.js build/package

View File

@@ -31,6 +31,6 @@ Please see our guide on [contributing](CONTRIBUTING.md) if you're interested in
## Community
- Need help? Find it on [stackoverflow using the tag 'openlayers-3'](http://stackoverflow.com/questions/tagged/openlayers-3)
- Need help? Find it on [Stack Overflow using the tag 'openlayers'](http://stackoverflow.com/questions/tagged/openlayers)
- Follow [@openlayers](https://twitter.com/openlayers) on Twitter
- Discuss with openlayers users on IRC in `#openlayers` at `chat.freenode`

View File

@@ -2,11 +2,31 @@
### Next release
#### Removed build flags (`@define`)
### v4.0.0
The `ol.DEBUG`, `ol.ENABLE_TILE`, `ol.ENABLE_IMAGE`, `ol.ENABLE_VECTOR`, and `ol.ENABLE_VECTOR_TILE` build flags are no longer necessary and have been removed. If you were using these in a `define` array for a custom build, you can remove them.
#### Simpler `ol.source.Zoomify` `url` configuration
If you leave `ol.ENABLE_WEBGL` set to `true` in your build, you should set `ol.DEBUG_WEBGL` to `false` to avoid including debuggable shader sources.
Instead specifying a base url, the `url` for the `ol.source.Zoomify` source can now be a template. The `{TileGroup}`, `{x}`, `{y}`, `{z}` and placeholders must be included in the `url` in this case. the `url` can now also include subdomain placeholders:
```js
new ol.source.Zoomify({
url: 'https://{a-f}.example.com/cgi-bin/iipsrv.fcgi?zoomify=/a/b/{TileGroup}/{z}-{x}-{y}.jpg'
});
```
#### Removal of deprecated methods
The deprecated `ol.animation` functions and `map.beforeRender()` method have been removed. Use `view.animate()` instead.
The `unByKey()` method has been removed from `ol.Observable` instances. Use the `ol.Observable.unByKey()` static function instead.
```js
var key = map.on('moveend', function() { ...});
map.unByKey(key);
```
New code:
```js
var key = map.on('moveend', function() { ...});
ol.Observable.unByKey(key);
```
#### Simplified `ol.View#fit()` API
@@ -29,6 +49,13 @@ Advanced use - new API:
map.getView().fit(extent, {size: [200, 100], padding 10});
```
#### Removed build flags (`@define`)
The `ol.DEBUG`, `ol.ENABLE_TILE`, `ol.ENABLE_IMAGE`, `ol.ENABLE_VECTOR`, and `ol.ENABLE_VECTOR_TILE` build flags are no longer necessary and have been removed. If you were using these in a `define` array for a custom build, you can remove them.
If you leave `ol.ENABLE_WEBGL` set to `true` in your build, you should set `ol.DEBUG_WEBGL` to `false` to avoid including debuggable shader sources.
### v3.20.0
#### Use `view.animate()` instead of `map.beforeRender()` and `ol.animation` functions

183
changelog/v4.0.0.md Normal file
View File

@@ -0,0 +1,183 @@
# 4.0.0
Starting with this version, OpenLayers introduces [Semantic Versioning](http://semver.org). Unlike the switch from v2.x to v3.x, which marked a complete rewrite of the library with an entirely new API, major version increments now simply mean that users should pay attention to the *'Breaking changes'* section of the upgrade notes.
For users of mainstream bundlers and minifiers, OpenLayers is now also available as a set of ES2015 modules. See https://npmjs.com/package/ol/. With that package, bundling only the needed parts of the library with an application is now completely hassle free.
Version 4.0.0 includes enhancements and fixes from 107 pull requests since the previous release.
Among these changes, [#6381](https://github.com/openlayers/openlayers/pull/6381) adds an example which shows how to use [geojson-vt](https://www.npmjs.com/package/geojson-vt) for highly efficient rendering of GeoJSON data as vector tiles.
Several improvements were made to `ol.source.Zoomify`, including projection support ([#6387](https://github.com/openlayers/openlayers/pull/6387)) and support for URL templates ([#6475](https://github.com/openlayers/openlayers/pull/6475)).
Also the `ol.source.ImageArcGISRest` saw some enhancements, including HiDPI/Retina support and a fix that avoids non-integer DPI values ([#6300](https://github.com/openlayers/openlayers/pull/6300) and [#6467](https://github.com/openlayers/openlayers/pull/6467)).
On the topic of drawing tools, @tst-ppenev completed an effort to make the `ol.interaction.Modify` interaction support modification of `ol.geom.Circle` geometries ([#6457](https://github.com/openlayers/openlayers/pull/6457)).
## Breaking changes
### Simplified `ol.View#fit()` API
In most cases, it is no longer necessary to provide an `ol.Size` (previously the 2nd argument) to `ol.View#fit()`. By default, the size of the first map that uses the view will be used. If you want to specify a different size, it goes in the options now (previously the 3rd argument, now the 2nd).
Most common use case - old API:
```js
map.getView().fit(extent, map.getSize());
```
Most common use case - new API:
```js
map.getView().fit(extent);
```
Advanced use - old API:
```js
map.getView().fit(extent, [200, 100], {padding: 10});
```
Advanced use - new API:
```js
map.getView().fit(extent, {size: [200, 100], padding 10});
```
### Removal of deprecated methods
The deprecated `ol.animation` functions and `map.beforeRender()` method have been removed. Use `view.animate()` instead.
The `unByKey()` method has been removed from `ol.Observable` instances. Use the `ol.Observable.unByKey()` static function instead.
```js
var key = map.on('moveend', function() { ...});
map.unByKey(key);
```
New code:
```js
var key = map.on('moveend', function() { ...});
ol.Observable.unByKey(key);
```
## Upgrade notes
### Simpler `ol.source.Zoomify` `url` configuration
Instead specifying a base url, the `url` for the `ol.source.Zoomify` source can now be a template. The `{TileGroup}`, `{x}`, `{y}`, `{z}` and placeholders must be included in the `url` in this case. the `url` can now also include subdomain placeholders:
```js
new ol.source.Zoomify({
url: 'https://{a-f}.example.com/cgi-bin/iipsrv.fcgi?zoomify=/a/b/{TileGroup}/{z}-{x}-{y}.jpg'
});
```
#### Removed build flags (`@define`)
The `ol.DEBUG`, `ol.ENABLE_TILE`, `ol.ENABLE_IMAGE`, `ol.ENABLE_VECTOR`, and `ol.ENABLE_VECTOR_TILE` build flags are no longer necessary and have been removed. If you were using these in a `define` array for a custom build, you can remove them.
If you leave `ol.ENABLE_WEBGL` set to `true` in your build, you should set `ol.DEBUG_WEBGL` to `false` to avoid including debuggable shader sources.
## List of all changes
* [#6477](https://github.com/openlayers/openlayers/pull/6477) - Save and restore context when rotating ([@ahocevar](https://github.com/ahocevar))
* [#6475](https://github.com/openlayers/openlayers/pull/6475) - Use an url template for ol.source.Zoomify ([@fredj](https://github.com/fredj))
* [#6478](https://github.com/openlayers/openlayers/pull/6478) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6472](https://github.com/openlayers/openlayers/pull/6472) - Use fixed pixel ratio for hit tolerance tests ([@ahocevar](https://github.com/ahocevar))
* [#6468](https://github.com/openlayers/openlayers/pull/6468) - Remove console.assert in ol.structs.PriorityQueue tests ([@fredj](https://github.com/fredj))
* [#6467](https://github.com/openlayers/openlayers/pull/6467) - Round the DPI value in ol.source.ImageArcGISRest ([@fredj](https://github.com/fredj))
* [#6466](https://github.com/openlayers/openlayers/pull/6466) - Small XML error in KML test ([@tchandelle](https://github.com/tchandelle))
* [#6410](https://github.com/openlayers/openlayers/pull/6410) - fixed the degreesToStringHDMS_() function to promote a seconds value … ([@rjackson64840](https://github.com/rjackson64840))
* [#6461](https://github.com/openlayers/openlayers/pull/6461) - Add button to edit examples in CodePen ([@tchandelle](https://github.com/tchandelle))
* [#6320](https://github.com/openlayers/openlayers/pull/6320) - Use the 'openlayers' tag instead of 'openlayers-3' ([@ahocevar](https://github.com/ahocevar))
* [#6460](https://github.com/openlayers/openlayers/pull/6460) - Remove ol.Observable#unByKey ([@fredj](https://github.com/fredj))
* [#6463](https://github.com/openlayers/openlayers/pull/6463) - chore(package): update clean-css-cli to version 4.0.5 ([@openlayers](https://github.com/openlayers))
* [#6459](https://github.com/openlayers/openlayers/pull/6459) - Use ol.coordinate.distance ([@fredj](https://github.com/fredj))
* [#6457](https://github.com/openlayers/openlayers/pull/6457) - Add Circle Modification ([@tst-ppenev](https://github.com/tst-ppenev))
* [#6455](https://github.com/openlayers/openlayers/pull/6455) - Make all @api annotations imply stability ([@tschaub](https://github.com/tschaub))
* [#6452](https://github.com/openlayers/openlayers/pull/6452) - Remove deprecated methods ([@tschaub](https://github.com/tschaub))
* [#6361](https://github.com/openlayers/openlayers/pull/6361) - Remove "margin" at the bottom of the canvas ([@tchandelle](https://github.com/tchandelle))
* [#6450](https://github.com/openlayers/openlayers/pull/6450) - Update coveralls to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6302](https://github.com/openlayers/openlayers/pull/6302) - Publish a package for use with ES module bundlers ([@tschaub](https://github.com/tschaub))
* [#6446](https://github.com/openlayers/openlayers/pull/6446) - Update eslint to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6445](https://github.com/openlayers/openlayers/pull/6445) - Fix pinch zooming ([@tschaub](https://github.com/tschaub))
* [#6444](https://github.com/openlayers/openlayers/pull/6444) - Disallow pinch zooming beyond min/max resolution ([@tschaub](https://github.com/tschaub))
* [#6443](https://github.com/openlayers/openlayers/pull/6443) - goog.require cleanup ([@openlayers](https://github.com/openlayers))
* [#6439](https://github.com/openlayers/openlayers/pull/6439) - Improve tile render performance ([@ahocevar](https://github.com/ahocevar))
* [#6442](https://github.com/openlayers/openlayers/pull/6442) - Fix missing goog.require ([@fredj](https://github.com/fredj))
* [#6441](https://github.com/openlayers/openlayers/pull/6441) - Update metalsmith-layouts to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
* [#6437](https://github.com/openlayers/openlayers/pull/6437) - Fit on circle ([@tchandelle](https://github.com/tchandelle))
* [#6427](https://github.com/openlayers/openlayers/pull/6427) - Ensure WMS width and height are always integers ([@ahocevar](https://github.com/ahocevar))
* [#6432](https://github.com/openlayers/openlayers/pull/6432) - Use ol.proj.EPSG3857.WORLD_EXTENT in ol.source.TileImage tests ([@fredj](https://github.com/fredj))
* [#6424](https://github.com/openlayers/openlayers/pull/6424) - Update dependencies to enable Greenkeeper 🌴 ([@openlayers](https://github.com/openlayers))
* [#6422](https://github.com/openlayers/openlayers/pull/6422) - Don't listen twice to move and end events in ol.control.ZoomSlider ([@fredj](https://github.com/fredj))
* [#6426](https://github.com/openlayers/openlayers/pull/6426) - Add rewrite_polyfills to custom builds tutorial ([@probins](https://github.com/probins))
* [#6365](https://github.com/openlayers/openlayers/pull/6365) - Make enums for draw and modify interactions public ([@gberaudo](https://github.com/gberaudo))
* [#6294](https://github.com/openlayers/openlayers/pull/6294) - Update code for closure-compiler v20170124 ([@fredj](https://github.com/fredj))
* [#6413](https://github.com/openlayers/openlayers/pull/6413) - Accept ol.StyleFunction in ol.Feature#setStyle() ([@ahocevar](https://github.com/ahocevar))
* [#6398](https://github.com/openlayers/openlayers/pull/6398) - Be more tolerant of map and position value ([@fredj](https://github.com/fredj))
* [#6399](https://github.com/openlayers/openlayers/pull/6399) - Small doc fix in VectorTileOptions renderMode ([@tchandelle](https://github.com/tchandelle))
* [#6396](https://github.com/openlayers/openlayers/pull/6396) - Show current year in attribution in "HERE Map Tile API" example ([@chrismayer](https://github.com/chrismayer))
* [#6390](https://github.com/openlayers/openlayers/pull/6390) - Tag deprecated functions with @deprecated ([@fredj](https://github.com/fredj))
* [#6370](https://github.com/openlayers/openlayers/pull/6370) - Feature apidoc, fix events and observable properties ([@tchandelle](https://github.com/tchandelle))
* [#6376](https://github.com/openlayers/openlayers/pull/6376) - Make ol.format.filter.or/and accept n filter conditions ([@tsauerwein](https://github.com/tsauerwein))
* [#6393](https://github.com/openlayers/openlayers/pull/6393) - Only stop animation when animating ([@ahocevar](https://github.com/ahocevar))
* [#6387](https://github.com/openlayers/openlayers/pull/6387) - Add projection option to ol.source.Zoomify ([@ahocevar](https://github.com/ahocevar))
* [#6386](https://github.com/openlayers/openlayers/pull/6386) - Snap : only listen to change event triggered by the feature ([@tchandelle](https://github.com/tchandelle))
* [#6383](https://github.com/openlayers/openlayers/pull/6383) - Modify interaction: check if interaction is active before drawing modifying vertex ([@tchandelle](https://github.com/tchandelle))
* [#6381](https://github.com/openlayers/openlayers/pull/6381) - geojson-vt integration example ([@drnextgis](https://github.com/drnextgis))
* [#6373](https://github.com/openlayers/openlayers/pull/6373) - Use the ol.DEBUG_WEBGL flag to debug shader sources ([@tschaub](https://github.com/tschaub))
* [#6379](https://github.com/openlayers/openlayers/pull/6379) - Set the overview map target in ol.control.OverviewMap.setMap ([@fredj](https://github.com/fredj))
* [#6375](https://github.com/openlayers/openlayers/pull/6375) - Use present in license text ([@bartvde](https://github.com/bartvde))
* [#6371](https://github.com/openlayers/openlayers/pull/6371) - Adjust copyright to include 2017 ([@kolosov-sergey](https://github.com/kolosov-sergey))
* [#6364](https://github.com/openlayers/openlayers/pull/6364) - Make sure moveTo is called after beginPath ([@ahocevar](https://github.com/ahocevar))
* [#6285](https://github.com/openlayers/openlayers/pull/6285) - Make size argument of ol.View#calculateExtent() optional ([@ahocevar](https://github.com/ahocevar))
* [#6357](https://github.com/openlayers/openlayers/pull/6357) - Fix GeoJSONCRSCode definition ([@fredj](https://github.com/fredj))
* [#6362](https://github.com/openlayers/openlayers/pull/6362) - Remove empty file ([@fredj](https://github.com/fredj))
* [#6358](https://github.com/openlayers/openlayers/pull/6358) - Ensure polygons without stroke are fully filled ([@ahocevar](https://github.com/ahocevar))
* [#6356](https://github.com/openlayers/openlayers/pull/6356) - Bring custom builds tutorial up to date ([@probins](https://github.com/probins))
* [#6359](https://github.com/openlayers/openlayers/pull/6359) - When applying a pending fill, also apply a pending stroke ([@ahocevar](https://github.com/ahocevar))
* [#6360](https://github.com/openlayers/openlayers/pull/6360) - Remove ol.array.flatten function ([@openlayers](https://github.com/openlayers))
* [#6353](https://github.com/openlayers/openlayers/pull/6353) - API doc : add highlight style to the active anchor ([@tchandelle](https://github.com/tchandelle))
* [#6355](https://github.com/openlayers/openlayers/pull/6355) - Remove test.geojson which was accidently committed in 57342a6 ([@ahocevar](https://github.com/ahocevar))
* [#6349](https://github.com/openlayers/openlayers/pull/6349) - Better documentation for icon-color example ([@ahocevar](https://github.com/ahocevar))
* [#6351](https://github.com/openlayers/openlayers/pull/6351) - Only consider pointerdown event if the last pointerup has been emitted ([@tchandelle](https://github.com/tchandelle))
* [#6345](https://github.com/openlayers/openlayers/pull/6345) - Mitigate rounding errors in GetMap width/height calculation ([@giohappy](https://github.com/giohappy))
* [#6344](https://github.com/openlayers/openlayers/pull/6344) - No special raster reprojection handling for Chrome ([@ahocevar](https://github.com/ahocevar))
* [#6339](https://github.com/openlayers/openlayers/pull/6339) - Code cleanup ([@fredj](https://github.com/fredj))
* [#6337](https://github.com/openlayers/openlayers/pull/6337) - Constrain center in DragZoom interaction ([@tchandelle](https://github.com/tchandelle))
* [#6336](https://github.com/openlayers/openlayers/pull/6336) - Remove unused ol.format.Feature.getExtensions function ([@fredj](https://github.com/fredj))
* [#6333](https://github.com/openlayers/openlayers/pull/6333) - Use API key for Thunderforest resources ([@ahocevar](https://github.com/ahocevar))
* [#6300](https://github.com/openlayers/openlayers/pull/6300) - Add missing hidpi option for ol.source.ImageArcGISRest ([@fredj](https://github.com/fredj))
* [#6109](https://github.com/openlayers/openlayers/pull/6109) - Export Map as PNG (IE issue) ([@NaveenKY](https://github.com/NaveenKY))
* [#6332](https://github.com/openlayers/openlayers/pull/6332) - Constrain the center in zoomByDelta ([@tchandelle](https://github.com/tchandelle))
* [#6331](https://github.com/openlayers/openlayers/pull/6331) - Remove unused map parameter from ol.interaction.Interaction ([@tchandelle](https://github.com/tchandelle))
* [#6326](https://github.com/openlayers/openlayers/pull/6326) - Add lineDashOffset to stroke style ([@tchandelle](https://github.com/tchandelle))
* [#6328](https://github.com/openlayers/openlayers/pull/6328) - ol.geom.polygon documentation update on the coordinates format ([@quentin-ol](https://github.com/quentin-ol))
* [#6324](https://github.com/openlayers/openlayers/pull/6324) - Ensure resolution stays in range when pinching ([@tschaub](https://github.com/tschaub))
* [#6329](https://github.com/openlayers/openlayers/pull/6329) - Fix WMTS theme location for sea-levels layer ([@thomasmoelhave](https://github.com/thomasmoelhave))
* [#6323](https://github.com/openlayers/openlayers/pull/6323) - Fix typo in Introduction ([@hdsnet](https://github.com/hdsnet))
* [#6305](https://github.com/openlayers/openlayers/pull/6305) - Moved hit Tolerance parameter to own example. ([@KlausBenndorf](https://github.com/KlausBenndorf))
* [#6319](https://github.com/openlayers/openlayers/pull/6319) - Remove the '3' from OpenLayers ([@ahocevar](https://github.com/ahocevar))
* [#6314](https://github.com/openlayers/openlayers/pull/6314) - WebGL conditional compilation ([@ahocevar](https://github.com/ahocevar))
* [#6313](https://github.com/openlayers/openlayers/pull/6313) - Remove ol.DEBUG ([@tschaub](https://github.com/tschaub))
* [#6317](https://github.com/openlayers/openlayers/pull/6317) - Update sinon to version 1.17.7 🚀 ([@openlayers](https://github.com/openlayers))
* [#6312](https://github.com/openlayers/openlayers/pull/6312) - Make layers responsible for creating layer renderers ([@tschaub](https://github.com/tschaub))
* [#6308](https://github.com/openlayers/openlayers/pull/6308) - Dedicated modules for shared enums ([@tschaub](https://github.com/tschaub))
* [#6307](https://github.com/openlayers/openlayers/pull/6307) - Dedicated modules for enums ([@tschaub](https://github.com/tschaub))
* [#6297](https://github.com/openlayers/openlayers/pull/6297) - Update resemblejs to version 2.2.3 🚀 ([@openlayers](https://github.com/openlayers))
* [#6296](https://github.com/openlayers/openlayers/pull/6296) - Fix #6295. Update reference link in sphere.js ([@jbelien](https://github.com/jbelien))
* [#6255](https://github.com/openlayers/openlayers/pull/6255) - Don't reset the css cursor if it's not needed ([@fredj](https://github.com/fredj))
* [#6290](https://github.com/openlayers/openlayers/pull/6290) - Use interim tiles ([@ahocevar](https://github.com/ahocevar))
* [#6291](https://github.com/openlayers/openlayers/pull/6291) - Document olx.AtPixelOptions#hitTolerance default value ([@fredj](https://github.com/fredj))
* [#6283](https://github.com/openlayers/openlayers/pull/6283) - Avoid modifying coordinate in forEachLayerAtCoordinate ([@tschaub](https://github.com/tschaub))
* [#6278](https://github.com/openlayers/openlayers/pull/6278) - Add missing require for ol.View ([@tschaub](https://github.com/tschaub))
* [#6280](https://github.com/openlayers/openlayers/pull/6280) - Continue loading tiles when image is not ready yet ([@ahocevar](https://github.com/ahocevar))
* [#6277](https://github.com/openlayers/openlayers/pull/6277) - Name modules more like their provide ([@tschaub](https://github.com/tschaub))
* [#6264](https://github.com/openlayers/openlayers/pull/6264) - Remove the requirement to provide a size to ol.View#fit() ([@ahocevar](https://github.com/ahocevar))
* [#6274](https://github.com/openlayers/openlayers/pull/6274) - Update clean-css to version 3.4.23 🚀 ([@openlayers](https://github.com/openlayers))
* [#6269](https://github.com/openlayers/openlayers/pull/6269) - Update derequire to version 2.0.6 🚀 ([@openlayers](https://github.com/openlayers))
* [#6270](https://github.com/openlayers/openlayers/pull/6270) - Add a magnify example ([@tschaub](https://github.com/tschaub))
* [#6261](https://github.com/openlayers/openlayers/pull/6261) - Fit Zoomify view to image extent ([@ahocevar](https://github.com/ahocevar))
* [#6259](https://github.com/openlayers/openlayers/pull/6259) - Simplify Zoomify example ([@ahocevar](https://github.com/ahocevar))
* [#6260](https://github.com/openlayers/openlayers/pull/6260) - Enhance documentation for ol.View#fit ([@marcjansen](https://github.com/marcjansen))
* [#6258](https://github.com/openlayers/openlayers/pull/6258) - Set geometry name properly ([@ahocevar](https://github.com/ahocevar))
* [#6251](https://github.com/openlayers/openlayers/pull/6251) - Take image pixel ratio into account for rendered resolution ([@ahocevar](https://github.com/ahocevar))
* [#6244](https://github.com/openlayers/openlayers/pull/6244) - Enforces spacing around commas ([@fredj](https://github.com/fredj))
* [#6246](https://github.com/openlayers/openlayers/pull/6246) - Re-render vector tiles when layer has changed ([@ahocevar](https://github.com/ahocevar))
* [#6243](https://github.com/openlayers/openlayers/pull/6243) - Consistent spacing between keys and values in object literal ([@fredj](https://github.com/fredj))
* [#6238](https://github.com/openlayers/openlayers/pull/6238) - Update eslint to version 3.12.1 🚀 ([@openlayers](https://github.com/openlayers))
* [#6236](https://github.com/openlayers/openlayers/pull/6236) - Update clean-css to version 3.4.22 🚀 ([@openlayers](https://github.com/openlayers))

11
changelog/v4.0.1.md Normal file
View File

@@ -0,0 +1,11 @@
# 4.0.1
## Summary
The v4.0.1 release is a patch release that addresses a regression in the v4.0.0 release. The fix makes pinch zooming work again properly when the two fingers are not placed on the screen at the same time.
See the [v4.0.0 release notes](https://github.com/openlayers/openlayers/releases/tag/v4.0.0) for details on upgrading from v3.20.x.
## Fix
* [#6486](https://github.com/openlayers/openlayers/pull/6486) - Do not set center when touches count has changed ([@ahocevar](https://github.com/ahocevar))

View File

@@ -59,14 +59,16 @@
<div class="row-fluid">
<div id="source-controls">
<a id="copy-button"><i class="fa fa-clipboard"></i> Copy</a>
<a id="jsfiddle-button"><i class="fa fa-jsfiddle"></i> Edit</a>
<a id="codepen-button"><i class="fa fa-codepen"></i> Edit</a>
</div>
<form method="POST" id="jsfiddle-form" target="_blank" action="https://jsfiddle.net/api/post/library/pure/">
<form method="POST" id="codepen-form" target="_blank" action="https://codepen.io/pen/define/">
<textarea class="hidden" name="title">{{ title }}</textarea>
<textarea class="hidden" name="description">{{ shortdesc }}</textarea>
<textarea class="hidden" name="js">{{ js.source }}</textarea>
<textarea class="hidden" name="css">{{ css.source }}</textarea>
<textarea class="hidden" name="html">{{ contents }}</textarea>
<input type="hidden" name="wrap" value="l">
<input type="hidden" name="resources" value="https://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">&lt;!DOCTYPE html&gt;
&lt;html&gt;

View File

@@ -26,9 +26,6 @@
"markdown": {
"parser": "gfm"
},
"stability": {
"levels": ["deprecated","experimental","unstable","stable","frozen","locked"]
},
"templates": {
"cleverLinks": true,
"monospaceLinks": true,

View File

@@ -44,21 +44,19 @@ Interactions for [vector features](ol.Feature.html)
#### API change policy
The OpenLayers.x API consists of
* names of classes, class methods and properties
* names of static functions and constants
* order and types of function arguments
* types of function return values
The OpenLayers API consists of
* names and signatures of constructors
* names and signatures of instance methods and properties
* names and signatures of functions
* names of constants
API elements marked as `experimental` provide stable and functioning code, but may change.
Any changes will be documented in upgrade notes so application code can be changed appropriately
before using the new version of the library. All other API elements will remain compatible throughout the 3.x releases so that no changes to existing application code are necessary when upgrading to a later version.
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 theme the
*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.Pixel`) are subject to change. It
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.Pixel`), or pay attention to the upgrade notes, which will list
`Array.<number>` instead of `ol.Coordinate`), or pay attention to the upgrade notes, which will list
the changes for those types.

View File

@@ -1,10 +1,6 @@
/**
* Define an @api tag
*/
var conf = env.conf.stability;
var defaultLevels = ["deprecated","experimental","unstable","stable","frozen","locked"];
var levels = conf.levels || defaultLevels;
var util = require('util');
exports.defineTags = function(dictionary) {
dictionary.defineTag('api', {
mustHaveValue: false,
@@ -12,13 +8,7 @@ exports.defineTags = function(dictionary) {
canHaveName: false,
onTagged: function(doclet, tag) {
includeTypes(doclet);
var level = tag.text || "experimental";
if (levels.indexOf(level) >= 0) {
doclet.stability = level;
} else {
var errorText = util.format('Invalid stability level (%s) in %s line %s', tag.text, doclet.meta.filename, doclet.meta.lineno);
require('jsdoc/lib/jsdoc/util/error').handle( new Error(errorText) );
}
doclet.stability = "stable";
}
});
};

View File

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

View File

@@ -92,30 +92,6 @@ $(function () {
textParts[1] + '</a>';
});
// show/hide unstable items
var links = $('a[href^="ol."]');
var unstable = $('.unstable');
var stabilityToggle = $('#stability-toggle');
stabilityToggle.change(function() {
unstable.toggleClass('hidden', this.checked);
var search = this.checked ? '?stableonly=true' : '';
links.each(function(i, el) {
this.href = this.pathname + search + this.hash;
});
if (history.replaceState) {
var url = window.location.pathname + search + window.location.hash;
history.replaceState({}, '', url);
}
return false;
});
var search = window.location.search;
links.each(function(i, el) {
this.href = this.pathname + search + this.hash;
});
stabilityToggle.prop('checked', search === '?stableonly=true');
unstable.toggleClass('hidden', stabilityToggle[0].checked);
// Highlighting current anchor
var anchors = $('.anchor');

View File

@@ -23,9 +23,6 @@ var version = obj.packageInfo.version;
<div class="navbar-inner">
<div class="container">
<a class="brand" href="/"><img src="logo-70x70.png"> OpenLayers</a>
<label id="stability">
<input type="checkbox" id="stability-toggle"> Stable Only
</label>
<ul class="nav navbar-nav pull-right">
<li><a href="../doc">Docs</a></li>
<li><a href="../examples">Examples</a></li>

View File

@@ -7,7 +7,7 @@ layout: doc.hbs
Certain questions arise more often than others when users ask for help. This
document tries to list some of the common questions that frequently get asked,
e.g. on [Stack Overflow](http://stackoverflow.com/questions/tagged/openlayers-3).
e.g. on [Stack Overflow](http://stackoverflow.com/questions/tagged/openlayers).
If you think a question (and naturally its answer) should be added here, feel
free to ping us or to send a pull request enhancing this document.

View File

@@ -19,4 +19,4 @@ We have put together a document that lists [Frequently Asked Questions (FAQ)](fa
# More questions?
If you cannot find an answer in the documentation or the FAQ, you can ask your question on [stackoverflow using the tag 'openlayers-3'](http://stackoverflow.com/questions/tagged/openlayers-3).
If you cannot find an answer in the documentation or the FAQ, you can ask your question on [Stack Overflow using the tag 'openlayers'](http://stackoverflow.com/questions/tagged/openlayers).

View File

@@ -13,5 +13,6 @@ tags: "draw, edit, modify, vector, featureoverlay"
<option value="Point">Point</option>
<option value="LineString">LineString</option>
<option value="Polygon">Polygon</option>
<option value="Circle">Circle</option>
</select>
</form>

View File

@@ -7,7 +7,7 @@ goog.require('ol.source.VectorTile');
goog.require('ol.layer.Tile');
goog.require('ol.layer.VectorTile');
goog.require('ol.tilegrid');
goog.require('ol.proj');
goog.require('ol.proj.Projection');
var replacer = function(key, value) {

View File

@@ -10,11 +10,40 @@
});
}
var fiddleButton = document.getElementById('jsfiddle-button');
if (fiddleButton) {
fiddleButton.onclick = function(event) {
var codepenButton = document.getElementById('codepen-button');
if (codepenButton) {
codepenButton.onclick = function(event) {
event.preventDefault();
document.getElementById('jsfiddle-form').submit();
var form = document.getElementById('codepen-form');
// Doc : https://blog.codepen.io/documentation/api/prefill/
var resources = form.resources.value.split(',');
var data = {
title: form.title.value,
description: form.description.value,
layout: 'left',
html: form.html.value,
css: form.css.value,
js: form.js.value,
css_external: resources.filter(function(resource) {
return resource.lastIndexOf('.css') === resource.length - 4;
}).join(';'),
js_external: resources.filter(function(resource) {
return resource.lastIndexOf('.js') === resource.length - 3;
}).join(';')
};
// binary flags to display html, css, js and/or console tabs
data.editors = '' + Number(data.html.length > 0) +
Number(data.css.length > 0) +
Number(data.js.length > 0) +
Number(data.js.indexOf('console') > 0);
form.data.value = JSON.stringify(data);
form.submit();
};
}

View File

@@ -106,7 +106,7 @@ pre[class*="language-"] {
cursor: pointer;
}
#jsfiddle-button {
#codepen-button {
text-decoration: none;
cursor: pointer;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "openlayers",
"version": "3.21.0-beta.2",
"version": "4.0.1",
"description": "Build tools and sources for developing OpenLayers based mapping applications",
"keywords": [
"map",
@@ -40,7 +40,7 @@
"jsdoc": "3.4.3",
"marked": "0.3.6",
"metalsmith": "2.3.0",
"metalsmith-layouts": "1.7.0",
"metalsmith-layouts": "1.8.0",
"nomnom": "1.8.1",
"pbf": "3.0.5",
"pixelworks": "1.1.0",
@@ -50,16 +50,18 @@
"walk": "2.3.9"
},
"devDependencies": {
"clean-css-cli": "4.0.0",
"coveralls": "2.11.15",
"clean-css-cli": "4.0.6",
"coveralls": "2.11.16",
"debounce": "^1.0.0",
"eslint": "3.14.1",
"eslint": "3.15.0",
"eslint-config-openlayers": "7.0.0",
"eslint-plugin-openlayers-internal": "^3.1.0",
"esprima": "2.x",
"expect.js": "0.3.1",
"gaze": "^1.0.0",
"istanbul": "0.4.5",
"jquery": "3.1.1",
"jscodeshift": "^0.3.30",
"mocha": "3.2.0",
"mocha-phantomjs-core": "^2.1.0",
"mustache": "2.3.0",
@@ -87,15 +89,6 @@
"openlayers-internal"
],
"rules": {
"no-console": [
2,
{
"allow": [
"assert",
"warn"
]
}
],
"no-constant-condition": 0,
"openlayers-internal/enum": 2,
"openlayers-internal/no-duplicate-requires": 2,

14
package/package.json Normal file
View File

@@ -0,0 +1,14 @@
{
"name": "ol",
"version": "4.0.1-beta.1",
"description": "OpenLayers as ES2015 modules",
"main": "index.js",
"module": "index.js",
"license": "BSD-2-Clause",
"dependencies": {
"pbf": "3.0.5",
"pixelworks": "1.1.0",
"rbush": "2.0.1",
"vector-tile": "1.3.0"
}
}

55
package/readme.md Normal file
View File

@@ -0,0 +1,55 @@
# ol
OpenLayers as ES2015 modules.
**Note: This package is in beta and the API is subject to change before a final stable release.**
## 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 & Uglify](https://gist.github.com/tschaub/8beb328ea72b36446fc2198d008287de)
* Using [Rollup & Closure Compiler](https://gist.github.com/tschaub/32a5692bedac5254da24fa3b12072f35)
* Using [Webpack & Uglify](https://gist.github.com/tschaub/79025aef325cd2837364400a105405b8)
* Using [Browserify & Uglify](https://gist.github.com/tschaub/4bfb209a8f809823f1495b2e4436018e)
## Module Identifiers
The module identifiers above (e.g. `ol/map`) are like the `ol.Map` names in the [API documentation](http://openlayers.org/en/latest/apidoc/) with `/` instead of `.` and all lowercase. Each module only has a `default` export (there are no other named exports).
Constructors are exported from dedicated modules. For example, the `ol/layer/tile` module exports the `Tile` layer constructor.
Utility functions are available as properties of the default export from utility modules. For example, the `getCenter` function is a property of the default export from the `ol/extent` utility module.
## Caveats
* Module identifiers and the structure of the exports are subject to change while this package is in beta.
* The WebGL renderer is not available in this package.

View File

@@ -1,174 +0,0 @@
goog.provide('ol.animation');
goog.require('ol');
goog.require('ol.ViewHint');
goog.require('ol.coordinate');
goog.require('ol.easing');
/**
* Generate an animated transition that will "bounce" the resolution as it
* approaches the final value.
* @param {olx.animation.BounceOptions} options Bounce options.
* @return {ol.PreRenderFunction} Pre-render function.
* @deprecated Use {@link ol.View#animate} instead.
* @api
*/
ol.animation.bounce = function(options) {
var resolution = options.resolution;
var start = options.start ? options.start : Date.now();
var duration = options.duration !== undefined ? options.duration : 1000;
var easing = options.easing ?
options.easing : ol.easing.upAndDown;
return (
/**
* @param {ol.Map} map Map.
* @param {?olx.FrameState} frameState Frame state.
* @return {boolean} Run this function in the next frame.
*/
function(map, frameState) {
if (frameState.time < start) {
frameState.animate = true;
frameState.viewHints[ol.ViewHint.ANIMATING] += 1;
return true;
} else if (frameState.time < start + duration) {
var delta = easing((frameState.time - start) / duration);
var deltaResolution = resolution - frameState.viewState.resolution;
frameState.animate = true;
frameState.viewState.resolution += delta * deltaResolution;
frameState.viewHints[ol.ViewHint.ANIMATING] += 1;
return true;
} else {
return false;
}
});
};
/**
* Generate an animated transition while updating the view center.
* @param {olx.animation.PanOptions} options Pan options.
* @return {ol.PreRenderFunction} Pre-render function.
* @deprecated Use {@link ol.View#animate} instead.
* @api
*/
ol.animation.pan = function(options) {
var source = options.source;
var start = options.start ? options.start : Date.now();
var sourceX = source[0];
var sourceY = source[1];
var duration = options.duration !== undefined ? options.duration : 1000;
var easing = options.easing ?
options.easing : ol.easing.inAndOut;
return (
/**
* @param {ol.Map} map Map.
* @param {?olx.FrameState} frameState Frame state.
* @return {boolean} Run this function in the next frame.
*/
function(map, frameState) {
if (frameState.time < start) {
frameState.animate = true;
frameState.viewHints[ol.ViewHint.ANIMATING] += 1;
return true;
} else if (frameState.time < start + duration) {
var delta = 1 - easing((frameState.time - start) / duration);
var deltaX = sourceX - frameState.viewState.center[0];
var deltaY = sourceY - frameState.viewState.center[1];
frameState.animate = true;
frameState.viewState.center[0] += delta * deltaX;
frameState.viewState.center[1] += delta * deltaY;
frameState.viewHints[ol.ViewHint.ANIMATING] += 1;
return true;
} else {
return false;
}
});
};
/**
* Generate an animated transition while updating the view rotation.
* @param {olx.animation.RotateOptions} options Rotate options.
* @return {ol.PreRenderFunction} Pre-render function.
* @deprecated Use {@link ol.View#animate} instead.
* @api
*/
ol.animation.rotate = function(options) {
var sourceRotation = options.rotation ? options.rotation : 0;
var start = options.start ? options.start : Date.now();
var duration = options.duration !== undefined ? options.duration : 1000;
var easing = options.easing ?
options.easing : ol.easing.inAndOut;
var anchor = options.anchor ?
options.anchor : null;
return (
/**
* @param {ol.Map} map Map.
* @param {?olx.FrameState} frameState Frame state.
* @return {boolean} Run this function in the next frame.
*/
function(map, frameState) {
if (frameState.time < start) {
frameState.animate = true;
frameState.viewHints[ol.ViewHint.ANIMATING] += 1;
return true;
} else if (frameState.time < start + duration) {
var delta = 1 - easing((frameState.time - start) / duration);
var deltaRotation =
(sourceRotation - frameState.viewState.rotation) * delta;
frameState.animate = true;
frameState.viewState.rotation += deltaRotation;
if (anchor) {
var center = frameState.viewState.center;
ol.coordinate.sub(center, anchor);
ol.coordinate.rotate(center, deltaRotation);
ol.coordinate.add(center, anchor);
}
frameState.viewHints[ol.ViewHint.ANIMATING] += 1;
return true;
} else {
return false;
}
});
};
/**
* Generate an animated transition while updating the view resolution.
* @param {olx.animation.ZoomOptions} options Zoom options.
* @return {ol.PreRenderFunction} Pre-render function.
* @deprecated Use {@link ol.View#animate} instead.
* @api
*/
ol.animation.zoom = function(options) {
var sourceResolution = options.resolution;
var start = options.start ? options.start : Date.now();
var duration = options.duration !== undefined ? options.duration : 1000;
var easing = options.easing ?
options.easing : ol.easing.inAndOut;
return (
/**
* @param {ol.Map} map Map.
* @param {?olx.FrameState} frameState Frame state.
* @return {boolean} Run this function in the next frame.
*/
function(map, frameState) {
if (frameState.time < start) {
frameState.animate = true;
frameState.viewHints[ol.ViewHint.ANIMATING] += 1;
return true;
} else if (frameState.time < start + duration) {
var delta = 1 - easing((frameState.time - start) / duration);
var deltaResolution =
sourceResolution - frameState.viewState.resolution;
frameState.animate = true;
frameState.viewState.resolution += delta * deltaResolution;
frameState.viewHints[ol.ViewHint.ANIMATING] += 1;
return true;
} else {
return false;
}
});
};

View File

@@ -1,13 +0,0 @@
/**
* The animation static methods are designed to be used with the
* {@link ol.Map#beforeRender} method. For example:
*
* var map = new ol.Map({ ... });
* var zoom = ol.animation.zoom({
* resolution: map.getView().getResolution()
* });
* map.beforeRender(zoom);
* map.getView().setResolution(map.getView().getResolution() * 2);
*
* @namespace ol.animation
*/

View File

@@ -1,7 +1,5 @@
goog.provide('ol.array');
goog.require('ol');
/**
* Performs a binary search on the provided sorted list and returns the index of the item if found. If it can't be found it'll return -1.

View File

@@ -24,7 +24,7 @@ goog.require('ol.tilegrid');
* @constructor
* @param {olx.AttributionOptions} options Attribution options.
* @struct
* @api stable
* @api
*/
ol.Attribution = function(options) {
@@ -46,7 +46,7 @@ ol.Attribution = function(options) {
/**
* Get the attribution markup.
* @return {string} The attribution HTML.
* @api stable
* @api
*/
ol.Attribution.prototype.getHTML = function() {
return this.html_;

View File

@@ -24,7 +24,7 @@ goog.require('ol.events.Event');
* @fires ol.Collection.Event
* @param {!Array.<T>=} opt_array Array.
* @template T
* @api stable
* @api
*/
ol.Collection = function(opt_array) {
@@ -44,7 +44,7 @@ ol.inherits(ol.Collection, ol.Object);
/**
* Remove all elements from the collection.
* @api stable
* @api
*/
ol.Collection.prototype.clear = function() {
while (this.getLength() > 0) {
@@ -58,7 +58,7 @@ ol.Collection.prototype.clear = function() {
* to the end of the collection.
* @param {!Array.<T>} arr Array.
* @return {ol.Collection.<T>} This collection.
* @api stable
* @api
*/
ol.Collection.prototype.extend = function(arr) {
var i, ii;
@@ -76,7 +76,7 @@ ol.Collection.prototype.extend = function(arr) {
* index and the array). The return value is ignored.
* @param {S=} opt_this The object to use as `this` in `f`.
* @template S
* @api stable
* @api
*/
ol.Collection.prototype.forEach = function(f, opt_this) {
this.array_.forEach(f, opt_this);
@@ -89,7 +89,7 @@ ol.Collection.prototype.forEach = function(f, opt_this) {
* collection's "length" property won't be in sync with the actual length
* of the array.
* @return {!Array.<T>} Array.
* @api stable
* @api
*/
ol.Collection.prototype.getArray = function() {
return this.array_;
@@ -100,7 +100,7 @@ ol.Collection.prototype.getArray = function() {
* Get the element at the provided index.
* @param {number} index Index.
* @return {T} Element.
* @api stable
* @api
*/
ol.Collection.prototype.item = function(index) {
return this.array_[index];
@@ -111,7 +111,7 @@ ol.Collection.prototype.item = function(index) {
* Get the length of this collection.
* @return {number} The length of the array.
* @observable
* @api stable
* @api
*/
ol.Collection.prototype.getLength = function() {
return /** @type {number} */ (this.get(ol.Collection.Property_.LENGTH));
@@ -122,7 +122,7 @@ ol.Collection.prototype.getLength = function() {
* Insert an element at the provided index.
* @param {number} index Index.
* @param {T} elem Element.
* @api stable
* @api
*/
ol.Collection.prototype.insertAt = function(index, elem) {
this.array_.splice(index, 0, elem);
@@ -136,7 +136,7 @@ ol.Collection.prototype.insertAt = function(index, elem) {
* Remove the last element of the collection and return it.
* Return `undefined` if the collection is empty.
* @return {T|undefined} Element.
* @api stable
* @api
*/
ol.Collection.prototype.pop = function() {
return this.removeAt(this.getLength() - 1);
@@ -147,7 +147,7 @@ ol.Collection.prototype.pop = function() {
* Insert the provided element at the end of the collection.
* @param {T} elem Element.
* @return {number} New length of the collection.
* @api stable
* @api
*/
ol.Collection.prototype.push = function(elem) {
var n = this.getLength();
@@ -160,7 +160,7 @@ ol.Collection.prototype.push = function(elem) {
* Remove the first occurrence of an element from the collection.
* @param {T} elem Element.
* @return {T|undefined} The removed element or undefined if none found.
* @api stable
* @api
*/
ol.Collection.prototype.remove = function(elem) {
var arr = this.array_;
@@ -179,7 +179,7 @@ ol.Collection.prototype.remove = function(elem) {
* Return `undefined` if the collection does not contain this index.
* @param {number} index Index.
* @return {T|undefined} Value.
* @api stable
* @api
*/
ol.Collection.prototype.removeAt = function(index) {
var prev = this.array_[index];
@@ -195,7 +195,7 @@ ol.Collection.prototype.removeAt = function(index) {
* Set the element at the provided index.
* @param {number} index Index.
* @param {T} elem Element.
* @api stable
* @api
*/
ol.Collection.prototype.setAt = function(index, elem) {
var n = this.getLength();
@@ -251,7 +251,7 @@ ol.Collection.Event = function(type, opt_element) {
/**
* The element that is added to or removed from the collection.
* @type {*}
* @api stable
* @api
*/
this.element = opt_element;

View File

@@ -7,13 +7,13 @@ ol.CollectionEventType = {
/**
* Triggered when an item is added to the collection.
* @event ol.Collection.Event#add
* @api stable
* @api
*/
ADD: 'add',
/**
* Triggered when an item is removed from the collection.
* @event ol.Collection.Event#remove
* @api stable
* @api
*/
REMOVE: 'remove'
};

View File

@@ -1,6 +1,5 @@
goog.provide('ol.control');
goog.require('ol');
goog.require('ol.Collection');
goog.require('ol.control.Attribution');
goog.require('ol.control.Rotate');
@@ -17,7 +16,7 @@ goog.require('ol.control.Zoom');
*
* @param {olx.control.DefaultsOptions=} opt_options Defaults options.
* @return {ol.Collection.<ol.control.Control>} Controls.
* @api stable
* @api
*/
ol.control.defaults = function(opt_options) {

View File

@@ -21,7 +21,7 @@ goog.require('ol.obj');
* @constructor
* @extends {ol.control.Control}
* @param {olx.control.AttributionOptions=} opt_options Attribution options.
* @api stable
* @api
*/
ol.control.Attribution = function(opt_options) {
@@ -359,7 +359,7 @@ ol.control.Attribution.prototype.handleToggle_ = function() {
/**
* Return `true` if the attribution is collapsible, `false` otherwise.
* @return {boolean} True if the widget is collapsible.
* @api stable
* @api
*/
ol.control.Attribution.prototype.getCollapsible = function() {
return this.collapsible_;
@@ -369,7 +369,7 @@ ol.control.Attribution.prototype.getCollapsible = function() {
/**
* Set whether the attribution should be collapsible.
* @param {boolean} collapsible True if the widget is collapsible.
* @api stable
* @api
*/
ol.control.Attribution.prototype.setCollapsible = function(collapsible) {
if (this.collapsible_ === collapsible) {
@@ -388,7 +388,7 @@ ol.control.Attribution.prototype.setCollapsible = function(collapsible) {
* not do anything if the attribution isn't collapsible or if the current
* collapsed state is already the one requested.
* @param {boolean} collapsed True if the widget is collapsed.
* @api stable
* @api
*/
ol.control.Attribution.prototype.setCollapsed = function(collapsed) {
if (!this.collapsible_ || this.collapsed_ === collapsed) {
@@ -402,7 +402,7 @@ ol.control.Attribution.prototype.setCollapsed = function(collapsed) {
* Return `true` when the attribution is currently collapsed or `false`
* otherwise.
* @return {boolean} True if the widget is collapsed.
* @api stable
* @api
*/
ol.control.Attribution.prototype.getCollapsed = function() {
return this.collapsed_;

View File

@@ -34,7 +34,7 @@ goog.require('ol.events');
* @extends {ol.Object}
* @implements {oli.control.Control}
* @param {olx.control.ControlOptions} options Control options.
* @api stable
* @api
*/
ol.control.Control = function(options) {
@@ -89,7 +89,7 @@ ol.control.Control.prototype.disposeInternal = function() {
/**
* Get the map associated with this control.
* @return {ol.Map} Map.
* @api stable
* @api
*/
ol.control.Control.prototype.getMap = function() {
return this.map_;
@@ -102,7 +102,7 @@ ol.control.Control.prototype.getMap = function() {
* the map here.
* @param {ol.Map} map Map.
* @override
* @api stable
* @api
*/
ol.control.Control.prototype.setMap = function(map) {
if (this.map_) {

View File

@@ -23,7 +23,7 @@ goog.require('ol.events.EventType');
* @constructor
* @extends {ol.control.Control}
* @param {olx.control.FullScreenOptions=} opt_options Options.
* @api stable
* @api
*/
ol.control.FullScreen = function(opt_options) {
@@ -155,7 +155,7 @@ ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.control.FullScreen.prototype.setMap = function(map) {
ol.control.Control.prototype.setMap.call(this, map);

View File

@@ -21,7 +21,7 @@ goog.require('ol.proj');
* @extends {ol.control.Control}
* @param {olx.control.MousePositionOptions=} opt_options Mouse position
* options.
* @api stable
* @api
*/
ol.control.MousePosition = function(opt_options) {
@@ -118,7 +118,7 @@ ol.control.MousePosition.prototype.handleProjectionChanged_ = function() {
* @return {ol.CoordinateFormatType|undefined} The format to render the current
* position in.
* @observable
* @api stable
* @api
*/
ol.control.MousePosition.prototype.getCoordinateFormat = function() {
return /** @type {ol.CoordinateFormatType|undefined} */ (
@@ -131,7 +131,7 @@ ol.control.MousePosition.prototype.getCoordinateFormat = function() {
* @return {ol.proj.Projection|undefined} The projection to report mouse
* position in.
* @observable
* @api stable
* @api
*/
ol.control.MousePosition.prototype.getProjection = function() {
return /** @type {ol.proj.Projection|undefined} */ (
@@ -162,7 +162,7 @@ ol.control.MousePosition.prototype.handleMouseOut = function(event) {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.control.MousePosition.prototype.setMap = function(map) {
ol.control.Control.prototype.setMap.call(this, map);
@@ -183,7 +183,7 @@ ol.control.MousePosition.prototype.setMap = function(map) {
* @param {ol.CoordinateFormatType} format The format to render the current
* position in.
* @observable
* @api stable
* @api
*/
ol.control.MousePosition.prototype.setCoordinateFormat = function(format) {
this.set(ol.control.MousePosition.Property_.COORDINATE_FORMAT, format);
@@ -195,7 +195,7 @@ ol.control.MousePosition.prototype.setCoordinateFormat = function(format) {
* @param {ol.proj.Projection} projection The projection to report mouse
* position in.
* @observable
* @api stable
* @api
*/
ol.control.MousePosition.prototype.setProjection = function(projection) {
this.set(ol.control.MousePosition.Property_.PROJECTION, projection);

View File

@@ -462,7 +462,7 @@ ol.control.OverviewMap.prototype.handleToggle_ = function() {
/**
* Return `true` if the overview map is collapsible, `false` otherwise.
* @return {boolean} True if the widget is collapsible.
* @api stable
* @api
*/
ol.control.OverviewMap.prototype.getCollapsible = function() {
return this.collapsible_;
@@ -472,7 +472,7 @@ ol.control.OverviewMap.prototype.getCollapsible = function() {
/**
* Set whether the overview map should be collapsible.
* @param {boolean} collapsible True if the widget is collapsible.
* @api stable
* @api
*/
ol.control.OverviewMap.prototype.setCollapsible = function(collapsible) {
if (this.collapsible_ === collapsible) {
@@ -491,7 +491,7 @@ ol.control.OverviewMap.prototype.setCollapsible = function(collapsible) {
* not do anything if the overview map isn't collapsible or if the current
* collapsed state is already the one requested.
* @param {boolean} collapsed True if the widget is collapsed.
* @api stable
* @api
*/
ol.control.OverviewMap.prototype.setCollapsed = function(collapsed) {
if (!this.collapsible_ || this.collapsed_ === collapsed) {
@@ -504,7 +504,7 @@ ol.control.OverviewMap.prototype.setCollapsed = function(collapsed) {
/**
* Determine if the overview map is collapsed.
* @return {boolean} The overview map is collapsed.
* @api stable
* @api
*/
ol.control.OverviewMap.prototype.getCollapsed = function() {
return this.collapsed_;

View File

@@ -17,7 +17,7 @@ goog.require('ol.easing');
* @constructor
* @extends {ol.control.Control}
* @param {olx.control.RotateOptions=} opt_options Rotate options.
* @api stable
* @api
*/
ol.control.Rotate = function(opt_options) {

View File

@@ -24,7 +24,7 @@ goog.require('ol.proj.Units');
* @constructor
* @extends {ol.control.Control}
* @param {olx.control.ScaleLineOptions=} opt_options Scale line options.
* @api stable
* @api
*/
ol.control.ScaleLine = function(opt_options) {
@@ -108,7 +108,7 @@ ol.control.ScaleLine.LEADING_DIGITS = [1, 2, 5];
* @return {ol.control.ScaleLineUnits|undefined} The units to use in the scale
* line.
* @observable
* @api stable
* @api
*/
ol.control.ScaleLine.prototype.getUnits = function() {
return /** @type {ol.control.ScaleLineUnits|undefined} */ (
@@ -145,7 +145,7 @@ ol.control.ScaleLine.prototype.handleUnitsChanged_ = function() {
* Set the units to use in the scale line.
* @param {ol.control.ScaleLineUnits} units The units to use in the scale line.
* @observable
* @api stable
* @api
*/
ol.control.ScaleLine.prototype.setUnits = function(units) {
this.set(ol.control.ScaleLine.Property_.UNITS, units);

View File

@@ -17,7 +17,7 @@ goog.require('ol.easing');
* @constructor
* @extends {ol.control.Control}
* @param {olx.control.ZoomOptions=} opt_options Zoom options.
* @api stable
* @api
*/
ol.control.Zoom = function(opt_options) {

View File

@@ -26,7 +26,7 @@ goog.require('ol.pointer.PointerEventHandler');
* @constructor
* @extends {ol.control.Control}
* @param {olx.control.ZoomSliderOptions=} opt_options Zoom slider options.
* @api stable
* @api
*/
ol.control.ZoomSlider = function(opt_options) {

View File

@@ -15,7 +15,7 @@ goog.require('ol.css');
* @constructor
* @extends {ol.control.Control}
* @param {olx.control.ZoomToExtentOptions=} opt_options Options.
* @api stable
* @api
*/
ol.control.ZoomToExtent = function(opt_options) {
var options = opt_options ? opt_options : {};

View File

@@ -17,7 +17,7 @@ goog.require('ol.string');
* @param {ol.Coordinate} coordinate Coordinate.
* @param {ol.Coordinate} delta Delta.
* @return {ol.Coordinate} The input coordinate adjusted by the given delta.
* @api stable
* @api
*/
ol.coordinate.add = function(coordinate, delta) {
coordinate[0] += delta[0];
@@ -86,7 +86,7 @@ ol.coordinate.closestOnSegment = function(coordinate, segment) {
* @param {number=} opt_fractionDigits The number of digits to include
* after the decimal point. Default is `0`.
* @return {ol.CoordinateFormatType} Coordinate format.
* @api stable
* @api
*/
ol.coordinate.createStringXY = function(opt_fractionDigits) {
return (
@@ -112,10 +112,26 @@ ol.coordinate.degreesToStringHDMS_ = function(degrees, hemispheres, opt_fraction
var normalizedDegrees = ol.math.modulo(degrees + 180, 360) - 180;
var x = Math.abs(3600 * normalizedDegrees);
var dflPrecision = opt_fractionDigits || 0;
return Math.floor(x / 3600) + '\u00b0 ' +
ol.string.padNumber(Math.floor((x / 60) % 60), 2) + '\u2032 ' +
ol.string.padNumber((x % 60), 2, dflPrecision) + '\u2033 ' +
hemispheres.charAt(normalizedDegrees < 0 ? 1 : 0);
var precision = Math.pow(10, dflPrecision);
var deg = Math.floor(x / 3600);
var min = Math.floor((x - deg * 3600) / 60);
var sec = x - (deg * 3600) - (min * 60);
sec = Math.ceil(sec * precision) / precision;
if (sec >= 60) {
sec = 0;
min += 1;
}
if (min >= 60) {
min = 0;
deg += 1;
}
return deg + '\u00b0 ' + ol.string.padNumber(min, 2) + '\u2032 ' +
ol.string.padNumber(sec, 2, dflPrecision) + '\u2033 ' +
hemispheres.charAt(normalizedDegrees < 0 ? 1 : 0);
};
@@ -144,7 +160,7 @@ ol.coordinate.degreesToStringHDMS_ = function(degrees, hemispheres, opt_fraction
* @param {number=} opt_fractionDigits The number of digits to include
* after the decimal point. Default is `0`.
* @return {string} Formatted coordinate.
* @api stable
* @api
*/
ol.coordinate.format = function(coordinate, template, opt_fractionDigits) {
if (coordinate) {
@@ -188,7 +204,7 @@ ol.coordinate.equals = function(coordinate1, coordinate2) {
* @param {ol.Coordinate} coordinate Coordinate.
* @param {number} angle Angle in radian.
* @return {ol.Coordinate} Coordinate.
* @api stable
* @api
*/
ol.coordinate.rotate = function(coordinate, angle) {
var cosAngle = Math.cos(angle);
@@ -250,6 +266,16 @@ ol.coordinate.squaredDistance = function(coord1, coord2) {
};
/**
* @param {ol.Coordinate} coord1 First coordinate.
* @param {ol.Coordinate} coord2 Second coordinate.
* @return {number} Distance between coord1 and coord2.
*/
ol.coordinate.distance = function(coord1, coord2) {
return Math.sqrt(ol.coordinate.squaredDistance(coord1, coord2));
};
/**
* Calculate the squared distance from a coordinate to a line segment.
*
@@ -283,7 +309,7 @@ ol.coordinate.squaredDistanceToSegment = function(coordinate, segment) {
* @param {number=} opt_fractionDigits The number of digits to include
* after the decimal point. Default is `0`.
* @return {string} Hemisphere, degrees, minutes and seconds.
* @api stable
* @api
*/
ol.coordinate.toStringHDMS = function(coordinate, opt_fractionDigits) {
if (coordinate) {
@@ -314,7 +340,7 @@ ol.coordinate.toStringHDMS = function(coordinate, opt_fractionDigits) {
* @param {number=} opt_fractionDigits The number of digits to include
* after the decimal point. Default is `0`.
* @return {string} XY.
* @api stable
* @api
*/
ol.coordinate.toStringXY = function(coordinate, opt_fractionDigits) {
return ol.coordinate.format(coordinate, '{x}, {y}', opt_fractionDigits);

View File

@@ -12,7 +12,7 @@ goog.require('ol.has');
*
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if only the alt key is pressed.
* @api stable
* @api
*/
ol.events.condition.altKeyOnly = function(mapBrowserEvent) {
var originalEvent = mapBrowserEvent.originalEvent;
@@ -29,7 +29,7 @@ ol.events.condition.altKeyOnly = function(mapBrowserEvent) {
*
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if only the alt and shift keys are pressed.
* @api stable
* @api
*/
ol.events.condition.altShiftKeysOnly = function(mapBrowserEvent) {
var originalEvent = mapBrowserEvent.originalEvent;
@@ -46,7 +46,7 @@ ol.events.condition.altShiftKeysOnly = function(mapBrowserEvent) {
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True.
* @function
* @api stable
* @api
*/
ol.events.condition.always = ol.functions.TRUE;
@@ -56,7 +56,7 @@ ol.events.condition.always = ol.functions.TRUE;
*
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the event is a map `click` event.
* @api stable
* @api
*/
ol.events.condition.click = function(mapBrowserEvent) {
return mapBrowserEvent.type == ol.MapBrowserEventType.CLICK;
@@ -85,7 +85,7 @@ ol.events.condition.mouseActionButton = function(mapBrowserEvent) {
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} False.
* @function
* @api stable
* @api
*/
ol.events.condition.never = ol.functions.FALSE;
@@ -108,7 +108,7 @@ ol.events.condition.pointerMove = function(mapBrowserEvent) {
*
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the event is a map `singleclick` event.
* @api stable
* @api
*/
ol.events.condition.singleClick = function(mapBrowserEvent) {
return mapBrowserEvent.type == ol.MapBrowserEventType.SINGLECLICK;
@@ -120,7 +120,7 @@ ol.events.condition.singleClick = function(mapBrowserEvent) {
*
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the event is a map `dblclick` event.
* @api stable
* @api
*/
ol.events.condition.doubleClick = function(mapBrowserEvent) {
return mapBrowserEvent.type == ol.MapBrowserEventType.DBLCLICK;
@@ -133,7 +133,7 @@ ol.events.condition.doubleClick = function(mapBrowserEvent) {
*
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True only if there no modifier keys are pressed.
* @api stable
* @api
*/
ol.events.condition.noModifierKeys = function(mapBrowserEvent) {
var originalEvent = mapBrowserEvent.originalEvent;
@@ -151,7 +151,7 @@ ol.events.condition.noModifierKeys = function(mapBrowserEvent) {
*
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if only the platform modifier key is pressed.
* @api stable
* @api
*/
ol.events.condition.platformModifierKeyOnly = function(mapBrowserEvent) {
var originalEvent = mapBrowserEvent.originalEvent;
@@ -168,7 +168,7 @@ ol.events.condition.platformModifierKeyOnly = function(mapBrowserEvent) {
*
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if only the shift key is pressed.
* @api stable
* @api
*/
ol.events.condition.shiftKeyOnly = function(mapBrowserEvent) {
var originalEvent = mapBrowserEvent.originalEvent;
@@ -202,7 +202,7 @@ ol.events.condition.targetNotEditable = function(mapBrowserEvent) {
*
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the event originates from a mouse device.
* @api stable
* @api
*/
ol.events.condition.mouseOnly = function(mapBrowserEvent) {
ol.asserts.assert(mapBrowserEvent.pointerEvent, 56); // mapBrowserEvent must originate from a pointer event

View File

@@ -25,14 +25,14 @@ ol.events.Event = function(type) {
/**
* The event type.
* @type {string}
* @api stable
* @api
*/
this.type = type;
/**
* The event target.
* @type {Object}
* @api stable
* @api
*/
this.target = null;
@@ -43,7 +43,7 @@ ol.events.Event = function(type) {
* Stop event propagation.
* @function
* @override
* @api stable
* @api
*/
ol.events.Event.prototype.preventDefault =
@@ -51,7 +51,7 @@ ol.events.Event.prototype.preventDefault =
* Stop event propagation.
* @function
* @override
* @api stable
* @api
*/
ol.events.Event.prototype.stopPropagation = function() {
this.propagationStopped = true;

View File

@@ -1,6 +1,5 @@
goog.provide('ol.extent');
goog.require('ol');
goog.require('ol.asserts');
goog.require('ol.extent.Corner');
goog.require('ol.extent.Relationship');
@@ -11,7 +10,7 @@ goog.require('ol.extent.Relationship');
*
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @return {ol.Extent} Bounding extent.
* @api stable
* @api
*/
ol.extent.boundingExtent = function(coordinates) {
var extent = ol.extent.createEmpty();
@@ -44,7 +43,7 @@ ol.extent.boundingExtentXYs_ = function(xs, ys, opt_extent) {
* @param {number} value The amount by which the extent should be buffered.
* @param {ol.Extent=} opt_extent Extent.
* @return {ol.Extent} Extent.
* @api stable
* @api
*/
ol.extent.buffer = function(extent, value, opt_extent) {
if (opt_extent) {
@@ -116,7 +115,7 @@ ol.extent.closestSquaredDistanceXY = function(extent, x, y) {
* @param {ol.Extent} extent Extent.
* @param {ol.Coordinate} coordinate Coordinate.
* @return {boolean} The coordinate is contained in the extent.
* @api stable
* @api
*/
ol.extent.containsCoordinate = function(extent, coordinate) {
return ol.extent.containsXY(extent, coordinate[0], coordinate[1]);
@@ -133,7 +132,7 @@ ol.extent.containsCoordinate = function(extent, coordinate) {
* @param {ol.Extent} extent2 Extent 2.
* @return {boolean} The second extent is contained by or on the edge of the
* first.
* @api stable
* @api
*/
ol.extent.containsExtent = function(extent1, extent2) {
return extent1[0] <= extent2[0] && extent2[2] <= extent1[2] &&
@@ -148,7 +147,7 @@ ol.extent.containsExtent = function(extent1, extent2) {
* @param {number} x X coordinate.
* @param {number} y Y coordinate.
* @return {boolean} The x, y values are contained in the extent.
* @api stable
* @api
*/
ol.extent.containsXY = function(extent, x, y) {
return extent[0] <= x && x <= extent[2] && extent[1] <= y && y <= extent[3];
@@ -190,7 +189,7 @@ ol.extent.coordinateRelationship = function(extent, coordinate) {
/**
* Create an empty extent.
* @return {ol.Extent} Empty extent.
* @api stable
* @api
*/
ol.extent.createEmpty = function() {
return [Infinity, Infinity, -Infinity, -Infinity];
@@ -284,7 +283,7 @@ ol.extent.createOrUpdateFromRings = function(rings, opt_extent) {
* @param {ol.Extent} extent1 Extent 1.
* @param {ol.Extent} extent2 Extent 2.
* @return {boolean} The two extents are equivalent.
* @api stable
* @api
*/
ol.extent.equals = function(extent1, extent2) {
return extent1[0] == extent2[0] && extent1[2] == extent2[2] &&
@@ -297,7 +296,7 @@ ol.extent.equals = function(extent1, extent2) {
* @param {ol.Extent} extent1 The extent to be modified.
* @param {ol.Extent} extent2 The extent that will be included in the first.
* @return {ol.Extent} A reference to the first (extended) extent.
* @api stable
* @api
*/
ol.extent.extend = function(extent1, extent2) {
if (extent2[0] < extent1[0]) {
@@ -443,7 +442,7 @@ ol.extent.getArea = function(extent) {
* Get the bottom left coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Bottom left coordinate.
* @api stable
* @api
*/
ol.extent.getBottomLeft = function(extent) {
return [extent[0], extent[1]];
@@ -454,7 +453,7 @@ ol.extent.getBottomLeft = function(extent) {
* Get the bottom right coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Bottom right coordinate.
* @api stable
* @api
*/
ol.extent.getBottomRight = function(extent) {
return [extent[2], extent[1]];
@@ -465,7 +464,7 @@ ol.extent.getBottomRight = function(extent) {
* Get the center coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Center.
* @api stable
* @api
*/
ol.extent.getCenter = function(extent) {
return [(extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2];
@@ -547,7 +546,7 @@ ol.extent.getForViewAndSize = function(center, resolution, rotation, size, opt_e
* Get the height of an extent.
* @param {ol.Extent} extent Extent.
* @return {number} Height.
* @api stable
* @api
*/
ol.extent.getHeight = function(extent) {
return extent[3] - extent[1];
@@ -571,7 +570,7 @@ ol.extent.getIntersectionArea = function(extent1, extent2) {
* @param {ol.Extent} extent2 Extent 2.
* @param {ol.Extent=} opt_extent Optional extent to populate with intersection.
* @return {ol.Extent} Intersecting extent.
* @api stable
* @api
*/
ol.extent.getIntersection = function(extent1, extent2, opt_extent) {
var intersection = opt_extent ? opt_extent : ol.extent.createEmpty();
@@ -614,7 +613,7 @@ ol.extent.getMargin = function(extent) {
* Get the size (width, height) of an extent.
* @param {ol.Extent} extent The extent.
* @return {ol.Size} The extent size.
* @api stable
* @api
*/
ol.extent.getSize = function(extent) {
return [extent[2] - extent[0], extent[3] - extent[1]];
@@ -625,7 +624,7 @@ ol.extent.getSize = function(extent) {
* Get the top left coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Top left coordinate.
* @api stable
* @api
*/
ol.extent.getTopLeft = function(extent) {
return [extent[0], extent[3]];
@@ -636,7 +635,7 @@ ol.extent.getTopLeft = function(extent) {
* Get the top right coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Top right coordinate.
* @api stable
* @api
*/
ol.extent.getTopRight = function(extent) {
return [extent[2], extent[3]];
@@ -647,7 +646,7 @@ ol.extent.getTopRight = function(extent) {
* Get the width of an extent.
* @param {ol.Extent} extent Extent.
* @return {number} Width.
* @api stable
* @api
*/
ol.extent.getWidth = function(extent) {
return extent[2] - extent[0];
@@ -659,7 +658,7 @@ ol.extent.getWidth = function(extent) {
* @param {ol.Extent} extent1 Extent 1.
* @param {ol.Extent} extent2 Extent.
* @return {boolean} The two extents intersect.
* @api stable
* @api
*/
ol.extent.intersects = function(extent1, extent2) {
return extent1[0] <= extent2[2] &&
@@ -673,7 +672,7 @@ ol.extent.intersects = function(extent1, extent2) {
* Determine if an extent is empty.
* @param {ol.Extent} extent Extent.
* @return {boolean} Is empty.
* @api stable
* @api
*/
ol.extent.isEmpty = function(extent) {
return extent[2] < extent[0] || extent[3] < extent[1];
@@ -775,7 +774,7 @@ ol.extent.intersectsSegment = function(extent, start, end) {
* [minX, minY, maxX, maxY] extent coordinates.
* @param {ol.Extent=} opt_extent Destination extent.
* @return {ol.Extent} Extent.
* @api stable
* @api
*/
ol.extent.applyTransform = function(extent, transformFn, opt_extent) {
var coordinates = [

View File

@@ -52,7 +52,7 @@ goog.require('ol.style.Style');
* You may pass a Geometry object directly, or an object literal
* containing properties. If you pass an object literal, you may
* include a Geometry associated with a `geometry` key.
* @api stable
* @api
*/
ol.Feature = function(opt_geometryOrProperties) {
@@ -113,7 +113,7 @@ ol.inherits(ol.Feature, ol.Object);
* Clone this feature. If the original feature has a geometry it
* is also cloned. The feature id is not set in the clone.
* @return {ol.Feature} The clone.
* @api stable
* @api
*/
ol.Feature.prototype.clone = function() {
var clone = new ol.Feature(this.getProperties());
@@ -135,7 +135,7 @@ ol.Feature.prototype.clone = function() {
* geometries. The "default" geometry (the one that is rendered by default) is
* set when calling {@link ol.Feature#setGeometry}.
* @return {ol.geom.Geometry|undefined} The default geometry for the feature.
* @api stable
* @api
* @observable
*/
ol.Feature.prototype.getGeometry = function() {
@@ -149,7 +149,7 @@ ol.Feature.prototype.getGeometry = function() {
* is either set when reading data from a remote source or set explicitly by
* calling {@link ol.Feature#setId}.
* @return {number|string|undefined} Id.
* @api stable
* @api
*/
ol.Feature.prototype.getId = function() {
return this.id_;
@@ -161,7 +161,7 @@ ol.Feature.prototype.getId = function() {
* geometry is named `geometry`.
* @return {string} Get the property name associated with the default geometry
* for this feature.
* @api stable
* @api
*/
ol.Feature.prototype.getGeometryName = function() {
return this.geometryName_;
@@ -173,7 +173,7 @@ ol.Feature.prototype.getGeometryName = function() {
* {@link ol.Feature#setStyle} method.
* @return {ol.style.Style|Array.<ol.style.Style>|
* ol.FeatureStyleFunction|ol.StyleFunction} The feature style.
* @api stable
* @api
*/
ol.Feature.prototype.getStyle = function() {
return this.style_;
@@ -184,7 +184,7 @@ ol.Feature.prototype.getStyle = function() {
* Get the feature's style function.
* @return {ol.FeatureStyleFunction|undefined} Return a function
* representing the current style of this feature.
* @api stable
* @api
*/
ol.Feature.prototype.getStyleFunction = function() {
return this.styleFunction_;
@@ -220,7 +220,7 @@ ol.Feature.prototype.handleGeometryChanged_ = function() {
* Set the default geometry for the feature. This will update the property
* with the name returned by {@link ol.Feature#getGeometryName}.
* @param {ol.geom.Geometry|undefined} geometry The new geometry.
* @api stable
* @api
* @observable
*/
ol.Feature.prototype.setGeometry = function(geometry) {
@@ -234,7 +234,7 @@ ol.Feature.prototype.setGeometry = function(geometry) {
* styles. If it is `null` the feature has no style (a `null` style).
* @param {ol.style.Style|Array.<ol.style.Style>|
* ol.FeatureStyleFunction|ol.StyleFunction} style Style for this feature.
* @api stable
* @api
* @fires ol.events.Event#event:change
*/
ol.Feature.prototype.setStyle = function(style) {
@@ -251,7 +251,7 @@ ol.Feature.prototype.setStyle = function(style) {
* The feature id can be used with the {@link ol.source.Vector#getFeatureById}
* method.
* @param {number|string|undefined} id The feature id.
* @api stable
* @api
* @fires ol.events.Event#event:change
*/
ol.Feature.prototype.setId = function(id) {
@@ -265,7 +265,7 @@ ol.Feature.prototype.setId = function(id) {
* When calling {@link ol.Feature#getGeometry}, the value of the property with
* this name will be returned.
* @param {string} name The property name of the default geometry.
* @api stable
* @api
*/
ol.Feature.prototype.setGeometryName = function(name) {
ol.events.unlisten(

View File

@@ -16,7 +16,7 @@ goog.require('ol.proj');
*
* @constructor
* @abstract
* @api stable
* @api
*/
ol.format.Feature = function() {

View File

@@ -1,6 +1,5 @@
goog.provide('ol.format.filter');
goog.require('ol');
goog.require('ol.format.filter.And');
goog.require('ol.format.filter.Bbox');
goog.require('ol.format.filter.EqualTo');

View File

@@ -1,7 +1,5 @@
goog.provide('ol.format.filter.Filter');
goog.require('ol');
/**
* @classdesc

View File

@@ -26,7 +26,7 @@ goog.require('ol.proj');
* @constructor
* @extends {ol.format.JSONFeature}
* @param {olx.format.GeoJSONOptions=} opt_options Options.
* @api stable
* @api
*/
ol.format.GeoJSON = function(opt_options) {
@@ -335,7 +335,7 @@ ol.format.GeoJSON.GEOMETRY_WRITERS_ = {
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {ol.Feature} Feature.
* @api stable
* @api
*/
ol.format.GeoJSON.prototype.readFeature;
@@ -349,7 +349,7 @@ ol.format.GeoJSON.prototype.readFeature;
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {Array.<ol.Feature>} Features.
* @api stable
* @api
*/
ol.format.GeoJSON.prototype.readFeatures;
@@ -420,7 +420,7 @@ ol.format.GeoJSON.prototype.readFeaturesFromObject = function(
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {ol.geom.Geometry} Geometry.
* @api stable
* @api
*/
ol.format.GeoJSON.prototype.readGeometry;
@@ -441,7 +441,7 @@ ol.format.GeoJSON.prototype.readGeometryFromObject = function(
* @function
* @param {Document|Node|Object|string} source Source.
* @return {ol.proj.Projection} Projection.
* @api stable
* @api
*/
ol.format.GeoJSON.prototype.readProjection;
@@ -480,7 +480,7 @@ ol.format.GeoJSON.prototype.readProjectionFromObject = function(object) {
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {string} GeoJSON.
* @override
* @api stable
* @api
*/
ol.format.GeoJSON.prototype.writeFeature;
@@ -492,7 +492,7 @@ ol.format.GeoJSON.prototype.writeFeature;
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {GeoJSONFeature} Object.
* @override
* @api stable
* @api
*/
ol.format.GeoJSON.prototype.writeFeatureObject = function(feature, opt_options) {
opt_options = this.adaptOptions(opt_options);
@@ -529,7 +529,7 @@ ol.format.GeoJSON.prototype.writeFeatureObject = function(feature, opt_options)
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {string} GeoJSON.
* @api stable
* @api
*/
ol.format.GeoJSON.prototype.writeFeatures;
@@ -541,7 +541,7 @@ ol.format.GeoJSON.prototype.writeFeatures;
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {GeoJSONFeatureCollection} GeoJSON Object.
* @override
* @api stable
* @api
*/
ol.format.GeoJSON.prototype.writeFeaturesObject = function(features, opt_options) {
opt_options = this.adaptOptions(opt_options);
@@ -564,7 +564,7 @@ ol.format.GeoJSON.prototype.writeFeaturesObject = function(features, opt_options
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {string} GeoJSON.
* @api stable
* @api
*/
ol.format.GeoJSON.prototype.writeGeometry;
@@ -576,7 +576,7 @@ ol.format.GeoJSON.prototype.writeGeometry;
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} Object.
* @override
* @api stable
* @api
*/
ol.format.GeoJSON.prototype.writeGeometryObject = function(geometry,
opt_options) {

View File

@@ -13,7 +13,7 @@ goog.require('ol.format.GML3');
* @param {olx.format.GMLOptions=} opt_options
* Optional configuration object.
* @extends {ol.format.GMLBase}
* @api stable
* @api
*/
ol.format.GML = ol.format.GML3;
@@ -25,7 +25,7 @@ ol.format.GML = ol.format.GML3;
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Options.
* @return {string} Result.
* @api stable
* @api
*/
ol.format.GML.prototype.writeFeatures;

View File

@@ -1186,7 +1186,7 @@ ol.format.GML3.prototype.writeGeometryNode = function(geometry, opt_options) {
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Options.
* @return {string} Result.
* @api stable
* @api
*/
ol.format.GML3.prototype.writeFeatures;

View File

@@ -564,7 +564,7 @@ ol.format.GMLBase.prototype.readGeometryFromNode = function(node, opt_options) {
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Options.
* @return {Array.<ol.Feature>} Features.
* @api stable
* @api
*/
ol.format.GMLBase.prototype.readFeatures;

View File

@@ -21,7 +21,7 @@ goog.require('ol.xml');
* @constructor
* @extends {ol.format.XMLFeature}
* @param {olx.format.GPXOptions=} opt_options Options.
* @api stable
* @api
*/
ol.format.GPX = function(opt_options) {
@@ -479,7 +479,7 @@ ol.format.GPX.prototype.handleReadExtensions_ = function(features) {
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {ol.Feature} Feature.
* @api stable
* @api
*/
ol.format.GPX.prototype.readFeature;
@@ -513,7 +513,7 @@ ol.format.GPX.prototype.readFeatureFromNode = function(node, opt_options) {
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {Array.<ol.Feature>} Features.
* @api stable
* @api
*/
ol.format.GPX.prototype.readFeatures;
@@ -546,7 +546,7 @@ ol.format.GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
* @function
* @param {Document|Node|Object|string} source Source.
* @return {ol.proj.Projection} Projection.
* @api stable
* @api
*/
ol.format.GPX.prototype.readProjection;
@@ -913,7 +913,7 @@ ol.format.GPX.GPX_SERIALIZERS_ = ol.xml.makeStructureNS(
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {string} Result.
* @api stable
* @api
*/
ol.format.GPX.prototype.writeFeatures;

View File

@@ -44,7 +44,7 @@ goog.require('ol.xml');
* @constructor
* @extends {ol.format.XMLFeature}
* @param {olx.format.KMLOptions=} opt_options Options.
* @api stable
* @api
*/
ol.format.KML = function(opt_options) {
@@ -1765,7 +1765,7 @@ ol.format.KML.prototype.readSharedStyleMap_ = function(node, objectStack) {
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {ol.Feature} Feature.
* @api stable
* @api
*/
ol.format.KML.prototype.readFeature;
@@ -1796,7 +1796,7 @@ ol.format.KML.prototype.readFeatureFromNode = function(node, opt_options) {
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {Array.<ol.Feature>} Features.
* @api stable
* @api
*/
ol.format.KML.prototype.readFeatures;
@@ -1847,7 +1847,7 @@ ol.format.KML.prototype.readFeaturesFromNode = function(node, opt_options) {
*
* @param {Document|Node|string} source Souce.
* @return {string|undefined} Name.
* @api stable
* @api
*/
ol.format.KML.prototype.readName = function(source) {
if (ol.xml.isDocument(source)) {
@@ -2047,7 +2047,7 @@ ol.format.KML.prototype.readRegionFromNode = function(node) {
* @function
* @param {Document|Node|Object|string} source Source.
* @return {ol.proj.Projection} Projection.
* @api stable
* @api
*/
ol.format.KML.prototype.readProjection;
@@ -3006,7 +3006,7 @@ ol.format.KML.OUTER_BOUNDARY_NODE_FACTORY_ =
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Options.
* @return {string} Result.
* @api stable
* @api
*/
ol.format.KML.prototype.writeFeatures;

View File

@@ -22,7 +22,7 @@ goog.require('ol.xml');
*
* @constructor
* @extends {ol.format.XMLFeature}
* @api stable
* @api
*/
ol.format.OSMXML = function() {
ol.format.XMLFeature.call(this);
@@ -176,7 +176,7 @@ ol.format.OSMXML.NODE_PARSERS_ = ol.xml.makeStructureNS(
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {Array.<ol.Feature>} Features.
* @api stable
* @api
*/
ol.format.OSMXML.prototype.readFeatures;
@@ -205,7 +205,7 @@ ol.format.OSMXML.prototype.readFeaturesFromNode = function(node, opt_options) {
* @function
* @param {Document|Node|Object|string} source Source.
* @return {ol.proj.Projection} Projection.
* @api stable
* @api
*/
ol.format.OSMXML.prototype.readProjection;

View File

@@ -22,7 +22,7 @@ goog.require('ol.proj');
* @extends {ol.format.TextFeature}
* @param {olx.format.PolylineOptions=} opt_options
* Optional configuration object.
* @api stable
* @api
*/
ol.format.Polyline = function(opt_options) {
@@ -271,7 +271,7 @@ ol.format.Polyline.encodeUnsignedInteger = function(num) {
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {ol.Feature} Feature.
* @api stable
* @api
*/
ol.format.Polyline.prototype.readFeature;
@@ -293,7 +293,7 @@ ol.format.Polyline.prototype.readFeatureFromText = function(text, opt_options) {
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {Array.<ol.Feature>} Features.
* @api stable
* @api
*/
ol.format.Polyline.prototype.readFeatures;
@@ -314,7 +314,7 @@ ol.format.Polyline.prototype.readFeaturesFromText = function(text, opt_options)
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {ol.geom.Geometry} Geometry.
* @api stable
* @api
*/
ol.format.Polyline.prototype.readGeometry;
@@ -344,7 +344,7 @@ ol.format.Polyline.prototype.readGeometryFromText = function(text, opt_options)
* @function
* @param {Document|Node|Object|string} source Source.
* @return {ol.proj.Projection} Projection.
* @api stable
* @api
*/
ol.format.Polyline.prototype.readProjection;
@@ -378,7 +378,7 @@ ol.format.Polyline.prototype.writeFeaturesText = function(features, opt_options)
* @param {ol.geom.Geometry} geometry Geometry.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {string} Geometry.
* @api stable
* @api
*/
ol.format.Polyline.prototype.writeGeometry;

View File

@@ -21,7 +21,7 @@ goog.require('ol.proj');
* @constructor
* @extends {ol.format.JSONFeature}
* @param {olx.format.TopoJSONOptions=} opt_options Options.
* @api stable
* @api
*/
ol.format.TopoJSON = function(opt_options) {
@@ -259,7 +259,7 @@ ol.format.TopoJSON.readFeatureFromGeometry_ = function(object, arcs,
* @function
* @param {Document|Node|Object|string} source Source.
* @return {Array.<ol.Feature>} Features.
* @api stable
* @api
*/
ol.format.TopoJSON.prototype.readFeatures;
@@ -369,7 +369,7 @@ ol.format.TopoJSON.transformVertex_ = function(vertex, scale, translate) {
* @param {Document|Node|Object|string} object Source.
* @return {ol.proj.Projection} Projection.
* @override
* @api stable
* @api
*/
ol.format.TopoJSON.prototype.readProjection;

View File

@@ -24,7 +24,7 @@ goog.require('ol.xml');
* @param {olx.format.WFSOptions=} opt_options
* Optional configuration object.
* @extends {ol.format.XMLFeature}
* @api stable
* @api
*/
ol.format.WFS = function(opt_options) {
var options = opt_options ? opt_options : {};
@@ -103,7 +103,7 @@ ol.format.WFS.SCHEMA_LOCATION = 'http://www.opengis.net/wfs ' +
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {Array.<ol.Feature>} Features.
* @api stable
* @api
*/
ol.format.WFS.prototype.readFeatures;
@@ -137,7 +137,7 @@ ol.format.WFS.prototype.readFeaturesFromNode = function(node, opt_options) {
*
* @param {Document|Node|Object|string} source Source.
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
* @api stable
* @api
*/
ol.format.WFS.prototype.readTransactionResponse = function(source) {
if (ol.xml.isDocument(source)) {
@@ -160,7 +160,7 @@ ol.format.WFS.prototype.readTransactionResponse = function(source) {
* @param {Document|Node|Object|string} source Source.
* @return {ol.WFSFeatureCollectionMetadata|undefined}
* FeatureCollection metadata.
* @api stable
* @api
*/
ol.format.WFS.prototype.readFeatureCollectionMetadata = function(source) {
if (ol.xml.isDocument(source)) {
@@ -778,7 +778,7 @@ ol.format.WFS.writeGetFeature_ = function(node, featureTypes, objectStack) {
*
* @param {olx.format.WFSWriteGetFeatureOptions} options Options.
* @return {Node} Result.
* @api stable
* @api
*/
ol.format.WFS.prototype.writeGetFeature = function(options) {
var node = ol.xml.createElementNS(ol.format.WFS.WFSNS, 'GetFeature');
@@ -845,7 +845,7 @@ ol.format.WFS.prototype.writeGetFeature = function(options) {
* @param {Array.<ol.Feature>} deletes The features to delete.
* @param {olx.format.WFSWriteTransactionOptions} options Write options.
* @return {Node} Result.
* @api stable
* @api
*/
ol.format.WFS.prototype.writeTransaction = function(inserts, updates, deletes,
options) {
@@ -910,7 +910,7 @@ ol.format.WFS.prototype.writeTransaction = function(inserts, updates, deletes,
* @function
* @param {Document|Node|Object|string} source Source.
* @return {?ol.proj.Projection} Projection.
* @api stable
* @api
*/
ol.format.WFS.prototype.readProjection;

View File

@@ -24,7 +24,7 @@ goog.require('ol.geom.SimpleGeometry');
* @constructor
* @extends {ol.format.TextFeature}
* @param {olx.format.WKTOptions=} opt_options Options.
* @api stable
* @api
*/
ol.format.WKT = function(opt_options) {
@@ -257,7 +257,7 @@ ol.format.WKT.prototype.parse_ = function(wkt) {
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {ol.Feature} Feature.
* @api stable
* @api
*/
ol.format.WKT.prototype.readFeature;
@@ -283,7 +283,7 @@ ol.format.WKT.prototype.readFeatureFromText = function(text, opt_options) {
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {Array.<ol.Feature>} Features.
* @api stable
* @api
*/
ol.format.WKT.prototype.readFeatures;
@@ -318,7 +318,7 @@ ol.format.WKT.prototype.readFeaturesFromText = function(text, opt_options) {
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {ol.geom.Geometry} Geometry.
* @api stable
* @api
*/
ol.format.WKT.prototype.readGeometry;
@@ -344,7 +344,7 @@ ol.format.WKT.prototype.readGeometryFromText = function(text, opt_options) {
* @param {ol.Feature} feature Feature.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {string} WKT string.
* @api stable
* @api
*/
ol.format.WKT.prototype.writeFeature;
@@ -368,7 +368,7 @@ ol.format.WKT.prototype.writeFeatureText = function(feature, opt_options) {
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {string} WKT string.
* @api stable
* @api
*/
ol.format.WKT.prototype.writeFeatures;
@@ -395,7 +395,7 @@ ol.format.WKT.prototype.writeFeaturesText = function(features, opt_options) {
* @function
* @param {ol.geom.Geometry} geometry Geometry.
* @return {string} WKT string.
* @api stable
* @api
*/
ol.format.WKT.prototype.writeGeometry;

View File

@@ -130,7 +130,7 @@ ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = function(node, objectStack
* @param {Document|Node|Object|string} source Source.
* @param {olx.format.ReadOptions=} opt_options Options.
* @return {Array.<ol.Feature>} Features.
* @api stable
* @api
*/
ol.format.WMSGetFeatureInfo.prototype.readFeatures;

View File

@@ -1,6 +1,5 @@
goog.provide('ol.format.XSD');
goog.require('ol');
goog.require('ol.xml');
goog.require('ol.string');

View File

@@ -38,7 +38,7 @@ goog.require('ol.sphere.WGS84');
* @constructor
* @extends {ol.Object}
* @param {olx.GeolocationOptions=} opt_options Options.
* @api stable
* @api
*/
ol.Geolocation = function(opt_options) {
@@ -182,7 +182,7 @@ ol.Geolocation.prototype.positionError_ = function(error) {
* @return {number|undefined} The accuracy of the position measurement in
* meters.
* @observable
* @api stable
* @api
*/
ol.Geolocation.prototype.getAccuracy = function() {
return /** @type {number|undefined} */ (
@@ -194,7 +194,7 @@ ol.Geolocation.prototype.getAccuracy = function() {
* Get a geometry of the position accuracy.
* @return {?ol.geom.Geometry} A geometry of the position accuracy.
* @observable
* @api stable
* @api
*/
ol.Geolocation.prototype.getAccuracyGeometry = function() {
return /** @type {?ol.geom.Geometry} */ (
@@ -207,7 +207,7 @@ ol.Geolocation.prototype.getAccuracyGeometry = function() {
* @return {number|undefined} The altitude of the position in meters above mean
* sea level.
* @observable
* @api stable
* @api
*/
ol.Geolocation.prototype.getAltitude = function() {
return /** @type {number|undefined} */ (
@@ -220,7 +220,7 @@ ol.Geolocation.prototype.getAltitude = function() {
* @return {number|undefined} The accuracy of the altitude measurement in
* meters.
* @observable
* @api stable
* @api
*/
ol.Geolocation.prototype.getAltitudeAccuracy = function() {
return /** @type {number|undefined} */ (
@@ -232,7 +232,7 @@ ol.Geolocation.prototype.getAltitudeAccuracy = function() {
* Get the heading as radians clockwise from North.
* @return {number|undefined} The heading of the device in radians from north.
* @observable
* @api stable
* @api
*/
ol.Geolocation.prototype.getHeading = function() {
return /** @type {number|undefined} */ (
@@ -245,7 +245,7 @@ ol.Geolocation.prototype.getHeading = function() {
* @return {ol.Coordinate|undefined} The current position of the device reported
* in the current projection.
* @observable
* @api stable
* @api
*/
ol.Geolocation.prototype.getPosition = function() {
return /** @type {ol.Coordinate|undefined} */ (
@@ -258,7 +258,7 @@ ol.Geolocation.prototype.getPosition = function() {
* @return {ol.proj.Projection|undefined} The projection the position is
* reported in.
* @observable
* @api stable
* @api
*/
ol.Geolocation.prototype.getProjection = function() {
return /** @type {ol.proj.Projection|undefined} */ (
@@ -271,7 +271,7 @@ ol.Geolocation.prototype.getProjection = function() {
* @return {number|undefined} The instantaneous speed of the device in meters
* per second.
* @observable
* @api stable
* @api
*/
ol.Geolocation.prototype.getSpeed = function() {
return /** @type {number|undefined} */ (
@@ -283,7 +283,7 @@ ol.Geolocation.prototype.getSpeed = function() {
* Determine if the device location is being tracked.
* @return {boolean} The device location is being tracked.
* @observable
* @api stable
* @api
*/
ol.Geolocation.prototype.getTracking = function() {
return /** @type {boolean} */ (
@@ -298,7 +298,7 @@ ol.Geolocation.prototype.getTracking = function() {
* the [HTML5 Geolocation spec
* ](http://www.w3.org/TR/geolocation-API/#position_options_interface).
* @observable
* @api stable
* @api
*/
ol.Geolocation.prototype.getTrackingOptions = function() {
return /** @type {GeolocationPositionOptions|undefined} */ (
@@ -311,7 +311,7 @@ ol.Geolocation.prototype.getTrackingOptions = function() {
* @param {ol.proj.Projection} projection The projection the position is
* reported in.
* @observable
* @api stable
* @api
*/
ol.Geolocation.prototype.setProjection = function(projection) {
this.set(ol.GeolocationProperty.PROJECTION, projection);
@@ -322,7 +322,7 @@ ol.Geolocation.prototype.setProjection = function(projection) {
* Enable or disable tracking.
* @param {boolean} tracking Enable tracking.
* @observable
* @api stable
* @api
*/
ol.Geolocation.prototype.setTracking = function(tracking) {
this.set(ol.GeolocationProperty.TRACKING, tracking);
@@ -336,7 +336,7 @@ ol.Geolocation.prototype.setTracking = function(tracking) {
* [HTML5 Geolocation spec
* ](http://www.w3.org/TR/geolocation-API/#position_options_interface).
* @observable
* @api stable
* @api
*/
ol.Geolocation.prototype.setTrackingOptions = function(options) {
this.set(ol.GeolocationProperty.TRACKING_OPTIONS, options);

View File

@@ -136,7 +136,7 @@ ol.geom.Circle.prototype.getType = function() {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.Circle.prototype.intersectsExtent = function(extent) {
var circleExtent = this.getExtent();
@@ -259,6 +259,6 @@ ol.geom.Circle.prototype.setRadius = function(radius) {
* @return {ol.geom.Circle} This geometry. Note that original geometry is
* modified in place.
* @function
* @api stable
* @api
*/
ol.geom.Circle.prototype.transform;

View File

@@ -1,6 +1,5 @@
goog.provide('ol.geom.flat.closest');
goog.require('ol');
goog.require('ol.math');

View File

@@ -1,6 +1,5 @@
goog.provide('ol.geom.flat.contains');
goog.require('ol');
goog.require('ol.extent');

View File

@@ -1,7 +1,5 @@
goog.provide('ol.geom.flat.deflate');
goog.require('ol');
/**
* @param {Array.<number>} flatCoordinates Flat coordinates.

View File

@@ -1,6 +1,5 @@
goog.provide('ol.geom.flat.geodesic');
goog.require('ol');
goog.require('ol.math');
goog.require('ol.proj');

View File

@@ -1,6 +1,5 @@
goog.provide('ol.geom.flat.interiorpoint');
goog.require('ol');
goog.require('ol.array');
goog.require('ol.geom.flat.contains');

View File

@@ -1,6 +1,5 @@
goog.provide('ol.geom.flat.interpolate');
goog.require('ol');
goog.require('ol.array');
goog.require('ol.math');

View File

@@ -1,6 +1,5 @@
goog.provide('ol.geom.flat.intersectsextent');
goog.require('ol');
goog.require('ol.extent');
goog.require('ol.geom.flat.contains');
goog.require('ol.geom.flat.segments');

View File

@@ -1,6 +1,5 @@
goog.provide('ol.geom.flat.orient');
goog.require('ol');
goog.require('ol.geom.flat.reverse');

View File

@@ -19,7 +19,7 @@ goog.require('ol.proj');
* @constructor
* @abstract
* @extends {ol.Object}
* @api stable
* @api
*/
ol.geom.Geometry = function() {
@@ -84,7 +84,7 @@ ol.geom.Geometry.prototype.closestPointXY = function(x, y, closestPoint, minSqua
* @param {ol.Coordinate} point Point.
* @param {ol.Coordinate=} opt_closestPoint Closest point.
* @return {ol.Coordinate} Closest point.
* @api stable
* @api
*/
ol.geom.Geometry.prototype.getClosestPoint = function(point, opt_closestPoint) {
var closestPoint = opt_closestPoint ? opt_closestPoint : [NaN, NaN];
@@ -126,7 +126,7 @@ ol.geom.Geometry.prototype.containsXY = ol.functions.FALSE;
* Get the extent of the geometry.
* @param {ol.Extent=} opt_extent Extent.
* @return {ol.Extent} extent Extent.
* @api stable
* @api
*/
ol.geom.Geometry.prototype.getExtent = function(opt_extent) {
if (this.extentRevision_ != this.getRevision()) {
@@ -241,7 +241,7 @@ ol.geom.Geometry.prototype.translate = function(deltaX, deltaY) {};
* string identifier or a {@link ol.proj.Projection} object.
* @return {ol.geom.Geometry} This geometry. Note that original geometry is
* modified in place.
* @api stable
* @api
*/
ol.geom.Geometry.prototype.transform = function(source, destination) {
this.applyTransform(ol.proj.getTransform(source, destination));

View File

@@ -16,7 +16,7 @@ goog.require('ol.obj');
* @constructor
* @extends {ol.geom.Geometry}
* @param {Array.<ol.geom.Geometry>=} opt_geometries Geometries.
* @api stable
* @api
*/
ol.geom.GeometryCollection = function(opt_geometries) {
@@ -84,7 +84,7 @@ ol.geom.GeometryCollection.prototype.listenGeometriesChange_ = function() {
* Make a complete copy of the geometry.
* @return {!ol.geom.GeometryCollection} Clone.
* @override
* @api stable
* @api
*/
ol.geom.GeometryCollection.prototype.clone = function() {
var geometryCollection = new ol.geom.GeometryCollection(null);
@@ -142,7 +142,7 @@ ol.geom.GeometryCollection.prototype.computeExtent = function(extent) {
/**
* Return the geometries that make up this geometry collection.
* @return {Array.<ol.geom.Geometry>} Geometries.
* @api stable
* @api
*/
ol.geom.GeometryCollection.prototype.getGeometries = function() {
return ol.geom.GeometryCollection.cloneGeometries_(this.geometries_);
@@ -202,7 +202,7 @@ ol.geom.GeometryCollection.prototype.getSimplifiedGeometry = function(squaredTol
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.GeometryCollection.prototype.getType = function() {
return ol.geom.GeometryType.GEOMETRY_COLLECTION;
@@ -211,7 +211,7 @@ ol.geom.GeometryCollection.prototype.getType = function() {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.GeometryCollection.prototype.intersectsExtent = function(extent) {
var geometries = this.geometries_;
@@ -266,7 +266,7 @@ ol.geom.GeometryCollection.prototype.scale = function(sx, opt_sy, opt_anchor) {
/**
* Set the geometries that make up this geometry collection.
* @param {Array.<ol.geom.Geometry>} geometries Geometries.
* @api stable
* @api
*/
ol.geom.GeometryCollection.prototype.setGeometries = function(geometries) {
this.setGeometriesArray(
@@ -287,7 +287,7 @@ ol.geom.GeometryCollection.prototype.setGeometriesArray = function(geometries) {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.GeometryCollection.prototype.applyTransform = function(transformFn) {
var geometries = this.geometries_;

View File

@@ -21,7 +21,7 @@ goog.require('ol.geom.flat.simplify');
* @extends {ol.geom.SimpleGeometry}
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api stable
* @api
*/
ol.geom.LinearRing = function(coordinates, opt_layout) {
@@ -49,7 +49,7 @@ ol.inherits(ol.geom.LinearRing, ol.geom.SimpleGeometry);
* Make a complete copy of the geometry.
* @return {!ol.geom.LinearRing} Clone.
* @override
* @api stable
* @api
*/
ol.geom.LinearRing.prototype.clone = function() {
var linearRing = new ol.geom.LinearRing(null);
@@ -80,7 +80,7 @@ ol.geom.LinearRing.prototype.closestPointXY = function(x, y, closestPoint, minSq
/**
* Return the area of the linear ring on projected plane.
* @return {number} Area (on projected plane).
* @api stable
* @api
*/
ol.geom.LinearRing.prototype.getArea = function() {
return ol.geom.flat.area.linearRing(
@@ -92,7 +92,7 @@ ol.geom.LinearRing.prototype.getArea = function() {
* Return the coordinates of the linear ring.
* @return {Array.<ol.Coordinate>} Coordinates.
* @override
* @api stable
* @api
*/
ol.geom.LinearRing.prototype.getCoordinates = function() {
return ol.geom.flat.inflate.coordinates(
@@ -117,7 +117,7 @@ ol.geom.LinearRing.prototype.getSimplifiedGeometryInternal = function(squaredTol
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.LinearRing.prototype.getType = function() {
return ol.geom.GeometryType.LINEAR_RING;
@@ -135,7 +135,7 @@ ol.geom.LinearRing.prototype.intersectsExtent = function(extent) {};
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @override
* @api stable
* @api
*/
ol.geom.LinearRing.prototype.setCoordinates = function(coordinates, opt_layout) {
if (!coordinates) {

View File

@@ -24,7 +24,7 @@ goog.require('ol.geom.flat.simplify');
* @extends {ol.geom.SimpleGeometry}
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api stable
* @api
*/
ol.geom.LineString = function(coordinates, opt_layout) {
@@ -63,7 +63,7 @@ ol.inherits(ol.geom.LineString, ol.geom.SimpleGeometry);
/**
* Append the passed coordinate to the coordinates of the linestring.
* @param {ol.Coordinate} coordinate Coordinate.
* @api stable
* @api
*/
ol.geom.LineString.prototype.appendCoordinate = function(coordinate) {
if (!this.flatCoordinates) {
@@ -79,7 +79,7 @@ ol.geom.LineString.prototype.appendCoordinate = function(coordinate) {
* Make a complete copy of the geometry.
* @return {!ol.geom.LineString} Clone.
* @override
* @api stable
* @api
*/
ol.geom.LineString.prototype.clone = function() {
var lineString = new ol.geom.LineString(null);
@@ -138,7 +138,7 @@ ol.geom.LineString.prototype.forEachSegment = function(callback, opt_this) {
* @param {number} m M.
* @param {boolean=} opt_extrapolate Extrapolate. Default is `false`.
* @return {ol.Coordinate} Coordinate.
* @api stable
* @api
*/
ol.geom.LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
if (this.layout != ol.geom.GeometryLayout.XYM &&
@@ -155,7 +155,7 @@ ol.geom.LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
* Return the coordinates of the linestring.
* @return {Array.<ol.Coordinate>} Coordinates.
* @override
* @api stable
* @api
*/
ol.geom.LineString.prototype.getCoordinates = function() {
return ol.geom.flat.inflate.coordinates(
@@ -183,7 +183,7 @@ ol.geom.LineString.prototype.getCoordinateAt = function(fraction, opt_dest) {
/**
* Return the length of the linestring on projected plane.
* @return {number} Length (on projected plane).
* @api stable
* @api
*/
ol.geom.LineString.prototype.getLength = function() {
return ol.geom.flat.length.lineString(
@@ -220,7 +220,7 @@ ol.geom.LineString.prototype.getSimplifiedGeometryInternal = function(squaredTol
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.LineString.prototype.getType = function() {
return ol.geom.GeometryType.LINE_STRING;
@@ -229,7 +229,7 @@ ol.geom.LineString.prototype.getType = function() {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.LineString.prototype.intersectsExtent = function(extent) {
return ol.geom.flat.intersectsextent.lineString(
@@ -243,7 +243,7 @@ ol.geom.LineString.prototype.intersectsExtent = function(extent) {
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @override
* @api stable
* @api
*/
ol.geom.LineString.prototype.setCoordinates = function(coordinates, opt_layout) {
if (!coordinates) {

View File

@@ -23,7 +23,7 @@ goog.require('ol.geom.flat.simplify');
* @extends {ol.geom.SimpleGeometry}
* @param {Array.<Array.<ol.Coordinate>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api stable
* @api
*/
ol.geom.MultiLineString = function(coordinates, opt_layout) {
@@ -56,7 +56,7 @@ ol.inherits(ol.geom.MultiLineString, ol.geom.SimpleGeometry);
/**
* Append the passed linestring to the multilinestring.
* @param {ol.geom.LineString} lineString LineString.
* @api stable
* @api
*/
ol.geom.MultiLineString.prototype.appendLineString = function(lineString) {
if (!this.flatCoordinates) {
@@ -74,7 +74,7 @@ ol.geom.MultiLineString.prototype.appendLineString = function(lineString) {
* Make a complete copy of the geometry.
* @return {!ol.geom.MultiLineString} Clone.
* @override
* @api stable
* @api
*/
ol.geom.MultiLineString.prototype.clone = function() {
var multiLineString = new ol.geom.MultiLineString(null);
@@ -123,7 +123,7 @@ ol.geom.MultiLineString.prototype.closestPointXY = function(x, y, closestPoint,
* @param {boolean=} opt_extrapolate Extrapolate. Default is `false`.
* @param {boolean=} opt_interpolate Interpolate. Default is `false`.
* @return {ol.Coordinate} Coordinate.
* @api stable
* @api
*/
ol.geom.MultiLineString.prototype.getCoordinateAtM = function(m, opt_extrapolate, opt_interpolate) {
if ((this.layout != ol.geom.GeometryLayout.XYM &&
@@ -142,7 +142,7 @@ ol.geom.MultiLineString.prototype.getCoordinateAtM = function(m, opt_extrapolate
* Return the coordinates of the multilinestring.
* @return {Array.<Array.<ol.Coordinate>>} Coordinates.
* @override
* @api stable
* @api
*/
ol.geom.MultiLineString.prototype.getCoordinates = function() {
return ol.geom.flat.inflate.coordinatess(
@@ -162,7 +162,7 @@ ol.geom.MultiLineString.prototype.getEnds = function() {
* Return the linestring at the specified index.
* @param {number} index Index.
* @return {ol.geom.LineString} LineString.
* @api stable
* @api
*/
ol.geom.MultiLineString.prototype.getLineString = function(index) {
if (index < 0 || this.ends_.length <= index) {
@@ -178,7 +178,7 @@ ol.geom.MultiLineString.prototype.getLineString = function(index) {
/**
* Return the linestrings of this multilinestring.
* @return {Array.<ol.geom.LineString>} LineStrings.
* @api stable
* @api
*/
ol.geom.MultiLineString.prototype.getLineStrings = function() {
var flatCoordinates = this.flatCoordinates;
@@ -238,7 +238,7 @@ ol.geom.MultiLineString.prototype.getSimplifiedGeometryInternal = function(squar
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.MultiLineString.prototype.getType = function() {
return ol.geom.GeometryType.MULTI_LINE_STRING;
@@ -247,7 +247,7 @@ ol.geom.MultiLineString.prototype.getType = function() {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.MultiLineString.prototype.intersectsExtent = function(extent) {
return ol.geom.flat.intersectsextent.lineStrings(
@@ -260,7 +260,7 @@ ol.geom.MultiLineString.prototype.intersectsExtent = function(extent) {
* @param {Array.<Array.<ol.Coordinate>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @override
* @api stable
* @api
*/
ol.geom.MultiLineString.prototype.setCoordinates = function(coordinates, opt_layout) {
if (!coordinates) {

View File

@@ -20,7 +20,7 @@ goog.require('ol.math');
* @extends {ol.geom.SimpleGeometry}
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api stable
* @api
*/
ol.geom.MultiPoint = function(coordinates, opt_layout) {
ol.geom.SimpleGeometry.call(this);
@@ -32,7 +32,7 @@ ol.inherits(ol.geom.MultiPoint, ol.geom.SimpleGeometry);
/**
* Append the passed point to this multipoint.
* @param {ol.geom.Point} point Point.
* @api stable
* @api
*/
ol.geom.MultiPoint.prototype.appendPoint = function(point) {
if (!this.flatCoordinates) {
@@ -48,7 +48,7 @@ ol.geom.MultiPoint.prototype.appendPoint = function(point) {
* Make a complete copy of the geometry.
* @return {!ol.geom.MultiPoint} Clone.
* @override
* @api stable
* @api
*/
ol.geom.MultiPoint.prototype.clone = function() {
var multiPoint = new ol.geom.MultiPoint(null);
@@ -87,7 +87,7 @@ ol.geom.MultiPoint.prototype.closestPointXY = function(x, y, closestPoint, minSq
* Return the coordinates of the multipoint.
* @return {Array.<ol.Coordinate>} Coordinates.
* @override
* @api stable
* @api
*/
ol.geom.MultiPoint.prototype.getCoordinates = function() {
return ol.geom.flat.inflate.coordinates(
@@ -99,7 +99,7 @@ ol.geom.MultiPoint.prototype.getCoordinates = function() {
* Return the point at the specified index.
* @param {number} index Index.
* @return {ol.geom.Point} Point.
* @api stable
* @api
*/
ol.geom.MultiPoint.prototype.getPoint = function(index) {
var n = !this.flatCoordinates ?
@@ -117,7 +117,7 @@ ol.geom.MultiPoint.prototype.getPoint = function(index) {
/**
* Return the points of this multipoint.
* @return {Array.<ol.geom.Point>} Points.
* @api stable
* @api
*/
ol.geom.MultiPoint.prototype.getPoints = function() {
var flatCoordinates = this.flatCoordinates;
@@ -137,7 +137,7 @@ ol.geom.MultiPoint.prototype.getPoints = function() {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.MultiPoint.prototype.getType = function() {
return ol.geom.GeometryType.MULTI_POINT;
@@ -146,7 +146,7 @@ ol.geom.MultiPoint.prototype.getType = function() {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.MultiPoint.prototype.intersectsExtent = function(extent) {
var flatCoordinates = this.flatCoordinates;
@@ -168,7 +168,7 @@ ol.geom.MultiPoint.prototype.intersectsExtent = function(extent) {
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @override
* @api stable
* @api
*/
ol.geom.MultiPoint.prototype.setCoordinates = function(coordinates, opt_layout) {
if (!coordinates) {

View File

@@ -28,7 +28,7 @@ goog.require('ol.geom.flat.simplify');
* @extends {ol.geom.SimpleGeometry}
* @param {Array.<Array.<Array.<ol.Coordinate>>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api stable
* @api
*/
ol.geom.MultiPolygon = function(coordinates, opt_layout) {
@@ -85,7 +85,7 @@ ol.inherits(ol.geom.MultiPolygon, ol.geom.SimpleGeometry);
/**
* Append the passed polygon to this multipolygon.
* @param {ol.geom.Polygon} polygon Polygon.
* @api stable
* @api
*/
ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) {
/** @type {Array.<number>} */
@@ -112,7 +112,7 @@ ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) {
* Make a complete copy of the geometry.
* @return {!ol.geom.MultiPolygon} Clone.
* @override
* @api stable
* @api
*/
ol.geom.MultiPolygon.prototype.clone = function() {
var multiPolygon = new ol.geom.MultiPolygon(null);
@@ -160,7 +160,7 @@ ol.geom.MultiPolygon.prototype.containsXY = function(x, y) {
/**
* Return the area of the multipolygon on projected plane.
* @return {number} Area (on projected plane).
* @api stable
* @api
*/
ol.geom.MultiPolygon.prototype.getArea = function() {
return ol.geom.flat.area.linearRingss(
@@ -180,7 +180,7 @@ ol.geom.MultiPolygon.prototype.getArea = function() {
* constructed.
* @return {Array.<Array.<Array.<ol.Coordinate>>>} Coordinates.
* @override
* @api stable
* @api
*/
ol.geom.MultiPolygon.prototype.getCoordinates = function(opt_right) {
var flatCoordinates;
@@ -224,7 +224,7 @@ ol.geom.MultiPolygon.prototype.getFlatInteriorPoints = function() {
/**
* Return the interior points as {@link ol.geom.MultiPoint multipoint}.
* @return {ol.geom.MultiPoint} Interior points.
* @api stable
* @api
*/
ol.geom.MultiPolygon.prototype.getInteriorPoints = function() {
var interiorPoints = new ol.geom.MultiPoint(null);
@@ -276,7 +276,7 @@ ol.geom.MultiPolygon.prototype.getSimplifiedGeometryInternal = function(squaredT
* Return the polygon at the specified index.
* @param {number} index Index.
* @return {ol.geom.Polygon} Polygon.
* @api stable
* @api
*/
ol.geom.MultiPolygon.prototype.getPolygon = function(index) {
if (index < 0 || this.endss_.length <= index) {
@@ -307,7 +307,7 @@ ol.geom.MultiPolygon.prototype.getPolygon = function(index) {
/**
* Return the polygons of this multipolygon.
* @return {Array.<ol.geom.Polygon>} Polygons.
* @api stable
* @api
*/
ol.geom.MultiPolygon.prototype.getPolygons = function() {
var layout = this.layout;
@@ -336,7 +336,7 @@ ol.geom.MultiPolygon.prototype.getPolygons = function() {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.MultiPolygon.prototype.getType = function() {
return ol.geom.GeometryType.MULTI_POLYGON;
@@ -345,7 +345,7 @@ ol.geom.MultiPolygon.prototype.getType = function() {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.MultiPolygon.prototype.intersectsExtent = function(extent) {
return ol.geom.flat.intersectsextent.linearRingss(
@@ -358,7 +358,7 @@ ol.geom.MultiPolygon.prototype.intersectsExtent = function(extent) {
* @param {Array.<Array.<Array.<ol.Coordinate>>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @override
* @api stable
* @api
*/
ol.geom.MultiPolygon.prototype.setCoordinates = function(coordinates, opt_layout) {
if (!coordinates) {

View File

@@ -17,7 +17,7 @@ goog.require('ol.math');
* @extends {ol.geom.SimpleGeometry}
* @param {ol.Coordinate} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api stable
* @api
*/
ol.geom.Point = function(coordinates, opt_layout) {
ol.geom.SimpleGeometry.call(this);
@@ -30,7 +30,7 @@ ol.inherits(ol.geom.Point, ol.geom.SimpleGeometry);
* Make a complete copy of the geometry.
* @return {!ol.geom.Point} Clone.
* @override
* @api stable
* @api
*/
ol.geom.Point.prototype.clone = function() {
var point = new ol.geom.Point(null);
@@ -64,7 +64,7 @@ ol.geom.Point.prototype.closestPointXY = function(x, y, closestPoint, minSquared
* Return the coordinate of the point.
* @return {ol.Coordinate} Coordinates.
* @override
* @api stable
* @api
*/
ol.geom.Point.prototype.getCoordinates = function() {
return !this.flatCoordinates ? [] : this.flatCoordinates.slice();
@@ -81,7 +81,7 @@ ol.geom.Point.prototype.computeExtent = function(extent) {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.Point.prototype.getType = function() {
return ol.geom.GeometryType.POINT;
@@ -90,7 +90,7 @@ ol.geom.Point.prototype.getType = function() {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.Point.prototype.intersectsExtent = function(extent) {
return ol.extent.containsXY(extent,
@@ -100,7 +100,7 @@ ol.geom.Point.prototype.intersectsExtent = function(extent) {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.Point.prototype.setCoordinates = function(coordinates, opt_layout) {
if (!coordinates) {

View File

@@ -33,7 +33,7 @@ goog.require('ol.math');
* is an array of vertices' coordinates where the first coordinate and the
* last are equivalent.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api stable
* @api
*/
ol.geom.Polygon = function(coordinates, opt_layout) {
@@ -90,7 +90,7 @@ ol.inherits(ol.geom.Polygon, ol.geom.SimpleGeometry);
/**
* Append the passed linear ring to this polygon.
* @param {ol.geom.LinearRing} linearRing Linear ring.
* @api stable
* @api
*/
ol.geom.Polygon.prototype.appendLinearRing = function(linearRing) {
if (!this.flatCoordinates) {
@@ -107,7 +107,7 @@ ol.geom.Polygon.prototype.appendLinearRing = function(linearRing) {
* Make a complete copy of the geometry.
* @return {!ol.geom.Polygon} Clone.
* @override
* @api stable
* @api
*/
ol.geom.Polygon.prototype.clone = function() {
var polygon = new ol.geom.Polygon(null);
@@ -148,7 +148,7 @@ ol.geom.Polygon.prototype.containsXY = function(x, y) {
/**
* Return the area of the polygon on projected plane.
* @return {number} Area (on projected plane).
* @api stable
* @api
*/
ol.geom.Polygon.prototype.getArea = function() {
return ol.geom.flat.area.linearRings(
@@ -168,7 +168,7 @@ ol.geom.Polygon.prototype.getArea = function() {
* constructed.
* @return {Array.<Array.<ol.Coordinate>>} Coordinates.
* @override
* @api stable
* @api
*/
ol.geom.Polygon.prototype.getCoordinates = function(opt_right) {
var flatCoordinates;
@@ -211,7 +211,7 @@ ol.geom.Polygon.prototype.getFlatInteriorPoint = function() {
/**
* Return an interior point of the polygon.
* @return {ol.geom.Point} Interior point.
* @api stable
* @api
*/
ol.geom.Polygon.prototype.getInteriorPoint = function() {
return new ol.geom.Point(this.getFlatInteriorPoint());
@@ -238,7 +238,7 @@ ol.geom.Polygon.prototype.getLinearRingCount = function() {
*
* @param {number} index Index.
* @return {ol.geom.LinearRing} Linear ring.
* @api stable
* @api
*/
ol.geom.Polygon.prototype.getLinearRing = function(index) {
if (index < 0 || this.ends_.length <= index) {
@@ -254,7 +254,7 @@ ol.geom.Polygon.prototype.getLinearRing = function(index) {
/**
* Return the linear rings of the polygon.
* @return {Array.<ol.geom.LinearRing>} Linear rings.
* @api stable
* @api
*/
ol.geom.Polygon.prototype.getLinearRings = function() {
var layout = this.layout;
@@ -314,7 +314,7 @@ ol.geom.Polygon.prototype.getSimplifiedGeometryInternal = function(squaredTolera
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.Polygon.prototype.getType = function() {
return ol.geom.GeometryType.POLYGON;
@@ -323,7 +323,7 @@ ol.geom.Polygon.prototype.getType = function() {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.Polygon.prototype.intersectsExtent = function(extent) {
return ol.geom.flat.intersectsextent.linearRings(
@@ -336,7 +336,7 @@ ol.geom.Polygon.prototype.intersectsExtent = function(extent) {
* @param {Array.<Array.<ol.Coordinate>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @override
* @api stable
* @api
*/
ol.geom.Polygon.prototype.setCoordinates = function(coordinates, opt_layout) {
if (!coordinates) {
@@ -375,7 +375,7 @@ ol.geom.Polygon.prototype.setFlatCoordinates = function(layout, flatCoordinates,
* @param {number=} opt_n Optional number of vertices for the resulting
* polygon. Default is `32`.
* @return {ol.geom.Polygon} The "circular" polygon.
* @api stable
* @api
*/
ol.geom.Polygon.circular = function(sphere, center, radius, opt_n) {
var n = opt_n ? opt_n : 32;

View File

@@ -17,7 +17,7 @@ goog.require('ol.obj');
* @constructor
* @abstract
* @extends {ol.geom.Geometry}
* @api stable
* @api
*/
ol.geom.SimpleGeometry = function() {
@@ -106,7 +106,7 @@ ol.geom.SimpleGeometry.prototype.getCoordinates = function() {};
/**
* Return the first coordinate of the geometry.
* @return {ol.Coordinate} First coordinate.
* @api stable
* @api
*/
ol.geom.SimpleGeometry.prototype.getFirstCoordinate = function() {
return this.flatCoordinates.slice(0, this.stride);
@@ -124,7 +124,7 @@ ol.geom.SimpleGeometry.prototype.getFlatCoordinates = function() {
/**
* Return the last coordinate of the geometry.
* @return {ol.Coordinate} Last point.
* @api stable
* @api
*/
ol.geom.SimpleGeometry.prototype.getLastCoordinate = function() {
return this.flatCoordinates.slice(this.flatCoordinates.length - this.stride);
@@ -134,7 +134,7 @@ ol.geom.SimpleGeometry.prototype.getLastCoordinate = function() {
/**
* Return the {@link ol.geom.GeometryLayout layout} of the geometry.
* @return {ol.geom.GeometryLayout} Layout.
* @api stable
* @api
*/
ol.geom.SimpleGeometry.prototype.getLayout = function() {
return this.layout;
@@ -251,7 +251,7 @@ ol.geom.SimpleGeometry.prototype.setLayout = function(layout, coordinates, nesti
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.SimpleGeometry.prototype.applyTransform = function(transformFn) {
if (this.flatCoordinates) {
@@ -303,7 +303,7 @@ ol.geom.SimpleGeometry.prototype.scale = function(sx, opt_sy, opt_anchor) {
/**
* @inheritDoc
* @api stable
* @api
*/
ol.geom.SimpleGeometry.prototype.translate = function(deltaX, deltaY) {
var flatCoordinates = this.getFlatCoordinates();

View File

@@ -1,6 +1,5 @@
goog.provide('ol.Graticule');
goog.require('ol');
goog.require('ol.extent');
goog.require('ol.geom.GeometryLayout');
goog.require('ol.geom.LineString');

View File

@@ -36,7 +36,7 @@ ol.has.MAC = ua.indexOf('macintosh') !== -1;
* (dips) on the device (`window.devicePixelRatio`).
* @const
* @type {number}
* @api stable
* @api
*/
ol.has.DEVICE_PIXEL_RATIO = window.devicePixelRatio || 1;
@@ -53,7 +53,7 @@ ol.has.CANVAS_LINE_DASH = false;
* if `ol.ENABLE_CANVAS` is set to `false` at compile time.
* @const
* @type {boolean}
* @api stable
* @api
*/
ol.has.CANVAS = ol.ENABLE_CANVAS && (
/**
@@ -83,7 +83,7 @@ ol.has.CANVAS = ol.ENABLE_CANVAS && (
* Indicates if DeviceOrientation is supported in the user's browser.
* @const
* @type {boolean}
* @api stable
* @api
*/
ol.has.DEVICE_ORIENTATION = 'DeviceOrientationEvent' in window;
@@ -92,7 +92,7 @@ ol.has.DEVICE_ORIENTATION = 'DeviceOrientationEvent' in window;
* Is HTML5 geolocation supported in the current browser?
* @const
* @type {boolean}
* @api stable
* @api
*/
ol.has.GEOLOCATION = 'geolocation' in navigator;
@@ -101,7 +101,7 @@ ol.has.GEOLOCATION = 'geolocation' in navigator;
* True if browser supports touch events.
* @const
* @type {boolean}
* @api stable
* @api
*/
ol.has.TOUCH = ol.ASSUME_TOUCH || 'ontouchstart' in window;
@@ -127,7 +127,7 @@ ol.has.MSPOINTER = !!(navigator.msPointerEnabled);
* if `ol.ENABLE_WEBGL` is set to `false` at compile time.
* @const
* @type {boolean}
* @api stable
* @api
*/
ol.has.WEBGL;

View File

@@ -1,6 +1,5 @@
goog.provide('ol.interaction');
goog.require('ol');
goog.require('ol.Collection');
goog.require('ol.Kinetic');
goog.require('ol.interaction.DoubleClickZoom');
@@ -35,7 +34,7 @@ goog.require('ol.interaction.PinchZoom');
* @param {olx.interaction.DefaultsOptions=} opt_options Defaults options.
* @return {ol.Collection.<ol.interaction.Interaction>} A collection of
* interactions to be used with the ol.Map constructor's interactions option.
* @api stable
* @api
*/
ol.interaction.defaults = function(opt_options) {

View File

@@ -12,7 +12,7 @@ goog.require('ol.interaction.Interaction');
* @constructor
* @extends {ol.interaction.Interaction}
* @param {olx.interaction.DoubleClickZoomOptions=} opt_options Options.
* @api stable
* @api
*/
ol.interaction.DoubleClickZoom = function(opt_options) {

View File

@@ -19,7 +19,7 @@ goog.require('ol.proj');
* @extends {ol.interaction.Interaction}
* @fires ol.interaction.DragAndDrop.Event
* @param {olx.interaction.DragAndDropOptions=} opt_options Options.
* @api stable
* @api
*/
ol.interaction.DragAndDrop = function(opt_options) {
@@ -189,7 +189,7 @@ ol.interaction.DragAndDrop.EventType_ = {
/**
* Triggered when features are added
* @event ol.interaction.DragAndDrop.Event#addfeatures
* @api stable
* @api
*/
ADD_FEATURES: 'addfeatures'
};
@@ -215,14 +215,14 @@ ol.interaction.DragAndDrop.Event = function(type, file, opt_features, opt_projec
/**
* The features parsed from dropped data.
* @type {Array.<ol.Feature>|undefined}
* @api stable
* @api
*/
this.features = opt_features;
/**
* The dropped file.
* @type {File}
* @api stable
* @api
*/
this.file = file;

View File

@@ -32,7 +32,7 @@ ol.DRAG_BOX_HYSTERESIS_PIXELS_SQUARED =
* @extends {ol.interaction.Pointer}
* @fires ol.interaction.DragBox.Event
* @param {olx.interaction.DragBoxOptions=} opt_options Options.
* @api stable
* @api
*/
ol.interaction.DragBox = function(opt_options) {
@@ -111,7 +111,7 @@ ol.interaction.DragBox.handleDragEvent_ = function(mapBrowserEvent) {
/**
* Returns geometry of last drawn box.
* @return {ol.geom.Polygon} Geometry.
* @api stable
* @api
*/
ol.interaction.DragBox.prototype.getGeometry = function() {
return this.box_.getGeometry();
@@ -183,7 +183,7 @@ ol.interaction.DragBox.EventType_ = {
/**
* Triggered upon drag box start.
* @event ol.interaction.DragBox.Event#boxstart
* @api stable
* @api
*/
BOXSTART: 'boxstart',
@@ -197,7 +197,7 @@ ol.interaction.DragBox.EventType_ = {
/**
* Triggered upon drag box end.
* @event ol.interaction.DragBox.Event#boxend
* @api stable
* @api
*/
BOXEND: 'boxend'
};
@@ -222,7 +222,7 @@ ol.interaction.DragBox.Event = function(type, coordinate, mapBrowserEvent) {
* The coordinate of the drag event.
* @const
* @type {ol.Coordinate}
* @api stable
* @api
*/
this.coordinate = coordinate;

View File

@@ -16,7 +16,7 @@ goog.require('ol.interaction.Pointer');
* @constructor
* @extends {ol.interaction.Pointer}
* @param {olx.interaction.DragPanOptions=} opt_options Options.
* @api stable
* @api
*/
ol.interaction.DragPan = function(opt_options) {
@@ -39,6 +39,11 @@ ol.interaction.DragPan = function(opt_options) {
*/
this.lastCentroid = null;
/**
* @type {number}
*/
this.lastPointersCount_;
/**
* @private
* @type {ol.EventsConditionType}
@@ -62,25 +67,33 @@ ol.inherits(ol.interaction.DragPan, ol.interaction.Pointer);
* @private
*/
ol.interaction.DragPan.handleDragEvent_ = function(mapBrowserEvent) {
var targetPointers = this.targetPointers;
var centroid =
ol.interaction.Pointer.centroid(this.targetPointers);
if (this.kinetic_) {
this.kinetic_.update(centroid[0], centroid[1]);
}
if (this.lastCentroid) {
var deltaX = this.lastCentroid[0] - centroid[0];
var deltaY = centroid[1] - this.lastCentroid[1];
var map = mapBrowserEvent.map;
var view = map.getView();
var viewState = view.getState();
var center = [deltaX, deltaY];
ol.coordinate.scale(center, viewState.resolution);
ol.coordinate.rotate(center, viewState.rotation);
ol.coordinate.add(center, viewState.center);
center = view.constrainCenter(center);
view.setCenter(center);
ol.interaction.Pointer.centroid(targetPointers);
if (targetPointers.length == this.lastPointersCount_) {
if (this.kinetic_) {
this.kinetic_.update(centroid[0], centroid[1]);
}
if (this.lastCentroid) {
var deltaX = this.lastCentroid[0] - centroid[0];
var deltaY = centroid[1] - this.lastCentroid[1];
var map = mapBrowserEvent.map;
var view = map.getView();
var viewState = view.getState();
var center = [deltaX, deltaY];
ol.coordinate.scale(center, viewState.resolution);
ol.coordinate.rotate(center, viewState.rotation);
ol.coordinate.add(center, viewState.center);
center = view.constrainCenter(center);
view.setCenter(center);
}
} else if (this.kinetic_) {
// reset so we don't overestimate the kinetic energy after
// after one finger down, tiny drag, second finger down
this.kinetic_.begin();
}
this.lastCentroid = centroid;
this.lastPointersCount_ = targetPointers.length;
};
@@ -112,6 +125,11 @@ ol.interaction.DragPan.handleUpEvent_ = function(mapBrowserEvent) {
view.setHint(ol.ViewHint.INTERACTING, -1);
return false;
} else {
if (this.kinetic_) {
// reset so we don't overestimate the kinetic energy after
// after one finger up, tiny drag, second finger up
this.kinetic_.begin();
}
this.lastCentroid = null;
return true;
}

View File

@@ -19,7 +19,7 @@ goog.require('ol.interaction.Pointer');
* @constructor
* @extends {ol.interaction.Pointer}
* @param {olx.interaction.DragRotateOptions=} opt_options Options.
* @api stable
* @api
*/
ol.interaction.DragRotate = function(opt_options) {

View File

@@ -20,7 +20,7 @@ goog.require('ol.interaction.Pointer');
* @constructor
* @extends {ol.interaction.Pointer}
* @param {olx.interaction.DragRotateAndZoomOptions=} opt_options Options.
* @api stable
* @api
*/
ol.interaction.DragRotateAndZoom = function(opt_options) {

View File

@@ -19,7 +19,7 @@ goog.require('ol.interaction.DragBox');
* @constructor
* @extends {ol.interaction.DragBox}
* @param {olx.interaction.DragZoomOptions=} opt_options Options.
* @api stable
* @api
*/
ol.interaction.DragZoom = function(opt_options) {
var options = opt_options ? opt_options : {};

View File

@@ -34,7 +34,7 @@ goog.require('ol.style.Style');
* @extends {ol.interaction.Pointer}
* @fires ol.interaction.Draw.Event
* @param {olx.interaction.DrawOptions} options Options.
* @api stable
* @api
*/
ol.interaction.Draw = function(options) {
@@ -853,7 +853,7 @@ ol.interaction.Draw.Event = function(type, feature) {
/**
* The feature being drawn.
* @type {ol.Feature}
* @api stable
* @api
*/
this.feature = feature;

View File

@@ -8,13 +8,13 @@ ol.interaction.DrawEventType = {
/**
* Triggered upon feature draw start
* @event ol.interaction.Draw.Event#drawstart
* @api stable
* @api
*/
DRAWSTART: 'drawstart',
/**
* Triggered upon feature draw end
* @event ol.interaction.Draw.Event#drawend
* @api stable
* @api
*/
DRAWEND: 'drawend'
};

View File

@@ -327,9 +327,7 @@ ol.interaction.Extent.prototype.snapToVertex_ = function(pixel, map) {
var vertexPixel = map.getPixelFromCoordinate(vertex);
//if the distance is within tolerance, snap to the segment
if (Math.sqrt(ol.coordinate.squaredDistance(pixel, vertexPixel)) <=
this.pixelTolerance_) {
if (ol.coordinate.distance(pixel, vertexPixel) <= this.pixelTolerance_) {
//test if we should further snap to a vertex
var pixel1 = map.getPixelFromCoordinate(closestSegment[0]);
var pixel2 = map.getPixelFromCoordinate(closestSegment[1]);

View File

@@ -23,7 +23,7 @@ goog.require('ol.interaction.Interaction');
* @constructor
* @extends {ol.interaction.Interaction}
* @param {olx.interaction.KeyboardPanOptions=} opt_options Options.
* @api stable
* @api
*/
ol.interaction.KeyboardPan = function(opt_options) {

View File

@@ -21,7 +21,7 @@ goog.require('ol.interaction.Interaction');
* @constructor
* @param {olx.interaction.KeyboardZoomOptions=} opt_options Options.
* @extends {ol.interaction.Interaction}
* @api stable
* @api
*/
ol.interaction.KeyboardZoom = function(opt_options) {

View File

@@ -164,6 +164,7 @@ ol.interaction.Modify = function(options) {
'MultiPoint': this.writeMultiPointGeometry_,
'MultiLineString': this.writeMultiLineStringGeometry_,
'MultiPolygon': this.writeMultiPolygonGeometry_,
'Circle': this.writeCircleGeometry_,
'GeometryCollection': this.writeGeometryCollectionGeometry_
};
@@ -189,6 +190,19 @@ ol.interaction.Modify = function(options) {
ol.inherits(ol.interaction.Modify, ol.interaction.Pointer);
/**
* @define {number} The segment index assigned to a circle's center when
* breaking up a cicrle into ModifySegmentDataType segments.
*/
ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CENTER_INDEX = 0;
/**
* @define {number} The segment index assigned to a circle's circumference when
* breaking up a circle into ModifySegmentDataType segments.
*/
ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX = 1;
/**
* @param {ol.Feature} feature Feature.
* @private
@@ -449,6 +463,38 @@ ol.interaction.Modify.prototype.writeMultiPolygonGeometry_ = function(feature, g
};
/**
* We convert a circle into two segments. The segment at index
* {@link ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CENTER_INDEX} is the
* circle's center (a point). The segment at index
* {@link ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX} is
* the circumference, and is not a line segment.
*
* @param {ol.Feature} feature Feature.
* @param {ol.geom.Circle} geometry Geometry.
* @private
*/
ol.interaction.Modify.prototype.writeCircleGeometry_ = function(feature, geometry) {
var coordinates = geometry.getCenter();
var centerSegmentData = /** @type {ol.ModifySegmentDataType} */ ({
feature: feature,
geometry: geometry,
index: ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CENTER_INDEX,
segment: [coordinates, coordinates]
});
var circumferenceSegmentData = /** @type {ol.ModifySegmentDataType} */ ({
feature: feature,
geometry: geometry,
index: ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX,
segment: [coordinates, coordinates]
});
var featureSegments = [centerSegmentData, circumferenceSegmentData];
centerSegmentData.featureSegments = circumferenceSegmentData.featureSegments = featureSegments;
this.rBush_.insert(ol.extent.createOrUpdateFromCoordinate(coordinates), centerSegmentData);
this.rBush_.insert(geometry.getExtent(), circumferenceSegmentData);
};
/**
* @param {ol.Feature} feature Feature
* @param {ol.geom.GeometryCollection} geometry Geometry.
@@ -526,7 +572,15 @@ ol.interaction.Modify.handleDownEvent_ = function(evt) {
if (!componentSegments[uid]) {
componentSegments[uid] = new Array(2);
}
if (ol.coordinate.equals(segment[0], vertex) &&
if (segmentDataMatch.geometry.getType() === ol.geom.GeometryType.CIRCLE &&
segmentDataMatch.index === ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX) {
var closestVertex = ol.interaction.Modify.closestOnSegmentData_(vertex, segmentDataMatch);
if (ol.coordinate.equals(closestVertex, vertex) && !componentSegments[uid][0]) {
this.dragSegments_.push([segmentDataMatch, 0]);
componentSegments[uid][0] = segmentDataMatch;
}
} else if (ol.coordinate.equals(segment[0], vertex) &&
!componentSegments[uid][0]) {
this.dragSegments_.push([segmentDataMatch, 0]);
componentSegments[uid][0] = segmentDataMatch;
@@ -576,7 +630,7 @@ ol.interaction.Modify.handleDragEvent_ = function(evt) {
var segmentData = dragSegment[0];
var depth = segmentData.depth;
var geometry = segmentData.geometry;
var coordinates = geometry.getCoordinates();
var coordinates;
var segment = segmentData.segment;
var index = dragSegment[1];
@@ -590,30 +644,49 @@ ol.interaction.Modify.handleDragEvent_ = function(evt) {
segment[0] = segment[1] = vertex;
break;
case ol.geom.GeometryType.MULTI_POINT:
coordinates = geometry.getCoordinates();
coordinates[segmentData.index] = vertex;
segment[0] = segment[1] = vertex;
break;
case ol.geom.GeometryType.LINE_STRING:
coordinates = geometry.getCoordinates();
coordinates[segmentData.index + index] = vertex;
segment[index] = vertex;
break;
case ol.geom.GeometryType.MULTI_LINE_STRING:
coordinates = geometry.getCoordinates();
coordinates[depth[0]][segmentData.index + index] = vertex;
segment[index] = vertex;
break;
case ol.geom.GeometryType.POLYGON:
coordinates = geometry.getCoordinates();
coordinates[depth[0]][segmentData.index + index] = vertex;
segment[index] = vertex;
break;
case ol.geom.GeometryType.MULTI_POLYGON:
coordinates = geometry.getCoordinates();
coordinates[depth[1]][depth[0]][segmentData.index + index] = vertex;
segment[index] = vertex;
break;
case ol.geom.GeometryType.CIRCLE:
segment[0] = segment[1] = vertex;
if (segmentData.index === ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CENTER_INDEX) {
this.changingFeature_ = true;
geometry.setCenter(vertex);
this.changingFeature_ = false;
} else { // We're dragging the circle's circumference:
this.changingFeature_ = true;
geometry.setRadius(ol.coordinate.distance(geometry.getCenter(), vertex));
this.changingFeature_ = false;
}
break;
default:
// pass
}
this.setGeometryCoordinates_(geometry, coordinates);
if (coordinates) {
this.setGeometryCoordinates_(geometry, coordinates);
}
}
this.createOrUpdateVertexFeature_(vertex);
};
@@ -627,10 +700,23 @@ ol.interaction.Modify.handleDragEvent_ = function(evt) {
*/
ol.interaction.Modify.handleUpEvent_ = function(evt) {
var segmentData;
var geometry;
for (var i = this.dragSegments_.length - 1; i >= 0; --i) {
segmentData = this.dragSegments_[i][0];
this.rBush_.update(ol.extent.boundingExtent(segmentData.segment),
segmentData);
geometry = segmentData.geometry;
if (geometry.getType() === ol.geom.GeometryType.CIRCLE) {
// Update a circle object in the R* bush:
var coordinates = geometry.getCenter();
var centerSegmentData = segmentData.featureSegments[0];
var circumferenceSegmentData = segmentData.featureSegments[1];
centerSegmentData.segment[0] = centerSegmentData.segment[1] = coordinates;
circumferenceSegmentData.segment[0] = circumferenceSegmentData.segment[1] = coordinates;
this.rBush_.update(ol.extent.createOrUpdateFromCoordinate(coordinates), centerSegmentData);
this.rBush_.update(geometry.getExtent(), circumferenceSegmentData);
} else {
this.rBush_.update(ol.extent.boundingExtent(segmentData.segment),
segmentData);
}
}
if (this.modified_) {
this.dispatchEvent(new ol.interaction.Modify.Event(
@@ -697,8 +783,8 @@ ol.interaction.Modify.prototype.handlePointerMove_ = function(evt) {
ol.interaction.Modify.prototype.handlePointerAtPixel_ = function(pixel, map) {
var pixelCoordinate = map.getCoordinateFromPixel(pixel);
var sortByDistance = function(a, b) {
return ol.coordinate.squaredDistanceToSegment(pixelCoordinate, a.segment) -
ol.coordinate.squaredDistanceToSegment(pixelCoordinate, b.segment);
return ol.interaction.Modify.pointDistanceToSegmentDataSquared_(pixelCoordinate, a) -
ol.interaction.Modify.pointDistanceToSegmentDataSquared_(pixelCoordinate, b);
};
var box = ol.extent.buffer(
@@ -711,36 +797,44 @@ ol.interaction.Modify.prototype.handlePointerAtPixel_ = function(pixel, map) {
nodes.sort(sortByDistance);
var node = nodes[0];
var closestSegment = node.segment;
var vertex = (ol.coordinate.closestOnSegment(pixelCoordinate,
closestSegment));
var vertex = ol.interaction.Modify.closestOnSegmentData_(pixelCoordinate, node);
var vertexPixel = map.getPixelFromCoordinate(vertex);
if (Math.sqrt(ol.coordinate.squaredDistance(pixel, vertexPixel)) <=
this.pixelTolerance_) {
var pixel1 = map.getPixelFromCoordinate(closestSegment[0]);
var pixel2 = map.getPixelFromCoordinate(closestSegment[1]);
var squaredDist1 = ol.coordinate.squaredDistance(vertexPixel, pixel1);
var squaredDist2 = ol.coordinate.squaredDistance(vertexPixel, pixel2);
var dist = Math.sqrt(Math.min(squaredDist1, squaredDist2));
this.snappedToVertex_ = dist <= this.pixelTolerance_;
if (this.snappedToVertex_) {
vertex = squaredDist1 > squaredDist2 ?
closestSegment[1] : closestSegment[0];
}
this.createOrUpdateVertexFeature_(vertex);
var dist = ol.coordinate.distance(pixel, vertexPixel);
if (dist <= this.pixelTolerance_) {
var vertexSegments = {};
vertexSegments[ol.getUid(closestSegment)] = true;
var segment;
for (var i = 1, ii = nodes.length; i < ii; ++i) {
segment = nodes[i].segment;
if ((ol.coordinate.equals(closestSegment[0], segment[0]) &&
ol.coordinate.equals(closestSegment[1], segment[1]) ||
(ol.coordinate.equals(closestSegment[0], segment[1]) &&
ol.coordinate.equals(closestSegment[1], segment[0])))) {
vertexSegments[ol.getUid(segment)] = true;
} else {
break;
if (node.geometry.getType() === ol.geom.GeometryType.CIRCLE &&
node.index === ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX) {
this.snappedToVertex_ = true;
this.createOrUpdateVertexFeature_(vertex);
} else {
var pixel1 = map.getPixelFromCoordinate(closestSegment[0]);
var pixel2 = map.getPixelFromCoordinate(closestSegment[1]);
var squaredDist1 = ol.coordinate.squaredDistance(vertexPixel, pixel1);
var squaredDist2 = ol.coordinate.squaredDistance(vertexPixel, pixel2);
dist = Math.sqrt(Math.min(squaredDist1, squaredDist2));
this.snappedToVertex_ = dist <= this.pixelTolerance_;
if (this.snappedToVertex_) {
vertex = squaredDist1 > squaredDist2 ?
closestSegment[1] : closestSegment[0];
}
this.createOrUpdateVertexFeature_(vertex);
var segment;
for (var i = 1, ii = nodes.length; i < ii; ++i) {
segment = nodes[i].segment;
if ((ol.coordinate.equals(closestSegment[0], segment[0]) &&
ol.coordinate.equals(closestSegment[1], segment[1]) ||
(ol.coordinate.equals(closestSegment[0], segment[1]) &&
ol.coordinate.equals(closestSegment[1], segment[0])))) {
vertexSegments[ol.getUid(segment)] = true;
} else {
break;
}
}
}
vertexSegments[ol.getUid(closestSegment)] = true;
this.vertexSegments_ = vertexSegments;
return;
}
@@ -752,6 +846,52 @@ ol.interaction.Modify.prototype.handlePointerAtPixel_ = function(pixel, map) {
};
/**
* Returns the distance from a point to a line segment.
*
* @param {ol.Coordinate} pointCoordinates The coordinates of the point from
* which to calculate the distance.
* @param {ol.ModifySegmentDataType} segmentData The object describing the line
* segment we are calculating the distance to.
* @return {number} The square of the distance between a point and a line segment.
*/
ol.interaction.Modify.pointDistanceToSegmentDataSquared_ = function(pointCoordinates, segmentData) {
var geometry = segmentData.geometry;
if (geometry.getType() === ol.geom.GeometryType.CIRCLE) {
var circleGeometry = /** @type {ol.geom.Circle} */ (geometry);
if (segmentData.index === ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX) {
var distanceToCenterSquared =
ol.coordinate.squaredDistance(circleGeometry.getCenter(), pointCoordinates);
var distanceToCircumference =
Math.sqrt(distanceToCenterSquared) - circleGeometry.getRadius();
return distanceToCircumference * distanceToCircumference;
}
}
return ol.coordinate.squaredDistanceToSegment(pointCoordinates, segmentData.segment);
};
/**
* Returns the point closest to a given line segment.
*
* @param {ol.Coordinate} pointCoordinates The point to which a closest point
* should be found.
* @param {ol.ModifySegmentDataType} segmentData The object describing the line
* segment which should contain the closest point.
* @return {ol.Coordinate} The point closest to the specified line segment.
*/
ol.interaction.Modify.closestOnSegmentData_ = function(pointCoordinates, segmentData) {
var geometry = segmentData.geometry;
if (geometry.getType() === ol.geom.GeometryType.CIRCLE &&
segmentData.index === ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX) {
return geometry.getClosestPoint(pointCoordinates);
}
return ol.coordinate.closestOnSegment(pointCoordinates, segmentData.segment);
};
/**
* @param {ol.ModifySegmentDataType} segmentData Segment data.
* @param {ol.Coordinate} vertex Vertex.

View File

@@ -16,7 +16,7 @@ goog.require('ol.math');
* @constructor
* @extends {ol.interaction.Interaction}
* @param {olx.interaction.MouseWheelZoomOptions=} opt_options Options.
* @api stable
* @api
*/
ol.interaction.MouseWheelZoom = function(opt_options) {

View File

@@ -15,7 +15,7 @@ goog.require('ol.interaction.Pointer');
* @constructor
* @extends {ol.interaction.Pointer}
* @param {olx.interaction.PinchRotateOptions=} opt_options Options.
* @api stable
* @api
*/
ol.interaction.PinchRotate = function(opt_options) {

View File

@@ -15,7 +15,7 @@ goog.require('ol.interaction.Pointer');
* @constructor
* @extends {ol.interaction.Pointer}
* @param {olx.interaction.PinchZoomOptions=} opt_options Options.
* @api stable
* @api
*/
ol.interaction.PinchZoom = function(opt_options) {
@@ -81,13 +81,25 @@ ol.interaction.PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
scaleDelta = this.lastDistance_ / distance;
}
this.lastDistance_ = distance;
if (scaleDelta != 1.0) {
this.lastScaleDelta_ = scaleDelta;
}
var map = mapBrowserEvent.map;
var view = map.getView();
var resolution = view.getResolution();
var maxResolution = view.getMaxResolution();
var minResolution = view.getMinResolution();
var newResolution = resolution * scaleDelta;
if (newResolution > maxResolution) {
scaleDelta = maxResolution / resolution;
newResolution = maxResolution;
} else if (newResolution < minResolution) {
scaleDelta = minResolution / resolution;
newResolution = minResolution;
}
if (scaleDelta != 1.0) {
this.lastScaleDelta_ = scaleDelta;
}
// scale anchor point.
var viewportPosition = map.getViewport().getBoundingClientRect();
@@ -98,8 +110,7 @@ ol.interaction.PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
// scale, bypass the resolution constraint
map.render();
ol.interaction.Interaction.zoomWithoutConstraints(
view, resolution * scaleDelta, this.anchor_);
ol.interaction.Interaction.zoomWithoutConstraints(view, newResolution, this.anchor_);
};

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