Compare commits
1 Commits
v4.0.0-bet
...
v3.21.0-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c2a26a2a3 |
9
Makefile
9
Makefile
@@ -103,7 +103,6 @@ clean:
|
|||||||
rm -f build/test_rendering_requires.js
|
rm -f build/test_rendering_requires.js
|
||||||
rm -rf build/examples
|
rm -rf build/examples
|
||||||
rm -rf build/compiled-examples
|
rm -rf build/compiled-examples
|
||||||
rm -rf build/package
|
|
||||||
rm -rf $(BUILD_HOSTED)
|
rm -rf $(BUILD_HOSTED)
|
||||||
|
|
||||||
.PHONY: cleanall
|
.PHONY: cleanall
|
||||||
@@ -301,11 +300,3 @@ 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
|
%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 > $@
|
@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
|
|
||||||
|
|||||||
@@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
### Next release
|
### Next release
|
||||||
|
|
||||||
#### Removal of deprecated methods
|
#### Removed build flags (`@define`)
|
||||||
|
|
||||||
The deprecated `ol.animation` functions and `map.beforeRender()` method have been removed. Use `view.animate()` instead.
|
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.
|
||||||
|
|
||||||
#### Simplified `ol.View#fit()` API
|
#### Simplified `ol.View#fit()` API
|
||||||
|
|
||||||
@@ -27,13 +29,6 @@ Advanced use - new API:
|
|||||||
map.getView().fit(extent, {size: [200, 100], padding 10});
|
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
|
### v3.20.0
|
||||||
|
|
||||||
#### Use `view.animate()` instead of `map.beforeRender()` and `ol.animation` functions
|
#### Use `view.animate()` instead of `map.beforeRender()` and `ol.animation` functions
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
"markdown": {
|
"markdown": {
|
||||||
"parser": "gfm"
|
"parser": "gfm"
|
||||||
},
|
},
|
||||||
|
"stability": {
|
||||||
|
"levels": ["deprecated","experimental","unstable","stable","frozen","locked"]
|
||||||
|
},
|
||||||
"templates": {
|
"templates": {
|
||||||
"cleverLinks": true,
|
"cleverLinks": true,
|
||||||
"monospaceLinks": true,
|
"monospaceLinks": true,
|
||||||
|
|||||||
@@ -44,19 +44,21 @@ Interactions for [vector features](ol.Feature.html)
|
|||||||
|
|
||||||
#### API change policy
|
#### API change policy
|
||||||
|
|
||||||
The OpenLayers API consists of
|
The OpenLayers.x API consists of
|
||||||
* names and signatures of constructors
|
* names of classes, class methods and properties
|
||||||
* names and signatures of instance methods and properties
|
* names of static functions and constants
|
||||||
* names and signatures of functions
|
* order and types of function arguments
|
||||||
* names of constants
|
* types of function return values
|
||||||
|
|
||||||
Within a major release series, the API will not be changed. Any changes to the API will be accompanied by a new major release.
|
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.
|
||||||
|
|
||||||
*Note*: The API change policy does not cover CSS class names that are used to style the
|
*Note*: The API change policy does not cover CSS class names that are used to theme the
|
||||||
OpenLayers UI.
|
OpenLayers UI.
|
||||||
|
|
||||||
*Note for Closure Compiler users compiling their application code together with OpenLayers*:
|
*Note for Closure Compiler users compiling their application code together with OpenLayers*:
|
||||||
The names of types other than those in the list above (e.g. `ol.Coordinate`) are subject to change. It
|
The names of types other than those in the list above (e.g. `ol.Pixel`) are subject to change. It
|
||||||
is therefore recommended to either use the resolved type as listed in the API docs (e.g.
|
is therefore recommended to either use the resolved type as listed in the API docs (e.g.
|
||||||
`Array.<number>` instead of `ol.Coordinate`), or pay attention to the upgrade notes, which will list
|
`Array.<number>` instead of `ol.Pixel`), or pay attention to the upgrade notes, which will list
|
||||||
the changes for those types.
|
the changes for those types.
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
* Define an @api tag
|
* 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) {
|
exports.defineTags = function(dictionary) {
|
||||||
dictionary.defineTag('api', {
|
dictionary.defineTag('api', {
|
||||||
mustHaveValue: false,
|
mustHaveValue: false,
|
||||||
@@ -8,7 +12,13 @@ exports.defineTags = function(dictionary) {
|
|||||||
canHaveName: false,
|
canHaveName: false,
|
||||||
onTagged: function(doclet, tag) {
|
onTagged: function(doclet, tag) {
|
||||||
includeTypes(doclet);
|
includeTypes(doclet);
|
||||||
doclet.stability = "stable";
|
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) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ contain Markdown.
|
|||||||
|
|
||||||
The second line tells the Closure compiler the type of the argument.
|
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. 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 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 `@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).
|
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).
|
||||||
|
|
||||||
|
|||||||
@@ -92,6 +92,30 @@ $(function () {
|
|||||||
textParts[1] + '</a>';
|
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
|
// Highlighting current anchor
|
||||||
|
|
||||||
var anchors = $('.anchor');
|
var anchors = $('.anchor');
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ var version = obj.packageInfo.version;
|
|||||||
<div class="navbar-inner">
|
<div class="navbar-inner">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="brand" href="/"><img src="logo-70x70.png"> OpenLayers</a>
|
<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">
|
<ul class="nav navbar-nav pull-right">
|
||||||
<li><a href="../doc">Docs</a></li>
|
<li><a href="../doc">Docs</a></li>
|
||||||
<li><a href="../examples">Examples</a></li>
|
<li><a href="../examples">Examples</a></li>
|
||||||
|
|||||||
@@ -13,6 +13,5 @@ tags: "draw, edit, modify, vector, featureoverlay"
|
|||||||
<option value="Point">Point</option>
|
<option value="Point">Point</option>
|
||||||
<option value="LineString">LineString</option>
|
<option value="LineString">LineString</option>
|
||||||
<option value="Polygon">Polygon</option>
|
<option value="Polygon">Polygon</option>
|
||||||
<option value="Circle">Circle</option>
|
|
||||||
</select>
|
</select>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ goog.require('ol.source.VectorTile');
|
|||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.layer.VectorTile');
|
goog.require('ol.layer.VectorTile');
|
||||||
goog.require('ol.tilegrid');
|
goog.require('ol.tilegrid');
|
||||||
goog.require('ol.proj.Projection');
|
goog.require('ol.proj');
|
||||||
|
|
||||||
|
|
||||||
var replacer = function(key, value) {
|
var replacer = function(key, value) {
|
||||||
|
|||||||
458
externs/olx.js
458
externs/olx.js
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "openlayers",
|
"name": "openlayers",
|
||||||
"version": "4.0.0-beta.1",
|
"version": "3.21.0-beta.2",
|
||||||
"description": "Build tools and sources for developing OpenLayers based mapping applications",
|
"description": "Build tools and sources for developing OpenLayers based mapping applications",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"map",
|
"map",
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
"jsdoc": "3.4.3",
|
"jsdoc": "3.4.3",
|
||||||
"marked": "0.3.6",
|
"marked": "0.3.6",
|
||||||
"metalsmith": "2.3.0",
|
"metalsmith": "2.3.0",
|
||||||
"metalsmith-layouts": "1.8.0",
|
"metalsmith-layouts": "1.7.0",
|
||||||
"nomnom": "1.8.1",
|
"nomnom": "1.8.1",
|
||||||
"pbf": "3.0.5",
|
"pbf": "3.0.5",
|
||||||
"pixelworks": "1.1.0",
|
"pixelworks": "1.1.0",
|
||||||
@@ -51,17 +51,15 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"clean-css-cli": "4.0.0",
|
"clean-css-cli": "4.0.0",
|
||||||
"coveralls": "2.11.16",
|
"coveralls": "2.11.15",
|
||||||
"debounce": "^1.0.0",
|
"debounce": "^1.0.0",
|
||||||
"eslint": "3.15.0",
|
"eslint": "3.14.1",
|
||||||
"eslint-config-openlayers": "7.0.0",
|
"eslint-config-openlayers": "7.0.0",
|
||||||
"eslint-plugin-openlayers-internal": "^3.1.0",
|
"eslint-plugin-openlayers-internal": "^3.1.0",
|
||||||
"esprima": "2.x",
|
|
||||||
"expect.js": "0.3.1",
|
"expect.js": "0.3.1",
|
||||||
"gaze": "^1.0.0",
|
"gaze": "^1.0.0",
|
||||||
"istanbul": "0.4.5",
|
"istanbul": "0.4.5",
|
||||||
"jquery": "3.1.1",
|
"jquery": "3.1.1",
|
||||||
"jscodeshift": "^0.3.30",
|
|
||||||
"mocha": "3.2.0",
|
"mocha": "3.2.0",
|
||||||
"mocha-phantomjs-core": "^2.1.0",
|
"mocha-phantomjs-core": "^2.1.0",
|
||||||
"mustache": "2.3.0",
|
"mustache": "2.3.0",
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "ol",
|
|
||||||
"version": "3.21.0-beta.17",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
# 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.
|
|
||||||
174
src/ol/animation.js
Normal file
174
src/ol/animation.js
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
13
src/ol/animation.jsdoc
Normal file
13
src/ol/animation.jsdoc
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
goog.provide('ol.array');
|
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.
|
* 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.
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ goog.require('ol.tilegrid');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @param {olx.AttributionOptions} options Attribution options.
|
* @param {olx.AttributionOptions} options Attribution options.
|
||||||
* @struct
|
* @struct
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Attribution = function(options) {
|
ol.Attribution = function(options) {
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ ol.Attribution = function(options) {
|
|||||||
/**
|
/**
|
||||||
* Get the attribution markup.
|
* Get the attribution markup.
|
||||||
* @return {string} The attribution HTML.
|
* @return {string} The attribution HTML.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Attribution.prototype.getHTML = function() {
|
ol.Attribution.prototype.getHTML = function() {
|
||||||
return this.html_;
|
return this.html_;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ goog.require('ol.events.Event');
|
|||||||
* @fires ol.Collection.Event
|
* @fires ol.Collection.Event
|
||||||
* @param {!Array.<T>=} opt_array Array.
|
* @param {!Array.<T>=} opt_array Array.
|
||||||
* @template T
|
* @template T
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Collection = function(opt_array) {
|
ol.Collection = function(opt_array) {
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ ol.inherits(ol.Collection, ol.Object);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove all elements from the collection.
|
* Remove all elements from the collection.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Collection.prototype.clear = function() {
|
ol.Collection.prototype.clear = function() {
|
||||||
while (this.getLength() > 0) {
|
while (this.getLength() > 0) {
|
||||||
@@ -58,7 +58,7 @@ ol.Collection.prototype.clear = function() {
|
|||||||
* to the end of the collection.
|
* to the end of the collection.
|
||||||
* @param {!Array.<T>} arr Array.
|
* @param {!Array.<T>} arr Array.
|
||||||
* @return {ol.Collection.<T>} This collection.
|
* @return {ol.Collection.<T>} This collection.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Collection.prototype.extend = function(arr) {
|
ol.Collection.prototype.extend = function(arr) {
|
||||||
var i, ii;
|
var i, ii;
|
||||||
@@ -76,7 +76,7 @@ ol.Collection.prototype.extend = function(arr) {
|
|||||||
* index and the array). The return value is ignored.
|
* index and the array). The return value is ignored.
|
||||||
* @param {S=} opt_this The object to use as `this` in `f`.
|
* @param {S=} opt_this The object to use as `this` in `f`.
|
||||||
* @template S
|
* @template S
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Collection.prototype.forEach = function(f, opt_this) {
|
ol.Collection.prototype.forEach = function(f, opt_this) {
|
||||||
this.array_.forEach(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
|
* collection's "length" property won't be in sync with the actual length
|
||||||
* of the array.
|
* of the array.
|
||||||
* @return {!Array.<T>} Array.
|
* @return {!Array.<T>} Array.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Collection.prototype.getArray = function() {
|
ol.Collection.prototype.getArray = function() {
|
||||||
return this.array_;
|
return this.array_;
|
||||||
@@ -100,7 +100,7 @@ ol.Collection.prototype.getArray = function() {
|
|||||||
* Get the element at the provided index.
|
* Get the element at the provided index.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {T} Element.
|
* @return {T} Element.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Collection.prototype.item = function(index) {
|
ol.Collection.prototype.item = function(index) {
|
||||||
return this.array_[index];
|
return this.array_[index];
|
||||||
@@ -111,7 +111,7 @@ ol.Collection.prototype.item = function(index) {
|
|||||||
* Get the length of this collection.
|
* Get the length of this collection.
|
||||||
* @return {number} The length of the array.
|
* @return {number} The length of the array.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Collection.prototype.getLength = function() {
|
ol.Collection.prototype.getLength = function() {
|
||||||
return /** @type {number} */ (this.get(ol.Collection.Property_.LENGTH));
|
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.
|
* Insert an element at the provided index.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @param {T} elem Element.
|
* @param {T} elem Element.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Collection.prototype.insertAt = function(index, elem) {
|
ol.Collection.prototype.insertAt = function(index, elem) {
|
||||||
this.array_.splice(index, 0, 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.
|
* Remove the last element of the collection and return it.
|
||||||
* Return `undefined` if the collection is empty.
|
* Return `undefined` if the collection is empty.
|
||||||
* @return {T|undefined} Element.
|
* @return {T|undefined} Element.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Collection.prototype.pop = function() {
|
ol.Collection.prototype.pop = function() {
|
||||||
return this.removeAt(this.getLength() - 1);
|
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.
|
* Insert the provided element at the end of the collection.
|
||||||
* @param {T} elem Element.
|
* @param {T} elem Element.
|
||||||
* @return {number} New length of the collection.
|
* @return {number} New length of the collection.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Collection.prototype.push = function(elem) {
|
ol.Collection.prototype.push = function(elem) {
|
||||||
var n = this.getLength();
|
var n = this.getLength();
|
||||||
@@ -160,7 +160,7 @@ ol.Collection.prototype.push = function(elem) {
|
|||||||
* Remove the first occurrence of an element from the collection.
|
* Remove the first occurrence of an element from the collection.
|
||||||
* @param {T} elem Element.
|
* @param {T} elem Element.
|
||||||
* @return {T|undefined} The removed element or undefined if none found.
|
* @return {T|undefined} The removed element or undefined if none found.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Collection.prototype.remove = function(elem) {
|
ol.Collection.prototype.remove = function(elem) {
|
||||||
var arr = this.array_;
|
var arr = this.array_;
|
||||||
@@ -179,7 +179,7 @@ ol.Collection.prototype.remove = function(elem) {
|
|||||||
* Return `undefined` if the collection does not contain this index.
|
* Return `undefined` if the collection does not contain this index.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {T|undefined} Value.
|
* @return {T|undefined} Value.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Collection.prototype.removeAt = function(index) {
|
ol.Collection.prototype.removeAt = function(index) {
|
||||||
var prev = this.array_[index];
|
var prev = this.array_[index];
|
||||||
@@ -195,7 +195,7 @@ ol.Collection.prototype.removeAt = function(index) {
|
|||||||
* Set the element at the provided index.
|
* Set the element at the provided index.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @param {T} elem Element.
|
* @param {T} elem Element.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Collection.prototype.setAt = function(index, elem) {
|
ol.Collection.prototype.setAt = function(index, elem) {
|
||||||
var n = this.getLength();
|
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.
|
* The element that is added to or removed from the collection.
|
||||||
* @type {*}
|
* @type {*}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
this.element = opt_element;
|
this.element = opt_element;
|
||||||
|
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ ol.CollectionEventType = {
|
|||||||
/**
|
/**
|
||||||
* Triggered when an item is added to the collection.
|
* Triggered when an item is added to the collection.
|
||||||
* @event ol.Collection.Event#add
|
* @event ol.Collection.Event#add
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ADD: 'add',
|
ADD: 'add',
|
||||||
/**
|
/**
|
||||||
* Triggered when an item is removed from the collection.
|
* Triggered when an item is removed from the collection.
|
||||||
* @event ol.Collection.Event#remove
|
* @event ol.Collection.Event#remove
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
REMOVE: 'remove'
|
REMOVE: 'remove'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
goog.provide('ol.control');
|
goog.provide('ol.control');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.Collection');
|
goog.require('ol.Collection');
|
||||||
goog.require('ol.control.Attribution');
|
goog.require('ol.control.Attribution');
|
||||||
goog.require('ol.control.Rotate');
|
goog.require('ol.control.Rotate');
|
||||||
@@ -16,7 +17,7 @@ goog.require('ol.control.Zoom');
|
|||||||
*
|
*
|
||||||
* @param {olx.control.DefaultsOptions=} opt_options Defaults options.
|
* @param {olx.control.DefaultsOptions=} opt_options Defaults options.
|
||||||
* @return {ol.Collection.<ol.control.Control>} Controls.
|
* @return {ol.Collection.<ol.control.Control>} Controls.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.defaults = function(opt_options) {
|
ol.control.defaults = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ goog.require('ol.obj');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {olx.control.AttributionOptions=} opt_options Attribution options.
|
* @param {olx.control.AttributionOptions=} opt_options Attribution options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.Attribution = function(opt_options) {
|
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 `true` if the attribution is collapsible, `false` otherwise.
|
||||||
* @return {boolean} True if the widget is collapsible.
|
* @return {boolean} True if the widget is collapsible.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.Attribution.prototype.getCollapsible = function() {
|
ol.control.Attribution.prototype.getCollapsible = function() {
|
||||||
return this.collapsible_;
|
return this.collapsible_;
|
||||||
@@ -369,7 +369,7 @@ ol.control.Attribution.prototype.getCollapsible = function() {
|
|||||||
/**
|
/**
|
||||||
* Set whether the attribution should be collapsible.
|
* Set whether the attribution should be collapsible.
|
||||||
* @param {boolean} collapsible True if the widget is collapsible.
|
* @param {boolean} collapsible True if the widget is collapsible.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.Attribution.prototype.setCollapsible = function(collapsible) {
|
ol.control.Attribution.prototype.setCollapsible = function(collapsible) {
|
||||||
if (this.collapsible_ === 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
|
* not do anything if the attribution isn't collapsible or if the current
|
||||||
* collapsed state is already the one requested.
|
* collapsed state is already the one requested.
|
||||||
* @param {boolean} collapsed True if the widget is collapsed.
|
* @param {boolean} collapsed True if the widget is collapsed.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.Attribution.prototype.setCollapsed = function(collapsed) {
|
ol.control.Attribution.prototype.setCollapsed = function(collapsed) {
|
||||||
if (!this.collapsible_ || this.collapsed_ === 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`
|
* Return `true` when the attribution is currently collapsed or `false`
|
||||||
* otherwise.
|
* otherwise.
|
||||||
* @return {boolean} True if the widget is collapsed.
|
* @return {boolean} True if the widget is collapsed.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.Attribution.prototype.getCollapsed = function() {
|
ol.control.Attribution.prototype.getCollapsed = function() {
|
||||||
return this.collapsed_;
|
return this.collapsed_;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ goog.require('ol.events');
|
|||||||
* @extends {ol.Object}
|
* @extends {ol.Object}
|
||||||
* @implements {oli.control.Control}
|
* @implements {oli.control.Control}
|
||||||
* @param {olx.control.ControlOptions} options Control options.
|
* @param {olx.control.ControlOptions} options Control options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.Control = function(options) {
|
ol.control.Control = function(options) {
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ ol.control.Control.prototype.disposeInternal = function() {
|
|||||||
/**
|
/**
|
||||||
* Get the map associated with this control.
|
* Get the map associated with this control.
|
||||||
* @return {ol.Map} Map.
|
* @return {ol.Map} Map.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.Control.prototype.getMap = function() {
|
ol.control.Control.prototype.getMap = function() {
|
||||||
return this.map_;
|
return this.map_;
|
||||||
@@ -102,7 +102,7 @@ ol.control.Control.prototype.getMap = function() {
|
|||||||
* the map here.
|
* the map here.
|
||||||
* @param {ol.Map} map Map.
|
* @param {ol.Map} map Map.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.Control.prototype.setMap = function(map) {
|
ol.control.Control.prototype.setMap = function(map) {
|
||||||
if (this.map_) {
|
if (this.map_) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ goog.require('ol.events.EventType');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {olx.control.FullScreenOptions=} opt_options Options.
|
* @param {olx.control.FullScreenOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.FullScreen = function(opt_options) {
|
ol.control.FullScreen = function(opt_options) {
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.FullScreen.prototype.setMap = function(map) {
|
ol.control.FullScreen.prototype.setMap = function(map) {
|
||||||
ol.control.Control.prototype.setMap.call(this, map);
|
ol.control.Control.prototype.setMap.call(this, map);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ goog.require('ol.proj');
|
|||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {olx.control.MousePositionOptions=} opt_options Mouse position
|
* @param {olx.control.MousePositionOptions=} opt_options Mouse position
|
||||||
* options.
|
* options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.MousePosition = function(opt_options) {
|
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
|
* @return {ol.CoordinateFormatType|undefined} The format to render the current
|
||||||
* position in.
|
* position in.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.MousePosition.prototype.getCoordinateFormat = function() {
|
ol.control.MousePosition.prototype.getCoordinateFormat = function() {
|
||||||
return /** @type {ol.CoordinateFormatType|undefined} */ (
|
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
|
* @return {ol.proj.Projection|undefined} The projection to report mouse
|
||||||
* position in.
|
* position in.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.MousePosition.prototype.getProjection = function() {
|
ol.control.MousePosition.prototype.getProjection = function() {
|
||||||
return /** @type {ol.proj.Projection|undefined} */ (
|
return /** @type {ol.proj.Projection|undefined} */ (
|
||||||
@@ -162,7 +162,7 @@ ol.control.MousePosition.prototype.handleMouseOut = function(event) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.MousePosition.prototype.setMap = function(map) {
|
ol.control.MousePosition.prototype.setMap = function(map) {
|
||||||
ol.control.Control.prototype.setMap.call(this, 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
|
* @param {ol.CoordinateFormatType} format The format to render the current
|
||||||
* position in.
|
* position in.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.MousePosition.prototype.setCoordinateFormat = function(format) {
|
ol.control.MousePosition.prototype.setCoordinateFormat = function(format) {
|
||||||
this.set(ol.control.MousePosition.Property_.COORDINATE_FORMAT, 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
|
* @param {ol.proj.Projection} projection The projection to report mouse
|
||||||
* position in.
|
* position in.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.MousePosition.prototype.setProjection = function(projection) {
|
ol.control.MousePosition.prototype.setProjection = function(projection) {
|
||||||
this.set(ol.control.MousePosition.Property_.PROJECTION, projection);
|
this.set(ol.control.MousePosition.Property_.PROJECTION, projection);
|
||||||
|
|||||||
@@ -462,7 +462,7 @@ ol.control.OverviewMap.prototype.handleToggle_ = function() {
|
|||||||
/**
|
/**
|
||||||
* Return `true` if the overview map is collapsible, `false` otherwise.
|
* Return `true` if the overview map is collapsible, `false` otherwise.
|
||||||
* @return {boolean} True if the widget is collapsible.
|
* @return {boolean} True if the widget is collapsible.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.OverviewMap.prototype.getCollapsible = function() {
|
ol.control.OverviewMap.prototype.getCollapsible = function() {
|
||||||
return this.collapsible_;
|
return this.collapsible_;
|
||||||
@@ -472,7 +472,7 @@ ol.control.OverviewMap.prototype.getCollapsible = function() {
|
|||||||
/**
|
/**
|
||||||
* Set whether the overview map should be collapsible.
|
* Set whether the overview map should be collapsible.
|
||||||
* @param {boolean} collapsible True if the widget is collapsible.
|
* @param {boolean} collapsible True if the widget is collapsible.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.OverviewMap.prototype.setCollapsible = function(collapsible) {
|
ol.control.OverviewMap.prototype.setCollapsible = function(collapsible) {
|
||||||
if (this.collapsible_ === 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
|
* not do anything if the overview map isn't collapsible or if the current
|
||||||
* collapsed state is already the one requested.
|
* collapsed state is already the one requested.
|
||||||
* @param {boolean} collapsed True if the widget is collapsed.
|
* @param {boolean} collapsed True if the widget is collapsed.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.OverviewMap.prototype.setCollapsed = function(collapsed) {
|
ol.control.OverviewMap.prototype.setCollapsed = function(collapsed) {
|
||||||
if (!this.collapsible_ || this.collapsed_ === 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.
|
* Determine if the overview map is collapsed.
|
||||||
* @return {boolean} The overview map is collapsed.
|
* @return {boolean} The overview map is collapsed.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.OverviewMap.prototype.getCollapsed = function() {
|
ol.control.OverviewMap.prototype.getCollapsed = function() {
|
||||||
return this.collapsed_;
|
return this.collapsed_;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ goog.require('ol.easing');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {olx.control.RotateOptions=} opt_options Rotate options.
|
* @param {olx.control.RotateOptions=} opt_options Rotate options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.Rotate = function(opt_options) {
|
ol.control.Rotate = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ goog.require('ol.proj.Units');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {olx.control.ScaleLineOptions=} opt_options Scale line options.
|
* @param {olx.control.ScaleLineOptions=} opt_options Scale line options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.ScaleLine = function(opt_options) {
|
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
|
* @return {ol.control.ScaleLineUnits|undefined} The units to use in the scale
|
||||||
* line.
|
* line.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.ScaleLine.prototype.getUnits = function() {
|
ol.control.ScaleLine.prototype.getUnits = function() {
|
||||||
return /** @type {ol.control.ScaleLineUnits|undefined} */ (
|
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.
|
* Set the units to use in the scale line.
|
||||||
* @param {ol.control.ScaleLineUnits} units The units to use in the scale line.
|
* @param {ol.control.ScaleLineUnits} units The units to use in the scale line.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.ScaleLine.prototype.setUnits = function(units) {
|
ol.control.ScaleLine.prototype.setUnits = function(units) {
|
||||||
this.set(ol.control.ScaleLine.Property_.UNITS, units);
|
this.set(ol.control.ScaleLine.Property_.UNITS, units);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ goog.require('ol.easing');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {olx.control.ZoomOptions=} opt_options Zoom options.
|
* @param {olx.control.ZoomOptions=} opt_options Zoom options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.Zoom = function(opt_options) {
|
ol.control.Zoom = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ goog.require('ol.pointer.PointerEventHandler');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {olx.control.ZoomSliderOptions=} opt_options Zoom slider options.
|
* @param {olx.control.ZoomSliderOptions=} opt_options Zoom slider options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.ZoomSlider = function(opt_options) {
|
ol.control.ZoomSlider = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ goog.require('ol.css');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {olx.control.ZoomToExtentOptions=} opt_options Options.
|
* @param {olx.control.ZoomToExtentOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.control.ZoomToExtent = function(opt_options) {
|
ol.control.ZoomToExtent = function(opt_options) {
|
||||||
var options = opt_options ? opt_options : {};
|
var options = opt_options ? opt_options : {};
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ goog.require('ol.string');
|
|||||||
* @param {ol.Coordinate} coordinate Coordinate.
|
* @param {ol.Coordinate} coordinate Coordinate.
|
||||||
* @param {ol.Coordinate} delta Delta.
|
* @param {ol.Coordinate} delta Delta.
|
||||||
* @return {ol.Coordinate} The input coordinate adjusted by the given delta.
|
* @return {ol.Coordinate} The input coordinate adjusted by the given delta.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.coordinate.add = function(coordinate, delta) {
|
ol.coordinate.add = function(coordinate, delta) {
|
||||||
coordinate[0] += delta[0];
|
coordinate[0] += delta[0];
|
||||||
@@ -86,7 +86,7 @@ ol.coordinate.closestOnSegment = function(coordinate, segment) {
|
|||||||
* @param {number=} opt_fractionDigits The number of digits to include
|
* @param {number=} opt_fractionDigits The number of digits to include
|
||||||
* after the decimal point. Default is `0`.
|
* after the decimal point. Default is `0`.
|
||||||
* @return {ol.CoordinateFormatType} Coordinate format.
|
* @return {ol.CoordinateFormatType} Coordinate format.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.coordinate.createStringXY = function(opt_fractionDigits) {
|
ol.coordinate.createStringXY = function(opt_fractionDigits) {
|
||||||
return (
|
return (
|
||||||
@@ -144,7 +144,7 @@ ol.coordinate.degreesToStringHDMS_ = function(degrees, hemispheres, opt_fraction
|
|||||||
* @param {number=} opt_fractionDigits The number of digits to include
|
* @param {number=} opt_fractionDigits The number of digits to include
|
||||||
* after the decimal point. Default is `0`.
|
* after the decimal point. Default is `0`.
|
||||||
* @return {string} Formatted coordinate.
|
* @return {string} Formatted coordinate.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.coordinate.format = function(coordinate, template, opt_fractionDigits) {
|
ol.coordinate.format = function(coordinate, template, opt_fractionDigits) {
|
||||||
if (coordinate) {
|
if (coordinate) {
|
||||||
@@ -188,7 +188,7 @@ ol.coordinate.equals = function(coordinate1, coordinate2) {
|
|||||||
* @param {ol.Coordinate} coordinate Coordinate.
|
* @param {ol.Coordinate} coordinate Coordinate.
|
||||||
* @param {number} angle Angle in radian.
|
* @param {number} angle Angle in radian.
|
||||||
* @return {ol.Coordinate} Coordinate.
|
* @return {ol.Coordinate} Coordinate.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.coordinate.rotate = function(coordinate, angle) {
|
ol.coordinate.rotate = function(coordinate, angle) {
|
||||||
var cosAngle = Math.cos(angle);
|
var cosAngle = Math.cos(angle);
|
||||||
@@ -250,16 +250,6 @@ 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.
|
* Calculate the squared distance from a coordinate to a line segment.
|
||||||
*
|
*
|
||||||
@@ -293,7 +283,7 @@ ol.coordinate.squaredDistanceToSegment = function(coordinate, segment) {
|
|||||||
* @param {number=} opt_fractionDigits The number of digits to include
|
* @param {number=} opt_fractionDigits The number of digits to include
|
||||||
* after the decimal point. Default is `0`.
|
* after the decimal point. Default is `0`.
|
||||||
* @return {string} Hemisphere, degrees, minutes and seconds.
|
* @return {string} Hemisphere, degrees, minutes and seconds.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.coordinate.toStringHDMS = function(coordinate, opt_fractionDigits) {
|
ol.coordinate.toStringHDMS = function(coordinate, opt_fractionDigits) {
|
||||||
if (coordinate) {
|
if (coordinate) {
|
||||||
@@ -324,7 +314,7 @@ ol.coordinate.toStringHDMS = function(coordinate, opt_fractionDigits) {
|
|||||||
* @param {number=} opt_fractionDigits The number of digits to include
|
* @param {number=} opt_fractionDigits The number of digits to include
|
||||||
* after the decimal point. Default is `0`.
|
* after the decimal point. Default is `0`.
|
||||||
* @return {string} XY.
|
* @return {string} XY.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.coordinate.toStringXY = function(coordinate, opt_fractionDigits) {
|
ol.coordinate.toStringXY = function(coordinate, opt_fractionDigits) {
|
||||||
return ol.coordinate.format(coordinate, '{x}, {y}', opt_fractionDigits);
|
return ol.coordinate.format(coordinate, '{x}, {y}', opt_fractionDigits);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ goog.require('ol.has');
|
|||||||
*
|
*
|
||||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if only the alt key is pressed.
|
* @return {boolean} True if only the alt key is pressed.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.events.condition.altKeyOnly = function(mapBrowserEvent) {
|
ol.events.condition.altKeyOnly = function(mapBrowserEvent) {
|
||||||
var originalEvent = mapBrowserEvent.originalEvent;
|
var originalEvent = mapBrowserEvent.originalEvent;
|
||||||
@@ -29,7 +29,7 @@ ol.events.condition.altKeyOnly = function(mapBrowserEvent) {
|
|||||||
*
|
*
|
||||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if only the alt and shift keys are pressed.
|
* @return {boolean} True if only the alt and shift keys are pressed.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.events.condition.altShiftKeysOnly = function(mapBrowserEvent) {
|
ol.events.condition.altShiftKeysOnly = function(mapBrowserEvent) {
|
||||||
var originalEvent = mapBrowserEvent.originalEvent;
|
var originalEvent = mapBrowserEvent.originalEvent;
|
||||||
@@ -46,7 +46,7 @@ ol.events.condition.altShiftKeysOnly = function(mapBrowserEvent) {
|
|||||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True.
|
* @return {boolean} True.
|
||||||
* @function
|
* @function
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.events.condition.always = ol.functions.TRUE;
|
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.
|
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if the event is a map `click` event.
|
* @return {boolean} True if the event is a map `click` event.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.events.condition.click = function(mapBrowserEvent) {
|
ol.events.condition.click = function(mapBrowserEvent) {
|
||||||
return mapBrowserEvent.type == ol.MapBrowserEventType.CLICK;
|
return mapBrowserEvent.type == ol.MapBrowserEventType.CLICK;
|
||||||
@@ -85,7 +85,7 @@ ol.events.condition.mouseActionButton = function(mapBrowserEvent) {
|
|||||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} False.
|
* @return {boolean} False.
|
||||||
* @function
|
* @function
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.events.condition.never = ol.functions.FALSE;
|
ol.events.condition.never = ol.functions.FALSE;
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ ol.events.condition.pointerMove = function(mapBrowserEvent) {
|
|||||||
*
|
*
|
||||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if the event is a map `singleclick` event.
|
* @return {boolean} True if the event is a map `singleclick` event.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.events.condition.singleClick = function(mapBrowserEvent) {
|
ol.events.condition.singleClick = function(mapBrowserEvent) {
|
||||||
return mapBrowserEvent.type == ol.MapBrowserEventType.SINGLECLICK;
|
return mapBrowserEvent.type == ol.MapBrowserEventType.SINGLECLICK;
|
||||||
@@ -120,7 +120,7 @@ ol.events.condition.singleClick = function(mapBrowserEvent) {
|
|||||||
*
|
*
|
||||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if the event is a map `dblclick` event.
|
* @return {boolean} True if the event is a map `dblclick` event.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.events.condition.doubleClick = function(mapBrowserEvent) {
|
ol.events.condition.doubleClick = function(mapBrowserEvent) {
|
||||||
return mapBrowserEvent.type == ol.MapBrowserEventType.DBLCLICK;
|
return mapBrowserEvent.type == ol.MapBrowserEventType.DBLCLICK;
|
||||||
@@ -133,7 +133,7 @@ ol.events.condition.doubleClick = function(mapBrowserEvent) {
|
|||||||
*
|
*
|
||||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True only if there no modifier keys are pressed.
|
* @return {boolean} True only if there no modifier keys are pressed.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.events.condition.noModifierKeys = function(mapBrowserEvent) {
|
ol.events.condition.noModifierKeys = function(mapBrowserEvent) {
|
||||||
var originalEvent = mapBrowserEvent.originalEvent;
|
var originalEvent = mapBrowserEvent.originalEvent;
|
||||||
@@ -151,7 +151,7 @@ ol.events.condition.noModifierKeys = function(mapBrowserEvent) {
|
|||||||
*
|
*
|
||||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if only the platform modifier key is pressed.
|
* @return {boolean} True if only the platform modifier key is pressed.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.events.condition.platformModifierKeyOnly = function(mapBrowserEvent) {
|
ol.events.condition.platformModifierKeyOnly = function(mapBrowserEvent) {
|
||||||
var originalEvent = mapBrowserEvent.originalEvent;
|
var originalEvent = mapBrowserEvent.originalEvent;
|
||||||
@@ -168,7 +168,7 @@ ol.events.condition.platformModifierKeyOnly = function(mapBrowserEvent) {
|
|||||||
*
|
*
|
||||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if only the shift key is pressed.
|
* @return {boolean} True if only the shift key is pressed.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.events.condition.shiftKeyOnly = function(mapBrowserEvent) {
|
ol.events.condition.shiftKeyOnly = function(mapBrowserEvent) {
|
||||||
var originalEvent = mapBrowserEvent.originalEvent;
|
var originalEvent = mapBrowserEvent.originalEvent;
|
||||||
@@ -202,7 +202,7 @@ ol.events.condition.targetNotEditable = function(mapBrowserEvent) {
|
|||||||
*
|
*
|
||||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if the event originates from a mouse device.
|
* @return {boolean} True if the event originates from a mouse device.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.events.condition.mouseOnly = function(mapBrowserEvent) {
|
ol.events.condition.mouseOnly = function(mapBrowserEvent) {
|
||||||
ol.asserts.assert(mapBrowserEvent.pointerEvent, 56); // mapBrowserEvent must originate from a pointer event
|
ol.asserts.assert(mapBrowserEvent.pointerEvent, 56); // mapBrowserEvent must originate from a pointer event
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ ol.events.Event = function(type) {
|
|||||||
/**
|
/**
|
||||||
* The event type.
|
* The event type.
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The event target.
|
* The event target.
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
this.target = null;
|
this.target = null;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ ol.events.Event = function(type) {
|
|||||||
* Stop event propagation.
|
* Stop event propagation.
|
||||||
* @function
|
* @function
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.events.Event.prototype.preventDefault =
|
ol.events.Event.prototype.preventDefault =
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ ol.events.Event.prototype.preventDefault =
|
|||||||
* Stop event propagation.
|
* Stop event propagation.
|
||||||
* @function
|
* @function
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.events.Event.prototype.stopPropagation = function() {
|
ol.events.Event.prototype.stopPropagation = function() {
|
||||||
this.propagationStopped = true;
|
this.propagationStopped = true;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
goog.provide('ol.extent');
|
goog.provide('ol.extent');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.asserts');
|
goog.require('ol.asserts');
|
||||||
goog.require('ol.extent.Corner');
|
goog.require('ol.extent.Corner');
|
||||||
goog.require('ol.extent.Relationship');
|
goog.require('ol.extent.Relationship');
|
||||||
@@ -10,7 +11,7 @@ goog.require('ol.extent.Relationship');
|
|||||||
*
|
*
|
||||||
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
||||||
* @return {ol.Extent} Bounding extent.
|
* @return {ol.Extent} Bounding extent.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.boundingExtent = function(coordinates) {
|
ol.extent.boundingExtent = function(coordinates) {
|
||||||
var extent = ol.extent.createEmpty();
|
var extent = ol.extent.createEmpty();
|
||||||
@@ -43,7 +44,7 @@ ol.extent.boundingExtentXYs_ = function(xs, ys, opt_extent) {
|
|||||||
* @param {number} value The amount by which the extent should be buffered.
|
* @param {number} value The amount by which the extent should be buffered.
|
||||||
* @param {ol.Extent=} opt_extent Extent.
|
* @param {ol.Extent=} opt_extent Extent.
|
||||||
* @return {ol.Extent} Extent.
|
* @return {ol.Extent} Extent.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.buffer = function(extent, value, opt_extent) {
|
ol.extent.buffer = function(extent, value, opt_extent) {
|
||||||
if (opt_extent) {
|
if (opt_extent) {
|
||||||
@@ -115,7 +116,7 @@ ol.extent.closestSquaredDistanceXY = function(extent, x, y) {
|
|||||||
* @param {ol.Extent} extent Extent.
|
* @param {ol.Extent} extent Extent.
|
||||||
* @param {ol.Coordinate} coordinate Coordinate.
|
* @param {ol.Coordinate} coordinate Coordinate.
|
||||||
* @return {boolean} The coordinate is contained in the extent.
|
* @return {boolean} The coordinate is contained in the extent.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.containsCoordinate = function(extent, coordinate) {
|
ol.extent.containsCoordinate = function(extent, coordinate) {
|
||||||
return ol.extent.containsXY(extent, coordinate[0], coordinate[1]);
|
return ol.extent.containsXY(extent, coordinate[0], coordinate[1]);
|
||||||
@@ -132,7 +133,7 @@ ol.extent.containsCoordinate = function(extent, coordinate) {
|
|||||||
* @param {ol.Extent} extent2 Extent 2.
|
* @param {ol.Extent} extent2 Extent 2.
|
||||||
* @return {boolean} The second extent is contained by or on the edge of the
|
* @return {boolean} The second extent is contained by or on the edge of the
|
||||||
* first.
|
* first.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.containsExtent = function(extent1, extent2) {
|
ol.extent.containsExtent = function(extent1, extent2) {
|
||||||
return extent1[0] <= extent2[0] && extent2[2] <= extent1[2] &&
|
return extent1[0] <= extent2[0] && extent2[2] <= extent1[2] &&
|
||||||
@@ -147,7 +148,7 @@ ol.extent.containsExtent = function(extent1, extent2) {
|
|||||||
* @param {number} x X coordinate.
|
* @param {number} x X coordinate.
|
||||||
* @param {number} y Y coordinate.
|
* @param {number} y Y coordinate.
|
||||||
* @return {boolean} The x, y values are contained in the extent.
|
* @return {boolean} The x, y values are contained in the extent.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.containsXY = function(extent, x, y) {
|
ol.extent.containsXY = function(extent, x, y) {
|
||||||
return extent[0] <= x && x <= extent[2] && extent[1] <= y && y <= extent[3];
|
return extent[0] <= x && x <= extent[2] && extent[1] <= y && y <= extent[3];
|
||||||
@@ -189,7 +190,7 @@ ol.extent.coordinateRelationship = function(extent, coordinate) {
|
|||||||
/**
|
/**
|
||||||
* Create an empty extent.
|
* Create an empty extent.
|
||||||
* @return {ol.Extent} Empty extent.
|
* @return {ol.Extent} Empty extent.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.createEmpty = function() {
|
ol.extent.createEmpty = function() {
|
||||||
return [Infinity, Infinity, -Infinity, -Infinity];
|
return [Infinity, Infinity, -Infinity, -Infinity];
|
||||||
@@ -283,7 +284,7 @@ ol.extent.createOrUpdateFromRings = function(rings, opt_extent) {
|
|||||||
* @param {ol.Extent} extent1 Extent 1.
|
* @param {ol.Extent} extent1 Extent 1.
|
||||||
* @param {ol.Extent} extent2 Extent 2.
|
* @param {ol.Extent} extent2 Extent 2.
|
||||||
* @return {boolean} The two extents are equivalent.
|
* @return {boolean} The two extents are equivalent.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.equals = function(extent1, extent2) {
|
ol.extent.equals = function(extent1, extent2) {
|
||||||
return extent1[0] == extent2[0] && extent1[2] == extent2[2] &&
|
return extent1[0] == extent2[0] && extent1[2] == extent2[2] &&
|
||||||
@@ -296,7 +297,7 @@ ol.extent.equals = function(extent1, extent2) {
|
|||||||
* @param {ol.Extent} extent1 The extent to be modified.
|
* @param {ol.Extent} extent1 The extent to be modified.
|
||||||
* @param {ol.Extent} extent2 The extent that will be included in the first.
|
* @param {ol.Extent} extent2 The extent that will be included in the first.
|
||||||
* @return {ol.Extent} A reference to the first (extended) extent.
|
* @return {ol.Extent} A reference to the first (extended) extent.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.extend = function(extent1, extent2) {
|
ol.extent.extend = function(extent1, extent2) {
|
||||||
if (extent2[0] < extent1[0]) {
|
if (extent2[0] < extent1[0]) {
|
||||||
@@ -442,7 +443,7 @@ ol.extent.getArea = function(extent) {
|
|||||||
* Get the bottom left coordinate of an extent.
|
* Get the bottom left coordinate of an extent.
|
||||||
* @param {ol.Extent} extent Extent.
|
* @param {ol.Extent} extent Extent.
|
||||||
* @return {ol.Coordinate} Bottom left coordinate.
|
* @return {ol.Coordinate} Bottom left coordinate.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.getBottomLeft = function(extent) {
|
ol.extent.getBottomLeft = function(extent) {
|
||||||
return [extent[0], extent[1]];
|
return [extent[0], extent[1]];
|
||||||
@@ -453,7 +454,7 @@ ol.extent.getBottomLeft = function(extent) {
|
|||||||
* Get the bottom right coordinate of an extent.
|
* Get the bottom right coordinate of an extent.
|
||||||
* @param {ol.Extent} extent Extent.
|
* @param {ol.Extent} extent Extent.
|
||||||
* @return {ol.Coordinate} Bottom right coordinate.
|
* @return {ol.Coordinate} Bottom right coordinate.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.getBottomRight = function(extent) {
|
ol.extent.getBottomRight = function(extent) {
|
||||||
return [extent[2], extent[1]];
|
return [extent[2], extent[1]];
|
||||||
@@ -464,7 +465,7 @@ ol.extent.getBottomRight = function(extent) {
|
|||||||
* Get the center coordinate of an extent.
|
* Get the center coordinate of an extent.
|
||||||
* @param {ol.Extent} extent Extent.
|
* @param {ol.Extent} extent Extent.
|
||||||
* @return {ol.Coordinate} Center.
|
* @return {ol.Coordinate} Center.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.getCenter = function(extent) {
|
ol.extent.getCenter = function(extent) {
|
||||||
return [(extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2];
|
return [(extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2];
|
||||||
@@ -546,7 +547,7 @@ ol.extent.getForViewAndSize = function(center, resolution, rotation, size, opt_e
|
|||||||
* Get the height of an extent.
|
* Get the height of an extent.
|
||||||
* @param {ol.Extent} extent Extent.
|
* @param {ol.Extent} extent Extent.
|
||||||
* @return {number} Height.
|
* @return {number} Height.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.getHeight = function(extent) {
|
ol.extent.getHeight = function(extent) {
|
||||||
return extent[3] - extent[1];
|
return extent[3] - extent[1];
|
||||||
@@ -570,7 +571,7 @@ ol.extent.getIntersectionArea = function(extent1, extent2) {
|
|||||||
* @param {ol.Extent} extent2 Extent 2.
|
* @param {ol.Extent} extent2 Extent 2.
|
||||||
* @param {ol.Extent=} opt_extent Optional extent to populate with intersection.
|
* @param {ol.Extent=} opt_extent Optional extent to populate with intersection.
|
||||||
* @return {ol.Extent} Intersecting extent.
|
* @return {ol.Extent} Intersecting extent.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.getIntersection = function(extent1, extent2, opt_extent) {
|
ol.extent.getIntersection = function(extent1, extent2, opt_extent) {
|
||||||
var intersection = opt_extent ? opt_extent : ol.extent.createEmpty();
|
var intersection = opt_extent ? opt_extent : ol.extent.createEmpty();
|
||||||
@@ -613,7 +614,7 @@ ol.extent.getMargin = function(extent) {
|
|||||||
* Get the size (width, height) of an extent.
|
* Get the size (width, height) of an extent.
|
||||||
* @param {ol.Extent} extent The extent.
|
* @param {ol.Extent} extent The extent.
|
||||||
* @return {ol.Size} The extent size.
|
* @return {ol.Size} The extent size.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.getSize = function(extent) {
|
ol.extent.getSize = function(extent) {
|
||||||
return [extent[2] - extent[0], extent[3] - extent[1]];
|
return [extent[2] - extent[0], extent[3] - extent[1]];
|
||||||
@@ -624,7 +625,7 @@ ol.extent.getSize = function(extent) {
|
|||||||
* Get the top left coordinate of an extent.
|
* Get the top left coordinate of an extent.
|
||||||
* @param {ol.Extent} extent Extent.
|
* @param {ol.Extent} extent Extent.
|
||||||
* @return {ol.Coordinate} Top left coordinate.
|
* @return {ol.Coordinate} Top left coordinate.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.getTopLeft = function(extent) {
|
ol.extent.getTopLeft = function(extent) {
|
||||||
return [extent[0], extent[3]];
|
return [extent[0], extent[3]];
|
||||||
@@ -635,7 +636,7 @@ ol.extent.getTopLeft = function(extent) {
|
|||||||
* Get the top right coordinate of an extent.
|
* Get the top right coordinate of an extent.
|
||||||
* @param {ol.Extent} extent Extent.
|
* @param {ol.Extent} extent Extent.
|
||||||
* @return {ol.Coordinate} Top right coordinate.
|
* @return {ol.Coordinate} Top right coordinate.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.getTopRight = function(extent) {
|
ol.extent.getTopRight = function(extent) {
|
||||||
return [extent[2], extent[3]];
|
return [extent[2], extent[3]];
|
||||||
@@ -646,7 +647,7 @@ ol.extent.getTopRight = function(extent) {
|
|||||||
* Get the width of an extent.
|
* Get the width of an extent.
|
||||||
* @param {ol.Extent} extent Extent.
|
* @param {ol.Extent} extent Extent.
|
||||||
* @return {number} Width.
|
* @return {number} Width.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.getWidth = function(extent) {
|
ol.extent.getWidth = function(extent) {
|
||||||
return extent[2] - extent[0];
|
return extent[2] - extent[0];
|
||||||
@@ -658,7 +659,7 @@ ol.extent.getWidth = function(extent) {
|
|||||||
* @param {ol.Extent} extent1 Extent 1.
|
* @param {ol.Extent} extent1 Extent 1.
|
||||||
* @param {ol.Extent} extent2 Extent.
|
* @param {ol.Extent} extent2 Extent.
|
||||||
* @return {boolean} The two extents intersect.
|
* @return {boolean} The two extents intersect.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.intersects = function(extent1, extent2) {
|
ol.extent.intersects = function(extent1, extent2) {
|
||||||
return extent1[0] <= extent2[2] &&
|
return extent1[0] <= extent2[2] &&
|
||||||
@@ -672,7 +673,7 @@ ol.extent.intersects = function(extent1, extent2) {
|
|||||||
* Determine if an extent is empty.
|
* Determine if an extent is empty.
|
||||||
* @param {ol.Extent} extent Extent.
|
* @param {ol.Extent} extent Extent.
|
||||||
* @return {boolean} Is empty.
|
* @return {boolean} Is empty.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.isEmpty = function(extent) {
|
ol.extent.isEmpty = function(extent) {
|
||||||
return extent[2] < extent[0] || extent[3] < extent[1];
|
return extent[2] < extent[0] || extent[3] < extent[1];
|
||||||
@@ -774,7 +775,7 @@ ol.extent.intersectsSegment = function(extent, start, end) {
|
|||||||
* [minX, minY, maxX, maxY] extent coordinates.
|
* [minX, minY, maxX, maxY] extent coordinates.
|
||||||
* @param {ol.Extent=} opt_extent Destination extent.
|
* @param {ol.Extent=} opt_extent Destination extent.
|
||||||
* @return {ol.Extent} Extent.
|
* @return {ol.Extent} Extent.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.extent.applyTransform = function(extent, transformFn, opt_extent) {
|
ol.extent.applyTransform = function(extent, transformFn, opt_extent) {
|
||||||
var coordinates = [
|
var coordinates = [
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ goog.require('ol.style.Style');
|
|||||||
* You may pass a Geometry object directly, or an object literal
|
* You may pass a Geometry object directly, or an object literal
|
||||||
* containing properties. If you pass an object literal, you may
|
* containing properties. If you pass an object literal, you may
|
||||||
* include a Geometry associated with a `geometry` key.
|
* include a Geometry associated with a `geometry` key.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Feature = function(opt_geometryOrProperties) {
|
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
|
* Clone this feature. If the original feature has a geometry it
|
||||||
* is also cloned. The feature id is not set in the clone.
|
* is also cloned. The feature id is not set in the clone.
|
||||||
* @return {ol.Feature} The clone.
|
* @return {ol.Feature} The clone.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Feature.prototype.clone = function() {
|
ol.Feature.prototype.clone = function() {
|
||||||
var clone = new ol.Feature(this.getProperties());
|
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
|
* geometries. The "default" geometry (the one that is rendered by default) is
|
||||||
* set when calling {@link ol.Feature#setGeometry}.
|
* set when calling {@link ol.Feature#setGeometry}.
|
||||||
* @return {ol.geom.Geometry|undefined} The default geometry for the feature.
|
* @return {ol.geom.Geometry|undefined} The default geometry for the feature.
|
||||||
* @api
|
* @api stable
|
||||||
* @observable
|
* @observable
|
||||||
*/
|
*/
|
||||||
ol.Feature.prototype.getGeometry = function() {
|
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
|
* is either set when reading data from a remote source or set explicitly by
|
||||||
* calling {@link ol.Feature#setId}.
|
* calling {@link ol.Feature#setId}.
|
||||||
* @return {number|string|undefined} Id.
|
* @return {number|string|undefined} Id.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Feature.prototype.getId = function() {
|
ol.Feature.prototype.getId = function() {
|
||||||
return this.id_;
|
return this.id_;
|
||||||
@@ -161,7 +161,7 @@ ol.Feature.prototype.getId = function() {
|
|||||||
* geometry is named `geometry`.
|
* geometry is named `geometry`.
|
||||||
* @return {string} Get the property name associated with the default geometry
|
* @return {string} Get the property name associated with the default geometry
|
||||||
* for this feature.
|
* for this feature.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Feature.prototype.getGeometryName = function() {
|
ol.Feature.prototype.getGeometryName = function() {
|
||||||
return this.geometryName_;
|
return this.geometryName_;
|
||||||
@@ -173,7 +173,7 @@ ol.Feature.prototype.getGeometryName = function() {
|
|||||||
* {@link ol.Feature#setStyle} method.
|
* {@link ol.Feature#setStyle} method.
|
||||||
* @return {ol.style.Style|Array.<ol.style.Style>|
|
* @return {ol.style.Style|Array.<ol.style.Style>|
|
||||||
* ol.FeatureStyleFunction|ol.StyleFunction} The feature style.
|
* ol.FeatureStyleFunction|ol.StyleFunction} The feature style.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Feature.prototype.getStyle = function() {
|
ol.Feature.prototype.getStyle = function() {
|
||||||
return this.style_;
|
return this.style_;
|
||||||
@@ -184,7 +184,7 @@ ol.Feature.prototype.getStyle = function() {
|
|||||||
* Get the feature's style function.
|
* Get the feature's style function.
|
||||||
* @return {ol.FeatureStyleFunction|undefined} Return a function
|
* @return {ol.FeatureStyleFunction|undefined} Return a function
|
||||||
* representing the current style of this feature.
|
* representing the current style of this feature.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Feature.prototype.getStyleFunction = function() {
|
ol.Feature.prototype.getStyleFunction = function() {
|
||||||
return this.styleFunction_;
|
return this.styleFunction_;
|
||||||
@@ -220,7 +220,7 @@ ol.Feature.prototype.handleGeometryChanged_ = function() {
|
|||||||
* Set the default geometry for the feature. This will update the property
|
* Set the default geometry for the feature. This will update the property
|
||||||
* with the name returned by {@link ol.Feature#getGeometryName}.
|
* with the name returned by {@link ol.Feature#getGeometryName}.
|
||||||
* @param {ol.geom.Geometry|undefined} geometry The new geometry.
|
* @param {ol.geom.Geometry|undefined} geometry The new geometry.
|
||||||
* @api
|
* @api stable
|
||||||
* @observable
|
* @observable
|
||||||
*/
|
*/
|
||||||
ol.Feature.prototype.setGeometry = function(geometry) {
|
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).
|
* styles. If it is `null` the feature has no style (a `null` style).
|
||||||
* @param {ol.style.Style|Array.<ol.style.Style>|
|
* @param {ol.style.Style|Array.<ol.style.Style>|
|
||||||
* ol.FeatureStyleFunction|ol.StyleFunction} style Style for this feature.
|
* ol.FeatureStyleFunction|ol.StyleFunction} style Style for this feature.
|
||||||
* @api
|
* @api stable
|
||||||
* @fires ol.events.Event#event:change
|
* @fires ol.events.Event#event:change
|
||||||
*/
|
*/
|
||||||
ol.Feature.prototype.setStyle = function(style) {
|
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}
|
* The feature id can be used with the {@link ol.source.Vector#getFeatureById}
|
||||||
* method.
|
* method.
|
||||||
* @param {number|string|undefined} id The feature id.
|
* @param {number|string|undefined} id The feature id.
|
||||||
* @api
|
* @api stable
|
||||||
* @fires ol.events.Event#event:change
|
* @fires ol.events.Event#event:change
|
||||||
*/
|
*/
|
||||||
ol.Feature.prototype.setId = function(id) {
|
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
|
* When calling {@link ol.Feature#getGeometry}, the value of the property with
|
||||||
* this name will be returned.
|
* this name will be returned.
|
||||||
* @param {string} name The property name of the default geometry.
|
* @param {string} name The property name of the default geometry.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Feature.prototype.setGeometryName = function(name) {
|
ol.Feature.prototype.setGeometryName = function(name) {
|
||||||
ol.events.unlisten(
|
ol.events.unlisten(
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ goog.require('ol.proj');
|
|||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @abstract
|
* @abstract
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.Feature = function() {
|
ol.format.Feature = function() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
goog.provide('ol.format.filter');
|
goog.provide('ol.format.filter');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.format.filter.And');
|
goog.require('ol.format.filter.And');
|
||||||
goog.require('ol.format.filter.Bbox');
|
goog.require('ol.format.filter.Bbox');
|
||||||
goog.require('ol.format.filter.EqualTo');
|
goog.require('ol.format.filter.EqualTo');
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
goog.provide('ol.format.filter.Filter');
|
goog.provide('ol.format.filter.Filter');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ goog.require('ol.proj');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.format.JSONFeature}
|
* @extends {ol.format.JSONFeature}
|
||||||
* @param {olx.format.GeoJSONOptions=} opt_options Options.
|
* @param {olx.format.GeoJSONOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GeoJSON = function(opt_options) {
|
ol.format.GeoJSON = function(opt_options) {
|
||||||
|
|
||||||
@@ -335,7 +335,7 @@ ol.format.GeoJSON.GEOMETRY_WRITERS_ = {
|
|||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.Feature} Feature.
|
* @return {ol.Feature} Feature.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GeoJSON.prototype.readFeature;
|
ol.format.GeoJSON.prototype.readFeature;
|
||||||
|
|
||||||
@@ -349,7 +349,7 @@ ol.format.GeoJSON.prototype.readFeature;
|
|||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {Array.<ol.Feature>} Features.
|
* @return {Array.<ol.Feature>} Features.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GeoJSON.prototype.readFeatures;
|
ol.format.GeoJSON.prototype.readFeatures;
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ ol.format.GeoJSON.prototype.readFeaturesFromObject = function(
|
|||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {ol.geom.Geometry} Geometry.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GeoJSON.prototype.readGeometry;
|
ol.format.GeoJSON.prototype.readGeometry;
|
||||||
|
|
||||||
@@ -441,7 +441,7 @@ ol.format.GeoJSON.prototype.readGeometryFromObject = function(
|
|||||||
* @function
|
* @function
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @return {ol.proj.Projection} Projection.
|
* @return {ol.proj.Projection} Projection.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GeoJSON.prototype.readProjection;
|
ol.format.GeoJSON.prototype.readProjection;
|
||||||
|
|
||||||
@@ -480,7 +480,7 @@ ol.format.GeoJSON.prototype.readProjectionFromObject = function(object) {
|
|||||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||||
* @return {string} GeoJSON.
|
* @return {string} GeoJSON.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GeoJSON.prototype.writeFeature;
|
ol.format.GeoJSON.prototype.writeFeature;
|
||||||
|
|
||||||
@@ -492,7 +492,7 @@ ol.format.GeoJSON.prototype.writeFeature;
|
|||||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONFeature} Object.
|
* @return {GeoJSONFeature} Object.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GeoJSON.prototype.writeFeatureObject = function(feature, opt_options) {
|
ol.format.GeoJSON.prototype.writeFeatureObject = function(feature, opt_options) {
|
||||||
opt_options = this.adaptOptions(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 {Array.<ol.Feature>} features Features.
|
||||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||||
* @return {string} GeoJSON.
|
* @return {string} GeoJSON.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GeoJSON.prototype.writeFeatures;
|
ol.format.GeoJSON.prototype.writeFeatures;
|
||||||
|
|
||||||
@@ -541,7 +541,7 @@ ol.format.GeoJSON.prototype.writeFeatures;
|
|||||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONFeatureCollection} GeoJSON Object.
|
* @return {GeoJSONFeatureCollection} GeoJSON Object.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GeoJSON.prototype.writeFeaturesObject = function(features, opt_options) {
|
ol.format.GeoJSON.prototype.writeFeaturesObject = function(features, opt_options) {
|
||||||
opt_options = this.adaptOptions(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 {ol.geom.Geometry} geometry Geometry.
|
||||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||||
* @return {string} GeoJSON.
|
* @return {string} GeoJSON.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GeoJSON.prototype.writeGeometry;
|
ol.format.GeoJSON.prototype.writeGeometry;
|
||||||
|
|
||||||
@@ -576,7 +576,7 @@ ol.format.GeoJSON.prototype.writeGeometry;
|
|||||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} Object.
|
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} Object.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GeoJSON.prototype.writeGeometryObject = function(geometry,
|
ol.format.GeoJSON.prototype.writeGeometryObject = function(geometry,
|
||||||
opt_options) {
|
opt_options) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ goog.require('ol.format.GML3');
|
|||||||
* @param {olx.format.GMLOptions=} opt_options
|
* @param {olx.format.GMLOptions=} opt_options
|
||||||
* Optional configuration object.
|
* Optional configuration object.
|
||||||
* @extends {ol.format.GMLBase}
|
* @extends {ol.format.GMLBase}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GML = ol.format.GML3;
|
ol.format.GML = ol.format.GML3;
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ ol.format.GML = ol.format.GML3;
|
|||||||
* @param {Array.<ol.Feature>} features Features.
|
* @param {Array.<ol.Feature>} features Features.
|
||||||
* @param {olx.format.WriteOptions=} opt_options Options.
|
* @param {olx.format.WriteOptions=} opt_options Options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GML.prototype.writeFeatures;
|
ol.format.GML.prototype.writeFeatures;
|
||||||
|
|
||||||
|
|||||||
@@ -1186,7 +1186,7 @@ ol.format.GML3.prototype.writeGeometryNode = function(geometry, opt_options) {
|
|||||||
* @param {Array.<ol.Feature>} features Features.
|
* @param {Array.<ol.Feature>} features Features.
|
||||||
* @param {olx.format.WriteOptions=} opt_options Options.
|
* @param {olx.format.WriteOptions=} opt_options Options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GML3.prototype.writeFeatures;
|
ol.format.GML3.prototype.writeFeatures;
|
||||||
|
|
||||||
|
|||||||
@@ -564,7 +564,7 @@ ol.format.GMLBase.prototype.readGeometryFromNode = function(node, opt_options) {
|
|||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Options.
|
* @param {olx.format.ReadOptions=} opt_options Options.
|
||||||
* @return {Array.<ol.Feature>} Features.
|
* @return {Array.<ol.Feature>} Features.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GMLBase.prototype.readFeatures;
|
ol.format.GMLBase.prototype.readFeatures;
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ goog.require('ol.xml');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.format.XMLFeature}
|
* @extends {ol.format.XMLFeature}
|
||||||
* @param {olx.format.GPXOptions=} opt_options Options.
|
* @param {olx.format.GPXOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GPX = function(opt_options) {
|
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 {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.Feature} Feature.
|
* @return {ol.Feature} Feature.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.prototype.readFeature;
|
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 {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {Array.<ol.Feature>} Features.
|
* @return {Array.<ol.Feature>} Features.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.prototype.readFeatures;
|
ol.format.GPX.prototype.readFeatures;
|
||||||
|
|
||||||
@@ -546,7 +546,7 @@ ol.format.GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
|
|||||||
* @function
|
* @function
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @return {ol.proj.Projection} Projection.
|
* @return {ol.proj.Projection} Projection.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.prototype.readProjection;
|
ol.format.GPX.prototype.readProjection;
|
||||||
|
|
||||||
@@ -913,7 +913,7 @@ ol.format.GPX.GPX_SERIALIZERS_ = ol.xml.makeStructureNS(
|
|||||||
* @param {Array.<ol.Feature>} features Features.
|
* @param {Array.<ol.Feature>} features Features.
|
||||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.prototype.writeFeatures;
|
ol.format.GPX.prototype.writeFeatures;
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ goog.require('ol.xml');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.format.XMLFeature}
|
* @extends {ol.format.XMLFeature}
|
||||||
* @param {olx.format.KMLOptions=} opt_options Options.
|
* @param {olx.format.KMLOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.KML = function(opt_options) {
|
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 {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.Feature} Feature.
|
* @return {ol.Feature} Feature.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.KML.prototype.readFeature;
|
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 {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {Array.<ol.Feature>} Features.
|
* @return {Array.<ol.Feature>} Features.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.KML.prototype.readFeatures;
|
ol.format.KML.prototype.readFeatures;
|
||||||
|
|
||||||
@@ -1847,7 +1847,7 @@ ol.format.KML.prototype.readFeaturesFromNode = function(node, opt_options) {
|
|||||||
*
|
*
|
||||||
* @param {Document|Node|string} source Souce.
|
* @param {Document|Node|string} source Souce.
|
||||||
* @return {string|undefined} Name.
|
* @return {string|undefined} Name.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.KML.prototype.readName = function(source) {
|
ol.format.KML.prototype.readName = function(source) {
|
||||||
if (ol.xml.isDocument(source)) {
|
if (ol.xml.isDocument(source)) {
|
||||||
@@ -2047,7 +2047,7 @@ ol.format.KML.prototype.readRegionFromNode = function(node) {
|
|||||||
* @function
|
* @function
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @return {ol.proj.Projection} Projection.
|
* @return {ol.proj.Projection} Projection.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.KML.prototype.readProjection;
|
ol.format.KML.prototype.readProjection;
|
||||||
|
|
||||||
@@ -3006,7 +3006,7 @@ ol.format.KML.OUTER_BOUNDARY_NODE_FACTORY_ =
|
|||||||
* @param {Array.<ol.Feature>} features Features.
|
* @param {Array.<ol.Feature>} features Features.
|
||||||
* @param {olx.format.WriteOptions=} opt_options Options.
|
* @param {olx.format.WriteOptions=} opt_options Options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.KML.prototype.writeFeatures;
|
ol.format.KML.prototype.writeFeatures;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ goog.require('ol.xml');
|
|||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.format.XMLFeature}
|
* @extends {ol.format.XMLFeature}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.OSMXML = function() {
|
ol.format.OSMXML = function() {
|
||||||
ol.format.XMLFeature.call(this);
|
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 {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {Array.<ol.Feature>} Features.
|
* @return {Array.<ol.Feature>} Features.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.OSMXML.prototype.readFeatures;
|
ol.format.OSMXML.prototype.readFeatures;
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ ol.format.OSMXML.prototype.readFeaturesFromNode = function(node, opt_options) {
|
|||||||
* @function
|
* @function
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @return {ol.proj.Projection} Projection.
|
* @return {ol.proj.Projection} Projection.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.OSMXML.prototype.readProjection;
|
ol.format.OSMXML.prototype.readProjection;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ goog.require('ol.proj');
|
|||||||
* @extends {ol.format.TextFeature}
|
* @extends {ol.format.TextFeature}
|
||||||
* @param {olx.format.PolylineOptions=} opt_options
|
* @param {olx.format.PolylineOptions=} opt_options
|
||||||
* Optional configuration object.
|
* Optional configuration object.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.Polyline = function(opt_options) {
|
ol.format.Polyline = function(opt_options) {
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ ol.format.Polyline.encodeUnsignedInteger = function(num) {
|
|||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.Feature} Feature.
|
* @return {ol.Feature} Feature.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.Polyline.prototype.readFeature;
|
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 {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {Array.<ol.Feature>} Features.
|
* @return {Array.<ol.Feature>} Features.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.Polyline.prototype.readFeatures;
|
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 {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {ol.geom.Geometry} Geometry.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.Polyline.prototype.readGeometry;
|
ol.format.Polyline.prototype.readGeometry;
|
||||||
|
|
||||||
@@ -344,7 +344,7 @@ ol.format.Polyline.prototype.readGeometryFromText = function(text, opt_options)
|
|||||||
* @function
|
* @function
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @return {ol.proj.Projection} Projection.
|
* @return {ol.proj.Projection} Projection.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.Polyline.prototype.readProjection;
|
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 {ol.geom.Geometry} geometry Geometry.
|
||||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Geometry.
|
* @return {string} Geometry.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.Polyline.prototype.writeGeometry;
|
ol.format.Polyline.prototype.writeGeometry;
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ goog.require('ol.proj');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.format.JSONFeature}
|
* @extends {ol.format.JSONFeature}
|
||||||
* @param {olx.format.TopoJSONOptions=} opt_options Options.
|
* @param {olx.format.TopoJSONOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.TopoJSON = function(opt_options) {
|
ol.format.TopoJSON = function(opt_options) {
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@ ol.format.TopoJSON.readFeatureFromGeometry_ = function(object, arcs,
|
|||||||
* @function
|
* @function
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @return {Array.<ol.Feature>} Features.
|
* @return {Array.<ol.Feature>} Features.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.TopoJSON.prototype.readFeatures;
|
ol.format.TopoJSON.prototype.readFeatures;
|
||||||
|
|
||||||
@@ -369,7 +369,7 @@ ol.format.TopoJSON.transformVertex_ = function(vertex, scale, translate) {
|
|||||||
* @param {Document|Node|Object|string} object Source.
|
* @param {Document|Node|Object|string} object Source.
|
||||||
* @return {ol.proj.Projection} Projection.
|
* @return {ol.proj.Projection} Projection.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.TopoJSON.prototype.readProjection;
|
ol.format.TopoJSON.prototype.readProjection;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ goog.require('ol.xml');
|
|||||||
* @param {olx.format.WFSOptions=} opt_options
|
* @param {olx.format.WFSOptions=} opt_options
|
||||||
* Optional configuration object.
|
* Optional configuration object.
|
||||||
* @extends {ol.format.XMLFeature}
|
* @extends {ol.format.XMLFeature}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WFS = function(opt_options) {
|
ol.format.WFS = function(opt_options) {
|
||||||
var options = opt_options ? 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 {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {Array.<ol.Feature>} Features.
|
* @return {Array.<ol.Feature>} Features.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.readFeatures;
|
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.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
|
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.readTransactionResponse = function(source) {
|
ol.format.WFS.prototype.readTransactionResponse = function(source) {
|
||||||
if (ol.xml.isDocument(source)) {
|
if (ol.xml.isDocument(source)) {
|
||||||
@@ -160,7 +160,7 @@ ol.format.WFS.prototype.readTransactionResponse = function(source) {
|
|||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @return {ol.WFSFeatureCollectionMetadata|undefined}
|
* @return {ol.WFSFeatureCollectionMetadata|undefined}
|
||||||
* FeatureCollection metadata.
|
* FeatureCollection metadata.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.readFeatureCollectionMetadata = function(source) {
|
ol.format.WFS.prototype.readFeatureCollectionMetadata = function(source) {
|
||||||
if (ol.xml.isDocument(source)) {
|
if (ol.xml.isDocument(source)) {
|
||||||
@@ -778,7 +778,7 @@ ol.format.WFS.writeGetFeature_ = function(node, featureTypes, objectStack) {
|
|||||||
*
|
*
|
||||||
* @param {olx.format.WFSWriteGetFeatureOptions} options Options.
|
* @param {olx.format.WFSWriteGetFeatureOptions} options Options.
|
||||||
* @return {Node} Result.
|
* @return {Node} Result.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.writeGetFeature = function(options) {
|
ol.format.WFS.prototype.writeGetFeature = function(options) {
|
||||||
var node = ol.xml.createElementNS(ol.format.WFS.WFSNS, 'GetFeature');
|
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 {Array.<ol.Feature>} deletes The features to delete.
|
||||||
* @param {olx.format.WFSWriteTransactionOptions} options Write options.
|
* @param {olx.format.WFSWriteTransactionOptions} options Write options.
|
||||||
* @return {Node} Result.
|
* @return {Node} Result.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.writeTransaction = function(inserts, updates, deletes,
|
ol.format.WFS.prototype.writeTransaction = function(inserts, updates, deletes,
|
||||||
options) {
|
options) {
|
||||||
@@ -910,7 +910,7 @@ ol.format.WFS.prototype.writeTransaction = function(inserts, updates, deletes,
|
|||||||
* @function
|
* @function
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @return {?ol.proj.Projection} Projection.
|
* @return {?ol.proj.Projection} Projection.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.readProjection;
|
ol.format.WFS.prototype.readProjection;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ goog.require('ol.geom.SimpleGeometry');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.format.TextFeature}
|
* @extends {ol.format.TextFeature}
|
||||||
* @param {olx.format.WKTOptions=} opt_options Options.
|
* @param {olx.format.WKTOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WKT = function(opt_options) {
|
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 {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.Feature} Feature.
|
* @return {ol.Feature} Feature.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WKT.prototype.readFeature;
|
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 {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {Array.<ol.Feature>} Features.
|
* @return {Array.<ol.Feature>} Features.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WKT.prototype.readFeatures;
|
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 {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {ol.geom.Geometry} Geometry.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WKT.prototype.readGeometry;
|
ol.format.WKT.prototype.readGeometry;
|
||||||
|
|
||||||
@@ -344,7 +344,7 @@ ol.format.WKT.prototype.readGeometryFromText = function(text, opt_options) {
|
|||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||||
* @return {string} WKT string.
|
* @return {string} WKT string.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WKT.prototype.writeFeature;
|
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 {Array.<ol.Feature>} features Features.
|
||||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||||
* @return {string} WKT string.
|
* @return {string} WKT string.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WKT.prototype.writeFeatures;
|
ol.format.WKT.prototype.writeFeatures;
|
||||||
|
|
||||||
@@ -395,7 +395,7 @@ ol.format.WKT.prototype.writeFeaturesText = function(features, opt_options) {
|
|||||||
* @function
|
* @function
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {ol.geom.Geometry} geometry Geometry.
|
||||||
* @return {string} WKT string.
|
* @return {string} WKT string.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WKT.prototype.writeGeometry;
|
ol.format.WKT.prototype.writeGeometry;
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ ol.format.WMSGetFeatureInfo.prototype.readFeatures_ = function(node, objectStack
|
|||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @param {olx.format.ReadOptions=} opt_options Options.
|
* @param {olx.format.ReadOptions=} opt_options Options.
|
||||||
* @return {Array.<ol.Feature>} Features.
|
* @return {Array.<ol.Feature>} Features.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.WMSGetFeatureInfo.prototype.readFeatures;
|
ol.format.WMSGetFeatureInfo.prototype.readFeatures;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
goog.provide('ol.format.XSD');
|
goog.provide('ol.format.XSD');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.xml');
|
goog.require('ol.xml');
|
||||||
goog.require('ol.string');
|
goog.require('ol.string');
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ goog.require('ol.sphere.WGS84');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.Object}
|
* @extends {ol.Object}
|
||||||
* @param {olx.GeolocationOptions=} opt_options Options.
|
* @param {olx.GeolocationOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Geolocation = function(opt_options) {
|
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
|
* @return {number|undefined} The accuracy of the position measurement in
|
||||||
* meters.
|
* meters.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Geolocation.prototype.getAccuracy = function() {
|
ol.Geolocation.prototype.getAccuracy = function() {
|
||||||
return /** @type {number|undefined} */ (
|
return /** @type {number|undefined} */ (
|
||||||
@@ -194,7 +194,7 @@ ol.Geolocation.prototype.getAccuracy = function() {
|
|||||||
* Get a geometry of the position accuracy.
|
* Get a geometry of the position accuracy.
|
||||||
* @return {?ol.geom.Geometry} A geometry of the position accuracy.
|
* @return {?ol.geom.Geometry} A geometry of the position accuracy.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Geolocation.prototype.getAccuracyGeometry = function() {
|
ol.Geolocation.prototype.getAccuracyGeometry = function() {
|
||||||
return /** @type {?ol.geom.Geometry} */ (
|
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
|
* @return {number|undefined} The altitude of the position in meters above mean
|
||||||
* sea level.
|
* sea level.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Geolocation.prototype.getAltitude = function() {
|
ol.Geolocation.prototype.getAltitude = function() {
|
||||||
return /** @type {number|undefined} */ (
|
return /** @type {number|undefined} */ (
|
||||||
@@ -220,7 +220,7 @@ ol.Geolocation.prototype.getAltitude = function() {
|
|||||||
* @return {number|undefined} The accuracy of the altitude measurement in
|
* @return {number|undefined} The accuracy of the altitude measurement in
|
||||||
* meters.
|
* meters.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Geolocation.prototype.getAltitudeAccuracy = function() {
|
ol.Geolocation.prototype.getAltitudeAccuracy = function() {
|
||||||
return /** @type {number|undefined} */ (
|
return /** @type {number|undefined} */ (
|
||||||
@@ -232,7 +232,7 @@ ol.Geolocation.prototype.getAltitudeAccuracy = function() {
|
|||||||
* Get the heading as radians clockwise from North.
|
* Get the heading as radians clockwise from North.
|
||||||
* @return {number|undefined} The heading of the device in radians from north.
|
* @return {number|undefined} The heading of the device in radians from north.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Geolocation.prototype.getHeading = function() {
|
ol.Geolocation.prototype.getHeading = function() {
|
||||||
return /** @type {number|undefined} */ (
|
return /** @type {number|undefined} */ (
|
||||||
@@ -245,7 +245,7 @@ ol.Geolocation.prototype.getHeading = function() {
|
|||||||
* @return {ol.Coordinate|undefined} The current position of the device reported
|
* @return {ol.Coordinate|undefined} The current position of the device reported
|
||||||
* in the current projection.
|
* in the current projection.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Geolocation.prototype.getPosition = function() {
|
ol.Geolocation.prototype.getPosition = function() {
|
||||||
return /** @type {ol.Coordinate|undefined} */ (
|
return /** @type {ol.Coordinate|undefined} */ (
|
||||||
@@ -258,7 +258,7 @@ ol.Geolocation.prototype.getPosition = function() {
|
|||||||
* @return {ol.proj.Projection|undefined} The projection the position is
|
* @return {ol.proj.Projection|undefined} The projection the position is
|
||||||
* reported in.
|
* reported in.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Geolocation.prototype.getProjection = function() {
|
ol.Geolocation.prototype.getProjection = function() {
|
||||||
return /** @type {ol.proj.Projection|undefined} */ (
|
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
|
* @return {number|undefined} The instantaneous speed of the device in meters
|
||||||
* per second.
|
* per second.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Geolocation.prototype.getSpeed = function() {
|
ol.Geolocation.prototype.getSpeed = function() {
|
||||||
return /** @type {number|undefined} */ (
|
return /** @type {number|undefined} */ (
|
||||||
@@ -283,7 +283,7 @@ ol.Geolocation.prototype.getSpeed = function() {
|
|||||||
* Determine if the device location is being tracked.
|
* Determine if the device location is being tracked.
|
||||||
* @return {boolean} The device location is being tracked.
|
* @return {boolean} The device location is being tracked.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Geolocation.prototype.getTracking = function() {
|
ol.Geolocation.prototype.getTracking = function() {
|
||||||
return /** @type {boolean} */ (
|
return /** @type {boolean} */ (
|
||||||
@@ -298,7 +298,7 @@ ol.Geolocation.prototype.getTracking = function() {
|
|||||||
* the [HTML5 Geolocation spec
|
* the [HTML5 Geolocation spec
|
||||||
* ](http://www.w3.org/TR/geolocation-API/#position_options_interface).
|
* ](http://www.w3.org/TR/geolocation-API/#position_options_interface).
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Geolocation.prototype.getTrackingOptions = function() {
|
ol.Geolocation.prototype.getTrackingOptions = function() {
|
||||||
return /** @type {GeolocationPositionOptions|undefined} */ (
|
return /** @type {GeolocationPositionOptions|undefined} */ (
|
||||||
@@ -311,7 +311,7 @@ ol.Geolocation.prototype.getTrackingOptions = function() {
|
|||||||
* @param {ol.proj.Projection} projection The projection the position is
|
* @param {ol.proj.Projection} projection The projection the position is
|
||||||
* reported in.
|
* reported in.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Geolocation.prototype.setProjection = function(projection) {
|
ol.Geolocation.prototype.setProjection = function(projection) {
|
||||||
this.set(ol.GeolocationProperty.PROJECTION, projection);
|
this.set(ol.GeolocationProperty.PROJECTION, projection);
|
||||||
@@ -322,7 +322,7 @@ ol.Geolocation.prototype.setProjection = function(projection) {
|
|||||||
* Enable or disable tracking.
|
* Enable or disable tracking.
|
||||||
* @param {boolean} tracking Enable tracking.
|
* @param {boolean} tracking Enable tracking.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Geolocation.prototype.setTracking = function(tracking) {
|
ol.Geolocation.prototype.setTracking = function(tracking) {
|
||||||
this.set(ol.GeolocationProperty.TRACKING, tracking);
|
this.set(ol.GeolocationProperty.TRACKING, tracking);
|
||||||
@@ -336,7 +336,7 @@ ol.Geolocation.prototype.setTracking = function(tracking) {
|
|||||||
* [HTML5 Geolocation spec
|
* [HTML5 Geolocation spec
|
||||||
* ](http://www.w3.org/TR/geolocation-API/#position_options_interface).
|
* ](http://www.w3.org/TR/geolocation-API/#position_options_interface).
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Geolocation.prototype.setTrackingOptions = function(options) {
|
ol.Geolocation.prototype.setTrackingOptions = function(options) {
|
||||||
this.set(ol.GeolocationProperty.TRACKING_OPTIONS, options);
|
this.set(ol.GeolocationProperty.TRACKING_OPTIONS, options);
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ ol.geom.Circle.prototype.getType = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Circle.prototype.intersectsExtent = function(extent) {
|
ol.geom.Circle.prototype.intersectsExtent = function(extent) {
|
||||||
var circleExtent = this.getExtent();
|
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
|
* @return {ol.geom.Circle} This geometry. Note that original geometry is
|
||||||
* modified in place.
|
* modified in place.
|
||||||
* @function
|
* @function
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Circle.prototype.transform;
|
ol.geom.Circle.prototype.transform;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
goog.provide('ol.geom.flat.closest');
|
goog.provide('ol.geom.flat.closest');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.math');
|
goog.require('ol.math');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
goog.provide('ol.geom.flat.contains');
|
goog.provide('ol.geom.flat.contains');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
goog.provide('ol.geom.flat.deflate');
|
goog.provide('ol.geom.flat.deflate');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
goog.provide('ol.geom.flat.geodesic');
|
goog.provide('ol.geom.flat.geodesic');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.math');
|
goog.require('ol.math');
|
||||||
goog.require('ol.proj');
|
goog.require('ol.proj');
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
goog.provide('ol.geom.flat.interiorpoint');
|
goog.provide('ol.geom.flat.interiorpoint');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.array');
|
goog.require('ol.array');
|
||||||
goog.require('ol.geom.flat.contains');
|
goog.require('ol.geom.flat.contains');
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
goog.provide('ol.geom.flat.interpolate');
|
goog.provide('ol.geom.flat.interpolate');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.array');
|
goog.require('ol.array');
|
||||||
goog.require('ol.math');
|
goog.require('ol.math');
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
goog.provide('ol.geom.flat.intersectsextent');
|
goog.provide('ol.geom.flat.intersectsextent');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.geom.flat.contains');
|
goog.require('ol.geom.flat.contains');
|
||||||
goog.require('ol.geom.flat.segments');
|
goog.require('ol.geom.flat.segments');
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
goog.provide('ol.geom.flat.orient');
|
goog.provide('ol.geom.flat.orient');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.geom.flat.reverse');
|
goog.require('ol.geom.flat.reverse');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ goog.require('ol.proj');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @abstract
|
* @abstract
|
||||||
* @extends {ol.Object}
|
* @extends {ol.Object}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Geometry = function() {
|
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} point Point.
|
||||||
* @param {ol.Coordinate=} opt_closestPoint Closest point.
|
* @param {ol.Coordinate=} opt_closestPoint Closest point.
|
||||||
* @return {ol.Coordinate} Closest point.
|
* @return {ol.Coordinate} Closest point.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Geometry.prototype.getClosestPoint = function(point, opt_closestPoint) {
|
ol.geom.Geometry.prototype.getClosestPoint = function(point, opt_closestPoint) {
|
||||||
var closestPoint = opt_closestPoint ? opt_closestPoint : [NaN, NaN];
|
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.
|
* Get the extent of the geometry.
|
||||||
* @param {ol.Extent=} opt_extent Extent.
|
* @param {ol.Extent=} opt_extent Extent.
|
||||||
* @return {ol.Extent} extent Extent.
|
* @return {ol.Extent} extent Extent.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Geometry.prototype.getExtent = function(opt_extent) {
|
ol.geom.Geometry.prototype.getExtent = function(opt_extent) {
|
||||||
if (this.extentRevision_ != this.getRevision()) {
|
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.
|
* string identifier or a {@link ol.proj.Projection} object.
|
||||||
* @return {ol.geom.Geometry} This geometry. Note that original geometry is
|
* @return {ol.geom.Geometry} This geometry. Note that original geometry is
|
||||||
* modified in place.
|
* modified in place.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Geometry.prototype.transform = function(source, destination) {
|
ol.geom.Geometry.prototype.transform = function(source, destination) {
|
||||||
this.applyTransform(ol.proj.getTransform(source, destination));
|
this.applyTransform(ol.proj.getTransform(source, destination));
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ goog.require('ol.obj');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.geom.Geometry}
|
* @extends {ol.geom.Geometry}
|
||||||
* @param {Array.<ol.geom.Geometry>=} opt_geometries Geometries.
|
* @param {Array.<ol.geom.Geometry>=} opt_geometries Geometries.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.GeometryCollection = function(opt_geometries) {
|
ol.geom.GeometryCollection = function(opt_geometries) {
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ ol.geom.GeometryCollection.prototype.listenGeometriesChange_ = function() {
|
|||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.GeometryCollection} Clone.
|
* @return {!ol.geom.GeometryCollection} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.GeometryCollection.prototype.clone = function() {
|
ol.geom.GeometryCollection.prototype.clone = function() {
|
||||||
var geometryCollection = new ol.geom.GeometryCollection(null);
|
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 the geometries that make up this geometry collection.
|
||||||
* @return {Array.<ol.geom.Geometry>} Geometries.
|
* @return {Array.<ol.geom.Geometry>} Geometries.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.GeometryCollection.prototype.getGeometries = function() {
|
ol.geom.GeometryCollection.prototype.getGeometries = function() {
|
||||||
return ol.geom.GeometryCollection.cloneGeometries_(this.geometries_);
|
return ol.geom.GeometryCollection.cloneGeometries_(this.geometries_);
|
||||||
@@ -202,7 +202,7 @@ ol.geom.GeometryCollection.prototype.getSimplifiedGeometry = function(squaredTol
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.GeometryCollection.prototype.getType = function() {
|
ol.geom.GeometryCollection.prototype.getType = function() {
|
||||||
return ol.geom.GeometryType.GEOMETRY_COLLECTION;
|
return ol.geom.GeometryType.GEOMETRY_COLLECTION;
|
||||||
@@ -211,7 +211,7 @@ ol.geom.GeometryCollection.prototype.getType = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.GeometryCollection.prototype.intersectsExtent = function(extent) {
|
ol.geom.GeometryCollection.prototype.intersectsExtent = function(extent) {
|
||||||
var geometries = this.geometries_;
|
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.
|
* Set the geometries that make up this geometry collection.
|
||||||
* @param {Array.<ol.geom.Geometry>} geometries Geometries.
|
* @param {Array.<ol.geom.Geometry>} geometries Geometries.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.GeometryCollection.prototype.setGeometries = function(geometries) {
|
ol.geom.GeometryCollection.prototype.setGeometries = function(geometries) {
|
||||||
this.setGeometriesArray(
|
this.setGeometriesArray(
|
||||||
@@ -287,7 +287,7 @@ ol.geom.GeometryCollection.prototype.setGeometriesArray = function(geometries) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.GeometryCollection.prototype.applyTransform = function(transformFn) {
|
ol.geom.GeometryCollection.prototype.applyTransform = function(transformFn) {
|
||||||
var geometries = this.geometries_;
|
var geometries = this.geometries_;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ goog.require('ol.geom.flat.simplify');
|
|||||||
* @extends {ol.geom.SimpleGeometry}
|
* @extends {ol.geom.SimpleGeometry}
|
||||||
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LinearRing = function(coordinates, opt_layout) {
|
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.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.LinearRing} Clone.
|
* @return {!ol.geom.LinearRing} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LinearRing.prototype.clone = function() {
|
ol.geom.LinearRing.prototype.clone = function() {
|
||||||
var linearRing = new ol.geom.LinearRing(null);
|
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 the area of the linear ring on projected plane.
|
||||||
* @return {number} Area (on projected plane).
|
* @return {number} Area (on projected plane).
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LinearRing.prototype.getArea = function() {
|
ol.geom.LinearRing.prototype.getArea = function() {
|
||||||
return ol.geom.flat.area.linearRing(
|
return ol.geom.flat.area.linearRing(
|
||||||
@@ -92,7 +92,7 @@ ol.geom.LinearRing.prototype.getArea = function() {
|
|||||||
* Return the coordinates of the linear ring.
|
* Return the coordinates of the linear ring.
|
||||||
* @return {Array.<ol.Coordinate>} Coordinates.
|
* @return {Array.<ol.Coordinate>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LinearRing.prototype.getCoordinates = function() {
|
ol.geom.LinearRing.prototype.getCoordinates = function() {
|
||||||
return ol.geom.flat.inflate.coordinates(
|
return ol.geom.flat.inflate.coordinates(
|
||||||
@@ -117,7 +117,7 @@ ol.geom.LinearRing.prototype.getSimplifiedGeometryInternal = function(squaredTol
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LinearRing.prototype.getType = function() {
|
ol.geom.LinearRing.prototype.getType = function() {
|
||||||
return ol.geom.GeometryType.LINEAR_RING;
|
return ol.geom.GeometryType.LINEAR_RING;
|
||||||
@@ -135,7 +135,7 @@ ol.geom.LinearRing.prototype.intersectsExtent = function(extent) {};
|
|||||||
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LinearRing.prototype.setCoordinates = function(coordinates, opt_layout) {
|
ol.geom.LinearRing.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||||
if (!coordinates) {
|
if (!coordinates) {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ goog.require('ol.geom.flat.simplify');
|
|||||||
* @extends {ol.geom.SimpleGeometry}
|
* @extends {ol.geom.SimpleGeometry}
|
||||||
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LineString = function(coordinates, opt_layout) {
|
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.
|
* Append the passed coordinate to the coordinates of the linestring.
|
||||||
* @param {ol.Coordinate} coordinate Coordinate.
|
* @param {ol.Coordinate} coordinate Coordinate.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LineString.prototype.appendCoordinate = function(coordinate) {
|
ol.geom.LineString.prototype.appendCoordinate = function(coordinate) {
|
||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
@@ -79,7 +79,7 @@ ol.geom.LineString.prototype.appendCoordinate = function(coordinate) {
|
|||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.LineString} Clone.
|
* @return {!ol.geom.LineString} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LineString.prototype.clone = function() {
|
ol.geom.LineString.prototype.clone = function() {
|
||||||
var lineString = new ol.geom.LineString(null);
|
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 {number} m M.
|
||||||
* @param {boolean=} opt_extrapolate Extrapolate. Default is `false`.
|
* @param {boolean=} opt_extrapolate Extrapolate. Default is `false`.
|
||||||
* @return {ol.Coordinate} Coordinate.
|
* @return {ol.Coordinate} Coordinate.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
|
ol.geom.LineString.prototype.getCoordinateAtM = function(m, opt_extrapolate) {
|
||||||
if (this.layout != ol.geom.GeometryLayout.XYM &&
|
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 the coordinates of the linestring.
|
||||||
* @return {Array.<ol.Coordinate>} Coordinates.
|
* @return {Array.<ol.Coordinate>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LineString.prototype.getCoordinates = function() {
|
ol.geom.LineString.prototype.getCoordinates = function() {
|
||||||
return ol.geom.flat.inflate.coordinates(
|
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 the length of the linestring on projected plane.
|
||||||
* @return {number} Length (on projected plane).
|
* @return {number} Length (on projected plane).
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LineString.prototype.getLength = function() {
|
ol.geom.LineString.prototype.getLength = function() {
|
||||||
return ol.geom.flat.length.lineString(
|
return ol.geom.flat.length.lineString(
|
||||||
@@ -220,7 +220,7 @@ ol.geom.LineString.prototype.getSimplifiedGeometryInternal = function(squaredTol
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LineString.prototype.getType = function() {
|
ol.geom.LineString.prototype.getType = function() {
|
||||||
return ol.geom.GeometryType.LINE_STRING;
|
return ol.geom.GeometryType.LINE_STRING;
|
||||||
@@ -229,7 +229,7 @@ ol.geom.LineString.prototype.getType = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LineString.prototype.intersectsExtent = function(extent) {
|
ol.geom.LineString.prototype.intersectsExtent = function(extent) {
|
||||||
return ol.geom.flat.intersectsextent.lineString(
|
return ol.geom.flat.intersectsextent.lineString(
|
||||||
@@ -243,7 +243,7 @@ ol.geom.LineString.prototype.intersectsExtent = function(extent) {
|
|||||||
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.LineString.prototype.setCoordinates = function(coordinates, opt_layout) {
|
ol.geom.LineString.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||||
if (!coordinates) {
|
if (!coordinates) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ goog.require('ol.geom.flat.simplify');
|
|||||||
* @extends {ol.geom.SimpleGeometry}
|
* @extends {ol.geom.SimpleGeometry}
|
||||||
* @param {Array.<Array.<ol.Coordinate>>} coordinates Coordinates.
|
* @param {Array.<Array.<ol.Coordinate>>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiLineString = function(coordinates, opt_layout) {
|
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.
|
* Append the passed linestring to the multilinestring.
|
||||||
* @param {ol.geom.LineString} lineString LineString.
|
* @param {ol.geom.LineString} lineString LineString.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiLineString.prototype.appendLineString = function(lineString) {
|
ol.geom.MultiLineString.prototype.appendLineString = function(lineString) {
|
||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
@@ -74,7 +74,7 @@ ol.geom.MultiLineString.prototype.appendLineString = function(lineString) {
|
|||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.MultiLineString} Clone.
|
* @return {!ol.geom.MultiLineString} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiLineString.prototype.clone = function() {
|
ol.geom.MultiLineString.prototype.clone = function() {
|
||||||
var multiLineString = new ol.geom.MultiLineString(null);
|
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_extrapolate Extrapolate. Default is `false`.
|
||||||
* @param {boolean=} opt_interpolate Interpolate. Default is `false`.
|
* @param {boolean=} opt_interpolate Interpolate. Default is `false`.
|
||||||
* @return {ol.Coordinate} Coordinate.
|
* @return {ol.Coordinate} Coordinate.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiLineString.prototype.getCoordinateAtM = function(m, opt_extrapolate, opt_interpolate) {
|
ol.geom.MultiLineString.prototype.getCoordinateAtM = function(m, opt_extrapolate, opt_interpolate) {
|
||||||
if ((this.layout != ol.geom.GeometryLayout.XYM &&
|
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 the coordinates of the multilinestring.
|
||||||
* @return {Array.<Array.<ol.Coordinate>>} Coordinates.
|
* @return {Array.<Array.<ol.Coordinate>>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiLineString.prototype.getCoordinates = function() {
|
ol.geom.MultiLineString.prototype.getCoordinates = function() {
|
||||||
return ol.geom.flat.inflate.coordinatess(
|
return ol.geom.flat.inflate.coordinatess(
|
||||||
@@ -162,7 +162,7 @@ ol.geom.MultiLineString.prototype.getEnds = function() {
|
|||||||
* Return the linestring at the specified index.
|
* Return the linestring at the specified index.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {ol.geom.LineString} LineString.
|
* @return {ol.geom.LineString} LineString.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiLineString.prototype.getLineString = function(index) {
|
ol.geom.MultiLineString.prototype.getLineString = function(index) {
|
||||||
if (index < 0 || this.ends_.length <= 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 the linestrings of this multilinestring.
|
||||||
* @return {Array.<ol.geom.LineString>} LineStrings.
|
* @return {Array.<ol.geom.LineString>} LineStrings.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiLineString.prototype.getLineStrings = function() {
|
ol.geom.MultiLineString.prototype.getLineStrings = function() {
|
||||||
var flatCoordinates = this.flatCoordinates;
|
var flatCoordinates = this.flatCoordinates;
|
||||||
@@ -238,7 +238,7 @@ ol.geom.MultiLineString.prototype.getSimplifiedGeometryInternal = function(squar
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiLineString.prototype.getType = function() {
|
ol.geom.MultiLineString.prototype.getType = function() {
|
||||||
return ol.geom.GeometryType.MULTI_LINE_STRING;
|
return ol.geom.GeometryType.MULTI_LINE_STRING;
|
||||||
@@ -247,7 +247,7 @@ ol.geom.MultiLineString.prototype.getType = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiLineString.prototype.intersectsExtent = function(extent) {
|
ol.geom.MultiLineString.prototype.intersectsExtent = function(extent) {
|
||||||
return ol.geom.flat.intersectsextent.lineStrings(
|
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 {Array.<Array.<ol.Coordinate>>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiLineString.prototype.setCoordinates = function(coordinates, opt_layout) {
|
ol.geom.MultiLineString.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||||
if (!coordinates) {
|
if (!coordinates) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ goog.require('ol.math');
|
|||||||
* @extends {ol.geom.SimpleGeometry}
|
* @extends {ol.geom.SimpleGeometry}
|
||||||
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPoint = function(coordinates, opt_layout) {
|
ol.geom.MultiPoint = function(coordinates, opt_layout) {
|
||||||
ol.geom.SimpleGeometry.call(this);
|
ol.geom.SimpleGeometry.call(this);
|
||||||
@@ -32,7 +32,7 @@ ol.inherits(ol.geom.MultiPoint, ol.geom.SimpleGeometry);
|
|||||||
/**
|
/**
|
||||||
* Append the passed point to this multipoint.
|
* Append the passed point to this multipoint.
|
||||||
* @param {ol.geom.Point} point Point.
|
* @param {ol.geom.Point} point Point.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPoint.prototype.appendPoint = function(point) {
|
ol.geom.MultiPoint.prototype.appendPoint = function(point) {
|
||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
@@ -48,7 +48,7 @@ ol.geom.MultiPoint.prototype.appendPoint = function(point) {
|
|||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.MultiPoint} Clone.
|
* @return {!ol.geom.MultiPoint} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPoint.prototype.clone = function() {
|
ol.geom.MultiPoint.prototype.clone = function() {
|
||||||
var multiPoint = new ol.geom.MultiPoint(null);
|
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 the coordinates of the multipoint.
|
||||||
* @return {Array.<ol.Coordinate>} Coordinates.
|
* @return {Array.<ol.Coordinate>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPoint.prototype.getCoordinates = function() {
|
ol.geom.MultiPoint.prototype.getCoordinates = function() {
|
||||||
return ol.geom.flat.inflate.coordinates(
|
return ol.geom.flat.inflate.coordinates(
|
||||||
@@ -99,7 +99,7 @@ ol.geom.MultiPoint.prototype.getCoordinates = function() {
|
|||||||
* Return the point at the specified index.
|
* Return the point at the specified index.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {ol.geom.Point} Point.
|
* @return {ol.geom.Point} Point.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPoint.prototype.getPoint = function(index) {
|
ol.geom.MultiPoint.prototype.getPoint = function(index) {
|
||||||
var n = !this.flatCoordinates ?
|
var n = !this.flatCoordinates ?
|
||||||
@@ -117,7 +117,7 @@ ol.geom.MultiPoint.prototype.getPoint = function(index) {
|
|||||||
/**
|
/**
|
||||||
* Return the points of this multipoint.
|
* Return the points of this multipoint.
|
||||||
* @return {Array.<ol.geom.Point>} Points.
|
* @return {Array.<ol.geom.Point>} Points.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPoint.prototype.getPoints = function() {
|
ol.geom.MultiPoint.prototype.getPoints = function() {
|
||||||
var flatCoordinates = this.flatCoordinates;
|
var flatCoordinates = this.flatCoordinates;
|
||||||
@@ -137,7 +137,7 @@ ol.geom.MultiPoint.prototype.getPoints = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPoint.prototype.getType = function() {
|
ol.geom.MultiPoint.prototype.getType = function() {
|
||||||
return ol.geom.GeometryType.MULTI_POINT;
|
return ol.geom.GeometryType.MULTI_POINT;
|
||||||
@@ -146,7 +146,7 @@ ol.geom.MultiPoint.prototype.getType = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPoint.prototype.intersectsExtent = function(extent) {
|
ol.geom.MultiPoint.prototype.intersectsExtent = function(extent) {
|
||||||
var flatCoordinates = this.flatCoordinates;
|
var flatCoordinates = this.flatCoordinates;
|
||||||
@@ -168,7 +168,7 @@ ol.geom.MultiPoint.prototype.intersectsExtent = function(extent) {
|
|||||||
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPoint.prototype.setCoordinates = function(coordinates, opt_layout) {
|
ol.geom.MultiPoint.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||||
if (!coordinates) {
|
if (!coordinates) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ goog.require('ol.geom.flat.simplify');
|
|||||||
* @extends {ol.geom.SimpleGeometry}
|
* @extends {ol.geom.SimpleGeometry}
|
||||||
* @param {Array.<Array.<Array.<ol.Coordinate>>>} coordinates Coordinates.
|
* @param {Array.<Array.<Array.<ol.Coordinate>>>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPolygon = function(coordinates, opt_layout) {
|
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.
|
* Append the passed polygon to this multipolygon.
|
||||||
* @param {ol.geom.Polygon} polygon Polygon.
|
* @param {ol.geom.Polygon} polygon Polygon.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) {
|
ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) {
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array.<number>} */
|
||||||
@@ -112,7 +112,7 @@ ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) {
|
|||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.MultiPolygon} Clone.
|
* @return {!ol.geom.MultiPolygon} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPolygon.prototype.clone = function() {
|
ol.geom.MultiPolygon.prototype.clone = function() {
|
||||||
var multiPolygon = new ol.geom.MultiPolygon(null);
|
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 the area of the multipolygon on projected plane.
|
||||||
* @return {number} Area (on projected plane).
|
* @return {number} Area (on projected plane).
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPolygon.prototype.getArea = function() {
|
ol.geom.MultiPolygon.prototype.getArea = function() {
|
||||||
return ol.geom.flat.area.linearRingss(
|
return ol.geom.flat.area.linearRingss(
|
||||||
@@ -180,7 +180,7 @@ ol.geom.MultiPolygon.prototype.getArea = function() {
|
|||||||
* constructed.
|
* constructed.
|
||||||
* @return {Array.<Array.<Array.<ol.Coordinate>>>} Coordinates.
|
* @return {Array.<Array.<Array.<ol.Coordinate>>>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPolygon.prototype.getCoordinates = function(opt_right) {
|
ol.geom.MultiPolygon.prototype.getCoordinates = function(opt_right) {
|
||||||
var flatCoordinates;
|
var flatCoordinates;
|
||||||
@@ -224,7 +224,7 @@ ol.geom.MultiPolygon.prototype.getFlatInteriorPoints = function() {
|
|||||||
/**
|
/**
|
||||||
* Return the interior points as {@link ol.geom.MultiPoint multipoint}.
|
* Return the interior points as {@link ol.geom.MultiPoint multipoint}.
|
||||||
* @return {ol.geom.MultiPoint} Interior points.
|
* @return {ol.geom.MultiPoint} Interior points.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPolygon.prototype.getInteriorPoints = function() {
|
ol.geom.MultiPolygon.prototype.getInteriorPoints = function() {
|
||||||
var interiorPoints = new ol.geom.MultiPoint(null);
|
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.
|
* Return the polygon at the specified index.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {ol.geom.Polygon} Polygon.
|
* @return {ol.geom.Polygon} Polygon.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPolygon.prototype.getPolygon = function(index) {
|
ol.geom.MultiPolygon.prototype.getPolygon = function(index) {
|
||||||
if (index < 0 || this.endss_.length <= 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 the polygons of this multipolygon.
|
||||||
* @return {Array.<ol.geom.Polygon>} Polygons.
|
* @return {Array.<ol.geom.Polygon>} Polygons.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPolygon.prototype.getPolygons = function() {
|
ol.geom.MultiPolygon.prototype.getPolygons = function() {
|
||||||
var layout = this.layout;
|
var layout = this.layout;
|
||||||
@@ -336,7 +336,7 @@ ol.geom.MultiPolygon.prototype.getPolygons = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPolygon.prototype.getType = function() {
|
ol.geom.MultiPolygon.prototype.getType = function() {
|
||||||
return ol.geom.GeometryType.MULTI_POLYGON;
|
return ol.geom.GeometryType.MULTI_POLYGON;
|
||||||
@@ -345,7 +345,7 @@ ol.geom.MultiPolygon.prototype.getType = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPolygon.prototype.intersectsExtent = function(extent) {
|
ol.geom.MultiPolygon.prototype.intersectsExtent = function(extent) {
|
||||||
return ol.geom.flat.intersectsextent.linearRingss(
|
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 {Array.<Array.<Array.<ol.Coordinate>>>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.MultiPolygon.prototype.setCoordinates = function(coordinates, opt_layout) {
|
ol.geom.MultiPolygon.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||||
if (!coordinates) {
|
if (!coordinates) {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ goog.require('ol.math');
|
|||||||
* @extends {ol.geom.SimpleGeometry}
|
* @extends {ol.geom.SimpleGeometry}
|
||||||
* @param {ol.Coordinate} coordinates Coordinates.
|
* @param {ol.Coordinate} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Point = function(coordinates, opt_layout) {
|
ol.geom.Point = function(coordinates, opt_layout) {
|
||||||
ol.geom.SimpleGeometry.call(this);
|
ol.geom.SimpleGeometry.call(this);
|
||||||
@@ -30,7 +30,7 @@ ol.inherits(ol.geom.Point, ol.geom.SimpleGeometry);
|
|||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.Point} Clone.
|
* @return {!ol.geom.Point} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Point.prototype.clone = function() {
|
ol.geom.Point.prototype.clone = function() {
|
||||||
var point = new ol.geom.Point(null);
|
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 the coordinate of the point.
|
||||||
* @return {ol.Coordinate} Coordinates.
|
* @return {ol.Coordinate} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Point.prototype.getCoordinates = function() {
|
ol.geom.Point.prototype.getCoordinates = function() {
|
||||||
return !this.flatCoordinates ? [] : this.flatCoordinates.slice();
|
return !this.flatCoordinates ? [] : this.flatCoordinates.slice();
|
||||||
@@ -81,7 +81,7 @@ ol.geom.Point.prototype.computeExtent = function(extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Point.prototype.getType = function() {
|
ol.geom.Point.prototype.getType = function() {
|
||||||
return ol.geom.GeometryType.POINT;
|
return ol.geom.GeometryType.POINT;
|
||||||
@@ -90,7 +90,7 @@ ol.geom.Point.prototype.getType = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Point.prototype.intersectsExtent = function(extent) {
|
ol.geom.Point.prototype.intersectsExtent = function(extent) {
|
||||||
return ol.extent.containsXY(extent,
|
return ol.extent.containsXY(extent,
|
||||||
@@ -100,7 +100,7 @@ ol.geom.Point.prototype.intersectsExtent = function(extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Point.prototype.setCoordinates = function(coordinates, opt_layout) {
|
ol.geom.Point.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||||
if (!coordinates) {
|
if (!coordinates) {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ goog.require('ol.math');
|
|||||||
* is an array of vertices' coordinates where the first coordinate and the
|
* is an array of vertices' coordinates where the first coordinate and the
|
||||||
* last are equivalent.
|
* last are equivalent.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon = function(coordinates, opt_layout) {
|
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.
|
* Append the passed linear ring to this polygon.
|
||||||
* @param {ol.geom.LinearRing} linearRing Linear ring.
|
* @param {ol.geom.LinearRing} linearRing Linear ring.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.prototype.appendLinearRing = function(linearRing) {
|
ol.geom.Polygon.prototype.appendLinearRing = function(linearRing) {
|
||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
@@ -107,7 +107,7 @@ ol.geom.Polygon.prototype.appendLinearRing = function(linearRing) {
|
|||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.Polygon} Clone.
|
* @return {!ol.geom.Polygon} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.prototype.clone = function() {
|
ol.geom.Polygon.prototype.clone = function() {
|
||||||
var polygon = new ol.geom.Polygon(null);
|
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 the area of the polygon on projected plane.
|
||||||
* @return {number} Area (on projected plane).
|
* @return {number} Area (on projected plane).
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.prototype.getArea = function() {
|
ol.geom.Polygon.prototype.getArea = function() {
|
||||||
return ol.geom.flat.area.linearRings(
|
return ol.geom.flat.area.linearRings(
|
||||||
@@ -168,7 +168,7 @@ ol.geom.Polygon.prototype.getArea = function() {
|
|||||||
* constructed.
|
* constructed.
|
||||||
* @return {Array.<Array.<ol.Coordinate>>} Coordinates.
|
* @return {Array.<Array.<ol.Coordinate>>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.prototype.getCoordinates = function(opt_right) {
|
ol.geom.Polygon.prototype.getCoordinates = function(opt_right) {
|
||||||
var flatCoordinates;
|
var flatCoordinates;
|
||||||
@@ -211,7 +211,7 @@ ol.geom.Polygon.prototype.getFlatInteriorPoint = function() {
|
|||||||
/**
|
/**
|
||||||
* Return an interior point of the polygon.
|
* Return an interior point of the polygon.
|
||||||
* @return {ol.geom.Point} Interior point.
|
* @return {ol.geom.Point} Interior point.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.prototype.getInteriorPoint = function() {
|
ol.geom.Polygon.prototype.getInteriorPoint = function() {
|
||||||
return new ol.geom.Point(this.getFlatInteriorPoint());
|
return new ol.geom.Point(this.getFlatInteriorPoint());
|
||||||
@@ -238,7 +238,7 @@ ol.geom.Polygon.prototype.getLinearRingCount = function() {
|
|||||||
*
|
*
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {ol.geom.LinearRing} Linear ring.
|
* @return {ol.geom.LinearRing} Linear ring.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.prototype.getLinearRing = function(index) {
|
ol.geom.Polygon.prototype.getLinearRing = function(index) {
|
||||||
if (index < 0 || this.ends_.length <= 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 the linear rings of the polygon.
|
||||||
* @return {Array.<ol.geom.LinearRing>} Linear rings.
|
* @return {Array.<ol.geom.LinearRing>} Linear rings.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.prototype.getLinearRings = function() {
|
ol.geom.Polygon.prototype.getLinearRings = function() {
|
||||||
var layout = this.layout;
|
var layout = this.layout;
|
||||||
@@ -314,7 +314,7 @@ ol.geom.Polygon.prototype.getSimplifiedGeometryInternal = function(squaredTolera
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.prototype.getType = function() {
|
ol.geom.Polygon.prototype.getType = function() {
|
||||||
return ol.geom.GeometryType.POLYGON;
|
return ol.geom.GeometryType.POLYGON;
|
||||||
@@ -323,7 +323,7 @@ ol.geom.Polygon.prototype.getType = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.prototype.intersectsExtent = function(extent) {
|
ol.geom.Polygon.prototype.intersectsExtent = function(extent) {
|
||||||
return ol.geom.flat.intersectsextent.linearRings(
|
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 {Array.<Array.<ol.Coordinate>>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.prototype.setCoordinates = function(coordinates, opt_layout) {
|
ol.geom.Polygon.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||||
if (!coordinates) {
|
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
|
* @param {number=} opt_n Optional number of vertices for the resulting
|
||||||
* polygon. Default is `32`.
|
* polygon. Default is `32`.
|
||||||
* @return {ol.geom.Polygon} The "circular" polygon.
|
* @return {ol.geom.Polygon} The "circular" polygon.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.Polygon.circular = function(sphere, center, radius, opt_n) {
|
ol.geom.Polygon.circular = function(sphere, center, radius, opt_n) {
|
||||||
var n = opt_n ? opt_n : 32;
|
var n = opt_n ? opt_n : 32;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ goog.require('ol.obj');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @abstract
|
* @abstract
|
||||||
* @extends {ol.geom.Geometry}
|
* @extends {ol.geom.Geometry}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.SimpleGeometry = function() {
|
ol.geom.SimpleGeometry = function() {
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ ol.geom.SimpleGeometry.prototype.getCoordinates = function() {};
|
|||||||
/**
|
/**
|
||||||
* Return the first coordinate of the geometry.
|
* Return the first coordinate of the geometry.
|
||||||
* @return {ol.Coordinate} First coordinate.
|
* @return {ol.Coordinate} First coordinate.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.SimpleGeometry.prototype.getFirstCoordinate = function() {
|
ol.geom.SimpleGeometry.prototype.getFirstCoordinate = function() {
|
||||||
return this.flatCoordinates.slice(0, this.stride);
|
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 the last coordinate of the geometry.
|
||||||
* @return {ol.Coordinate} Last point.
|
* @return {ol.Coordinate} Last point.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.SimpleGeometry.prototype.getLastCoordinate = function() {
|
ol.geom.SimpleGeometry.prototype.getLastCoordinate = function() {
|
||||||
return this.flatCoordinates.slice(this.flatCoordinates.length - this.stride);
|
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 the {@link ol.geom.GeometryLayout layout} of the geometry.
|
||||||
* @return {ol.geom.GeometryLayout} Layout.
|
* @return {ol.geom.GeometryLayout} Layout.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.SimpleGeometry.prototype.getLayout = function() {
|
ol.geom.SimpleGeometry.prototype.getLayout = function() {
|
||||||
return this.layout;
|
return this.layout;
|
||||||
@@ -251,7 +251,7 @@ ol.geom.SimpleGeometry.prototype.setLayout = function(layout, coordinates, nesti
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.SimpleGeometry.prototype.applyTransform = function(transformFn) {
|
ol.geom.SimpleGeometry.prototype.applyTransform = function(transformFn) {
|
||||||
if (this.flatCoordinates) {
|
if (this.flatCoordinates) {
|
||||||
@@ -303,7 +303,7 @@ ol.geom.SimpleGeometry.prototype.scale = function(sx, opt_sy, opt_anchor) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.geom.SimpleGeometry.prototype.translate = function(deltaX, deltaY) {
|
ol.geom.SimpleGeometry.prototype.translate = function(deltaX, deltaY) {
|
||||||
var flatCoordinates = this.getFlatCoordinates();
|
var flatCoordinates = this.getFlatCoordinates();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
goog.provide('ol.Graticule');
|
goog.provide('ol.Graticule');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
goog.require('ol.geom.GeometryLayout');
|
goog.require('ol.geom.GeometryLayout');
|
||||||
goog.require('ol.geom.LineString');
|
goog.require('ol.geom.LineString');
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ ol.has.MAC = ua.indexOf('macintosh') !== -1;
|
|||||||
* (dips) on the device (`window.devicePixelRatio`).
|
* (dips) on the device (`window.devicePixelRatio`).
|
||||||
* @const
|
* @const
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.has.DEVICE_PIXEL_RATIO = window.devicePixelRatio || 1;
|
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.
|
* if `ol.ENABLE_CANVAS` is set to `false` at compile time.
|
||||||
* @const
|
* @const
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.has.CANVAS = ol.ENABLE_CANVAS && (
|
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.
|
* Indicates if DeviceOrientation is supported in the user's browser.
|
||||||
* @const
|
* @const
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.has.DEVICE_ORIENTATION = 'DeviceOrientationEvent' in window;
|
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?
|
* Is HTML5 geolocation supported in the current browser?
|
||||||
* @const
|
* @const
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.has.GEOLOCATION = 'geolocation' in navigator;
|
ol.has.GEOLOCATION = 'geolocation' in navigator;
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ ol.has.GEOLOCATION = 'geolocation' in navigator;
|
|||||||
* True if browser supports touch events.
|
* True if browser supports touch events.
|
||||||
* @const
|
* @const
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.has.TOUCH = ol.ASSUME_TOUCH || 'ontouchstart' in window;
|
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.
|
* if `ol.ENABLE_WEBGL` is set to `false` at compile time.
|
||||||
* @const
|
* @const
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.has.WEBGL;
|
ol.has.WEBGL;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
goog.provide('ol.interaction');
|
goog.provide('ol.interaction');
|
||||||
|
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.Collection');
|
goog.require('ol.Collection');
|
||||||
goog.require('ol.Kinetic');
|
goog.require('ol.Kinetic');
|
||||||
goog.require('ol.interaction.DoubleClickZoom');
|
goog.require('ol.interaction.DoubleClickZoom');
|
||||||
@@ -34,7 +35,7 @@ goog.require('ol.interaction.PinchZoom');
|
|||||||
* @param {olx.interaction.DefaultsOptions=} opt_options Defaults options.
|
* @param {olx.interaction.DefaultsOptions=} opt_options Defaults options.
|
||||||
* @return {ol.Collection.<ol.interaction.Interaction>} A collection of
|
* @return {ol.Collection.<ol.interaction.Interaction>} A collection of
|
||||||
* interactions to be used with the ol.Map constructor's interactions option.
|
* interactions to be used with the ol.Map constructor's interactions option.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.defaults = function(opt_options) {
|
ol.interaction.defaults = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ goog.require('ol.interaction.Interaction');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.interaction.Interaction}
|
* @extends {ol.interaction.Interaction}
|
||||||
* @param {olx.interaction.DoubleClickZoomOptions=} opt_options Options.
|
* @param {olx.interaction.DoubleClickZoomOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.DoubleClickZoom = function(opt_options) {
|
ol.interaction.DoubleClickZoom = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ goog.require('ol.proj');
|
|||||||
* @extends {ol.interaction.Interaction}
|
* @extends {ol.interaction.Interaction}
|
||||||
* @fires ol.interaction.DragAndDrop.Event
|
* @fires ol.interaction.DragAndDrop.Event
|
||||||
* @param {olx.interaction.DragAndDropOptions=} opt_options Options.
|
* @param {olx.interaction.DragAndDropOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.DragAndDrop = function(opt_options) {
|
ol.interaction.DragAndDrop = function(opt_options) {
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ ol.interaction.DragAndDrop.EventType_ = {
|
|||||||
/**
|
/**
|
||||||
* Triggered when features are added
|
* Triggered when features are added
|
||||||
* @event ol.interaction.DragAndDrop.Event#addfeatures
|
* @event ol.interaction.DragAndDrop.Event#addfeatures
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ADD_FEATURES: 'addfeatures'
|
ADD_FEATURES: 'addfeatures'
|
||||||
};
|
};
|
||||||
@@ -215,14 +215,14 @@ ol.interaction.DragAndDrop.Event = function(type, file, opt_features, opt_projec
|
|||||||
/**
|
/**
|
||||||
* The features parsed from dropped data.
|
* The features parsed from dropped data.
|
||||||
* @type {Array.<ol.Feature>|undefined}
|
* @type {Array.<ol.Feature>|undefined}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
this.features = opt_features;
|
this.features = opt_features;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The dropped file.
|
* The dropped file.
|
||||||
* @type {File}
|
* @type {File}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
this.file = file;
|
this.file = file;
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ ol.DRAG_BOX_HYSTERESIS_PIXELS_SQUARED =
|
|||||||
* @extends {ol.interaction.Pointer}
|
* @extends {ol.interaction.Pointer}
|
||||||
* @fires ol.interaction.DragBox.Event
|
* @fires ol.interaction.DragBox.Event
|
||||||
* @param {olx.interaction.DragBoxOptions=} opt_options Options.
|
* @param {olx.interaction.DragBoxOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.DragBox = function(opt_options) {
|
ol.interaction.DragBox = function(opt_options) {
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ ol.interaction.DragBox.handleDragEvent_ = function(mapBrowserEvent) {
|
|||||||
/**
|
/**
|
||||||
* Returns geometry of last drawn box.
|
* Returns geometry of last drawn box.
|
||||||
* @return {ol.geom.Polygon} Geometry.
|
* @return {ol.geom.Polygon} Geometry.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.DragBox.prototype.getGeometry = function() {
|
ol.interaction.DragBox.prototype.getGeometry = function() {
|
||||||
return this.box_.getGeometry();
|
return this.box_.getGeometry();
|
||||||
@@ -183,7 +183,7 @@ ol.interaction.DragBox.EventType_ = {
|
|||||||
/**
|
/**
|
||||||
* Triggered upon drag box start.
|
* Triggered upon drag box start.
|
||||||
* @event ol.interaction.DragBox.Event#boxstart
|
* @event ol.interaction.DragBox.Event#boxstart
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
BOXSTART: 'boxstart',
|
BOXSTART: 'boxstart',
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ ol.interaction.DragBox.EventType_ = {
|
|||||||
/**
|
/**
|
||||||
* Triggered upon drag box end.
|
* Triggered upon drag box end.
|
||||||
* @event ol.interaction.DragBox.Event#boxend
|
* @event ol.interaction.DragBox.Event#boxend
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
BOXEND: 'boxend'
|
BOXEND: 'boxend'
|
||||||
};
|
};
|
||||||
@@ -222,7 +222,7 @@ ol.interaction.DragBox.Event = function(type, coordinate, mapBrowserEvent) {
|
|||||||
* The coordinate of the drag event.
|
* The coordinate of the drag event.
|
||||||
* @const
|
* @const
|
||||||
* @type {ol.Coordinate}
|
* @type {ol.Coordinate}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
this.coordinate = coordinate;
|
this.coordinate = coordinate;
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ goog.require('ol.interaction.Pointer');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.interaction.Pointer}
|
* @extends {ol.interaction.Pointer}
|
||||||
* @param {olx.interaction.DragPanOptions=} opt_options Options.
|
* @param {olx.interaction.DragPanOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.DragPan = function(opt_options) {
|
ol.interaction.DragPan = function(opt_options) {
|
||||||
|
|
||||||
@@ -112,11 +112,6 @@ ol.interaction.DragPan.handleUpEvent_ = function(mapBrowserEvent) {
|
|||||||
view.setHint(ol.ViewHint.INTERACTING, -1);
|
view.setHint(ol.ViewHint.INTERACTING, -1);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} 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;
|
this.lastCentroid = null;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ goog.require('ol.interaction.Pointer');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.interaction.Pointer}
|
* @extends {ol.interaction.Pointer}
|
||||||
* @param {olx.interaction.DragRotateOptions=} opt_options Options.
|
* @param {olx.interaction.DragRotateOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.DragRotate = function(opt_options) {
|
ol.interaction.DragRotate = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ goog.require('ol.interaction.Pointer');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.interaction.Pointer}
|
* @extends {ol.interaction.Pointer}
|
||||||
* @param {olx.interaction.DragRotateAndZoomOptions=} opt_options Options.
|
* @param {olx.interaction.DragRotateAndZoomOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.DragRotateAndZoom = function(opt_options) {
|
ol.interaction.DragRotateAndZoom = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ goog.require('ol.interaction.DragBox');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.interaction.DragBox}
|
* @extends {ol.interaction.DragBox}
|
||||||
* @param {olx.interaction.DragZoomOptions=} opt_options Options.
|
* @param {olx.interaction.DragZoomOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.DragZoom = function(opt_options) {
|
ol.interaction.DragZoom = function(opt_options) {
|
||||||
var options = opt_options ? opt_options : {};
|
var options = opt_options ? opt_options : {};
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ goog.require('ol.style.Style');
|
|||||||
* @extends {ol.interaction.Pointer}
|
* @extends {ol.interaction.Pointer}
|
||||||
* @fires ol.interaction.Draw.Event
|
* @fires ol.interaction.Draw.Event
|
||||||
* @param {olx.interaction.DrawOptions} options Options.
|
* @param {olx.interaction.DrawOptions} options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.Draw = function(options) {
|
ol.interaction.Draw = function(options) {
|
||||||
|
|
||||||
@@ -853,7 +853,7 @@ ol.interaction.Draw.Event = function(type, feature) {
|
|||||||
/**
|
/**
|
||||||
* The feature being drawn.
|
* The feature being drawn.
|
||||||
* @type {ol.Feature}
|
* @type {ol.Feature}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
this.feature = feature;
|
this.feature = feature;
|
||||||
|
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ ol.interaction.DrawEventType = {
|
|||||||
/**
|
/**
|
||||||
* Triggered upon feature draw start
|
* Triggered upon feature draw start
|
||||||
* @event ol.interaction.Draw.Event#drawstart
|
* @event ol.interaction.Draw.Event#drawstart
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
DRAWSTART: 'drawstart',
|
DRAWSTART: 'drawstart',
|
||||||
/**
|
/**
|
||||||
* Triggered upon feature draw end
|
* Triggered upon feature draw end
|
||||||
* @event ol.interaction.Draw.Event#drawend
|
* @event ol.interaction.Draw.Event#drawend
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
DRAWEND: 'drawend'
|
DRAWEND: 'drawend'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ goog.require('ol.interaction.Interaction');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.interaction.Interaction}
|
* @extends {ol.interaction.Interaction}
|
||||||
* @param {olx.interaction.KeyboardPanOptions=} opt_options Options.
|
* @param {olx.interaction.KeyboardPanOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.KeyboardPan = function(opt_options) {
|
ol.interaction.KeyboardPan = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ goog.require('ol.interaction.Interaction');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @param {olx.interaction.KeyboardZoomOptions=} opt_options Options.
|
* @param {olx.interaction.KeyboardZoomOptions=} opt_options Options.
|
||||||
* @extends {ol.interaction.Interaction}
|
* @extends {ol.interaction.Interaction}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.KeyboardZoom = function(opt_options) {
|
ol.interaction.KeyboardZoom = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,6 @@ ol.interaction.Modify = function(options) {
|
|||||||
'MultiPoint': this.writeMultiPointGeometry_,
|
'MultiPoint': this.writeMultiPointGeometry_,
|
||||||
'MultiLineString': this.writeMultiLineStringGeometry_,
|
'MultiLineString': this.writeMultiLineStringGeometry_,
|
||||||
'MultiPolygon': this.writeMultiPolygonGeometry_,
|
'MultiPolygon': this.writeMultiPolygonGeometry_,
|
||||||
'Circle': this.writeCircleGeometry_,
|
|
||||||
'GeometryCollection': this.writeGeometryCollectionGeometry_
|
'GeometryCollection': this.writeGeometryCollectionGeometry_
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -190,19 +189,6 @@ ol.interaction.Modify = function(options) {
|
|||||||
ol.inherits(ol.interaction.Modify, ol.interaction.Pointer);
|
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.
|
* @param {ol.Feature} feature Feature.
|
||||||
* @private
|
* @private
|
||||||
@@ -463,38 +449,6 @@ 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.Feature} feature Feature
|
||||||
* @param {ol.geom.GeometryCollection} geometry Geometry.
|
* @param {ol.geom.GeometryCollection} geometry Geometry.
|
||||||
@@ -572,15 +526,7 @@ ol.interaction.Modify.handleDownEvent_ = function(evt) {
|
|||||||
if (!componentSegments[uid]) {
|
if (!componentSegments[uid]) {
|
||||||
componentSegments[uid] = new Array(2);
|
componentSegments[uid] = new Array(2);
|
||||||
}
|
}
|
||||||
if (segmentDataMatch.geometry.getType() === ol.geom.GeometryType.CIRCLE &&
|
if (ol.coordinate.equals(segment[0], vertex) &&
|
||||||
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]) {
|
!componentSegments[uid][0]) {
|
||||||
this.dragSegments_.push([segmentDataMatch, 0]);
|
this.dragSegments_.push([segmentDataMatch, 0]);
|
||||||
componentSegments[uid][0] = segmentDataMatch;
|
componentSegments[uid][0] = segmentDataMatch;
|
||||||
@@ -630,7 +576,7 @@ ol.interaction.Modify.handleDragEvent_ = function(evt) {
|
|||||||
var segmentData = dragSegment[0];
|
var segmentData = dragSegment[0];
|
||||||
var depth = segmentData.depth;
|
var depth = segmentData.depth;
|
||||||
var geometry = segmentData.geometry;
|
var geometry = segmentData.geometry;
|
||||||
var coordinates;
|
var coordinates = geometry.getCoordinates();
|
||||||
var segment = segmentData.segment;
|
var segment = segmentData.segment;
|
||||||
var index = dragSegment[1];
|
var index = dragSegment[1];
|
||||||
|
|
||||||
@@ -644,49 +590,30 @@ ol.interaction.Modify.handleDragEvent_ = function(evt) {
|
|||||||
segment[0] = segment[1] = vertex;
|
segment[0] = segment[1] = vertex;
|
||||||
break;
|
break;
|
||||||
case ol.geom.GeometryType.MULTI_POINT:
|
case ol.geom.GeometryType.MULTI_POINT:
|
||||||
coordinates = geometry.getCoordinates();
|
|
||||||
coordinates[segmentData.index] = vertex;
|
coordinates[segmentData.index] = vertex;
|
||||||
segment[0] = segment[1] = vertex;
|
segment[0] = segment[1] = vertex;
|
||||||
break;
|
break;
|
||||||
case ol.geom.GeometryType.LINE_STRING:
|
case ol.geom.GeometryType.LINE_STRING:
|
||||||
coordinates = geometry.getCoordinates();
|
|
||||||
coordinates[segmentData.index + index] = vertex;
|
coordinates[segmentData.index + index] = vertex;
|
||||||
segment[index] = vertex;
|
segment[index] = vertex;
|
||||||
break;
|
break;
|
||||||
case ol.geom.GeometryType.MULTI_LINE_STRING:
|
case ol.geom.GeometryType.MULTI_LINE_STRING:
|
||||||
coordinates = geometry.getCoordinates();
|
|
||||||
coordinates[depth[0]][segmentData.index + index] = vertex;
|
coordinates[depth[0]][segmentData.index + index] = vertex;
|
||||||
segment[index] = vertex;
|
segment[index] = vertex;
|
||||||
break;
|
break;
|
||||||
case ol.geom.GeometryType.POLYGON:
|
case ol.geom.GeometryType.POLYGON:
|
||||||
coordinates = geometry.getCoordinates();
|
|
||||||
coordinates[depth[0]][segmentData.index + index] = vertex;
|
coordinates[depth[0]][segmentData.index + index] = vertex;
|
||||||
segment[index] = vertex;
|
segment[index] = vertex;
|
||||||
break;
|
break;
|
||||||
case ol.geom.GeometryType.MULTI_POLYGON:
|
case ol.geom.GeometryType.MULTI_POLYGON:
|
||||||
coordinates = geometry.getCoordinates();
|
|
||||||
coordinates[depth[1]][depth[0]][segmentData.index + index] = vertex;
|
coordinates[depth[1]][depth[0]][segmentData.index + index] = vertex;
|
||||||
segment[index] = vertex;
|
segment[index] = vertex;
|
||||||
break;
|
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:
|
default:
|
||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
|
|
||||||
if (coordinates) {
|
this.setGeometryCoordinates_(geometry, coordinates);
|
||||||
this.setGeometryCoordinates_(geometry, coordinates);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.createOrUpdateVertexFeature_(vertex);
|
this.createOrUpdateVertexFeature_(vertex);
|
||||||
};
|
};
|
||||||
@@ -700,23 +627,10 @@ ol.interaction.Modify.handleDragEvent_ = function(evt) {
|
|||||||
*/
|
*/
|
||||||
ol.interaction.Modify.handleUpEvent_ = function(evt) {
|
ol.interaction.Modify.handleUpEvent_ = function(evt) {
|
||||||
var segmentData;
|
var segmentData;
|
||||||
var geometry;
|
|
||||||
for (var i = this.dragSegments_.length - 1; i >= 0; --i) {
|
for (var i = this.dragSegments_.length - 1; i >= 0; --i) {
|
||||||
segmentData = this.dragSegments_[i][0];
|
segmentData = this.dragSegments_[i][0];
|
||||||
geometry = segmentData.geometry;
|
this.rBush_.update(ol.extent.boundingExtent(segmentData.segment),
|
||||||
if (geometry.getType() === ol.geom.GeometryType.CIRCLE) {
|
segmentData);
|
||||||
// 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_) {
|
if (this.modified_) {
|
||||||
this.dispatchEvent(new ol.interaction.Modify.Event(
|
this.dispatchEvent(new ol.interaction.Modify.Event(
|
||||||
@@ -783,8 +697,8 @@ ol.interaction.Modify.prototype.handlePointerMove_ = function(evt) {
|
|||||||
ol.interaction.Modify.prototype.handlePointerAtPixel_ = function(pixel, map) {
|
ol.interaction.Modify.prototype.handlePointerAtPixel_ = function(pixel, map) {
|
||||||
var pixelCoordinate = map.getCoordinateFromPixel(pixel);
|
var pixelCoordinate = map.getCoordinateFromPixel(pixel);
|
||||||
var sortByDistance = function(a, b) {
|
var sortByDistance = function(a, b) {
|
||||||
return ol.interaction.Modify.pointDistanceToSegmentDataSquared_(pixelCoordinate, a) -
|
return ol.coordinate.squaredDistanceToSegment(pixelCoordinate, a.segment) -
|
||||||
ol.interaction.Modify.pointDistanceToSegmentDataSquared_(pixelCoordinate, b);
|
ol.coordinate.squaredDistanceToSegment(pixelCoordinate, b.segment);
|
||||||
};
|
};
|
||||||
|
|
||||||
var box = ol.extent.buffer(
|
var box = ol.extent.buffer(
|
||||||
@@ -797,44 +711,36 @@ ol.interaction.Modify.prototype.handlePointerAtPixel_ = function(pixel, map) {
|
|||||||
nodes.sort(sortByDistance);
|
nodes.sort(sortByDistance);
|
||||||
var node = nodes[0];
|
var node = nodes[0];
|
||||||
var closestSegment = node.segment;
|
var closestSegment = node.segment;
|
||||||
var vertex = ol.interaction.Modify.closestOnSegmentData_(pixelCoordinate, node);
|
var vertex = (ol.coordinate.closestOnSegment(pixelCoordinate,
|
||||||
|
closestSegment));
|
||||||
var vertexPixel = map.getPixelFromCoordinate(vertex);
|
var vertexPixel = map.getPixelFromCoordinate(vertex);
|
||||||
var dist = ol.coordinate.distance(pixel, vertexPixel);
|
if (Math.sqrt(ol.coordinate.squaredDistance(pixel, vertexPixel)) <=
|
||||||
if (dist <= this.pixelTolerance_) {
|
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 vertexSegments = {};
|
var vertexSegments = {};
|
||||||
|
vertexSegments[ol.getUid(closestSegment)] = true;
|
||||||
if (node.geometry.getType() === ol.geom.GeometryType.CIRCLE &&
|
var segment;
|
||||||
node.index === ol.interaction.Modify.MODIFY_SEGMENT_CIRCLE_CIRCUMFERENCE_INDEX) {
|
for (var i = 1, ii = nodes.length; i < ii; ++i) {
|
||||||
|
segment = nodes[i].segment;
|
||||||
this.snappedToVertex_ = true;
|
if ((ol.coordinate.equals(closestSegment[0], segment[0]) &&
|
||||||
this.createOrUpdateVertexFeature_(vertex);
|
ol.coordinate.equals(closestSegment[1], segment[1]) ||
|
||||||
} else {
|
(ol.coordinate.equals(closestSegment[0], segment[1]) &&
|
||||||
var pixel1 = map.getPixelFromCoordinate(closestSegment[0]);
|
ol.coordinate.equals(closestSegment[1], segment[0])))) {
|
||||||
var pixel2 = map.getPixelFromCoordinate(closestSegment[1]);
|
vertexSegments[ol.getUid(segment)] = true;
|
||||||
var squaredDist1 = ol.coordinate.squaredDistance(vertexPixel, pixel1);
|
} else {
|
||||||
var squaredDist2 = ol.coordinate.squaredDistance(vertexPixel, pixel2);
|
break;
|
||||||
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;
|
this.vertexSegments_ = vertexSegments;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -846,52 +752,6 @@ 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.ModifySegmentDataType} segmentData Segment data.
|
||||||
* @param {ol.Coordinate} vertex Vertex.
|
* @param {ol.Coordinate} vertex Vertex.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ goog.require('ol.math');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.interaction.Interaction}
|
* @extends {ol.interaction.Interaction}
|
||||||
* @param {olx.interaction.MouseWheelZoomOptions=} opt_options Options.
|
* @param {olx.interaction.MouseWheelZoomOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.MouseWheelZoom = function(opt_options) {
|
ol.interaction.MouseWheelZoom = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ goog.require('ol.interaction.Pointer');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.interaction.Pointer}
|
* @extends {ol.interaction.Pointer}
|
||||||
* @param {olx.interaction.PinchRotateOptions=} opt_options Options.
|
* @param {olx.interaction.PinchRotateOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.PinchRotate = function(opt_options) {
|
ol.interaction.PinchRotate = function(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ goog.require('ol.interaction.Pointer');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.interaction.Pointer}
|
* @extends {ol.interaction.Pointer}
|
||||||
* @param {olx.interaction.PinchZoomOptions=} opt_options Options.
|
* @param {olx.interaction.PinchZoomOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.PinchZoom = function(opt_options) {
|
ol.interaction.PinchZoom = function(opt_options) {
|
||||||
|
|
||||||
@@ -81,25 +81,13 @@ ol.interaction.PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
|
|||||||
scaleDelta = this.lastDistance_ / distance;
|
scaleDelta = this.lastDistance_ / distance;
|
||||||
}
|
}
|
||||||
this.lastDistance_ = distance;
|
this.lastDistance_ = distance;
|
||||||
|
if (scaleDelta != 1.0) {
|
||||||
|
this.lastScaleDelta_ = scaleDelta;
|
||||||
|
}
|
||||||
|
|
||||||
var map = mapBrowserEvent.map;
|
var map = mapBrowserEvent.map;
|
||||||
var view = map.getView();
|
var view = map.getView();
|
||||||
var resolution = view.getResolution();
|
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.
|
// scale anchor point.
|
||||||
var viewportPosition = map.getViewport().getBoundingClientRect();
|
var viewportPosition = map.getViewport().getBoundingClientRect();
|
||||||
@@ -110,7 +98,8 @@ ol.interaction.PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
|
|||||||
|
|
||||||
// scale, bypass the resolution constraint
|
// scale, bypass the resolution constraint
|
||||||
map.render();
|
map.render();
|
||||||
ol.interaction.Interaction.zoomWithoutConstraints(view, newResolution, this.anchor_);
|
ol.interaction.Interaction.zoomWithoutConstraints(
|
||||||
|
view, resolution * scaleDelta, this.anchor_);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -187,8 +187,8 @@ ol.interaction.Pointer.handleEvent = function(mapBrowserEvent) {
|
|||||||
if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERDRAG) {
|
if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERDRAG) {
|
||||||
this.handleDragEvent_(mapBrowserEvent);
|
this.handleDragEvent_(mapBrowserEvent);
|
||||||
} else if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERUP) {
|
} else if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERUP) {
|
||||||
var handledUp = this.handleUpEvent_(mapBrowserEvent);
|
this.handleUpEvent_(mapBrowserEvent);
|
||||||
this.handlingDownUpSequence = handledUp && this.targetPointers.length > 0;
|
this.handlingDownUpSequence = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERDOWN) {
|
if (mapBrowserEvent.type == ol.MapBrowserEventType.POINTERDOWN) {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ goog.require('ol.style.Style');
|
|||||||
* @extends {ol.interaction.Interaction}
|
* @extends {ol.interaction.Interaction}
|
||||||
* @param {olx.interaction.SelectOptions=} opt_options Options.
|
* @param {olx.interaction.SelectOptions=} opt_options Options.
|
||||||
* @fires ol.interaction.Select.Event
|
* @fires ol.interaction.Select.Event
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.Select = function(opt_options) {
|
ol.interaction.Select = function(opt_options) {
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ ol.interaction.Select.prototype.addFeatureLayerAssociation_ = function(feature,
|
|||||||
/**
|
/**
|
||||||
* Get the selected features.
|
* Get the selected features.
|
||||||
* @return {ol.Collection.<ol.Feature>} Features collection.
|
* @return {ol.Collection.<ol.Feature>} Features collection.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.Select.prototype.getFeatures = function() {
|
ol.interaction.Select.prototype.getFeatures = function() {
|
||||||
return this.featureOverlay_.getSource().getFeaturesCollection();
|
return this.featureOverlay_.getSource().getFeaturesCollection();
|
||||||
@@ -304,7 +304,7 @@ ol.interaction.Select.prototype.setHitTolerance = function(hitTolerance) {
|
|||||||
* map, if any. Pass `null` to just remove the interaction from the current map.
|
* map, if any. Pass `null` to just remove the interaction from the current map.
|
||||||
* @param {ol.Map} map Map.
|
* @param {ol.Map} map Map.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.interaction.Select.prototype.setMap = function(map) {
|
ol.interaction.Select.prototype.setMap = function(map) {
|
||||||
var currentMap = this.getMap();
|
var currentMap = this.getMap();
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ goog.require('ol.obj');
|
|||||||
* @abstract
|
* @abstract
|
||||||
* @extends {ol.Object}
|
* @extends {ol.Object}
|
||||||
* @param {olx.layer.BaseOptions} options Layer options.
|
* @param {olx.layer.BaseOptions} options Layer options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Base = function(options) {
|
ol.layer.Base = function(options) {
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ ol.layer.Base.prototype.getLayerStatesArray = function(opt_states) {};
|
|||||||
* will be visible regardless of extent.
|
* will be visible regardless of extent.
|
||||||
* @return {ol.Extent|undefined} The layer extent.
|
* @return {ol.Extent|undefined} The layer extent.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Base.prototype.getExtent = function() {
|
ol.layer.Base.prototype.getExtent = function() {
|
||||||
return /** @type {ol.Extent|undefined} */ (
|
return /** @type {ol.Extent|undefined} */ (
|
||||||
@@ -115,7 +115,7 @@ ol.layer.Base.prototype.getExtent = function() {
|
|||||||
* Return the maximum resolution of the layer.
|
* Return the maximum resolution of the layer.
|
||||||
* @return {number} The maximum resolution of the layer.
|
* @return {number} The maximum resolution of the layer.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Base.prototype.getMaxResolution = function() {
|
ol.layer.Base.prototype.getMaxResolution = function() {
|
||||||
return /** @type {number} */ (
|
return /** @type {number} */ (
|
||||||
@@ -127,7 +127,7 @@ ol.layer.Base.prototype.getMaxResolution = function() {
|
|||||||
* Return the minimum resolution of the layer.
|
* Return the minimum resolution of the layer.
|
||||||
* @return {number} The minimum resolution of the layer.
|
* @return {number} The minimum resolution of the layer.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Base.prototype.getMinResolution = function() {
|
ol.layer.Base.prototype.getMinResolution = function() {
|
||||||
return /** @type {number} */ (
|
return /** @type {number} */ (
|
||||||
@@ -139,7 +139,7 @@ ol.layer.Base.prototype.getMinResolution = function() {
|
|||||||
* Return the opacity of the layer (between 0 and 1).
|
* Return the opacity of the layer (between 0 and 1).
|
||||||
* @return {number} The opacity of the layer.
|
* @return {number} The opacity of the layer.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Base.prototype.getOpacity = function() {
|
ol.layer.Base.prototype.getOpacity = function() {
|
||||||
return /** @type {number} */ (this.get(ol.layer.Property.OPACITY));
|
return /** @type {number} */ (this.get(ol.layer.Property.OPACITY));
|
||||||
@@ -157,7 +157,7 @@ ol.layer.Base.prototype.getSourceState = function() {};
|
|||||||
* Return the visibility of the layer (`true` or `false`).
|
* Return the visibility of the layer (`true` or `false`).
|
||||||
* @return {boolean} The visibility of the layer.
|
* @return {boolean} The visibility of the layer.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Base.prototype.getVisible = function() {
|
ol.layer.Base.prototype.getVisible = function() {
|
||||||
return /** @type {boolean} */ (this.get(ol.layer.Property.VISIBLE));
|
return /** @type {boolean} */ (this.get(ol.layer.Property.VISIBLE));
|
||||||
@@ -181,7 +181,7 @@ ol.layer.Base.prototype.getZIndex = function() {
|
|||||||
* will be visible at all extents.
|
* will be visible at all extents.
|
||||||
* @param {ol.Extent|undefined} extent The extent of the layer.
|
* @param {ol.Extent|undefined} extent The extent of the layer.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Base.prototype.setExtent = function(extent) {
|
ol.layer.Base.prototype.setExtent = function(extent) {
|
||||||
this.set(ol.layer.Property.EXTENT, extent);
|
this.set(ol.layer.Property.EXTENT, extent);
|
||||||
@@ -192,7 +192,7 @@ ol.layer.Base.prototype.setExtent = function(extent) {
|
|||||||
* Set the maximum resolution at which the layer is visible.
|
* Set the maximum resolution at which the layer is visible.
|
||||||
* @param {number} maxResolution The maximum resolution of the layer.
|
* @param {number} maxResolution The maximum resolution of the layer.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Base.prototype.setMaxResolution = function(maxResolution) {
|
ol.layer.Base.prototype.setMaxResolution = function(maxResolution) {
|
||||||
this.set(ol.layer.Property.MAX_RESOLUTION, maxResolution);
|
this.set(ol.layer.Property.MAX_RESOLUTION, maxResolution);
|
||||||
@@ -203,7 +203,7 @@ ol.layer.Base.prototype.setMaxResolution = function(maxResolution) {
|
|||||||
* Set the minimum resolution at which the layer is visible.
|
* Set the minimum resolution at which the layer is visible.
|
||||||
* @param {number} minResolution The minimum resolution of the layer.
|
* @param {number} minResolution The minimum resolution of the layer.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Base.prototype.setMinResolution = function(minResolution) {
|
ol.layer.Base.prototype.setMinResolution = function(minResolution) {
|
||||||
this.set(ol.layer.Property.MIN_RESOLUTION, minResolution);
|
this.set(ol.layer.Property.MIN_RESOLUTION, minResolution);
|
||||||
@@ -214,7 +214,7 @@ ol.layer.Base.prototype.setMinResolution = function(minResolution) {
|
|||||||
* Set the opacity of the layer, allowed values range from 0 to 1.
|
* Set the opacity of the layer, allowed values range from 0 to 1.
|
||||||
* @param {number} opacity The opacity of the layer.
|
* @param {number} opacity The opacity of the layer.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Base.prototype.setOpacity = function(opacity) {
|
ol.layer.Base.prototype.setOpacity = function(opacity) {
|
||||||
this.set(ol.layer.Property.OPACITY, opacity);
|
this.set(ol.layer.Property.OPACITY, opacity);
|
||||||
@@ -225,7 +225,7 @@ ol.layer.Base.prototype.setOpacity = function(opacity) {
|
|||||||
* Set the visibility of the layer (`true` or `false`).
|
* Set the visibility of the layer (`true` or `false`).
|
||||||
* @param {boolean} visible The visibility of the layer.
|
* @param {boolean} visible The visibility of the layer.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Base.prototype.setVisible = function(visible) {
|
ol.layer.Base.prototype.setVisible = function(visible) {
|
||||||
this.set(ol.layer.Property.VISIBLE, visible);
|
this.set(ol.layer.Property.VISIBLE, visible);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ goog.require('ol.source.State');
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.layer.Base}
|
* @extends {ol.layer.Base}
|
||||||
* @param {olx.layer.GroupOptions=} opt_options Layer options.
|
* @param {olx.layer.GroupOptions=} opt_options Layer options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Group = function(opt_options) {
|
ol.layer.Group = function(opt_options) {
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ ol.layer.Group.prototype.handleLayersRemove_ = function(collectionEvent) {
|
|||||||
* @return {!ol.Collection.<ol.layer.Base>} Collection of
|
* @return {!ol.Collection.<ol.layer.Base>} Collection of
|
||||||
* {@link ol.layer.Base layers} that are part of this group.
|
* {@link ol.layer.Base layers} that are part of this group.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Group.prototype.getLayers = function() {
|
ol.layer.Group.prototype.getLayers = function() {
|
||||||
return /** @type {!ol.Collection.<ol.layer.Base>} */ (this.get(
|
return /** @type {!ol.Collection.<ol.layer.Base>} */ (this.get(
|
||||||
@@ -172,7 +172,7 @@ ol.layer.Group.prototype.getLayers = function() {
|
|||||||
* @param {!ol.Collection.<ol.layer.Base>} layers Collection of
|
* @param {!ol.Collection.<ol.layer.Base>} layers Collection of
|
||||||
* {@link ol.layer.Base layers} that are part of this group.
|
* {@link ol.layer.Base layers} that are part of this group.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Group.prototype.setLayers = function(layers) {
|
ol.layer.Group.prototype.setLayers = function(layers) {
|
||||||
this.set(ol.layer.Group.Property_.LAYERS, layers);
|
this.set(ol.layer.Group.Property_.LAYERS, layers);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ goog.require('ol.renderer.webgl.ImageLayer');
|
|||||||
* @extends {ol.layer.Layer}
|
* @extends {ol.layer.Layer}
|
||||||
* @fires ol.render.Event
|
* @fires ol.render.Event
|
||||||
* @param {olx.layer.ImageOptions=} opt_options Layer options.
|
* @param {olx.layer.ImageOptions=} opt_options Layer options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Image = function(opt_options) {
|
ol.layer.Image = function(opt_options) {
|
||||||
var options = opt_options ? opt_options : {};
|
var options = opt_options ? opt_options : {};
|
||||||
@@ -47,6 +47,6 @@ ol.layer.Image.prototype.createRenderer = function(mapRenderer) {
|
|||||||
* Return the associated {@link ol.source.Image source} of the image layer.
|
* Return the associated {@link ol.source.Image source} of the image layer.
|
||||||
* @function
|
* @function
|
||||||
* @return {ol.source.Image} Source.
|
* @return {ol.source.Image} Source.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Image.prototype.getSource;
|
ol.layer.Image.prototype.getSource;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ goog.require('ol.source.State');
|
|||||||
* @extends {ol.layer.Base}
|
* @extends {ol.layer.Base}
|
||||||
* @fires ol.render.Event
|
* @fires ol.render.Event
|
||||||
* @param {olx.layer.LayerOptions} options Layer options.
|
* @param {olx.layer.LayerOptions} options Layer options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Layer = function(options) {
|
ol.layer.Layer = function(options) {
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ ol.layer.Layer.prototype.getLayerStatesArray = function(opt_states) {
|
|||||||
* Get the layer source.
|
* Get the layer source.
|
||||||
* @return {ol.source.Source} The layer source (or `null` if not yet set).
|
* @return {ol.source.Source} The layer source (or `null` if not yet set).
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Layer.prototype.getSource = function() {
|
ol.layer.Layer.prototype.getSource = function() {
|
||||||
var source = this.get(ol.layer.Property.SOURCE);
|
var source = this.get(ol.layer.Property.SOURCE);
|
||||||
@@ -196,7 +196,7 @@ ol.layer.Layer.prototype.setMap = function(map) {
|
|||||||
* Set the layer source.
|
* Set the layer source.
|
||||||
* @param {ol.source.Source} source The layer source.
|
* @param {ol.source.Source} source The layer source.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Layer.prototype.setSource = function(source) {
|
ol.layer.Layer.prototype.setSource = function(source) {
|
||||||
this.set(ol.layer.Property.SOURCE, source);
|
this.set(ol.layer.Property.SOURCE, source);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ goog.require('ol.renderer.webgl.TileLayer');
|
|||||||
* @extends {ol.layer.Layer}
|
* @extends {ol.layer.Layer}
|
||||||
* @fires ol.render.Event
|
* @fires ol.render.Event
|
||||||
* @param {olx.layer.TileOptions=} opt_options Tile layer options.
|
* @param {olx.layer.TileOptions=} opt_options Tile layer options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Tile = function(opt_options) {
|
ol.layer.Tile = function(opt_options) {
|
||||||
var options = opt_options ? opt_options : {};
|
var options = opt_options ? opt_options : {};
|
||||||
@@ -69,7 +69,7 @@ ol.layer.Tile.prototype.getPreload = function() {
|
|||||||
* Return the associated {@link ol.source.Tile tilesource} of the layer.
|
* Return the associated {@link ol.source.Tile tilesource} of the layer.
|
||||||
* @function
|
* @function
|
||||||
* @return {ol.source.Tile} Source.
|
* @return {ol.source.Tile} Source.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Tile.prototype.getSource;
|
ol.layer.Tile.prototype.getSource;
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ goog.require('ol.style.Style');
|
|||||||
* @extends {ol.layer.Layer}
|
* @extends {ol.layer.Layer}
|
||||||
* @fires ol.render.Event
|
* @fires ol.render.Event
|
||||||
* @param {olx.layer.VectorOptions=} opt_options Options.
|
* @param {olx.layer.VectorOptions=} opt_options Options.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Vector = function(opt_options) {
|
ol.layer.Vector = function(opt_options) {
|
||||||
var options = opt_options ?
|
var options = opt_options ?
|
||||||
@@ -111,7 +111,7 @@ ol.layer.Vector.prototype.getRenderOrder = function() {
|
|||||||
* Return the associated {@link ol.source.Vector vectorsource} of the layer.
|
* Return the associated {@link ol.source.Vector vectorsource} of the layer.
|
||||||
* @function
|
* @function
|
||||||
* @return {ol.source.Vector} Source.
|
* @return {ol.source.Vector} Source.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Vector.prototype.getSource;
|
ol.layer.Vector.prototype.getSource;
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ ol.layer.Vector.prototype.getSource;
|
|||||||
* option at construction or to the `setStyle` method.
|
* option at construction or to the `setStyle` method.
|
||||||
* @return {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction}
|
* @return {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction}
|
||||||
* Layer style.
|
* Layer style.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Vector.prototype.getStyle = function() {
|
ol.layer.Vector.prototype.getStyle = function() {
|
||||||
return this.style_;
|
return this.style_;
|
||||||
@@ -131,7 +131,7 @@ ol.layer.Vector.prototype.getStyle = function() {
|
|||||||
/**
|
/**
|
||||||
* Get the style function.
|
* Get the style function.
|
||||||
* @return {ol.StyleFunction|undefined} Layer style function.
|
* @return {ol.StyleFunction|undefined} Layer style function.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Vector.prototype.getStyleFunction = function() {
|
ol.layer.Vector.prototype.getStyleFunction = function() {
|
||||||
return this.styleFunction_;
|
return this.styleFunction_;
|
||||||
@@ -174,7 +174,7 @@ ol.layer.Vector.prototype.setRenderOrder = function(renderOrder) {
|
|||||||
* {@link ol.style} for information on the default style.
|
* {@link ol.style} for information on the default style.
|
||||||
* @param {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|null|undefined}
|
* @param {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|null|undefined}
|
||||||
* style Layer style.
|
* style Layer style.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.layer.Vector.prototype.setStyle = function(style) {
|
ol.layer.Vector.prototype.setStyle = function(style) {
|
||||||
this.style_ = style !== undefined ? style : ol.style.Style.defaultFunction;
|
this.style_ = style !== undefined ? style : ol.style.Style.defaultFunction;
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ ol.DEFAULT_RENDERER_TYPES = [
|
|||||||
* @fires ol.MapEvent
|
* @fires ol.MapEvent
|
||||||
* @fires ol.render.Event#postcompose
|
* @fires ol.render.Event#postcompose
|
||||||
* @fires ol.render.Event#precompose
|
* @fires ol.render.Event#precompose
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map = function(options) {
|
ol.Map = function(options) {
|
||||||
|
|
||||||
@@ -345,6 +345,12 @@ ol.Map = function(options) {
|
|||||||
*/
|
*/
|
||||||
this.focus_ = null;
|
this.focus_ = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {Array.<ol.PreRenderFunction>}
|
||||||
|
*/
|
||||||
|
this.preRenderFunctions_ = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<ol.PostRenderFunction>}
|
* @type {Array.<ol.PostRenderFunction>}
|
||||||
@@ -460,7 +466,7 @@ ol.inherits(ol.Map, ol.Object);
|
|||||||
/**
|
/**
|
||||||
* Add the given control to the map.
|
* Add the given control to the map.
|
||||||
* @param {ol.control.Control} control Control.
|
* @param {ol.control.Control} control Control.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.addControl = function(control) {
|
ol.Map.prototype.addControl = function(control) {
|
||||||
this.getControls().push(control);
|
this.getControls().push(control);
|
||||||
@@ -470,7 +476,7 @@ ol.Map.prototype.addControl = function(control) {
|
|||||||
/**
|
/**
|
||||||
* Add the given interaction to the map.
|
* Add the given interaction to the map.
|
||||||
* @param {ol.interaction.Interaction} interaction Interaction to add.
|
* @param {ol.interaction.Interaction} interaction Interaction to add.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.addInteraction = function(interaction) {
|
ol.Map.prototype.addInteraction = function(interaction) {
|
||||||
this.getInteractions().push(interaction);
|
this.getInteractions().push(interaction);
|
||||||
@@ -482,7 +488,7 @@ ol.Map.prototype.addInteraction = function(interaction) {
|
|||||||
* elsewhere in the stack, use `getLayers()` and the methods available on
|
* elsewhere in the stack, use `getLayers()` and the methods available on
|
||||||
* {@link ol.Collection}.
|
* {@link ol.Collection}.
|
||||||
* @param {ol.layer.Base} layer Layer.
|
* @param {ol.layer.Base} layer Layer.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.addLayer = function(layer) {
|
ol.Map.prototype.addLayer = function(layer) {
|
||||||
var layers = this.getLayerGroup().getLayers();
|
var layers = this.getLayerGroup().getLayers();
|
||||||
@@ -493,7 +499,7 @@ ol.Map.prototype.addLayer = function(layer) {
|
|||||||
/**
|
/**
|
||||||
* Add the given overlay to the map.
|
* Add the given overlay to the map.
|
||||||
* @param {ol.Overlay} overlay Overlay.
|
* @param {ol.Overlay} overlay Overlay.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.addOverlay = function(overlay) {
|
ol.Map.prototype.addOverlay = function(overlay) {
|
||||||
this.getOverlays().push(overlay);
|
this.getOverlays().push(overlay);
|
||||||
@@ -514,6 +520,20 @@ ol.Map.prototype.addOverlayInternal_ = function(overlay) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add functions to be called before rendering. This can be used for attaching
|
||||||
|
* animations before updating the map's view. The {@link ol.animation}
|
||||||
|
* namespace provides several static methods for creating prerender functions.
|
||||||
|
* @param {...ol.PreRenderFunction} var_args Any number of pre-render functions.
|
||||||
|
* @deprecated Use {@link ol.View#animate} instead.
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
ol.Map.prototype.beforeRender = function(var_args) {
|
||||||
|
this.render();
|
||||||
|
Array.prototype.push.apply(this.preRenderFunctions_, arguments);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
@@ -556,7 +576,7 @@ ol.Map.prototype.disposeInternal = function() {
|
|||||||
* @return {T|undefined} Callback result, i.e. the return value of last
|
* @return {T|undefined} Callback result, i.e. the return value of last
|
||||||
* callback execution, or the first truthy callback return value.
|
* callback execution, or the first truthy callback return value.
|
||||||
* @template S,T
|
* @template S,T
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.forEachFeatureAtPixel = function(pixel, callback, opt_options) {
|
ol.Map.prototype.forEachFeatureAtPixel = function(pixel, callback, opt_options) {
|
||||||
if (!this.frameState_) {
|
if (!this.frameState_) {
|
||||||
@@ -596,7 +616,7 @@ ol.Map.prototype.forEachFeatureAtPixel = function(pixel, callback, opt_options)
|
|||||||
* @return {T|undefined} Callback result, i.e. the return value of last
|
* @return {T|undefined} Callback result, i.e. the return value of last
|
||||||
* callback execution, or the first truthy callback return value.
|
* callback execution, or the first truthy callback return value.
|
||||||
* @template S,T,U
|
* @template S,T,U
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.forEachLayerAtPixel = function(pixel, callback, opt_this, opt_layerFilter, opt_this2) {
|
ol.Map.prototype.forEachLayerAtPixel = function(pixel, callback, opt_this, opt_layerFilter, opt_this2) {
|
||||||
if (!this.frameState_) {
|
if (!this.frameState_) {
|
||||||
@@ -640,7 +660,7 @@ ol.Map.prototype.hasFeatureAtPixel = function(pixel, opt_options) {
|
|||||||
* Returns the coordinate in view projection for a browser event.
|
* Returns the coordinate in view projection for a browser event.
|
||||||
* @param {Event} event Event.
|
* @param {Event} event Event.
|
||||||
* @return {ol.Coordinate} Coordinate.
|
* @return {ol.Coordinate} Coordinate.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getEventCoordinate = function(event) {
|
ol.Map.prototype.getEventCoordinate = function(event) {
|
||||||
return this.getCoordinateFromPixel(this.getEventPixel(event));
|
return this.getCoordinateFromPixel(this.getEventPixel(event));
|
||||||
@@ -651,7 +671,7 @@ ol.Map.prototype.getEventCoordinate = function(event) {
|
|||||||
* Returns the map pixel position for a browser event relative to the viewport.
|
* Returns the map pixel position for a browser event relative to the viewport.
|
||||||
* @param {Event} event Event.
|
* @param {Event} event Event.
|
||||||
* @return {ol.Pixel} Pixel.
|
* @return {ol.Pixel} Pixel.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getEventPixel = function(event) {
|
ol.Map.prototype.getEventPixel = function(event) {
|
||||||
var viewportPosition = this.viewport_.getBoundingClientRect();
|
var viewportPosition = this.viewport_.getBoundingClientRect();
|
||||||
@@ -670,7 +690,7 @@ ol.Map.prototype.getEventPixel = function(event) {
|
|||||||
* @return {Element|string|undefined} The Element or id of the Element that the
|
* @return {Element|string|undefined} The Element or id of the Element that the
|
||||||
* map is rendered in.
|
* map is rendered in.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getTarget = function() {
|
ol.Map.prototype.getTarget = function() {
|
||||||
return /** @type {Element|string|undefined} */ (
|
return /** @type {Element|string|undefined} */ (
|
||||||
@@ -702,7 +722,7 @@ ol.Map.prototype.getTargetElement = function() {
|
|||||||
* map view projection.
|
* map view projection.
|
||||||
* @param {ol.Pixel} pixel Pixel position in the map viewport.
|
* @param {ol.Pixel} pixel Pixel position in the map viewport.
|
||||||
* @return {ol.Coordinate} The coordinate for the pixel position.
|
* @return {ol.Coordinate} The coordinate for the pixel position.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getCoordinateFromPixel = function(pixel) {
|
ol.Map.prototype.getCoordinateFromPixel = function(pixel) {
|
||||||
var frameState = this.frameState_;
|
var frameState = this.frameState_;
|
||||||
@@ -718,7 +738,7 @@ ol.Map.prototype.getCoordinateFromPixel = function(pixel) {
|
|||||||
* Get the map controls. Modifying this collection changes the controls
|
* Get the map controls. Modifying this collection changes the controls
|
||||||
* associated with the map.
|
* associated with the map.
|
||||||
* @return {ol.Collection.<ol.control.Control>} Controls.
|
* @return {ol.Collection.<ol.control.Control>} Controls.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getControls = function() {
|
ol.Map.prototype.getControls = function() {
|
||||||
return this.controls_;
|
return this.controls_;
|
||||||
@@ -729,7 +749,7 @@ ol.Map.prototype.getControls = function() {
|
|||||||
* Get the map overlays. Modifying this collection changes the overlays
|
* Get the map overlays. Modifying this collection changes the overlays
|
||||||
* associated with the map.
|
* associated with the map.
|
||||||
* @return {ol.Collection.<ol.Overlay>} Overlays.
|
* @return {ol.Collection.<ol.Overlay>} Overlays.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getOverlays = function() {
|
ol.Map.prototype.getOverlays = function() {
|
||||||
return this.overlays_;
|
return this.overlays_;
|
||||||
@@ -756,7 +776,7 @@ ol.Map.prototype.getOverlayById = function(id) {
|
|||||||
*
|
*
|
||||||
* Interactions are used for e.g. pan, zoom and rotate.
|
* Interactions are used for e.g. pan, zoom and rotate.
|
||||||
* @return {ol.Collection.<ol.interaction.Interaction>} Interactions.
|
* @return {ol.Collection.<ol.interaction.Interaction>} Interactions.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getInteractions = function() {
|
ol.Map.prototype.getInteractions = function() {
|
||||||
return this.interactions_;
|
return this.interactions_;
|
||||||
@@ -767,7 +787,7 @@ ol.Map.prototype.getInteractions = function() {
|
|||||||
* Get the layergroup associated with this map.
|
* Get the layergroup associated with this map.
|
||||||
* @return {ol.layer.Group} A layer group containing the layers in this map.
|
* @return {ol.layer.Group} A layer group containing the layers in this map.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getLayerGroup = function() {
|
ol.Map.prototype.getLayerGroup = function() {
|
||||||
return /** @type {ol.layer.Group} */ (this.get(ol.MapProperty.LAYERGROUP));
|
return /** @type {ol.layer.Group} */ (this.get(ol.MapProperty.LAYERGROUP));
|
||||||
@@ -777,7 +797,7 @@ ol.Map.prototype.getLayerGroup = function() {
|
|||||||
/**
|
/**
|
||||||
* Get the collection of layers associated with this map.
|
* Get the collection of layers associated with this map.
|
||||||
* @return {!ol.Collection.<ol.layer.Base>} Layers.
|
* @return {!ol.Collection.<ol.layer.Base>} Layers.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getLayers = function() {
|
ol.Map.prototype.getLayers = function() {
|
||||||
var layers = this.getLayerGroup().getLayers();
|
var layers = this.getLayerGroup().getLayers();
|
||||||
@@ -790,7 +810,7 @@ ol.Map.prototype.getLayers = function() {
|
|||||||
* projection and returns the corresponding pixel.
|
* projection and returns the corresponding pixel.
|
||||||
* @param {ol.Coordinate} coordinate A map coordinate.
|
* @param {ol.Coordinate} coordinate A map coordinate.
|
||||||
* @return {ol.Pixel} A pixel position in the map viewport.
|
* @return {ol.Pixel} A pixel position in the map viewport.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getPixelFromCoordinate = function(coordinate) {
|
ol.Map.prototype.getPixelFromCoordinate = function(coordinate) {
|
||||||
var frameState = this.frameState_;
|
var frameState = this.frameState_;
|
||||||
@@ -816,7 +836,7 @@ ol.Map.prototype.getRenderer = function() {
|
|||||||
* Get the size of this map.
|
* Get the size of this map.
|
||||||
* @return {ol.Size|undefined} The size in pixels of the map in the DOM.
|
* @return {ol.Size|undefined} The size in pixels of the map in the DOM.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getSize = function() {
|
ol.Map.prototype.getSize = function() {
|
||||||
return /** @type {ol.Size|undefined} */ (this.get(ol.MapProperty.SIZE));
|
return /** @type {ol.Size|undefined} */ (this.get(ol.MapProperty.SIZE));
|
||||||
@@ -828,7 +848,7 @@ ol.Map.prototype.getSize = function() {
|
|||||||
* center and resolution.
|
* center and resolution.
|
||||||
* @return {ol.View} The view that controls this map.
|
* @return {ol.View} The view that controls this map.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getView = function() {
|
ol.Map.prototype.getView = function() {
|
||||||
return /** @type {ol.View} */ (this.get(ol.MapProperty.VIEW));
|
return /** @type {ol.View} */ (this.get(ol.MapProperty.VIEW));
|
||||||
@@ -838,7 +858,7 @@ ol.Map.prototype.getView = function() {
|
|||||||
/**
|
/**
|
||||||
* Get the element that serves as the map viewport.
|
* Get the element that serves as the map viewport.
|
||||||
* @return {Element} Viewport.
|
* @return {Element} Viewport.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getViewport = function() {
|
ol.Map.prototype.getViewport = function() {
|
||||||
return this.viewport_;
|
return this.viewport_;
|
||||||
@@ -1120,7 +1140,7 @@ ol.Map.prototype.isRendered = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests an immediate render in a synchronous manner.
|
* Requests an immediate render in a synchronous manner.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.renderSync = function() {
|
ol.Map.prototype.renderSync = function() {
|
||||||
if (this.animationDelayKey_) {
|
if (this.animationDelayKey_) {
|
||||||
@@ -1132,7 +1152,7 @@ ol.Map.prototype.renderSync = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Request a map rendering (at the next animation frame).
|
* Request a map rendering (at the next animation frame).
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.render = function() {
|
ol.Map.prototype.render = function() {
|
||||||
if (this.animationDelayKey_ === undefined) {
|
if (this.animationDelayKey_ === undefined) {
|
||||||
@@ -1147,7 +1167,7 @@ ol.Map.prototype.render = function() {
|
|||||||
* @param {ol.control.Control} control Control.
|
* @param {ol.control.Control} control Control.
|
||||||
* @return {ol.control.Control|undefined} The removed control (or undefined
|
* @return {ol.control.Control|undefined} The removed control (or undefined
|
||||||
* if the control was not found).
|
* if the control was not found).
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.removeControl = function(control) {
|
ol.Map.prototype.removeControl = function(control) {
|
||||||
return this.getControls().remove(control);
|
return this.getControls().remove(control);
|
||||||
@@ -1159,7 +1179,7 @@ ol.Map.prototype.removeControl = function(control) {
|
|||||||
* @param {ol.interaction.Interaction} interaction Interaction to remove.
|
* @param {ol.interaction.Interaction} interaction Interaction to remove.
|
||||||
* @return {ol.interaction.Interaction|undefined} The removed interaction (or
|
* @return {ol.interaction.Interaction|undefined} The removed interaction (or
|
||||||
* undefined if the interaction was not found).
|
* undefined if the interaction was not found).
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.removeInteraction = function(interaction) {
|
ol.Map.prototype.removeInteraction = function(interaction) {
|
||||||
return this.getInteractions().remove(interaction);
|
return this.getInteractions().remove(interaction);
|
||||||
@@ -1171,7 +1191,7 @@ ol.Map.prototype.removeInteraction = function(interaction) {
|
|||||||
* @param {ol.layer.Base} layer Layer.
|
* @param {ol.layer.Base} layer Layer.
|
||||||
* @return {ol.layer.Base|undefined} The removed layer (or undefined if the
|
* @return {ol.layer.Base|undefined} The removed layer (or undefined if the
|
||||||
* layer was not found).
|
* layer was not found).
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.removeLayer = function(layer) {
|
ol.Map.prototype.removeLayer = function(layer) {
|
||||||
var layers = this.getLayerGroup().getLayers();
|
var layers = this.getLayerGroup().getLayers();
|
||||||
@@ -1184,7 +1204,7 @@ ol.Map.prototype.removeLayer = function(layer) {
|
|||||||
* @param {ol.Overlay} overlay Overlay.
|
* @param {ol.Overlay} overlay Overlay.
|
||||||
* @return {ol.Overlay|undefined} The removed overlay (or undefined
|
* @return {ol.Overlay|undefined} The removed overlay (or undefined
|
||||||
* if the overlay was not found).
|
* if the overlay was not found).
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.removeOverlay = function(overlay) {
|
ol.Map.prototype.removeOverlay = function(overlay) {
|
||||||
return this.getOverlays().remove(overlay);
|
return this.getOverlays().remove(overlay);
|
||||||
@@ -1236,6 +1256,16 @@ ol.Map.prototype.renderFrame_ = function(time) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (frameState) {
|
if (frameState) {
|
||||||
|
var preRenderFunctions = this.preRenderFunctions_;
|
||||||
|
var n = 0, preRenderFunction;
|
||||||
|
for (i = 0, ii = preRenderFunctions.length; i < ii; ++i) {
|
||||||
|
preRenderFunction = preRenderFunctions[i];
|
||||||
|
if (preRenderFunction(this, frameState)) {
|
||||||
|
preRenderFunctions[n++] = preRenderFunction;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
preRenderFunctions.length = n;
|
||||||
|
|
||||||
frameState.extent = ol.extent.getForViewAndSize(viewState.center,
|
frameState.extent = ol.extent.getForViewAndSize(viewState.center,
|
||||||
viewState.resolution, viewState.rotation, frameState.size, extent);
|
viewState.resolution, viewState.rotation, frameState.size, extent);
|
||||||
}
|
}
|
||||||
@@ -1250,7 +1280,8 @@ ol.Map.prototype.renderFrame_ = function(time) {
|
|||||||
Array.prototype.push.apply(
|
Array.prototype.push.apply(
|
||||||
this.postRenderFunctions_, frameState.postRenderFunctions);
|
this.postRenderFunctions_, frameState.postRenderFunctions);
|
||||||
|
|
||||||
var idle = !frameState.viewHints[ol.ViewHint.ANIMATING] &&
|
var idle = this.preRenderFunctions_.length === 0 &&
|
||||||
|
!frameState.viewHints[ol.ViewHint.ANIMATING] &&
|
||||||
!frameState.viewHints[ol.ViewHint.INTERACTING] &&
|
!frameState.viewHints[ol.ViewHint.INTERACTING] &&
|
||||||
!ol.extent.equals(frameState.extent, this.previousExtent_);
|
!ol.extent.equals(frameState.extent, this.previousExtent_);
|
||||||
|
|
||||||
@@ -1274,7 +1305,7 @@ ol.Map.prototype.renderFrame_ = function(time) {
|
|||||||
* @param {ol.layer.Group} layerGroup A layer group containing the layers in
|
* @param {ol.layer.Group} layerGroup A layer group containing the layers in
|
||||||
* this map.
|
* this map.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.setLayerGroup = function(layerGroup) {
|
ol.Map.prototype.setLayerGroup = function(layerGroup) {
|
||||||
this.set(ol.MapProperty.LAYERGROUP, layerGroup);
|
this.set(ol.MapProperty.LAYERGROUP, layerGroup);
|
||||||
@@ -1297,7 +1328,7 @@ ol.Map.prototype.setSize = function(size) {
|
|||||||
* @param {Element|string|undefined} target The Element or id of the Element
|
* @param {Element|string|undefined} target The Element or id of the Element
|
||||||
* that the map is rendered in.
|
* that the map is rendered in.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.setTarget = function(target) {
|
ol.Map.prototype.setTarget = function(target) {
|
||||||
this.set(ol.MapProperty.TARGET, target);
|
this.set(ol.MapProperty.TARGET, target);
|
||||||
@@ -1308,7 +1339,7 @@ ol.Map.prototype.setTarget = function(target) {
|
|||||||
* Set the view for this map.
|
* Set the view for this map.
|
||||||
* @param {ol.View} view The view that controls this map.
|
* @param {ol.View} view The view that controls this map.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.setView = function(view) {
|
ol.Map.prototype.setView = function(view) {
|
||||||
this.set(ol.MapProperty.VIEW, view);
|
this.set(ol.MapProperty.VIEW, view);
|
||||||
@@ -1328,7 +1359,7 @@ ol.Map.prototype.skipFeature = function(feature) {
|
|||||||
/**
|
/**
|
||||||
* Force a recalculation of the map viewport size. This should be called when
|
* Force a recalculation of the map viewport size. This should be called when
|
||||||
* third-party code changes the size of the map viewport.
|
* third-party code changes the size of the map viewport.
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.updateSize = function() {
|
ol.Map.prototype.updateSize = function() {
|
||||||
var targetElement = this.getTargetElement();
|
var targetElement = this.getTargetElement();
|
||||||
|
|||||||
@@ -27,21 +27,21 @@ ol.MapBrowserEvent = function(type, map, browserEvent, opt_dragging,
|
|||||||
* The original browser event.
|
* The original browser event.
|
||||||
* @const
|
* @const
|
||||||
* @type {Event}
|
* @type {Event}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
this.originalEvent = browserEvent;
|
this.originalEvent = browserEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The map pixel relative to the viewport corresponding to the original browser event.
|
* The map pixel relative to the viewport corresponding to the original browser event.
|
||||||
* @type {ol.Pixel}
|
* @type {ol.Pixel}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
this.pixel = map.getEventPixel(browserEvent);
|
this.pixel = map.getEventPixel(browserEvent);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The coordinate in view projection corresponding to the original browser event.
|
* The coordinate in view projection corresponding to the original browser event.
|
||||||
* @type {ol.Coordinate}
|
* @type {ol.Coordinate}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
this.coordinate = map.getCoordinateFromPixel(this.pixel);
|
this.coordinate = map.getCoordinateFromPixel(this.pixel);
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ ol.MapBrowserEvent = function(type, map, browserEvent, opt_dragging,
|
|||||||
* `POINTERDRAG` and `POINTERMOVE` events. Default is `false`.
|
* `POINTERDRAG` and `POINTERMOVE` events. Default is `false`.
|
||||||
*
|
*
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
this.dragging = opt_dragging !== undefined ? opt_dragging : false;
|
this.dragging = opt_dragging !== undefined ? opt_dragging : false;
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ ol.inherits(ol.MapBrowserEvent, ol.MapEvent);
|
|||||||
* Prevents the default browser action.
|
* Prevents the default browser action.
|
||||||
* @see https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.MapBrowserEvent.prototype.preventDefault = function() {
|
ol.MapBrowserEvent.prototype.preventDefault = function() {
|
||||||
ol.MapEvent.prototype.preventDefault.call(this);
|
ol.MapEvent.prototype.preventDefault.call(this);
|
||||||
@@ -74,7 +74,7 @@ ol.MapBrowserEvent.prototype.preventDefault = function() {
|
|||||||
* Prevents further propagation of the current event.
|
* Prevents further propagation of the current event.
|
||||||
* @see https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.MapBrowserEvent.prototype.stopPropagation = function() {
|
ol.MapBrowserEvent.prototype.stopPropagation = function() {
|
||||||
ol.MapEvent.prototype.stopPropagation.call(this);
|
ol.MapEvent.prototype.stopPropagation.call(this);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user