Compare commits
227 Commits
v3.15.1
...
v3.16.0-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df6cd8e54d | ||
|
|
c4eb0ffcb5 | ||
|
|
a948d4b3ea | ||
|
|
2c1353f6e9 | ||
|
|
783721951a | ||
|
|
c5dcde4455 | ||
|
|
47cc4aac62 | ||
|
|
f86e7e5a71 | ||
|
|
9f501aeb0e | ||
|
|
8afae37c4c | ||
|
|
2bff721227 | ||
|
|
7a1756d8a9 | ||
|
|
412dc0457e | ||
|
|
693e91970e | ||
|
|
557a3aee04 | ||
|
|
7080c508a4 | ||
|
|
bc95ec053c | ||
|
|
443d252ec1 | ||
|
|
9a83339724 | ||
|
|
1a1d55d54e | ||
|
|
57e9e96e5f | ||
|
|
5949170df0 | ||
|
|
70dd26a412 | ||
|
|
21e8f69d97 | ||
|
|
9b9d006d75 | ||
|
|
350c4d525b | ||
|
|
1c03814860 | ||
|
|
532275e779 | ||
|
|
ef52a757b1 | ||
|
|
048865d975 | ||
|
|
fb402d120e | ||
|
|
5a5ad7ce31 | ||
|
|
476191b0d0 | ||
|
|
94b8c853a7 | ||
|
|
a810feb257 | ||
|
|
5c07628044 | ||
|
|
4c82b3403c | ||
|
|
cce7b148bb | ||
|
|
176ddd3403 | ||
|
|
4626554a18 | ||
|
|
9523fb6edd | ||
|
|
31d0278dfb | ||
|
|
e74434299e | ||
|
|
3fc70bac00 | ||
|
|
0d2b833e06 | ||
|
|
19692ed60a | ||
|
|
0daa2cf574 | ||
|
|
dd358af0f2 | ||
|
|
ab9ff536f5 | ||
|
|
c7aeebed8c | ||
|
|
a1c86ed560 | ||
|
|
4f0b4dacbd | ||
|
|
ed34caa25a | ||
|
|
535e8f5e35 | ||
|
|
d0e5b1e395 | ||
|
|
49e2fd0df3 | ||
|
|
d59ace1a61 | ||
|
|
d6395a3c82 | ||
|
|
d27ea0974e | ||
|
|
b49546d2af | ||
|
|
8c8c4c3df4 | ||
|
|
fa067b7e8a | ||
|
|
c4387c14ff | ||
|
|
afcaa2ea51 | ||
|
|
e55dc30257 | ||
|
|
cb50e4a102 | ||
|
|
7d805393fc | ||
|
|
684d49cb78 | ||
|
|
2a44669e18 | ||
|
|
39087b2fa4 | ||
|
|
5c76cb01af | ||
|
|
f57065c412 | ||
|
|
e94939d01b | ||
|
|
56a365acf4 | ||
|
|
fbb9194923 | ||
|
|
ffe8daec66 | ||
|
|
7984cc2b57 | ||
|
|
7944144c65 | ||
|
|
ae46b40def | ||
|
|
ed421ce4b2 | ||
|
|
51397ee294 | ||
|
|
d316651c35 | ||
|
|
ff37fe128f | ||
|
|
72468f3470 | ||
|
|
b2c6bb11cf | ||
|
|
088c439c34 | ||
|
|
0b4ef31750 | ||
|
|
f3cc873d65 | ||
|
|
b1648c949e | ||
|
|
18520cd89d | ||
|
|
e2b2004aa4 | ||
|
|
a6a0c88641 | ||
|
|
54e1e3408b | ||
|
|
9ea297c54f | ||
|
|
5044c49ac3 | ||
|
|
f835d86333 | ||
|
|
7c15280e81 | ||
|
|
9f3c951c71 | ||
|
|
6abecb0192 | ||
|
|
4e17f58b26 | ||
|
|
15b6921bc9 | ||
|
|
c7898bcb0e | ||
|
|
c28fd2ae1c | ||
|
|
690ef18ee2 | ||
|
|
cd2ea6c7d6 | ||
|
|
36b8f31f40 | ||
|
|
0151d802d3 | ||
|
|
a54c686691 | ||
|
|
ebc28aefd4 | ||
|
|
d49bcdeedc | ||
|
|
2939ebc9b9 | ||
|
|
c17e23f2ae | ||
|
|
73a04c14f5 | ||
|
|
88d20a69ad | ||
|
|
138fe6ede1 | ||
|
|
12849a678e | ||
|
|
c72a39ff53 | ||
|
|
ec832243a2 | ||
|
|
c5f81a5706 | ||
|
|
664507b79b | ||
|
|
c3217e8d30 | ||
|
|
e3e0d23a83 | ||
|
|
6002d4c3e8 | ||
|
|
63ebed437b | ||
|
|
762aa3029c | ||
|
|
1ca28506ac | ||
|
|
c11e95099c | ||
|
|
3a1ff59cfb | ||
|
|
9186d1fbda | ||
|
|
2f72804fc3 | ||
|
|
af294bd44e | ||
|
|
ed6ac93222 | ||
|
|
8f96251618 | ||
|
|
343f41e99e | ||
|
|
255e449dd3 | ||
|
|
b37cd3fae6 | ||
|
|
d425f75bea | ||
|
|
989c04cf12 | ||
|
|
e85d8fa749 | ||
|
|
394ef94fd3 | ||
|
|
5934f9d416 | ||
|
|
ead6063170 | ||
|
|
c7af6bd494 | ||
|
|
2076ef02ca | ||
|
|
130b4d9459 | ||
|
|
60926626df | ||
|
|
405ed2af56 | ||
|
|
44f09497f0 | ||
|
|
c40993d0d3 | ||
|
|
18a29ea6d3 | ||
|
|
f7147960a9 | ||
|
|
0e4692e69e | ||
|
|
3de5a021a9 | ||
|
|
b7278f184c | ||
|
|
e46c8370d5 | ||
|
|
dca7d6fc8f | ||
|
|
db9dbc96b2 | ||
|
|
2496662070 | ||
|
|
8e3e47bed4 | ||
|
|
92c96b95f9 | ||
|
|
8e1ffbf91e | ||
|
|
8562c9a4fc | ||
|
|
400204357f | ||
|
|
e6e9b12bac | ||
|
|
a2c3dfd5de | ||
|
|
72e354dce3 | ||
|
|
f92a38b28c | ||
|
|
c15f8c8f07 | ||
|
|
de4e51efe8 | ||
|
|
d4ac5800d5 | ||
|
|
9507020218 | ||
|
|
ccfc3f7798 | ||
|
|
593132c902 | ||
|
|
6a6a906e83 | ||
|
|
ed4ac8d83b | ||
|
|
35f0928802 | ||
|
|
044f6638ea | ||
|
|
936d38ca6f | ||
|
|
737daaeea9 | ||
|
|
01a6612ab3 | ||
|
|
05ceaab620 | ||
|
|
f9fd73c44e | ||
|
|
27f20e2f54 | ||
|
|
50b956b108 | ||
|
|
33db3d4941 | ||
|
|
06ac1b603c | ||
|
|
fb96ed94ec | ||
|
|
664efa18fc | ||
|
|
2a64d9ef55 | ||
|
|
1ecd47aeb9 | ||
|
|
bb5b461192 | ||
|
|
9fb4a88841 | ||
|
|
231234f9d0 | ||
|
|
c92223d792 | ||
|
|
cd6494149b | ||
|
|
6efd3dab0b | ||
|
|
935eb9994c | ||
|
|
6fc4427f4f | ||
|
|
fe33910ec2 | ||
|
|
c9ffcef766 | ||
|
|
8c9ac5932f | ||
|
|
6be704af69 | ||
|
|
c549fadc01 | ||
|
|
e099dcd9a9 | ||
|
|
53a9341ef0 | ||
|
|
18e9ff98ee | ||
|
|
f011b5266e | ||
|
|
d275b1cf74 | ||
|
|
b691c47e78 | ||
|
|
f2c30cffe2 | ||
|
|
f645d81fee | ||
|
|
38718ee5e6 | ||
|
|
fc6b078642 | ||
|
|
587e8a6ecd | ||
|
|
db9c6a99c8 | ||
|
|
5302882fba | ||
|
|
60fb3b55ff | ||
|
|
f20e446689 | ||
|
|
e36ffca838 | ||
|
|
4b832708e5 | ||
|
|
a7f61e6dda | ||
|
|
825d525d3f | ||
|
|
a42d76d69d | ||
|
|
02d262e387 | ||
|
|
fe372847f8 | ||
|
|
1cd7b76efe | ||
|
|
4eb6997be9 |
@@ -3,7 +3,7 @@ sudo: false
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- "4"
|
||||
- "6"
|
||||
|
||||
cache:
|
||||
directories:
|
||||
|
||||
12
Makefile
12
Makefile
@@ -119,8 +119,7 @@ examples: $(BUILD_EXAMPLES)
|
||||
install: build/timestamps/node-modules-timestamp
|
||||
|
||||
.PHONY: lint
|
||||
lint: build/timestamps/eslint-timestamp \
|
||||
build/timestamps/check-requires-timestamp
|
||||
lint: build/timestamps/eslint-timestamp
|
||||
|
||||
.PHONY: npm-install
|
||||
npm-install: build/timestamps/node-modules-timestamp
|
||||
@@ -184,13 +183,6 @@ build/timestamps/check-%-timestamp: $(BUILD_HOSTED)/examples/%.html \
|
||||
./node_modules/.bin/phantomjs --local-to-remote-url-access=true --ssl-protocol=any --ignore-ssl-errors=true bin/check-example.js $<
|
||||
@touch $@
|
||||
|
||||
build/timestamps/check-requires-timestamp: $(SRC_JS) $(EXAMPLES_JS) \
|
||||
$(SRC_SHADER_JS) $(SPEC_JS) \
|
||||
$(SPEC_RENDERING_JS)
|
||||
@mkdir -p $(@D)
|
||||
@python bin/check-requires.py $(CLOSURE_LIB) $^
|
||||
@touch $@
|
||||
|
||||
build/compiled-examples/all.js: $(EXAMPLES_JS)
|
||||
@mkdir -p $(@D)
|
||||
@python bin/combine-examples.py $^ > $@
|
||||
@@ -219,7 +211,7 @@ build/timestamps/jsdoc-$(BRANCH)-timestamp: config/jsdoc/api/index.md \
|
||||
build/timestamps/node-modules-timestamp
|
||||
@mkdir -p $(@D)
|
||||
@rm -rf $(BUILD_HOSTED)/apidoc
|
||||
./node_modules/.bin/jsdoc config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -d $(BUILD_HOSTED)/apidoc
|
||||
./node_modules/.bin/jsdoc config/jsdoc/api/index.md -c config/jsdoc/api/conf.json --package package.json -d $(BUILD_HOSTED)/apidoc
|
||||
@touch $@
|
||||
|
||||
$(BUILD_HOSTED_EXAMPLES_JS): $(BUILD_HOSTED)/examples/%.js: build/examples/%.js
|
||||
|
||||
@@ -1,193 +0,0 @@
|
||||
import os
|
||||
import logging
|
||||
import re
|
||||
import sys
|
||||
|
||||
logging.basicConfig(format='%(asctime)s %(name)s: %(message)s',
|
||||
level=logging.INFO)
|
||||
|
||||
logger = logging.getLogger('check-requires')
|
||||
|
||||
|
||||
class Node(object):
|
||||
|
||||
def __init__(self):
|
||||
self.present = False
|
||||
self.children = {}
|
||||
|
||||
def _build_re(self, key):
|
||||
if key == '*':
|
||||
assert len(self.children) == 0
|
||||
# We want to match `.doIt` but not `.SomeClass` or `.more.stuff`
|
||||
return '(?=\\.[a-z]\\w*\\b(?!\\.))'
|
||||
elif len(self.children) == 1:
|
||||
child_key, child = next(self.children.iteritems())
|
||||
child_re = child._build_re(child_key)
|
||||
if child_key != '*':
|
||||
child_re = '\\.' + child_re
|
||||
if self.present:
|
||||
return key + '(' + child_re + ')?'
|
||||
else:
|
||||
return key + child_re
|
||||
elif self.children:
|
||||
children_re = '(?:' + '|'.join(
|
||||
('\\.' if k != '*' else '') + self.children[k]._build_re(k)
|
||||
for k in sorted(self.children.keys())) + ')'
|
||||
if self.present:
|
||||
return key + children_re + '?'
|
||||
else:
|
||||
return key + children_re
|
||||
else:
|
||||
assert self.present
|
||||
return key
|
||||
|
||||
def build_re(self, key):
|
||||
return re.compile('\\b' + self._build_re(key) + '\\b')
|
||||
|
||||
|
||||
def ifind(*paths):
|
||||
"""ifind is an iterative version of os.walk, yielding all walked paths and
|
||||
normalizing paths to use forward slashes."""
|
||||
for path in paths:
|
||||
for dirpath, dirnames, names in os.walk(path):
|
||||
for name in names:
|
||||
if os.sep == '/':
|
||||
yield os.path.join(dirpath, name)
|
||||
else:
|
||||
yield '/'.join(dirpath.split(os.sep) + [name])
|
||||
|
||||
|
||||
def _strip_comments(lines):
|
||||
# FIXME this is a horribe hack, we should use a proper JavaScript parser
|
||||
# here
|
||||
in_multiline_comment = False
|
||||
lineno = 0
|
||||
for line in lines:
|
||||
lineno += 1
|
||||
if in_multiline_comment:
|
||||
index = line.find('*/')
|
||||
if index != -1:
|
||||
in_multiline_comment = False
|
||||
line = line[index + 2:]
|
||||
if not in_multiline_comment:
|
||||
line = re.sub(r'//[^\n]*', '', line)
|
||||
line = re.sub(r'/\*.*?\*/', '', line)
|
||||
index = line.find('/*')
|
||||
if index != -1:
|
||||
yield lineno, line[:index]
|
||||
in_multiline_comment = True
|
||||
else:
|
||||
yield lineno, line
|
||||
|
||||
|
||||
def check_requires(closure_lib, *filenames):
|
||||
unused_count = 0
|
||||
all_provides = set()
|
||||
|
||||
for filename in ifind(closure_lib):
|
||||
if filename.endswith('.js'):
|
||||
if not re.match(r'.*/closure/goog/', filename):
|
||||
continue
|
||||
# Skip goog.i18n because it contains so many modules that it causes
|
||||
# the generated regular expression to exceed Python's limits
|
||||
if re.match(r'.*/closure/goog/i18n/', filename):
|
||||
continue
|
||||
for line in open(filename, 'rU'):
|
||||
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
|
||||
if m:
|
||||
all_provides.add(m.group(1))
|
||||
|
||||
for filename in sorted(filenames):
|
||||
require_linenos = {}
|
||||
uses = set()
|
||||
lines = open(filename, 'rU').readlines()
|
||||
for lineno, line in _strip_comments(lines):
|
||||
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
|
||||
if m:
|
||||
all_provides.add(m.group(1))
|
||||
continue
|
||||
m = re.match(r'goog.require\(\'(.*)\'\);', line)
|
||||
if m:
|
||||
require_linenos[m.group(1)] = lineno
|
||||
continue
|
||||
ignore_linenos = require_linenos.values()
|
||||
for lineno, line in enumerate(lines):
|
||||
if lineno in ignore_linenos:
|
||||
continue
|
||||
for require in require_linenos.iterkeys():
|
||||
if require in line:
|
||||
uses.add(require)
|
||||
for require in sorted(set(require_linenos.keys()) - uses):
|
||||
logger.info('%s:%d: unused goog.require: %r' % (
|
||||
filename, require_linenos[require], require))
|
||||
unused_count += 1
|
||||
|
||||
all_provides.discard('ol')
|
||||
all_provides.discard('ol.MapProperty')
|
||||
|
||||
root = Node()
|
||||
for provide in all_provides:
|
||||
node = root
|
||||
for component in provide.split('.'):
|
||||
if component not in node.children:
|
||||
node.children[component] = Node()
|
||||
node = node.children[component]
|
||||
if component[0].islower():
|
||||
# We've arrived at a namespace provide like `ol.foo`.
|
||||
# In this case, we want to match uses like `ol.foo.doIt()` but
|
||||
# not match things like `new ol.foo.SomeClass()`.
|
||||
# For this purpose, we use the special wildcard key for the child.
|
||||
node.children['*'] = Node()
|
||||
else:
|
||||
node.present = True
|
||||
provide_res = [child.build_re(key)
|
||||
for key, child in root.children.iteritems()]
|
||||
missing_count = 0
|
||||
for filename in sorted(filenames):
|
||||
provides = set()
|
||||
requires = set()
|
||||
uses = set()
|
||||
uses_linenos = {}
|
||||
for lineno, line in _strip_comments(open(filename, 'rU')):
|
||||
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
|
||||
if m:
|
||||
provides.add(m.group(1))
|
||||
continue
|
||||
m = re.match(r'goog.require\(\'(.*)\'\);', line)
|
||||
if m:
|
||||
requires.add(m.group(1))
|
||||
continue
|
||||
while True:
|
||||
for provide_re in provide_res:
|
||||
m = provide_re.search(line)
|
||||
if m:
|
||||
uses.add(m.group())
|
||||
uses_linenos[m.group()] = lineno
|
||||
line = line[:m.start()] + line[m.end():]
|
||||
break
|
||||
else:
|
||||
break
|
||||
if filename == 'src/ol/renderer/layerrenderer.js':
|
||||
uses.discard('ol.renderer.Map')
|
||||
m = re.match(
|
||||
r'src/ol/renderer/(\w+)/\1(\w*)layerrenderer\.js\Z', filename)
|
||||
if m:
|
||||
uses.discard('ol.renderer.Map')
|
||||
uses.discard('ol.renderer.%s.Map' % (m.group(1),))
|
||||
missing_requires = uses - requires - provides
|
||||
if missing_requires:
|
||||
for missing_require in sorted(missing_requires):
|
||||
logger.info("%s:%d missing goog.require('%s')" %
|
||||
(filename, uses_linenos[missing_require],
|
||||
missing_require))
|
||||
missing_count += 1
|
||||
|
||||
return (unused_count, missing_count)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unused_count, missing_count = check_requires(*sys.argv[1:])
|
||||
if unused_count > 0 or missing_count > 0:
|
||||
logger.error('%d unused goog.requires, %d missing goog.requires' %
|
||||
(unused_count, missing_count))
|
||||
sys.exit(1)
|
||||
@@ -1,5 +1,30 @@
|
||||
## Upgrade notes
|
||||
|
||||
#### Move of typedefs out of code and into separate file
|
||||
|
||||
This change should not affect the great majority of application developers, but it's possible there are edge cases when compiling application code together with the library which cause compiler errors or warnings. In this case, please raise a GitHub issue. `goog.require`s for typedefs should not be necessary.
|
||||
|
||||
#### Removal of `opaque` option for `ol.source.VectorTile`
|
||||
|
||||
This option is no longer needed, so it was removed from the API.
|
||||
|
||||
#### XHR loading for `ol.source.TileUTFGrid`
|
||||
|
||||
The `ol.source.TileUTFGrid` now uses XMLHttpRequest to load UTFGrid tiles by default. This works out of the box with the v4 Mapbox API. To work with the v3 API, you must use the new `jsonp` option on the source. See the examples below for detail.
|
||||
|
||||
```js
|
||||
// To work with the v4 API
|
||||
var v4source = new ol.source.TileUTFGrid({
|
||||
url: 'https://api.tiles.mapbox.com/v4/example.json?access_token=' + YOUR_KEY_HERE
|
||||
});
|
||||
|
||||
// To work with the v3 API
|
||||
var v3source = new ol.source.TileUTFGrid({
|
||||
jsonp: true, // <--- this is required for v3
|
||||
url: 'http://api.tiles.mapbox.com/v3/example.json'
|
||||
});
|
||||
```
|
||||
|
||||
### v3.15.0
|
||||
|
||||
#### Internet Explorer 9 support
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
"externs/closure-compiler.js",
|
||||
"externs/esrijson.js",
|
||||
"externs/example.js",
|
||||
"externs/fastclick.js",
|
||||
"externs/geojson.js",
|
||||
"externs/jquery-1.9.js",
|
||||
"externs/proj4js.js",
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
"externs/closure-compiler.js",
|
||||
"externs/esrijson.js",
|
||||
"externs/example.js",
|
||||
"externs/fastclick.js",
|
||||
"externs/geojson.js",
|
||||
"externs/jspdf.js",
|
||||
"externs/jquery-1.9.js",
|
||||
"externs/proj4js.js",
|
||||
"externs/tilejson.js",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="./resources/prism/prism.css" type="text/css">
|
||||
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
|
||||
@@ -36,6 +36,11 @@
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div id="latest-check" class="alert alert-warning alert-dismissible" role="alert" style="display:none">
|
||||
<button id="latest-dismiss" type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
This example uses OpenLayers v<span>{{ olVersion }}</span>. The <a id="latest-link" href="#" class="alert-link">latest</a> is v<span id="latest-version"></span>.
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<h4 id="title">{{ title }}</h4>
|
||||
@@ -85,4 +90,30 @@
|
||||
<script src="./resources/prism/prism.min.js"></script>
|
||||
{{{ js.tag }}}
|
||||
</body>
|
||||
<script>
|
||||
var packageUrl = 'https://raw.githubusercontent.com/openlayers/openlayers.github.io/build/package.json';
|
||||
fetch(packageUrl).then(function(response) {
|
||||
return response.json();
|
||||
}).then(function(json) {
|
||||
var latestVersion = json.version;
|
||||
document.getElementById('latest-version').innerHTML = latestVersion;
|
||||
var url = window.location.href;
|
||||
var branchSearch = url.match(/\/([^\/]*)\/examples\//);
|
||||
var cookieText = 'dismissed=-' + latestVersion + '-';
|
||||
var dismissed = document.cookie.indexOf(cookieText) != -1;
|
||||
if (!dismissed && /^v[0-9\.]*$/.test(branchSearch[1]) && '{{ olVersion }}' != latestVersion) {
|
||||
var link = url.replace(branchSearch[0], '/latest/examples/');
|
||||
fetch(link, {method: 'head'}).then(function(response) {
|
||||
var a = document.getElementById('latest-link');
|
||||
a.href = response.status == 200 ? link : '../../latest/examples/';
|
||||
});
|
||||
var latestCheck = document.getElementById('latest-check');
|
||||
latestCheck.style.display = '';
|
||||
document.getElementById('latest-dismiss').onclick = function() {
|
||||
latestCheck.style.display = 'none';
|
||||
document.cookie = cookieText;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
|
||||
@@ -39,3 +39,26 @@ Interactions for [vector features](ol.Feature.html)
|
||||
[ol.Geolocation](ol.Geolocation.html)<br>
|
||||
[ol.Overlay](ol.Overlay.html)<br></td>
|
||||
</tr></table>
|
||||
|
||||
|
||||
|
||||
#### API change policy
|
||||
|
||||
The OpenLayers 3.x API consists of
|
||||
* names of classes, class methods and properties
|
||||
* names of static functions and constants
|
||||
* order and types of function arguments
|
||||
* types of function return values
|
||||
|
||||
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 theme the
|
||||
OpenLayers UI.
|
||||
|
||||
*Note for Closure Compiler users compiling their application code together with OpenLayers*:
|
||||
The names of types other than those in the list above (e.g. `ol.Pixel`) are subject to change. It
|
||||
is therefore recommended to either use the resolved type as listed in the API docs (e.g.
|
||||
`Array.<number>` instead of `ol.Pixel`), or pay attention to the upgrade notes, which will list
|
||||
the changes for those types.
|
||||
|
||||
@@ -113,7 +113,8 @@ function generate(title, docs, filename, resolveLinks) {
|
||||
var docData = {
|
||||
filename: filename,
|
||||
title: title,
|
||||
docs: docs
|
||||
docs: docs,
|
||||
packageInfo: ( find({kind: 'package'}) || [] ) [0]
|
||||
};
|
||||
|
||||
var outpath = path.join(outdir, filename),
|
||||
@@ -327,11 +328,6 @@ exports.publish = function(taffyData, opts, tutorials) {
|
||||
}
|
||||
});
|
||||
|
||||
// update outdir if necessary, then create outdir
|
||||
var packageInfo = ( find({kind: 'package'}) || [] ) [0];
|
||||
if (packageInfo && packageInfo.name) {
|
||||
outdir = path.join(outdir, packageInfo.name, packageInfo.version);
|
||||
}
|
||||
fs.mkPath(outdir);
|
||||
|
||||
// copy the template's static files to outdir
|
||||
@@ -439,13 +435,10 @@ exports.publish = function(taffyData, opts, tutorials) {
|
||||
if (members.globals.length) { generate('Global', [{kind: 'globalobj'}], globalUrl); }
|
||||
|
||||
// index page displays information from package.json and lists files
|
||||
var files = find({kind: 'file'}),
|
||||
packages = find({kind: 'package'});
|
||||
var files = find({kind: 'file'});
|
||||
|
||||
generate('Index',
|
||||
packages.concat(
|
||||
[{kind: 'mainpage', readme: opts.readme, longname: (opts.mainpagetitle) ? opts.mainpagetitle : 'Main Page'}]
|
||||
).concat(files),
|
||||
[{kind: 'mainpage', readme: opts.readme, longname: (opts.mainpagetitle) ? opts.mainpagetitle : 'Main Page'}].concat(files),
|
||||
indexUrl);
|
||||
|
||||
// set up the lists that we'll use to generate pages
|
||||
|
||||
@@ -53,20 +53,44 @@ $(function () {
|
||||
$(window).on('resize', _onResize);
|
||||
_onResize();
|
||||
|
||||
var currentVersion = document.getElementById('package-version').innerHTML;
|
||||
|
||||
// warn about outdated version
|
||||
var packageUrl = 'https://raw.githubusercontent.com/openlayers/openlayers.github.io/build/package.json';
|
||||
fetch(packageUrl).then(function(response) {
|
||||
return response.json();
|
||||
}).then(function(json) {
|
||||
var latestVersion = json.version;
|
||||
document.getElementById('latest-version').innerHTML = latestVersion;
|
||||
var url = window.location.href;
|
||||
var branchSearch = url.match(/\/([^\/]*)\/apidoc\//);
|
||||
var cookieText = 'dismissed=-' + latestVersion + '-';
|
||||
var dismissed = document.cookie.indexOf(cookieText) != -1;
|
||||
if (!dismissed && /^v[0-9\.]*$/.test(branchSearch[1]) && currentVersion != latestVersion) {
|
||||
var link = url.replace(branchSearch[0], '/latest/apidoc/');
|
||||
fetch(link, {method: 'head'}).then(function(response) {
|
||||
var a = document.getElementById('latest-link');
|
||||
a.href = response.status == 200 ? link : '../../latest/apidoc/';
|
||||
});
|
||||
var latestCheck = document.getElementById('latest-check');
|
||||
latestCheck.style.display = '';
|
||||
document.getElementById('latest-dismiss').onclick = function() {
|
||||
latestCheck.style.display = 'none';
|
||||
document.cookie = cookieText;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// create source code links to github
|
||||
var srcLinks = $('div.tag-source');
|
||||
var masterSearch = window.location.href.match(/\/([^\/]*\/)apidoc\//);
|
||||
if (masterSearch && masterSearch.length) {
|
||||
var branch = masterSearch[1];
|
||||
srcLinks.each(function(i, el) {
|
||||
var textParts = el.innerHTML.trim().split(', ');
|
||||
var link = 'https://github.com/openlayers/ol3/blob/' + branch +
|
||||
var link = 'https://github.com/openlayers/ol3/blob/v' + currentVersion + '/' +
|
||||
textParts[0];
|
||||
el.innerHTML = '<a href="' + link + '">' + textParts[0] + '</a>, ' +
|
||||
'<a href="' + link + textParts[1].replace('line ', '#l') + '">' +
|
||||
textParts[1] + '</a>';
|
||||
});
|
||||
}
|
||||
|
||||
// show/hide unstable items
|
||||
var links = $('a[href^="ol."]');
|
||||
|
||||
@@ -416,3 +416,7 @@ footer {
|
||||
left: 250px;
|
||||
font-weight: normal;
|
||||
}
|
||||
#latest-check {
|
||||
margin-top: -10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
<?js
|
||||
var version = obj.packageInfo.version;
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>OpenLayers 3 API Reference - <?js= title ?></title>
|
||||
<title>OpenLayers v<?js= version ?> API - <?js= title ?></title>
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch"></script>
|
||||
<script src="scripts/prettify/prettify.js"> </script>
|
||||
<script src="scripts/prettify/lang-css.js"> </script>
|
||||
<script src="scripts/jquery.min.js"> </script>
|
||||
@@ -36,6 +40,10 @@
|
||||
<?js= this.partial('navigation.tmpl', this) ?>
|
||||
<div class="main">
|
||||
<h1 class="page-title" data-filename="<?js= filename ?>"><?js= title ?></h1>
|
||||
<div id="latest-check" class="alert alert-warning alert-dismissible" role="alert" style="display:none">
|
||||
<button id="latest-dismiss" type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
This documentation is for OpenLayers v<span id="package-version"><?js= version ?></span>. The <a id="latest-link" href="#" class="alert-link">latest</a> is v<span id="latest-version"></span>.
|
||||
</div>
|
||||
<?js= content ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -45,7 +45,7 @@ The easiest way to use a custom projection is to add the [Proj4js](http://proj4j
|
||||
Following example shows definition of a [British National Grid](http://epsg.io/27700):
|
||||
|
||||
``` html
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.12/proj4.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js"></script>
|
||||
```
|
||||
|
||||
``` javascript
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"globals": {
|
||||
"FastClick": false,
|
||||
"$": false,
|
||||
"arc": false,
|
||||
"common": false,
|
||||
|
||||
11
examples/arcgis-image.html
Normal file
11
examples/arcgis-image.html
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Image ArcGIS MapServer
|
||||
shortdesc: Example of an image ArcGIS layer.
|
||||
docs: >
|
||||
This example shows how to use a dynamic ArcGIS REST MapService.
|
||||
This source type supports Map and Image Services. For dyamic ArcGIS
|
||||
services.
|
||||
tags: arcgis, image, dynamiclayer"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
29
examples/arcgis-image.js
Normal file
29
examples/arcgis-image.js
Normal file
@@ -0,0 +1,29 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Image');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.ImageArcGISRest');
|
||||
|
||||
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
||||
'Specialty/ESRI_StateCityHighway_USA/MapServer';
|
||||
|
||||
var layers = [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
}),
|
||||
new ol.layer.Image({
|
||||
source: new ol.source.ImageArcGISRest({
|
||||
params: {},
|
||||
url: url
|
||||
})
|
||||
})
|
||||
];
|
||||
var map = new ol.Map({
|
||||
layers: layers,
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [-10997148, 4569099],
|
||||
zoom: 4
|
||||
})
|
||||
});
|
||||
@@ -6,8 +6,8 @@ docs: >
|
||||
This example shows how to customize the buttons tooltips with <a href="http://getbootstrap.com/javascript/#tooltips">Bootstrap</a>.
|
||||
tags: "custom, tooltip"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
|
||||
- https://code.jquery.com/jquery-2.2.3.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
9
examples/custom-icon.html
Normal file
9
examples/custom-icon.html
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Custom Icon
|
||||
shortdesc: Example using a custom attribution icon object
|
||||
docs: >
|
||||
This example creates a custom element for the attribution icon
|
||||
tags: "icon, element"
|
||||
---
|
||||
<div id="map" class="map"><div id="popup"></div></div>
|
||||
27
examples/custom-icon.js
Normal file
27
examples/custom-icon.js
Normal file
@@ -0,0 +1,27 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
var logoElement = document.createElement('a');
|
||||
logoElement.href = 'http://www.osgeo.org/';
|
||||
logoElement.target = '_blank';
|
||||
|
||||
var logoImage = document.createElement('img');
|
||||
logoImage.src = 'http://www.osgeo.org/sites/all/themes/osgeo/logo.png';
|
||||
|
||||
logoElement.appendChild(logoImage);
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
}),
|
||||
logo: logoElement
|
||||
});
|
||||
@@ -1,3 +1,4 @@
|
||||
// NOCOMPILE
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.control');
|
||||
|
||||
@@ -10,7 +10,7 @@ tags: "fullscreen, geolocation, orientation, mobile"
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
|
||||
<title>Mobile Geolocation Tracking with Orientation</title>
|
||||
@@ -44,7 +44,7 @@ tags: "fullscreen, geolocation, orientation, mobile"
|
||||
<button id="geolocate">Geolocate Me!</button>
|
||||
<button id="simulate">Simulate</button>
|
||||
</div>
|
||||
<script src="http://code.jquery.com/jquery-1.9.1.min.js" type="text/javascript"></script>
|
||||
<script src="http://code.jquery.com/jquery-2.2.3.min.js" type="text/javascript"></script>
|
||||
<script src="./resources/common.js" type="text/javascript"></script>
|
||||
<script src="loader.js?id=geolocation-orientation" type="text/javascript"></script>
|
||||
</body>
|
||||
|
||||
@@ -6,8 +6,8 @@ docs: >
|
||||
Example using an icon to symbolize a point.
|
||||
tags: "vector, style, icon, marker, popup"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
|
||||
- https://code.jquery.com/jquery-2.2.3.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js
|
||||
---
|
||||
<div id="map" class="map"><div id="popup"></div></div>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
|
||||
<style>
|
||||
|
||||
@@ -6,8 +6,8 @@ docs: >
|
||||
This example parses a KML file and renders the features as a vector layer. The layer is given a <code>style</code> that renders earthquake locations with a size relative to their magnitude.
|
||||
tags: "KML, vector, style, tooltip"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
|
||||
- https://code.jquery.com/jquery-2.2.3.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js
|
||||
---
|
||||
<div id="map" class="map"><div id="info"></div></div>
|
||||
|
||||
@@ -7,8 +7,8 @@ docs: >
|
||||
yellow with an opacity calculated based on the current offset to local noon.
|
||||
tags: "KML, vector, style"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
|
||||
- https://code.jquery.com/jquery-2.2.3.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js
|
||||
---
|
||||
<div id="map" class="map"><div id="info"></div></div>
|
||||
|
||||
@@ -6,7 +6,7 @@ docs: >
|
||||
Example of a map with layer group.
|
||||
tags: "tilejson, input, bind, group, layergroup"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
- https://code.jquery.com/jquery-2.2.3.min.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<div id="layertree">
|
||||
|
||||
@@ -43,6 +43,7 @@ function tileUrlFunction(tileCoord) {
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.VectorTile({
|
||||
renderMode: 'vector',
|
||||
preload: Infinity,
|
||||
source: new ol.source.VectorTile({
|
||||
attributions: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> ' +
|
||||
|
||||
@@ -5,8 +5,6 @@ shortdesc: Example of using the ol.interaction.Draw interaction to create a simp
|
||||
docs: >
|
||||
<p><i>NOTE: By default, length and area are calculated using the projected coordinates. This is not accurate for projections like Mercator where the projected meters do not correspond to meters on the ground. To get a standarized measurement across all projections, use the geodesic measures.</i></p>
|
||||
tags: "draw, edit, measure, vector"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<form class="form-inline">
|
||||
|
||||
@@ -117,7 +117,7 @@ var pointerMoveHandler = function(evt) {
|
||||
helpTooltipElement.innerHTML = helpMsg;
|
||||
helpTooltip.setPosition(evt.coordinate);
|
||||
|
||||
$(helpTooltipElement).removeClass('hidden');
|
||||
helpTooltipElement.classList.remove('hidden');
|
||||
};
|
||||
|
||||
|
||||
@@ -132,8 +132,8 @@ var map = new ol.Map({
|
||||
|
||||
map.on('pointermove', pointerMoveHandler);
|
||||
|
||||
$(map.getViewport()).on('mouseout', function() {
|
||||
$(helpTooltipElement).addClass('hidden');
|
||||
map.getViewport().addEventListener('mouseout', function() {
|
||||
helpTooltipElement.classList.add('hidden');
|
||||
});
|
||||
|
||||
var typeSelect = document.getElementById('type');
|
||||
|
||||
@@ -24,9 +24,8 @@ cloak:
|
||||
</head>
|
||||
<body>
|
||||
<div id="map" class="map"></div>
|
||||
<script src="https://code.jquery.com/jquery-1.9.1.min.js" type="text/javascript"></script>
|
||||
<script src="https://code.jquery.com/jquery-2.2.3.min.js" type="text/javascript"></script>
|
||||
<script src="./resources/common.js" type="text/javascript"></script>
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js" type="text/javascript"></script>
|
||||
<script src="loader.js?id=mobile-full-screen" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -32,11 +32,3 @@ geolocation.once('change:position', function() {
|
||||
view.setCenter(geolocation.getPosition());
|
||||
view.setResolution(2.388657133911758);
|
||||
});
|
||||
|
||||
// Use FastClick to eliminate the 300ms delay between a physical tap
|
||||
// and the firing of a click event on mobile browsers.
|
||||
// See http://updates.html5rocks.com/2013/12/300ms-tap-delay-gone-away
|
||||
// for more information.
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
FastClick.attach(document.body);
|
||||
});
|
||||
|
||||
@@ -3,8 +3,7 @@ layout: example.html
|
||||
title: Navigation Controls
|
||||
shortdesc: Shows how to add navigation controls.
|
||||
docs: >
|
||||
<p>This example shows how to use the beforeRender function on the Map to run one
|
||||
or more animations.</p>
|
||||
<p>This example shows how to use the <code>ol.control.ZoomToExtent</code> control.</p>
|
||||
<p>The following navigation controls are added to the map:</p>
|
||||
<ul>
|
||||
<li><code>ol.control.Zoom</code> (added by default)</li>
|
||||
|
||||
@@ -6,9 +6,9 @@ docs: >
|
||||
<p>The popups are created using <a href="http://getbootstrap.com/javascript/#popovers">Popovers</a> from Bootstrap.</p>
|
||||
tags: "overlay, popup, bootstrap, popover, mapquest, openaerial"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
|
||||
- https://code.jquery.com/jquery-2.2.3.min.js
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
|
||||
- https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<div style="display: none;">
|
||||
|
||||
@@ -8,7 +8,7 @@ docs: >
|
||||
in <a href="http://epsg.io/">EPSG.io</a> database.
|
||||
tags: "reprojection, projection, proj4js, mapquest, epsg.io"
|
||||
resources:
|
||||
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js
|
||||
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<form class="form-inline">
|
||||
|
||||
@@ -6,6 +6,6 @@ docs: >
|
||||
This example shows client-side reprojection of single image source.
|
||||
tags: "reprojection, projection, proj4js, mapquest, image, imagestatic"
|
||||
resources:
|
||||
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js
|
||||
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -6,7 +6,7 @@ docs: >
|
||||
This example shows client-side raster reprojection between various projections.
|
||||
tags: "reprojection, projection, proj4js, mapquest, wms, wmts, hidpi"
|
||||
resources:
|
||||
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js
|
||||
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<form class="form-inline">
|
||||
|
||||
@@ -122,3 +122,7 @@ pre {
|
||||
#api-links ul {
|
||||
display: inline;
|
||||
}
|
||||
#latest-check {
|
||||
margin-top: -10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ function createMapboxStreetsV6Style() {
|
||||
var icon = iconCache[iconName];
|
||||
if (!icon) {
|
||||
icon = new ol.style.Style({image: new ol.style.Icon({
|
||||
src: '//raw.githubusercontent.com/mapbox/maki/mb-pages/renders/' +
|
||||
iconName + '-12.png'
|
||||
src: 'https://cdn.rawgit.com/mapbox/maki/master/icons/' + iconName + '-15.svg',
|
||||
imgSize: [15, 15]
|
||||
})});
|
||||
iconCache[iconName] = icon;
|
||||
}
|
||||
|
||||
12
examples/reusable-source.html
Normal file
12
examples/reusable-source.html
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Reusable Source
|
||||
shortdesc: Updating a tile source by changing the URL.
|
||||
docs: >
|
||||
You can call <code>source.setUrl()</code> to update the URL for a tile source. Note that when you change the URL for a tile source, existing tiles will not be replaced until new tiles are loaded. If you are interested instead in clearing currently rendered tiles, you can call the <code>source.refresh()</code> method. Alternatively, you can use two separate sources if you want to remove rendered tiles and start over loading new tiles.
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<button class="switcher" value="0">January</button>
|
||||
<button class="switcher" value="1">January (with bathymetry)</button>
|
||||
<button class="switcher" value="2">July</button>
|
||||
<button class="switcher" value="3">July (with bathymetry)</button>
|
||||
39
examples/reusable-source.js
Normal file
39
examples/reusable-source.js
Normal file
@@ -0,0 +1,39 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.XYZ');
|
||||
|
||||
var urls = [
|
||||
'https://{a-c}.tiles.mapbox.com/v3/mapbox.blue-marble-topo-jan/{z}/{x}/{y}.png',
|
||||
'https://{a-c}.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jan/{z}/{x}/{y}.png',
|
||||
'https://{a-c}.tiles.mapbox.com/v3/mapbox.blue-marble-topo-jul/{z}/{x}/{y}.png',
|
||||
'https://{a-c}.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jul/{z}/{x}/{y}.png'
|
||||
];
|
||||
|
||||
var source = new ol.source.XYZ();
|
||||
|
||||
var map = new ol.Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: source
|
||||
})
|
||||
],
|
||||
view: new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
function updateUrl(index) {
|
||||
source.setUrl(urls[index]);
|
||||
}
|
||||
|
||||
var buttons = document.getElementsByClassName('switcher');
|
||||
for (var i = 0, ii = buttons.length; i < ii; ++i) {
|
||||
var button = buttons[i];
|
||||
button.addEventListener('click', updateUrl.bind(null, Number(button.value)));
|
||||
}
|
||||
|
||||
updateUrl(0);
|
||||
@@ -6,6 +6,6 @@ docs: >
|
||||
This example shows client-side reprojection of OpenStreetMap to NAD83 Indiana East, including a ScaleLine control with US units.
|
||||
tags: "reprojection, projection, openstreetmap, nad83, tile, scaleline"
|
||||
resources:
|
||||
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js
|
||||
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -6,6 +6,6 @@ docs: >
|
||||
Example of a Sphere Mollweide map with a Graticule component.
|
||||
tags: "graticule, Mollweide, projection, proj4js"
|
||||
resources:
|
||||
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js
|
||||
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -8,7 +8,6 @@ docs: >
|
||||
and <code>tileloaderror</code> type events to monitor tile loading
|
||||
progress. This example registers listeners for these events and
|
||||
renders a tile loading progress bar at the bottom of the map.</p>
|
||||
This example creates a "rotate to north" button.
|
||||
tags: "tile, events, loading"
|
||||
---
|
||||
<div class="wrapper">
|
||||
|
||||
@@ -6,6 +6,8 @@ docs: >
|
||||
<p>Point to a country to see its name and flag.</p>
|
||||
Tiles made with [TileMill](http://tilemill.com). Hosting on MapBox.com or with open-source [TileServer](https://github.com/klokantech/tileserver-php/).
|
||||
tags: "utfgrid, tileutfgrid, tilejson"
|
||||
cloak:
|
||||
pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg: Your Mapbox access token from http://mapbox.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<div style="display: none;">
|
||||
|
||||
@@ -5,14 +5,17 @@ goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.TileJSON');
|
||||
goog.require('ol.source.TileUTFGrid');
|
||||
|
||||
var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
|
||||
|
||||
var mapLayer = new ol.layer.Tile({
|
||||
source: new ol.source.TileJSON({
|
||||
url: 'http://api.tiles.mapbox.com/v3/mapbox.geography-class.json'
|
||||
url: 'http://api.tiles.mapbox.com/v4/mapbox.geography-class.json?access_token=' + key
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
var gridSource = new ol.source.TileUTFGrid({
|
||||
url: 'http://api.tiles.mapbox.com/v3/mapbox.geography-class.json'
|
||||
url: 'http://api.tiles.mapbox.com/v4/mapbox.geography-class.json?access_token=' + key
|
||||
});
|
||||
|
||||
var gridLayer = new ol.layer.Tile({source: gridSource});
|
||||
|
||||
@@ -4,9 +4,9 @@ title: Editable ArcGIS REST Feature Service
|
||||
shortdesc: Example of using an ArcGIS REST Feature Service in an editing application.
|
||||
docs: >
|
||||
This example loads features from ArcGIS REST Feature Service and allows to add new features or update existing features.
|
||||
tags: "vector, esri, ArcGIS, REST, Feature, Service, bbox, loading, server, edit, updateFeature, addFeature"
|
||||
tags: "vector, esri, ArcGIS, REST, Feature, Service, loading, server, edit, updateFeature, addFeature"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
- https://code.jquery.com/jquery-2.2.3.min.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<form class="form-inline">
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: ArcGIS REST Feature Service
|
||||
shortdesc: Example of using an ArcGIS REST Feature Service with a BBOX strategy.
|
||||
shortdesc: Example of using an ArcGIS REST Feature Service with a Tile strategy.
|
||||
docs: >
|
||||
This example loads new features from ArcGIS REST Feature Service when the view extent changes.
|
||||
tags: "vector, esri, ArcGIS, REST, Feature, Service, bbox, loading, server"
|
||||
tags: "vector, esri, ArcGIS, REST, Feature, Service, loading, server"
|
||||
resources:
|
||||
- https://code.jquery.com/jquery-1.11.2.min.js
|
||||
- https://code.jquery.com/jquery-2.2.3.min.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<div id="info"> </div>
|
||||
|
||||
13
examples/vector-wfs-getfeature.html
Normal file
13
examples/vector-wfs-getfeature.html
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: WFS - GetFeature
|
||||
shortdesc: Example of making a WFS GetFeature request with a filter.
|
||||
docs: >
|
||||
This example generates a `GetFeature` request which uses a `PropertyIsEqualTo`
|
||||
and a `PropertyIsLike` filter, and then posts the request to load the features
|
||||
that match the query.
|
||||
tags: "vector, WFS, GetFeature, filter"
|
||||
cloak:
|
||||
AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF: Your Bing Maps Key from http://www.bingmapsportal.com/ here
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
66
examples/vector-wfs-getfeature.js
Normal file
66
examples/vector-wfs-getfeature.js
Normal file
@@ -0,0 +1,66 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.format.ogc.filter');
|
||||
goog.require('ol.format.WFS');
|
||||
goog.require('ol.format.GeoJSON');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.BingMaps');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
|
||||
var vectorSource = new ol.source.Vector();
|
||||
var vector = new ol.layer.Vector({
|
||||
source: vectorSource,
|
||||
style: new ol.style.Style({
|
||||
stroke: new ol.style.Stroke({
|
||||
color: 'rgba(0, 0, 255, 1.0)',
|
||||
width: 2
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.BingMaps({
|
||||
imagerySet: 'Aerial',
|
||||
key: 'AkGbxXx6tDWf1swIhPJyoAVp06H0s0gDTYslNWWHZ6RoPqMpB9ld5FY1WutX8UoF'
|
||||
})
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [raster, vector],
|
||||
target: document.getElementById('map'),
|
||||
view: new ol.View({
|
||||
center: [-8908887.277395891, 5381918.072437216],
|
||||
maxZoom: 19,
|
||||
zoom: 12
|
||||
})
|
||||
});
|
||||
|
||||
// generate a GetFeature request
|
||||
var f = ol.format.ogc.filter;
|
||||
var featureRequest = new ol.format.WFS().writeGetFeature({
|
||||
srsName: 'EPSG:3857',
|
||||
featureNS: 'http://openstreemap.org',
|
||||
featurePrefix: 'osm',
|
||||
featureTypes: ['water_areas'],
|
||||
outputFormat: 'application/json',
|
||||
filter: f.and(
|
||||
f.like('name', 'Mississippi*'),
|
||||
f.equalTo('waterway', 'riverbank')
|
||||
)
|
||||
});
|
||||
|
||||
// then post the request and add the received features to a layer
|
||||
fetch('http://demo.boundlessgeo.com/geoserver/wfs', {
|
||||
method: 'POST',
|
||||
body: new XMLSerializer().serializeToString(featureRequest)
|
||||
}).then(function(response) {
|
||||
return response.json();
|
||||
}).then(function(json) {
|
||||
var features = new ol.format.GeoJSON().readFeatures(json);
|
||||
vectorSource.addFeatures(features);
|
||||
map.getView().fit(vectorSource.getExtent(), /** @type {ol.Size} */ (map.getSize()));
|
||||
});
|
||||
@@ -18,9 +18,7 @@ var vectorSource = new ol.source.Vector({
|
||||
'outputFormat=application/json&srsname=EPSG:3857&' +
|
||||
'bbox=' + extent.join(',') + ',EPSG:3857';
|
||||
},
|
||||
strategy: ol.loadingstrategy.tile(ol.tilegrid.createXYZ({
|
||||
maxZoom: 19
|
||||
}))
|
||||
strategy: ol.loadingstrategy.bbox
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ docs: >
|
||||
With [Proj4js](http://proj4js.org/) integration, OpenLayers can transform coordinates between arbitrary projections.
|
||||
tags: "wms, single image, proj4js, projection"
|
||||
resources:
|
||||
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js
|
||||
- http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.14/proj4.js
|
||||
- http://epsg.io/21781-1753.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* @fileoverview Externs for FastClick 1.0.6
|
||||
* @see https://github.com/ftlabs/fastclick
|
||||
* @externs
|
||||
*/
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
* @const
|
||||
*/
|
||||
var FastClick = {};
|
||||
|
||||
/**
|
||||
* @typedef {{
|
||||
* touchBoundary: (number|undefined),
|
||||
* tapDelay: (number|undefined),
|
||||
* tapTimeout: (number|undefined)
|
||||
* }}
|
||||
*/
|
||||
FastClick.AttachOptions;
|
||||
|
||||
/**
|
||||
* @param {Element} layer
|
||||
* @param {FastClick.AttachOptions=} opt_options
|
||||
*/
|
||||
FastClick.attach = function(layer, opt_options) {};
|
||||
@@ -1,46 +0,0 @@
|
||||
/**
|
||||
* @fileoverview jsPDF PDF generator.
|
||||
* @see https://github.com/MrRio/jsPDF
|
||||
*/
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {string=} orientation One of `portrait` or `landscape`
|
||||
* (or shortcuts `p` (default), `l`).
|
||||
* @param {string=} unit Measurement unit to be used when coordinates are specified.
|
||||
* One of `pt`, `mm` (default), `cm`, `in`.
|
||||
* @param {string=} format Default: `a4`.
|
||||
* @param {boolean=} compressPdf
|
||||
*/
|
||||
var jsPDF = function(orientation, unit, format, compressPdf) {};
|
||||
|
||||
/**
|
||||
* @param {string} imageData
|
||||
* @param {string} format
|
||||
* @param {number} x
|
||||
* @param {number} y
|
||||
* @param {number} w
|
||||
* @param {number} h
|
||||
* @param {string=} alias
|
||||
* @param {number=} compression
|
||||
* @return {jsPDF}
|
||||
*/
|
||||
jsPDF.prototype.addImage = function(imageData, format, x, y, w, h, alias, compression) {};
|
||||
|
||||
/**
|
||||
* @return {jsPDF}
|
||||
*/
|
||||
jsPDF.prototype.autoPrint = function() {};
|
||||
|
||||
/**
|
||||
* @param {string} type
|
||||
* @param {Object=} options
|
||||
* @return {jsPDF}
|
||||
*/
|
||||
jsPDF.prototype.output = function(type, options) {};
|
||||
|
||||
/**
|
||||
* @param {string} filename
|
||||
* @return {jsPDF}
|
||||
*/
|
||||
jsPDF.prototype.save = function(filename) {};
|
||||
284
externs/olx.js
284
externs/olx.js
@@ -175,7 +175,7 @@ olx.interaction.InteractionOptions.prototype.handleEvent;
|
||||
* layers: (Array.<ol.layer.Base>|ol.Collection.<ol.layer.Base>|undefined),
|
||||
* loadTilesWhileAnimating: (boolean|undefined),
|
||||
* loadTilesWhileInteracting: (boolean|undefined),
|
||||
* logo: (boolean|string|olx.LogoOptions|undefined),
|
||||
* logo: (boolean|string|olx.LogoOptions|Element|undefined),
|
||||
* overlays: (ol.Collection.<ol.Overlay>|Array.<ol.Overlay>|undefined),
|
||||
* renderer: (ol.RendererType|Array.<ol.RendererType|string>|string|undefined),
|
||||
* target: (Element|string|undefined),
|
||||
@@ -261,9 +261,10 @@ olx.MapOptions.prototype.loadTilesWhileInteracting;
|
||||
* The map logo. A logo to be displayed on the map at all times. If a string is
|
||||
* provided, it will be set as the image source of the logo. If an object is
|
||||
* provided, the `src` property should be the URL for an image and the `href`
|
||||
* property should be a URL for creating a link. To disable the map logo, set
|
||||
* the option to `false`. By default, the OpenLayers 3 logo is shown.
|
||||
* @type {boolean|string|olx.LogoOptions|undefined}
|
||||
* property should be a URL for creating a link. If an element is provided,
|
||||
* the element will be used. To disable the map logo, set the option to
|
||||
* `false`. By default, the OpenLayers 3 logo is shown.
|
||||
* @type {boolean|string|olx.LogoOptions|Element|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.MapOptions.prototype.logo;
|
||||
@@ -2049,7 +2050,8 @@ olx.format.WFSOptions.prototype.schemaLocation;
|
||||
* propertyNames: (Array.<string>|undefined),
|
||||
* startIndex: (number|undefined),
|
||||
* count: (number|undefined),
|
||||
* bbox: (ol.Extent|undefined)}}
|
||||
* bbox: (ol.Extent|undefined),
|
||||
* filter: (ol.format.ogc.filter.Filter|undefined)}}
|
||||
* @api
|
||||
*/
|
||||
olx.format.WFSWriteGetFeatureOptions;
|
||||
@@ -2155,6 +2157,14 @@ olx.format.WFSWriteGetFeatureOptions.prototype.count;
|
||||
olx.format.WFSWriteGetFeatureOptions.prototype.bbox;
|
||||
|
||||
|
||||
/**
|
||||
* OGC filter condition. See {@link ol.format.ogc.filter} for more information.
|
||||
* @type {ol.format.ogc.filter.Filter|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.format.WFSWriteGetFeatureOptions.prototype.filter;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{featureNS: string,
|
||||
* featurePrefix: string,
|
||||
@@ -2585,6 +2595,7 @@ olx.interaction.DragZoomOptions.prototype.out;
|
||||
* type: ol.geom.GeometryType,
|
||||
* maxPoints: (number|undefined),
|
||||
* minPoints: (number|undefined),
|
||||
* finishCondition: (ol.events.ConditionType|undefined),
|
||||
* style: (ol.style.Style|Array.<ol.style.Style>|ol.style.StyleFunction|undefined),
|
||||
* geometryFunction: (ol.interaction.DrawGeometryFunctionType|undefined),
|
||||
* geometryName: (string|undefined),
|
||||
@@ -2659,6 +2670,15 @@ olx.interaction.DrawOptions.prototype.maxPoints;
|
||||
olx.interaction.DrawOptions.prototype.minPoints;
|
||||
|
||||
|
||||
/**
|
||||
* A function that takes an {@link ol.MapBrowserEvent} and returns a boolean
|
||||
* to indicate whether the drawing can be finished.
|
||||
* @type {ol.events.ConditionType|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.DrawOptions.prototype.finishCondition;
|
||||
|
||||
|
||||
/**
|
||||
* Style for sketch features.
|
||||
* @type {ol.style.Style|Array.<ol.style.Style>|ol.style.StyleFunction|undefined}
|
||||
@@ -2715,7 +2735,10 @@ olx.interaction.DrawOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{features: (ol.Collection.<ol.Feature>|undefined)}}
|
||||
* @typedef {{
|
||||
* features: (ol.Collection.<ol.Feature>|undefined),
|
||||
* layers: (undefined|Array.<ol.layer.Layer>|function(ol.layer.Layer): boolean)
|
||||
* }}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.TranslateOptions;
|
||||
@@ -2730,6 +2753,18 @@ olx.interaction.TranslateOptions;
|
||||
olx.interaction.TranslateOptions.prototype.features;
|
||||
|
||||
|
||||
/**
|
||||
* A list of layers from which features should be
|
||||
* translated. Alternatively, a filter function can be provided. The
|
||||
* function will be called for each layer in the map and should return
|
||||
* `true` for layers that you want to be translatable. If the option is
|
||||
* absent, all visible layers will be considered translatable.
|
||||
* @type {undefined|Array.<ol.layer.Layer>|function(ol.layer.Layer): boolean}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.TranslateOptions.prototype.layers;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{condition: (ol.events.ConditionType|undefined),
|
||||
* duration: (number|undefined),
|
||||
@@ -2802,7 +2837,8 @@ olx.interaction.KeyboardZoomOptions.prototype.delta;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{deleteCondition: (ol.events.ConditionType|undefined),
|
||||
* @typedef {{condition: (ol.events.ConditionType|undefined),
|
||||
* deleteCondition: (ol.events.ConditionType|undefined),
|
||||
* pixelTolerance: (number|undefined),
|
||||
* style: (ol.style.Style|Array.<ol.style.Style>|ol.style.StyleFunction|undefined),
|
||||
* features: ol.Collection.<ol.Feature>,
|
||||
@@ -2812,6 +2848,17 @@ olx.interaction.KeyboardZoomOptions.prototype.delta;
|
||||
olx.interaction.ModifyOptions;
|
||||
|
||||
|
||||
/**
|
||||
* A function that takes an {@link ol.MapBrowserEvent} and returns a boolean
|
||||
* to indicate whether that event will be considered to add or move a vertex
|
||||
* to the sketch.
|
||||
* Default is {@link ol.events.condition.primaryAction}.
|
||||
* @type {ol.events.ConditionType|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.interaction.ModifyOptions.prototype.condition;
|
||||
|
||||
|
||||
/**
|
||||
* A function that takes an {@link ol.MapBrowserEvent} and returns a boolean
|
||||
* to indicate whether that event should be handled.
|
||||
@@ -3079,7 +3126,6 @@ olx.interaction.SelectOptions.prototype.toggleCondition;
|
||||
*/
|
||||
olx.interaction.SelectOptions.prototype.multi;
|
||||
|
||||
|
||||
/**
|
||||
* Collection where the interaction will place selected features. Optional. If
|
||||
* not set the interaction will create a collection. In any case the collection
|
||||
@@ -3090,7 +3136,6 @@ olx.interaction.SelectOptions.prototype.multi;
|
||||
*/
|
||||
olx.interaction.SelectOptions.prototype.features;
|
||||
|
||||
|
||||
/**
|
||||
* A function that takes an {@link ol.Feature} and an {@link ol.layer.Layer} and
|
||||
* returns `true` if the feature may be selected or `false` otherwise.
|
||||
@@ -3783,6 +3828,7 @@ olx.layer.VectorOptions.prototype.visible;
|
||||
* maxResolution: (number|undefined),
|
||||
* opacity: (number|undefined),
|
||||
* renderBuffer: (number|undefined),
|
||||
* renderMode: (ol.layer.VectorTileRenderType|string|undefined),
|
||||
* renderOrder: (function(ol.Feature, ol.Feature):number|undefined),
|
||||
* source: (ol.source.VectorTile|undefined),
|
||||
* style: (ol.style.Style|Array.<ol.style.Style>|ol.style.StyleFunction|undefined),
|
||||
@@ -3807,6 +3853,22 @@ olx.layer.VectorTileOptions;
|
||||
olx.layer.VectorTileOptions.prototype.renderBuffer;
|
||||
|
||||
|
||||
/**
|
||||
* Render mode for vector tiles:
|
||||
* * `'image'`: Vector tiles are rendered as images. Great performance, but
|
||||
* point symbols and texts are always rotated with the view and pixels are
|
||||
* scaled during zoom animations.
|
||||
* * `'hybrid'`: Polygon and line elements are rendered as images, so pixels
|
||||
* are scaled during zoom animations. Point symbols and texts are accurately
|
||||
* rendered as vectors and can stay upright on rotated views.
|
||||
* * `'vector'`: Vector tiles are rendered as vectors. Most accurate rendering
|
||||
* even during animations, but slower performance than the other options.
|
||||
* The default is `'hybrid'`.
|
||||
* @type {ol.layer.VectorTileRenderType|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.layer.VectorTileOptions.prototype.renderMode;
|
||||
|
||||
/**
|
||||
* Render order. Function to be used when sorting features before rendering. By
|
||||
* default features are drawn in the order that they are created.
|
||||
@@ -3946,13 +4008,6 @@ olx.render.ToContextOptions.prototype.pixelRatio;
|
||||
olx.source;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {string|Array.<string>|ol.Attribution|Array.<ol.Attribution>}
|
||||
* @api
|
||||
*/
|
||||
olx.source.AttributionOption;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{cacheSize: (number|undefined),
|
||||
* culture: (string|undefined),
|
||||
@@ -4039,7 +4094,7 @@ olx.source.BingMapsOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* distance: (number|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* format: (ol.format.Feature|undefined),
|
||||
@@ -4055,7 +4110,7 @@ olx.source.ClusterOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ClusterOptions.prototype.attributions;
|
||||
@@ -4138,6 +4193,7 @@ olx.source.ClusterOptions.prototype.wrapX;
|
||||
|
||||
/**
|
||||
* @typedef {{preemptive: (boolean|undefined),
|
||||
* jsonp: (boolean|undefined),
|
||||
* tileJSON: (TileJSON|undefined),
|
||||
* url: (string|undefined)}}
|
||||
* @api
|
||||
@@ -4145,6 +4201,15 @@ olx.source.ClusterOptions.prototype.wrapX;
|
||||
olx.source.TileUTFGridOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Use JSONP with callback to load the TileJSON. Useful when the server
|
||||
* does not support CORS. Default is `false`.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileUTFGridOptions.prototype.jsonp;
|
||||
|
||||
|
||||
/**
|
||||
* If `true` the TileUTFGrid source loads the tiles based on their "visibility".
|
||||
* This improves the speed of response, but increases traffic.
|
||||
@@ -4177,7 +4242,7 @@ olx.source.TileUTFGridOptions.prototype.url;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
@@ -4202,7 +4267,7 @@ olx.source.TileImageOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileImageOptions.prototype.attributions;
|
||||
@@ -4349,11 +4414,10 @@ olx.source.TileImageOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* format: (ol.format.Feature|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* opaque: (boolean|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* state: (ol.source.State|undefined),
|
||||
* tileClass: (function(new: ol.VectorTile, ol.TileCoord,
|
||||
@@ -4373,7 +4437,7 @@ olx.source.VectorTileOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.VectorTileOptions.prototype.attributions;
|
||||
@@ -4404,14 +4468,6 @@ olx.source.VectorTileOptions.prototype.format;
|
||||
olx.source.VectorTileOptions.prototype.logo;
|
||||
|
||||
|
||||
/**
|
||||
* Whether the layer is opaque.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.VectorTileOptions.prototype.opaque;
|
||||
|
||||
|
||||
/**
|
||||
* Projection.
|
||||
* @type {ol.proj.ProjectionLike}
|
||||
@@ -4701,7 +4757,7 @@ olx.source.TileDebugOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* maxZoom: (number|undefined),
|
||||
@@ -4717,7 +4773,7 @@ olx.source.OSMOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.OSMOptions.prototype.attributions;
|
||||
@@ -4801,7 +4857,106 @@ olx.source.OSMOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* imageLoadFunction: (ol.ImageLoadFunctionType|undefined),
|
||||
* params: Object.<string,*>,
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* ratio: (number|undefined),
|
||||
* resolutions: (Array.<number>|undefined),
|
||||
* url: (string|undefined)}}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageArcGISRestOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {Array.<ol.Attribution>|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageArcGISRestOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* The `crossOrigin` attribute for loaded images. Note that you must provide a
|
||||
* `crossOrigin` value if you are using the WebGL renderer or if you want to
|
||||
* access pixel data with the Canvas renderer. See
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image}
|
||||
* for more detail.
|
||||
* @type {null|string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageArcGISRestOptions.prototype.crossOrigin;
|
||||
|
||||
|
||||
/**
|
||||
* Logo.
|
||||
* @type {string|olx.LogoOptions|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageArcGISRestOptions.prototype.logo;
|
||||
|
||||
|
||||
/**
|
||||
* Optional function to load an image given a URL.
|
||||
* @type {ol.ImageLoadFunctionType|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageArcGISRestOptions.prototype.imageLoadFunction;
|
||||
|
||||
|
||||
/**
|
||||
* ArcGIS Rest parameters. This field is optional. Service defaults will be
|
||||
* used for any fields not specified. `FORMAT` is `PNG32` by default. `F` is `IMAGE` by
|
||||
* default. `TRANSPARENT` is `true` by default. `BBOX, `SIZE`, `BBOXSR`,
|
||||
* and `IMAGESR` will be set dynamically. Set `LAYERS` to
|
||||
* override the default service layer visibility. See
|
||||
* {@link http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Map/02r3000000v7000000/}
|
||||
* for further reference.
|
||||
* @type {Object.<string,*>|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageArcGISRestOptions.prototype.params;
|
||||
|
||||
|
||||
/**
|
||||
* Projection.
|
||||
* @type {ol.proj.ProjectionLike}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageArcGISRestOptions.prototype.projection;
|
||||
|
||||
|
||||
/**
|
||||
* Ratio. `1` means image requests are the size of the map viewport, `2` means
|
||||
* twice the size of the map viewport, and so on. Default is `1.5`.
|
||||
* @type {number|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageArcGISRestOptions.prototype.ratio;
|
||||
|
||||
|
||||
/**
|
||||
* Resolutions. If specified, requests will be made for these resolutions only.
|
||||
* @type {Array.<number>|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageArcGISRestOptions.prototype.resolutions;
|
||||
|
||||
|
||||
/**
|
||||
* ArcGIS Rest service URL for a Map Service or Image Service. The
|
||||
* url should include /MapServer or /ImageServer.
|
||||
* @type {string|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageArcGISRestOptions.prototype.url;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* canvasFunction: ol.CanvasFunctionType,
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
@@ -4815,7 +4970,7 @@ olx.source.ImageCanvasOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageCanvasOptions.prototype.attributions;
|
||||
@@ -4880,7 +5035,7 @@ olx.source.ImageCanvasOptions.prototype.state;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* ratio: (number|undefined),
|
||||
@@ -4894,7 +5049,7 @@ olx.source.ImageVectorOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.ImageVectorOptions.prototype.attributions;
|
||||
@@ -5012,7 +5167,7 @@ olx.source.RasterOptions.prototype.operationType;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* hidpi: (boolean|undefined),
|
||||
* serverType: (ol.source.wms.ServerType|string|undefined),
|
||||
@@ -5030,7 +5185,7 @@ olx.source.ImageWMSOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.ImageWMSOptions.prototype.attributions;
|
||||
@@ -5210,7 +5365,7 @@ olx.source.StamenOptions.prototype.url;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* imageExtent: (ol.Extent),
|
||||
* imageLoadFunction: (ol.ImageLoadFunctionType|undefined),
|
||||
@@ -5225,7 +5380,7 @@ olx.source.ImageStaticOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.ImageStaticOptions.prototype.attributions;
|
||||
@@ -5294,7 +5449,7 @@ olx.source.ImageStaticOptions.prototype.url;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* params: (Object.<string, *>|undefined),
|
||||
@@ -5313,7 +5468,7 @@ olx.source.TileArcGISRestOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileArcGISRestOptions.prototype.attributions;
|
||||
@@ -5430,7 +5585,7 @@ olx.source.TileArcGISRestOptions.prototype.urls;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* jsonp: (boolean|undefined),
|
||||
@@ -5447,7 +5602,7 @@ olx.source.TileJSONOptions;
|
||||
* Optional attributions for the source. If provided, these will be used
|
||||
* instead of any attribution data advertised by the server. If not provided,
|
||||
* any attributions advertised by the server will be used.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.TileJSONOptions.prototype.attributions;
|
||||
@@ -5521,7 +5676,7 @@ olx.source.TileJSONOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* params: Object.<string,*>,
|
||||
* crossOrigin: (null|string|undefined),
|
||||
@@ -5544,7 +5699,7 @@ olx.source.TileWMSOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.TileWMSOptions.prototype.attributions;
|
||||
@@ -5700,7 +5855,7 @@ olx.source.TileWMSOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* features: (Array.<ol.Feature>|ol.Collection.<ol.Feature>|undefined),
|
||||
* format: (ol.format.Feature|undefined),
|
||||
* loader: (ol.FeatureLoader|undefined),
|
||||
@@ -5716,7 +5871,7 @@ olx.source.VectorOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.VectorOptions.prototype.attributions;
|
||||
@@ -5742,8 +5897,8 @@ olx.source.VectorOptions.prototype.format;
|
||||
|
||||
/**
|
||||
* The loader function used to load features, from a remote source for example.
|
||||
* Note that the source will create and use an XHR feature loader when `url` is
|
||||
* set.
|
||||
* If this is not set and `url` is set, the source will create and use an XHR
|
||||
* feature loader.
|
||||
* @type {ol.FeatureLoader|undefined}
|
||||
* @api
|
||||
*/
|
||||
@@ -5820,7 +5975,7 @@ olx.source.VectorOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (string|null|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
@@ -5850,7 +6005,7 @@ olx.source.WMTSOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.source.WMTSOptions.prototype.attributions;
|
||||
@@ -6036,7 +6191,7 @@ olx.source.WMTSOptions.prototype.wrapX;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
@@ -6060,7 +6215,7 @@ olx.source.XYZOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.XYZOptions.prototype.attributions;
|
||||
@@ -6210,7 +6365,7 @@ olx.source.XYZOptions.prototype.urls;
|
||||
olx.source.XYZOptions.prototype.wrapX;
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
@@ -6228,7 +6383,7 @@ olx.source.CartoDBOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.CartoDBOptions.prototype.attributions;
|
||||
@@ -6326,7 +6481,7 @@ olx.source.CartoDBOptions.prototype.account;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (olx.source.AttributionOption|undefined),
|
||||
* @typedef {{attributions: (ol.AttributionLike|undefined),
|
||||
* cacheSize: (number|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
@@ -6341,7 +6496,7 @@ olx.source.ZoomifyOptions;
|
||||
|
||||
/**
|
||||
* Attributions.
|
||||
* @type {olx.source.AttributionOption|undefined}
|
||||
* @type {ol.AttributionLike|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
olx.source.ZoomifyOptions.prototype.attributions;
|
||||
@@ -7272,7 +7427,8 @@ olx.view;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{padding: !Array.<number>,
|
||||
* @typedef {{
|
||||
* padding: (!Array.<number>|undefined),
|
||||
* constrainResolution: (boolean|undefined),
|
||||
* nearest: (boolean|undefined),
|
||||
* maxZoom: (number|undefined),
|
||||
@@ -7285,7 +7441,7 @@ olx.view.FitOptions;
|
||||
/**
|
||||
* Padding (in pixels) to be cleared inside the view. Values in the array are
|
||||
* top, right, bottom and left padding. Default is `[0, 0, 0, 0]`.
|
||||
* @type {!Array.<number>}
|
||||
* @type {!Array.<number>|undefined}
|
||||
* @api
|
||||
*/
|
||||
olx.view.FitOptions.prototype.padding;
|
||||
@@ -7334,9 +7490,9 @@ olx.view.FitOptions.prototype.maxZoom;
|
||||
* extent: (null|ol.Extent),
|
||||
* focus: ol.Coordinate,
|
||||
* index: number,
|
||||
* layerStates: Object.<number, ol.layer.LayerState>,
|
||||
* layerStatesArray: Array.<ol.layer.LayerState>,
|
||||
* logos: Object.<string, string>,
|
||||
* layerStates: Object.<number, ol.LayerState>,
|
||||
* layerStatesArray: Array.<ol.LayerState>,
|
||||
* logos: Object.<string, (string|Element)>,
|
||||
* pixelRatio: number,
|
||||
* pixelToCoordinateMatrix: ol.vec.Mat4.Number,
|
||||
* postRenderFunctions: Array.<ol.PostRenderFunction>,
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
/**
|
||||
* @externs
|
||||
* @see http://www.khronos.org/webgl/wiki/Debugging
|
||||
* @see http://www.khronos.org/webgl/wiki/HandlingContextLost
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {WebGLRenderingContext}
|
||||
*/
|
||||
var WebGLDebugRenderingContext = function() {};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {HTMLCanvasElement}
|
||||
*/
|
||||
var WebGLDebugLostContextSimulatingCanvas = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @nosideeffects
|
||||
* @return {number}
|
||||
*/
|
||||
WebGLDebugLostContextSimulatingCanvas.prototype.getNumCalls = function() {};
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
WebGLDebugLostContextSimulatingCanvas.prototype.loseContext = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} numCalls
|
||||
*/
|
||||
WebGLDebugLostContextSimulatingCanvas.prototype.loseContextInNCalls =
|
||||
function(numCalls) {};
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
WebGLDebugLostContextSimulatingCanvas.prototype.restoreContext = function() {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} timeout
|
||||
*/
|
||||
WebGLDebugLostContextSimulatingCanvas.prototype.setRestoreTimeout =
|
||||
function(timeout) {};
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
var WebGLDebugUtils = {};
|
||||
|
||||
|
||||
/**
|
||||
* @nosideeffects
|
||||
* @param {number} value
|
||||
* @return {string}
|
||||
*/
|
||||
WebGLDebugUtils.glEnumToString = function(value) {};
|
||||
|
||||
|
||||
/**
|
||||
* @nosideeffects
|
||||
* @param {string} functionName
|
||||
* @param {Array} args Args.
|
||||
* @return {string} String.
|
||||
*/
|
||||
WebGLDebugUtils.glFunctionArgsToString = function(functionName, args) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {WebGLRenderingContext} ctx
|
||||
*/
|
||||
WebGLDebugUtils.init = function(ctx) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {HTMLCanvasElement} canvas
|
||||
* @return {WebGLDebugLostContextSimulatingCanvas}
|
||||
*/
|
||||
WebGLDebugUtils.makeLostContextSimulatingCanvas = function(canvas) {};
|
||||
|
||||
|
||||
/**
|
||||
* @param {WebGLRenderingContext} context
|
||||
* @param {Function=} opt_onErrorFunc
|
||||
* @param {Function=} opt_onFunc
|
||||
* @return {WebGLDebugRenderingContext}
|
||||
*/
|
||||
WebGLDebugUtils.makeDebugContext =
|
||||
function(context, opt_onErrorFunc, opt_onFunc) {};
|
||||
22
package.json
22
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openlayers",
|
||||
"version": "3.15.1",
|
||||
"version": "3.16.0-alpha.4",
|
||||
"description": "Build tools and sources for developing OpenLayers based mapping applications",
|
||||
"keywords": [
|
||||
"map",
|
||||
@@ -31,41 +31,41 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"async": "1.5.2",
|
||||
"browserify": "13.0.0",
|
||||
"closure-util": "1.13.0",
|
||||
"browserify": "13.0.1",
|
||||
"closure-util": "1.13.1",
|
||||
"derequire": "2.0.3",
|
||||
"fs-extra": "0.26.6",
|
||||
"fs-extra": "0.30.0",
|
||||
"glob": "6.0.4",
|
||||
"handlebars": "4.0.5",
|
||||
"jsdoc": "3.4.0",
|
||||
"marked": "0.3.5",
|
||||
"metalsmith": "2.1.0",
|
||||
"metalsmith-layouts": "1.6.4",
|
||||
"metalsmith-layouts": "1.6.5",
|
||||
"nomnom": "1.8.1",
|
||||
"pbf": "1.3.5",
|
||||
"pixelworks": "1.1.0",
|
||||
"rbush": "1.4.2",
|
||||
"rbush": "1.4.3",
|
||||
"temp": "0.8.3",
|
||||
"vector-tile": "1.2.0",
|
||||
"walk": "2.3.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"clean-css": "3.4.11",
|
||||
"clean-css": "3.4.12",
|
||||
"coveralls": "2.11.9",
|
||||
"debounce": "^1.0.0",
|
||||
"eslint": "2.6.0",
|
||||
"eslint": "2.10.2",
|
||||
"eslint-config-openlayers": "4.1.0",
|
||||
"expect.js": "0.3.1",
|
||||
"gaze": "^1.0.0",
|
||||
"istanbul": "0.4.2",
|
||||
"jquery": "2.2.2",
|
||||
"istanbul": "0.4.3",
|
||||
"jquery": "2.2.3",
|
||||
"mocha": "2.4.5",
|
||||
"mocha-phantomjs-core": "^1.3.0",
|
||||
"mustache": "2.2.1",
|
||||
"phantomjs-prebuilt": "2.1.7",
|
||||
"proj4": "2.3.14",
|
||||
"resemblejs": "2.2.0",
|
||||
"sinon": "1.17.3",
|
||||
"sinon": "1.17.4",
|
||||
"slimerjs": "0.906.1"
|
||||
},
|
||||
"eslintConfig": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
goog.provide('ol.animation');
|
||||
|
||||
goog.require('ol');
|
||||
goog.require('ol.PreRenderFunction');
|
||||
goog.require('ol.ViewHint');
|
||||
goog.require('ol.coordinate');
|
||||
goog.require('ol.easing');
|
||||
|
||||
@@ -232,9 +232,9 @@ ol.array.find = function(arr, func) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array|Uint8ClampedArray} arr1 The first array to compare.
|
||||
* @param {Array|Uint8ClampedArray} arr2 The second array to compare.
|
||||
* @return {boolean} Whether the two arrays are equal.
|
||||
* @param {Array|Uint8ClampedArray} arr1 The first array to compare.
|
||||
* @param {Array|Uint8ClampedArray} arr2 The second array to compare.
|
||||
* @return {boolean} Whether the two arrays are equal.
|
||||
*/
|
||||
ol.array.equals = function(arr1, arr2) {
|
||||
var len1 = arr1.length;
|
||||
@@ -251,8 +251,8 @@ ol.array.equals = function(arr1, arr2) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<*>} arr The array to sort (modifies original).
|
||||
* @param {Function} compareFnc Comparison function.
|
||||
* @param {Array.<*>} arr The array to sort (modifies original).
|
||||
* @param {Function} compareFnc Comparison function.
|
||||
*/
|
||||
ol.array.stableSort = function(arr, compareFnc) {
|
||||
var length = arr.length;
|
||||
@@ -271,9 +271,9 @@ ol.array.stableSort = function(arr, compareFnc) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<*>} arr The array to search in.
|
||||
* @param {Function} func Comparison function.
|
||||
* @return {number} Return index.
|
||||
* @param {Array.<*>} arr The array to search in.
|
||||
* @param {Function} func Comparison function.
|
||||
* @return {number} Return index.
|
||||
*/
|
||||
ol.array.findIndex = function(arr, func) {
|
||||
var index;
|
||||
@@ -286,10 +286,10 @@ ol.array.findIndex = function(arr, func) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<*>} arr The array to test.
|
||||
* @param {Function=} opt_func Comparison function.
|
||||
* @param {boolean=} opt_strict Strictly sorted (default false).
|
||||
* @return {boolean} Return index.
|
||||
* @param {Array.<*>} arr The array to test.
|
||||
* @param {Function=} opt_func Comparison function.
|
||||
* @param {boolean=} opt_strict Strictly sorted (default false).
|
||||
* @return {boolean} Return index.
|
||||
*/
|
||||
ol.array.isSorted = function(arr, opt_func, opt_strict) {
|
||||
var compare = opt_func || ol.array.numberSafeCompareFunction;
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
goog.provide('ol.CanvasFunctionType');
|
||||
|
||||
|
||||
/**
|
||||
* A function returning the canvas element (`{HTMLCanvasElement}`)
|
||||
* used by the source as an image. The arguments passed to the function are:
|
||||
* {@link ol.Extent} the image extent, `{number}` the image resolution,
|
||||
* `{number}` the device pixel ratio, {@link ol.Size} the image size, and
|
||||
* {@link ol.proj.Projection} the image projection. The canvas returned by
|
||||
* this function is cached by the source. The this keyword inside the function
|
||||
* references the {@link ol.source.ImageCanvas}.
|
||||
*
|
||||
* @typedef {function(this:ol.source.ImageCanvas, ol.Extent, number,
|
||||
* number, ol.Size, ol.proj.Projection): HTMLCanvasElement}
|
||||
* @api
|
||||
*/
|
||||
ol.CanvasFunctionType;
|
||||
@@ -1,15 +1,8 @@
|
||||
goog.provide('ol.CenterConstraint');
|
||||
goog.provide('ol.CenterConstraintType');
|
||||
|
||||
goog.require('ol.math');
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {function((ol.Coordinate|undefined)): (ol.Coordinate|undefined)}
|
||||
*/
|
||||
ol.CenterConstraintType;
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @return {ol.CenterConstraintType} The constraint.
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// causes occasional loss of precision and rounding errors, especially in the
|
||||
// alpha channel.
|
||||
|
||||
goog.provide('ol.Color');
|
||||
goog.provide('ol.color');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
@@ -13,17 +12,6 @@ goog.require('ol');
|
||||
goog.require('ol.math');
|
||||
|
||||
|
||||
/**
|
||||
* A color represented as a short array [red, green, blue, alpha].
|
||||
* red, green, and blue should be integers in the range 0..255 inclusive.
|
||||
* alpha should be a float in the range 0..1 inclusive. If no alpha value is
|
||||
* given then `1` will be used.
|
||||
* @typedef {Array.<number>}
|
||||
* @api
|
||||
*/
|
||||
ol.Color;
|
||||
|
||||
|
||||
/**
|
||||
* This RegExp matches # followed by 3 or 6 hex digits.
|
||||
* @const
|
||||
|
||||
@@ -1,19 +1,8 @@
|
||||
goog.provide('ol.ColorLike');
|
||||
goog.provide('ol.colorlike');
|
||||
|
||||
goog.require('ol.color');
|
||||
|
||||
|
||||
/**
|
||||
* A type accepted by CanvasRenderingContext2D.fillStyle.
|
||||
* Represents a color, pattern, or gradient.
|
||||
*
|
||||
* @typedef {string|CanvasPattern|CanvasGradient}
|
||||
* @api
|
||||
*/
|
||||
ol.ColorLike;
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Color|ol.ColorLike} color Color.
|
||||
* @return {ol.ColorLike} The color as an ol.ColorLike
|
||||
|
||||
5
src/ol/colorlike.jsdoc
Normal file
5
src/ol/colorlike.jsdoc
Normal file
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* An {@link ol.ColorLike} can be a color, gradient or pattern accepted by
|
||||
* [CanvasRenderingContext2D.fillStyle](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle).
|
||||
* @namespace ol.colorlike
|
||||
*/
|
||||
@@ -1,9 +1,5 @@
|
||||
goog.provide('ol.Constraints');
|
||||
|
||||
goog.require('ol.CenterConstraintType');
|
||||
goog.require('ol.ResolutionConstraintType');
|
||||
goog.require('ol.RotationConstraintType');
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
|
||||
@@ -303,10 +303,14 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
|
||||
|
||||
var image, logoElement, logoKey;
|
||||
for (logoKey in logos) {
|
||||
var logoValue = logos[logoKey];
|
||||
if (logoValue instanceof HTMLElement) {
|
||||
this.logoLi_.appendChild(logoValue);
|
||||
logoElements[logoKey] = logoValue;
|
||||
}
|
||||
if (!(logoKey in logoElements)) {
|
||||
image = new Image();
|
||||
image.src = logoKey;
|
||||
var logoValue = logos[logoKey];
|
||||
if (logoValue === '') {
|
||||
logoElement = image;
|
||||
} else {
|
||||
|
||||
@@ -156,7 +156,7 @@ ol.control.FullScreen.prototype.setMap = function(map) {
|
||||
goog.base(this, 'setMap', map);
|
||||
if (map) {
|
||||
this.listenerKeys.push(
|
||||
ol.events.listen(goog.global.document, goog.dom.fullscreen.EventType.CHANGE,
|
||||
ol.events.listen(ol.global.document, goog.dom.fullscreen.EventType.CHANGE,
|
||||
this.handleFullScreenChange_, this)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,10 +4,7 @@ goog.provide('ol.control.MousePosition');
|
||||
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.events.EventType');
|
||||
goog.require('ol.CoordinateFormatType');
|
||||
goog.require('ol.Object');
|
||||
goog.require('ol.Pixel');
|
||||
goog.require('ol.TransformFunction');
|
||||
goog.require('ol.control.Control');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.proj.Projection');
|
||||
|
||||
@@ -40,7 +40,7 @@ ol.control.Rotate = function(opt_options) {
|
||||
'ol-compass', label);
|
||||
} else {
|
||||
this.label_ = label;
|
||||
this.label_.classList.add(this.label_, 'ol-compass');
|
||||
this.label_.classList.add('ol-compass');
|
||||
}
|
||||
|
||||
var tipLabel = options.tipLabel ? options.tipLabel : 'Reset rotation';
|
||||
|
||||
@@ -42,9 +42,8 @@ ol.control.Zoom = function(opt_options) {
|
||||
'title': zoomInTipLabel
|
||||
}, zoomInLabel);
|
||||
|
||||
ol.events.listen(inElement,
|
||||
ol.events.EventType.CLICK, goog.partial(
|
||||
ol.control.Zoom.prototype.handleClick_, delta), this);
|
||||
ol.events.listen(inElement, ol.events.EventType.CLICK,
|
||||
ol.control.Zoom.prototype.handleClick_.bind(this, delta));
|
||||
|
||||
var outElement = goog.dom.createDom('BUTTON', {
|
||||
'class': className + '-out',
|
||||
@@ -52,9 +51,8 @@ ol.control.Zoom = function(opt_options) {
|
||||
'title': zoomOutTipLabel
|
||||
}, zoomOutLabel);
|
||||
|
||||
ol.events.listen(outElement,
|
||||
ol.events.EventType.CLICK, goog.partial(
|
||||
ol.control.Zoom.prototype.handleClick_, -delta), this);
|
||||
ol.events.listen(outElement, ol.events.EventType.CLICK,
|
||||
ol.control.Zoom.prototype.handleClick_.bind(this, -delta));
|
||||
|
||||
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
|
||||
ol.css.CLASS_CONTROL;
|
||||
|
||||
@@ -9,7 +9,6 @@ goog.require('ol.events');
|
||||
goog.require('ol.events.Event');
|
||||
goog.require('ol.events.EventType');
|
||||
goog.require('ol.pointer.PointerEventHandler');
|
||||
goog.require('ol.Size');
|
||||
goog.require('ol.ViewHint');
|
||||
goog.require('ol.animation');
|
||||
goog.require('ol.control.Control');
|
||||
|
||||
@@ -1,27 +1,7 @@
|
||||
goog.provide('ol.Coordinate');
|
||||
goog.provide('ol.CoordinateFormatType');
|
||||
goog.provide('ol.coordinate');
|
||||
|
||||
goog.require('goog.string');
|
||||
goog.require('ol.math');
|
||||
|
||||
|
||||
/**
|
||||
* A function that takes a {@link ol.Coordinate} and transforms it into a
|
||||
* `{string}`.
|
||||
*
|
||||
* @typedef {function((ol.Coordinate|undefined)): string}
|
||||
* @api stable
|
||||
*/
|
||||
ol.CoordinateFormatType;
|
||||
|
||||
|
||||
/**
|
||||
* An array of numbers representing an xy coordinate. Example: `[16, 48]`.
|
||||
* @typedef {Array.<number>} ol.Coordinate
|
||||
* @api stable
|
||||
*/
|
||||
ol.Coordinate;
|
||||
goog.require('ol.string');
|
||||
|
||||
|
||||
/**
|
||||
@@ -133,8 +113,8 @@ ol.coordinate.degreesToStringHDMS_ = function(degrees, hemispheres, opt_fraction
|
||||
var x = Math.abs(3600 * normalizedDegrees);
|
||||
var dflPrecision = opt_fractionDigits || 0;
|
||||
return Math.floor(x / 3600) + '\u00b0 ' +
|
||||
goog.string.padNumber(Math.floor((x / 60) % 60), 2) + '\u2032 ' +
|
||||
goog.string.padNumber((x % 60), 2, dflPrecision) + '\u2033 ' +
|
||||
ol.string.padNumber(Math.floor((x / 60) % 60), 2) + '\u2032 ' +
|
||||
ol.string.padNumber((x % 60), 2, dflPrecision) + '\u2033 ' +
|
||||
hemispheres.charAt(normalizedDegrees < 0 ? 1 : 0);
|
||||
};
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ ol.DeviceOrientation.prototype.handleTrackingChanged_ = function() {
|
||||
if (ol.has.DEVICE_ORIENTATION) {
|
||||
var tracking = this.getTracking();
|
||||
if (tracking && !this.listenerKey_) {
|
||||
this.listenerKey_ = ol.events.listen(goog.global, 'deviceorientation',
|
||||
this.listenerKey_ = ol.events.listen(ol.global, 'deviceorientation',
|
||||
this.orientationChange_, this);
|
||||
} else if (!tracking && this.listenerKey_ !== null) {
|
||||
ol.events.unlistenByKey(this.listenerKey_);
|
||||
|
||||
@@ -36,7 +36,7 @@ ol.dom.canUseCssTransform = (function() {
|
||||
if (canUseCssTransform === undefined) {
|
||||
goog.asserts.assert(document.body,
|
||||
'document.body should not be null');
|
||||
goog.asserts.assert(goog.global.getComputedStyle,
|
||||
goog.asserts.assert(ol.global.getComputedStyle,
|
||||
'getComputedStyle is required (unsupported browser?)');
|
||||
|
||||
var el = document.createElement('P'),
|
||||
@@ -52,7 +52,7 @@ ol.dom.canUseCssTransform = (function() {
|
||||
for (var t in transforms) {
|
||||
if (t in el.style) {
|
||||
el.style[t] = 'translate(1px,1px)';
|
||||
has2d = goog.global.getComputedStyle(el).getPropertyValue(
|
||||
has2d = ol.global.getComputedStyle(el).getPropertyValue(
|
||||
transforms[t]);
|
||||
}
|
||||
}
|
||||
@@ -77,7 +77,7 @@ ol.dom.canUseCssTransform3D = (function() {
|
||||
if (canUseCssTransform3D === undefined) {
|
||||
goog.asserts.assert(document.body,
|
||||
'document.body should not be null');
|
||||
goog.asserts.assert(goog.global.getComputedStyle,
|
||||
goog.asserts.assert(ol.global.getComputedStyle,
|
||||
'getComputedStyle is required (unsupported browser?)');
|
||||
|
||||
var el = document.createElement('P'),
|
||||
@@ -93,7 +93,7 @@ ol.dom.canUseCssTransform3D = (function() {
|
||||
for (var t in transforms) {
|
||||
if (t in el.style) {
|
||||
el.style[t] = 'translate3d(1px,1px,1px)';
|
||||
has3d = goog.global.getComputedStyle(el).getPropertyValue(
|
||||
has3d = ol.global.getComputedStyle(el).getPropertyValue(
|
||||
transforms[t]);
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,7 @@ ol.dom.transformElement2D = function(element, transform, opt_precision) {
|
||||
*/
|
||||
ol.dom.outerWidth = function(element) {
|
||||
var width = element.offsetWidth;
|
||||
var style = element.currentStyle || goog.global.getComputedStyle(element);
|
||||
var style = element.currentStyle || ol.global.getComputedStyle(element);
|
||||
width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
|
||||
|
||||
return width;
|
||||
@@ -208,7 +208,7 @@ ol.dom.outerWidth = function(element) {
|
||||
*/
|
||||
ol.dom.outerHeight = function(element) {
|
||||
var height = element.offsetHeight;
|
||||
var style = element.currentStyle || goog.global.getComputedStyle(element);
|
||||
var style = element.currentStyle || ol.global.getComputedStyle(element);
|
||||
height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);
|
||||
|
||||
return height;
|
||||
|
||||
@@ -3,6 +3,7 @@ goog.provide('ol.events.EventType');
|
||||
goog.provide('ol.events.KeyCode');
|
||||
|
||||
goog.require('ol.object');
|
||||
goog.require('ol.events.EventTargetLike');
|
||||
|
||||
|
||||
/**
|
||||
@@ -61,40 +62,6 @@ ol.events.KeyCode = {
|
||||
ol.events.LISTENER_MAP_PROP_ = 'olm_' + ((Math.random() * 1e4) | 0);
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {EventTarget|ol.events.EventTarget|
|
||||
* {addEventListener: function(string, Function, boolean=),
|
||||
* removeEventListener: function(string, Function, boolean=),
|
||||
* dispatchEvent: function(string)}}
|
||||
*/
|
||||
ol.events.EventTargetLike;
|
||||
|
||||
|
||||
/**
|
||||
* Key to use with {@link ol.Observable#unByKey}.
|
||||
*
|
||||
* @typedef {{bindTo: (Object|undefined),
|
||||
* boundListener: (ol.events.ListenerFunctionType|undefined),
|
||||
* callOnce: boolean,
|
||||
* deleteIndex: (number|undefined),
|
||||
* listener: ol.events.ListenerFunctionType,
|
||||
* target: (EventTarget|ol.events.EventTarget),
|
||||
* type: string}}
|
||||
* @api
|
||||
*/
|
||||
ol.events.Key;
|
||||
|
||||
|
||||
/**
|
||||
* Listener function. This function is called with an event object as argument.
|
||||
* When the function returns `false`, event propagation will stop.
|
||||
*
|
||||
* @typedef {function(ol.events.Event)|function(ol.events.Event): boolean}
|
||||
* @api
|
||||
*/
|
||||
ol.events.ListenerFunctionType;
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.events.Key} listenerObj Listener object.
|
||||
* @return {ol.events.ListenerFunctionType} Bound listener.
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
goog.provide('ol.events.ConditionType');
|
||||
goog.provide('ol.events.condition');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
@@ -7,16 +6,6 @@ goog.require('ol.MapBrowserEvent.EventType');
|
||||
goog.require('ol.MapBrowserPointerEvent');
|
||||
|
||||
|
||||
/**
|
||||
* A function that takes an {@link ol.MapBrowserEvent} and returns a
|
||||
* `{boolean}`. If the condition is met, true should be returned.
|
||||
*
|
||||
* @typedef {function(ol.MapBrowserEvent): boolean}
|
||||
* @api stable
|
||||
*/
|
||||
ol.events.ConditionType;
|
||||
|
||||
|
||||
/**
|
||||
* Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when
|
||||
* additionally the shift-key is pressed).
|
||||
@@ -221,3 +210,18 @@ ol.events.condition.mouseOnly = function(mapBrowserEvent) {
|
||||
// see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
||||
return mapBrowserEvent.pointerEvent.pointerType == 'mouse';
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Return `true` if the event originates from a primary pointer in
|
||||
* contact with the surface or if the left mouse button is pressed.
|
||||
* @see http://www.w3.org/TR/pointerevents/#button-states
|
||||
*
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event originates from a primary pointer.
|
||||
* @api
|
||||
*/
|
||||
ol.events.condition.primaryAction = function(mapBrowserEvent) {
|
||||
var pointerEvent = mapBrowserEvent.pointerEvent;
|
||||
return pointerEvent.isPrimary && pointerEvent.button === 0;
|
||||
};
|
||||
|
||||
@@ -33,6 +33,12 @@ ol.events.EventTarget = function() {
|
||||
*/
|
||||
this.pendingRemovals_ = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string, number>}
|
||||
*/
|
||||
this.dispatching_ = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string, Array.<ol.events.ListenerFunctionType>>}
|
||||
@@ -72,20 +78,26 @@ ol.events.EventTarget.prototype.dispatchEvent = function(event) {
|
||||
var listeners = this.listeners_[type];
|
||||
var propagate;
|
||||
if (listeners) {
|
||||
if (!(type in this.pendingRemovals_)) {
|
||||
if (!(type in this.dispatching_)) {
|
||||
this.dispatching_[type] = 0;
|
||||
this.pendingRemovals_[type] = 0;
|
||||
}
|
||||
++this.dispatching_[type];
|
||||
for (var i = 0, ii = listeners.length; i < ii; ++i) {
|
||||
if (listeners[i].call(this, evt) === false || evt.propagationStopped) {
|
||||
propagate = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
--this.dispatching_[type];
|
||||
if (this.dispatching_[type] === 0) {
|
||||
var pendingRemovals = this.pendingRemovals_[type];
|
||||
delete this.pendingRemovals_[type];
|
||||
while (pendingRemovals--) {
|
||||
this.removeEventListener(type, ol.nullFunction);
|
||||
}
|
||||
delete this.dispatching_[type];
|
||||
}
|
||||
return propagate;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,21 +1,8 @@
|
||||
goog.provide('ol.Extent');
|
||||
goog.provide('ol.extent');
|
||||
goog.provide('ol.extent.Corner');
|
||||
goog.provide('ol.extent.Relationship');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.vec.Mat4');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Size');
|
||||
goog.require('ol.TransformFunction');
|
||||
|
||||
|
||||
/**
|
||||
* An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.
|
||||
* @typedef {Array.<number>}
|
||||
* @api stable
|
||||
*/
|
||||
ol.Extent;
|
||||
|
||||
|
||||
/**
|
||||
@@ -878,37 +865,3 @@ ol.extent.applyTransform = function(extent, transformFn, opt_extent) {
|
||||
var ys = [coordinates[1], coordinates[3], coordinates[5], coordinates[7]];
|
||||
return ol.extent.boundingExtentXYs_(xs, ys, opt_extent);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Apply a 2d transform to an extent.
|
||||
* @param {ol.Extent} extent Input extent.
|
||||
* @param {goog.vec.Mat4.Number} transform The transform matrix.
|
||||
* @param {ol.Extent=} opt_extent Optional extent for return values.
|
||||
* @return {ol.Extent} The transformed extent.
|
||||
*/
|
||||
ol.extent.transform2D = function(extent, transform, opt_extent) {
|
||||
var dest = opt_extent ? opt_extent : [];
|
||||
var m00 = goog.vec.Mat4.getElement(transform, 0, 0);
|
||||
var m10 = goog.vec.Mat4.getElement(transform, 1, 0);
|
||||
var m01 = goog.vec.Mat4.getElement(transform, 0, 1);
|
||||
var m11 = goog.vec.Mat4.getElement(transform, 1, 1);
|
||||
var m03 = goog.vec.Mat4.getElement(transform, 0, 3);
|
||||
var m13 = goog.vec.Mat4.getElement(transform, 1, 3);
|
||||
var xi = [0, 2, 0, 2];
|
||||
var yi = [1, 1, 3, 3];
|
||||
var xs = [];
|
||||
var ys = [];
|
||||
var i, x, y;
|
||||
for (i = 0; i < 4; ++i) {
|
||||
x = extent[xi[i]];
|
||||
y = extent[yi[i]];
|
||||
xs[i] = m00 * x + m01 * y + m03;
|
||||
ys[i] = m10 * x + m11 * y + m13;
|
||||
}
|
||||
dest[0] = Math.min.apply(null, xs);
|
||||
dest[1] = Math.min.apply(null, ys);
|
||||
dest[2] = Math.max.apply(null, xs);
|
||||
dest[3] = Math.max.apply(null, ys);
|
||||
return dest;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
goog.provide('ol.Feature');
|
||||
goog.provide('ol.FeatureStyleFunction');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('ol.events');
|
||||
@@ -284,18 +283,6 @@ ol.Feature.prototype.setGeometryName = function(name) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* A function that returns an array of {@link ol.style.Style styles} given a
|
||||
* resolution. The `this` keyword inside the function references the
|
||||
* {@link ol.Feature} to be styled.
|
||||
*
|
||||
* @typedef {function(this: ol.Feature, number):
|
||||
* (ol.style.Style|Array.<ol.style.Style>)}
|
||||
* @api stable
|
||||
*/
|
||||
ol.FeatureStyleFunction;
|
||||
|
||||
|
||||
/**
|
||||
* Convert the provided object into a feature style function. Functions passed
|
||||
* through unchanged. Arrays of ol.style.Style or single style objects wrapped
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
goog.provide('ol.FeatureLoader');
|
||||
goog.provide('ol.FeatureUrlFunction');
|
||||
goog.provide('ol.featureloader');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
@@ -11,38 +9,6 @@ goog.require('ol.proj.Projection');
|
||||
goog.require('ol.xml');
|
||||
|
||||
|
||||
/**
|
||||
* {@link ol.source.Vector} sources use a function of this type to load
|
||||
* features.
|
||||
*
|
||||
* This function takes an {@link ol.Extent} representing the area to be loaded,
|
||||
* a `{number}` representing the resolution (map units per pixel) and an
|
||||
* {@link ol.proj.Projection} for the projection as arguments. `this` within
|
||||
* the function is bound to the {@link ol.source.Vector} it's called from.
|
||||
*
|
||||
* The function is responsible for loading the features and adding them to the
|
||||
* source.
|
||||
* @api
|
||||
* @typedef {function(this:ol.source.Vector, ol.Extent, number,
|
||||
* ol.proj.Projection)}
|
||||
*/
|
||||
ol.FeatureLoader;
|
||||
|
||||
|
||||
/**
|
||||
* {@link ol.source.Vector} sources use a function of this type to get the url
|
||||
* to load features from.
|
||||
*
|
||||
* This function takes an {@link ol.Extent} representing the area to be loaded,
|
||||
* a `{number}` representing the resolution (map units per pixel) and an
|
||||
* {@link ol.proj.Projection} for the projection as arguments and returns a
|
||||
* `{string}` representing the URL.
|
||||
* @api
|
||||
* @typedef {function(ol.Extent, number, ol.proj.Projection) : string}
|
||||
*/
|
||||
ol.FeatureUrlFunction;
|
||||
|
||||
|
||||
/**
|
||||
* @param {string|ol.FeatureUrlFunction} url Feature URL service.
|
||||
* @param {ol.format.Feature} format Feature format.
|
||||
|
||||
@@ -166,7 +166,7 @@ ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
@@ -179,7 +179,7 @@ ol.format.GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
@@ -192,7 +192,7 @@ ol.format.GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML2.prototype.BOX_PARSERS_ = {
|
||||
@@ -205,7 +205,7 @@ ol.format.GML2.prototype.BOX_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML2.prototype.GEOMETRY_PARSERS_ = {
|
||||
|
||||
@@ -450,7 +450,7 @@ ol.format.GML3.prototype.readFlatPosList_ = function(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
@@ -463,7 +463,7 @@ ol.format.GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
@@ -476,7 +476,7 @@ ol.format.GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.GEOMETRY_PARSERS_ = {
|
||||
@@ -506,7 +506,7 @@ ol.format.GML3.prototype.GEOMETRY_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.MULTICURVE_PARSERS_ = {
|
||||
@@ -521,7 +521,7 @@ ol.format.GML3.prototype.MULTICURVE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.MULTISURFACE_PARSERS_ = {
|
||||
@@ -536,7 +536,7 @@ ol.format.GML3.prototype.MULTISURFACE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
||||
@@ -550,7 +550,7 @@ ol.format.GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
||||
@@ -563,7 +563,7 @@ ol.format.GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.SURFACE_PARSERS_ = {
|
||||
@@ -575,7 +575,7 @@ ol.format.GML3.prototype.SURFACE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.CURVE_PARSERS_ = {
|
||||
@@ -587,7 +587,7 @@ ol.format.GML3.prototype.CURVE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.ENVELOPE_PARSERS_ = {
|
||||
@@ -602,7 +602,7 @@ ol.format.GML3.prototype.ENVELOPE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.PATCHES_PARSERS_ = {
|
||||
@@ -615,7 +615,7 @@ ol.format.GML3.prototype.PATCHES_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.prototype.SEGMENTS_PARSERS_ = {
|
||||
@@ -712,7 +712,7 @@ ol.format.GML3.prototype.writePoint_ = function(node, geometry, objectStack) {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.ENVELOPE_SERIALIZERS_ = {
|
||||
@@ -738,7 +738,7 @@ ol.format.GML3.prototype.writeEnvelope = function(node, extent, objectStack) {
|
||||
}
|
||||
var keys = ['lowerCorner', 'upperCorner'];
|
||||
var values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
|
||||
({node: node}), ol.format.GML3.ENVELOPE_SERIALIZERS_,
|
||||
ol.xml.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
values,
|
||||
@@ -1019,7 +1019,7 @@ ol.format.GML3.prototype.writeGeometryElement = function(node, geometry, objectS
|
||||
value =
|
||||
ol.format.Feature.transformWithOptions(geometry, true, context);
|
||||
}
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
|
||||
(item), ol.format.GML3.GEOMETRY_SERIALIZERS_,
|
||||
this.GEOMETRY_NODE_FACTORY_, [value],
|
||||
objectStack, undefined, this);
|
||||
@@ -1066,7 +1066,7 @@ ol.format.GML3.prototype.writeFeatureElement = function(node, feature, objectSta
|
||||
}
|
||||
var item = ol.object.assign({}, context);
|
||||
item.node = node;
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
|
||||
(item), context.serializers,
|
||||
ol.xml.makeSimpleNodeFactory(undefined, featureNS),
|
||||
values,
|
||||
@@ -1091,7 +1091,7 @@ ol.format.GML3.prototype.writeFeatureMembers_ = function(node, features, objectS
|
||||
this.writeFeatureElement, this);
|
||||
var item = ol.object.assign({}, context);
|
||||
item.node = node;
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
|
||||
(item),
|
||||
serializers,
|
||||
ol.xml.makeSimpleNodeFactory(featureType, featureNS), features,
|
||||
@@ -1100,7 +1100,7 @@ ol.format.GML3.prototype.writeFeatureMembers_ = function(node, features, objectS
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
@@ -1114,7 +1114,7 @@ ol.format.GML3.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.POINTMEMBER_SERIALIZERS_ = {
|
||||
@@ -1126,7 +1126,7 @@ ol.format.GML3.POINTMEMBER_SERIALIZERS_ = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
@@ -1140,7 +1140,7 @@ ol.format.GML3.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.RING_SERIALIZERS_ = {
|
||||
@@ -1152,7 +1152,7 @@ ol.format.GML3.RING_SERIALIZERS_ = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GML3.GEOMETRY_SERIALIZERS_ = {
|
||||
|
||||
@@ -106,13 +106,13 @@ ol.format.GMLBase.ONLY_WHITESPACE_RE_ = /^[\s\xa0]*$/;
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<ol.Feature>} Features.
|
||||
* @return {Array.<ol.Feature> | undefined} Features.
|
||||
*/
|
||||
ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
var localName = node.localName;
|
||||
var features;
|
||||
var features = null;
|
||||
if (localName == 'FeatureCollection') {
|
||||
if (node.namespaceURI === 'http://www.opengis.net/wfs') {
|
||||
features = ol.xml.pushParseAndPop([],
|
||||
@@ -154,9 +154,12 @@ ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (localName != 'featureMember') {
|
||||
// recheck featureType for each featureMember
|
||||
context['featureType'] = featureType;
|
||||
context['featureNS'] = featureNS;
|
||||
}
|
||||
}
|
||||
if (typeof featureNS === 'string') {
|
||||
var ns = featureNS;
|
||||
featureNS = {};
|
||||
@@ -178,9 +181,13 @@ ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
|
||||
}
|
||||
parsersNS[featureNS[p]] = parsers;
|
||||
}
|
||||
if (localName == 'featureMember') {
|
||||
features = ol.xml.pushParseAndPop(undefined, parsersNS, node, objectStack);
|
||||
} else {
|
||||
features = ol.xml.pushParseAndPop([], parsersNS, node, objectStack);
|
||||
}
|
||||
if (!features) {
|
||||
}
|
||||
if (features === null) {
|
||||
features = [];
|
||||
}
|
||||
return features;
|
||||
@@ -500,7 +507,7 @@ ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, object
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
||||
@@ -515,7 +522,7 @@ ol.format.GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
||||
@@ -530,7 +537,7 @@ ol.format.GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||
@@ -545,7 +552,7 @@ ol.format.GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
||||
@@ -558,7 +565,7 @@ ol.format.GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||
@@ -571,7 +578,7 @@ ol.format.GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||
@@ -584,7 +591,7 @@ ol.format.GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @protected
|
||||
*/
|
||||
ol.format.GMLBase.prototype.RING_PARSERS = {
|
||||
@@ -628,7 +635,8 @@ ol.format.GMLBase.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
if (opt_options) {
|
||||
ol.object.assign(options, this.getReadOptions(node, opt_options));
|
||||
}
|
||||
return this.readFeaturesInternal(node, [options]);
|
||||
var features = this.readFeaturesInternal(node, [options]);
|
||||
return features || [];
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ ol.format.GPX.FEATURE_READER_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.GPX_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -292,7 +292,7 @@ ol.format.GPX.GPX_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.LINK_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -306,7 +306,7 @@ ol.format.GPX.LINK_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.RTE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -326,7 +326,7 @@ ol.format.GPX.RTE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.RTEPT_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -338,7 +338,7 @@ ol.format.GPX.RTEPT_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.TRK_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -358,7 +358,7 @@ ol.format.GPX.TRK_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.TRKSEG_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -369,7 +369,7 @@ ol.format.GPX.TRKSEG_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.TRKPT_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -381,7 +381,7 @@ ol.format.GPX.TRKPT_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.WPT_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -526,7 +526,7 @@ ol.format.GPX.writeLink_ = function(node, value, objectStack) {
|
||||
properties['linkText'],
|
||||
properties['linkType']
|
||||
];
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */ ({node: node}),
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */ ({node: node}),
|
||||
ol.format.GPX.LINK_SERIALIZERS_, ol.xml.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
link, objectStack, ol.format.GPX.LINK_SEQUENCE_);
|
||||
};
|
||||
@@ -571,7 +571,7 @@ ol.format.GPX.writeWptType_ = function(node, coordinate, objectStack) {
|
||||
}
|
||||
var orderedKeys = ol.format.GPX.WPT_TYPE_SEQUENCE_[namespaceURI];
|
||||
var values = ol.xml.makeSequence(properties, orderedKeys);
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
|
||||
({node: node, 'properties': properties}),
|
||||
ol.format.GPX.WPT_TYPE_SERIALIZERS_, ol.xml.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
values, objectStack, orderedKeys);
|
||||
@@ -615,7 +615,7 @@ ol.format.GPX.writeRte_ = function(node, feature, objectStack) {
|
||||
ol.format.GPX.writeTrk_ = function(node, feature, objectStack) {
|
||||
var options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
|
||||
var properties = feature.getProperties();
|
||||
/** @type {ol.xml.NodeStackItem} */
|
||||
/** @type {ol.xmlNodeStackItem} */
|
||||
var context = {node: node, 'properties': properties};
|
||||
var geometry = feature.getGeometry();
|
||||
if (geometry) {
|
||||
@@ -641,7 +641,7 @@ ol.format.GPX.writeTrk_ = function(node, feature, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.writeTrkSeg_ = function(node, lineString, objectStack) {
|
||||
/** @type {ol.xml.NodeStackItem} */
|
||||
/** @type {ol.xmlNodeStackItem} */
|
||||
var context = {node: node, 'geometryLayout': lineString.getLayout(),
|
||||
'properties': {}};
|
||||
ol.xml.pushSerializeAndPop(context,
|
||||
@@ -682,7 +682,7 @@ ol.format.GPX.LINK_SEQUENCE_ = ['text', 'type'];
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.LINK_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -705,7 +705,7 @@ ol.format.GPX.RTE_SEQUENCE_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.RTE_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -736,7 +736,7 @@ ol.format.GPX.TRK_SEQUENCE_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.TRK_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -764,7 +764,7 @@ ol.format.GPX.TRKSEG_NODE_FACTORY_ = ol.xml.makeSimpleNodeFactory('trkpt');
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.TRKSEG_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -787,7 +787,7 @@ ol.format.GPX.WPT_TYPE_SEQUENCE_ = ol.xml.makeStructureNS(
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.WPT_TYPE_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -855,7 +855,7 @@ ol.format.GPX.GPX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.GPX_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -895,7 +895,7 @@ ol.format.GPX.prototype.writeFeaturesNode = function(features, opt_options) {
|
||||
//FIXME Serialize metadata
|
||||
var gpx = ol.xml.createElementNS('http://www.topografix.com/GPX/1/1', 'gpx');
|
||||
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xmlNodeStackItem} */
|
||||
({node: gpx}), ol.format.GPX.GPX_SERIALIZERS_,
|
||||
ol.format.GPX.GPX_NODE_FACTORY_, features, [opt_options]);
|
||||
return gpx;
|
||||
|
||||
@@ -11,7 +11,6 @@ goog.require('goog.dom.NodeType');
|
||||
goog.require('goog.object');
|
||||
goog.require('ol');
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.FeatureStyleFunction');
|
||||
goog.require('ol.array');
|
||||
goog.require('ol.color');
|
||||
goog.require('ol.format.Feature');
|
||||
@@ -42,20 +41,6 @@ goog.require('ol.style.Text');
|
||||
goog.require('ol.xml');
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{x: number, xunits: (ol.style.IconAnchorUnits|undefined),
|
||||
* y: number, yunits: (ol.style.IconAnchorUnits|undefined)}}
|
||||
*/
|
||||
ol.format.KMLVec2_;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{flatCoordinates: Array.<number>,
|
||||
* whens: Array.<number>}}
|
||||
*/
|
||||
ol.format.KMLGxTrackObject_;
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Feature format for reading and writing data in the KML format.
|
||||
@@ -529,7 +514,7 @@ ol.format.KML.readURI_ = function(node) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @private
|
||||
* @return {ol.format.KMLVec2_} Vec2.
|
||||
* @return {ol.KMLVec2_} Vec2.
|
||||
*/
|
||||
ol.format.KML.readVec2_ = function(node) {
|
||||
var xunits = node.getAttribute('xunits');
|
||||
@@ -604,7 +589,7 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
|
||||
src = ol.format.KML.DEFAULT_IMAGE_STYLE_SRC_;
|
||||
}
|
||||
var anchor, anchorXUnits, anchorYUnits;
|
||||
var hotSpot = /** @type {ol.format.KMLVec2_|undefined} */
|
||||
var hotSpot = /** @type {ol.KMLVec2_|undefined} */
|
||||
(object['hotSpot']);
|
||||
if (hotSpot) {
|
||||
anchor = [hotSpot.x, hotSpot.y];
|
||||
@@ -798,7 +783,7 @@ ol.format.KML.gxCoordParser_ = function(node, objectStack) {
|
||||
ol.format.KML.GX_NAMESPACE_URIS_, node.namespaceURI),
|
||||
'namespaceURI of the node should be known to the KML parser');
|
||||
goog.asserts.assert(node.localName == 'coord', 'localName should be coord');
|
||||
var gxTrackObject = /** @type {ol.format.KMLGxTrackObject_} */
|
||||
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
goog.asserts.assert(goog.isObject(gxTrackObject),
|
||||
'gxTrackObject should be an Object');
|
||||
@@ -857,7 +842,7 @@ ol.format.KML.readGxTrack_ = function(node, objectStack) {
|
||||
'namespaceURI of the node should be known to the KML parser');
|
||||
goog.asserts.assert(node.localName == 'Track', 'localName should be Track');
|
||||
var gxTrackObject = ol.xml.pushParseAndPop(
|
||||
/** @type {ol.format.KMLGxTrackObject_} */ ({
|
||||
/** @type {ol.KMLGxTrackObject_} */ ({
|
||||
flatCoordinates: [],
|
||||
whens: []
|
||||
}), ol.format.KML.GX_TRACK_PARSERS_, node, objectStack);
|
||||
@@ -1383,7 +1368,7 @@ ol.format.KML.whenParser_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'when', 'localName should be when');
|
||||
var gxTrackObject = /** @type {ol.format.KMLGxTrackObject_} */
|
||||
var gxTrackObject = /** @type {ol.KMLGxTrackObject_} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
goog.asserts.assert(goog.isObject(gxTrackObject),
|
||||
'gxTrackObject should be an Object');
|
||||
@@ -1416,7 +1401,7 @@ ol.format.KML.whenParser_ = function(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.DATA_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1427,7 +1412,7 @@ ol.format.KML.DATA_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.EXTENDED_DATA_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1439,7 +1424,7 @@ ol.format.KML.EXTENDED_DATA_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1451,7 +1436,7 @@ ol.format.KML.EXTRUDE_AND_ALTITUDE_MODE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.FLAT_LINEAR_RING_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1462,7 +1447,7 @@ ol.format.KML.FLAT_LINEAR_RING_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.FLAT_LINEAR_RINGS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1474,7 +1459,7 @@ ol.format.KML.FLAT_LINEAR_RINGS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.GX_TRACK_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1488,7 +1473,7 @@ ol.format.KML.GX_TRACK_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1499,7 +1484,7 @@ ol.format.KML.GEOMETRY_FLAT_COORDINATES_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.ICON_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1516,7 +1501,7 @@ ol.format.KML.ICON_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.ICON_STYLE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1530,7 +1515,7 @@ ol.format.KML.ICON_STYLE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.INNER_BOUNDARY_IS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1541,7 +1526,7 @@ ol.format.KML.INNER_BOUNDARY_IS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.LABEL_STYLE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1553,7 +1538,7 @@ ol.format.KML.LABEL_STYLE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.LINE_STYLE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1565,7 +1550,7 @@ ol.format.KML.LINE_STYLE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.MULTI_GEOMETRY_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1580,7 +1565,7 @@ ol.format.KML.MULTI_GEOMETRY_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.GX_MULTITRACK_GEOMETRY_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1591,7 +1576,7 @@ ol.format.KML.GX_MULTITRACK_GEOMETRY_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.NETWORK_LINK_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1609,7 +1594,7 @@ ol.format.KML.NETWORK_LINK_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.LINK_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1620,7 +1605,7 @@ ol.format.KML.LINK_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.OUTER_BOUNDARY_IS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1631,7 +1616,7 @@ ol.format.KML.OUTER_BOUNDARY_IS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.PAIR_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1644,7 +1629,7 @@ ol.format.KML.PAIR_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.PLACEMARK_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1681,7 +1666,7 @@ ol.format.KML.PLACEMARK_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.POLY_STYLE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1694,7 +1679,7 @@ ol.format.KML.POLY_STYLE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.SCHEMA_DATA_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1705,7 +1690,7 @@ ol.format.KML.SCHEMA_DATA_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.STYLE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1719,7 +1704,7 @@ ol.format.KML.STYLE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.STYLE_MAP_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -1869,7 +1854,9 @@ ol.format.KML.prototype.readSharedStyleMap_ = function(node, objectStack) {
|
||||
|
||||
|
||||
/**
|
||||
* Read the first feature from a KML source.
|
||||
* Read the first feature from a KML source. MultiGeometries are converted into
|
||||
* GeometryCollections if they are a mix of geometry types, and into MultiPoint/
|
||||
* MultiLineString/MultiPolygon if they are all of the same type.
|
||||
*
|
||||
* @function
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
@@ -1902,7 +1889,9 @@ ol.format.KML.prototype.readFeatureFromNode = function(node, opt_options) {
|
||||
|
||||
|
||||
/**
|
||||
* Read all features from a KML source.
|
||||
* Read all features from a KML source. MultiGeometries are converted into
|
||||
* GeometryCollections if they are a mix of geometry types, and into MultiPoint/
|
||||
* MultiLineString/MultiPolygon if they are all of the same type.
|
||||
*
|
||||
* @function
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
@@ -2172,7 +2161,7 @@ ol.format.KML.writeCoordinatesTextNode_ = function(node, coordinates, objectStac
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.writeDocument_ = function(node, features, objectStack) {
|
||||
var /** @type {ol.xml.NodeStackItem} */ context = {node: node};
|
||||
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
|
||||
ol.xml.pushSerializeAndPop(context, ol.format.KML.DOCUMENT_SERIALIZERS_,
|
||||
ol.format.KML.DOCUMENT_NODE_FACTORY_, features, objectStack, undefined,
|
||||
this);
|
||||
@@ -2186,7 +2175,7 @@ ol.format.KML.writeDocument_ = function(node, features, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.writeIcon_ = function(node, icon, objectStack) {
|
||||
var /** @type {ol.xml.NodeStackItem} */ context = {node: node};
|
||||
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
|
||||
var parentNode = objectStack[objectStack.length - 1].node;
|
||||
var orderedKeys = ol.format.KML.ICON_SEQUENCE_[parentNode.namespaceURI];
|
||||
var values = ol.xml.makeSequence(icon, orderedKeys);
|
||||
@@ -2208,7 +2197,7 @@ ol.format.KML.writeIcon_ = function(node, icon, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.writeIconStyle_ = function(node, style, objectStack) {
|
||||
var /** @type {ol.xml.NodeStackItem} */ context = {node: node};
|
||||
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
|
||||
var properties = {};
|
||||
var src = style.getSrc();
|
||||
var size = style.getSize();
|
||||
@@ -2229,7 +2218,7 @@ ol.format.KML.writeIconStyle_ = function(node, style, objectStack) {
|
||||
}
|
||||
|
||||
if (anchor && anchor[0] !== 0 && anchor[1] !== size[1]) {
|
||||
var /** @type {ol.format.KMLVec2_} */ hotSpot = {
|
||||
var /** @type {ol.KMLVec2_} */ hotSpot = {
|
||||
x: anchor[0],
|
||||
xunits: ol.style.IconAnchorUnits.PIXELS,
|
||||
y: size[1] - anchor[1],
|
||||
@@ -2266,7 +2255,7 @@ ol.format.KML.writeIconStyle_ = function(node, style, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.writeLabelStyle_ = function(node, style, objectStack) {
|
||||
var /** @type {ol.xml.NodeStackItem} */ context = {node: node};
|
||||
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
|
||||
var properties = {};
|
||||
var fill = style.getFill();
|
||||
if (fill) {
|
||||
@@ -2292,7 +2281,7 @@ ol.format.KML.writeLabelStyle_ = function(node, style, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.writeLineStyle_ = function(node, style, objectStack) {
|
||||
var /** @type {ol.xml.NodeStackItem} */ context = {node: node};
|
||||
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
|
||||
var properties = {
|
||||
'color': style.getColor(),
|
||||
'width': style.getWidth()
|
||||
@@ -2313,19 +2302,23 @@ ol.format.KML.writeLineStyle_ = function(node, style, objectStack) {
|
||||
*/
|
||||
ol.format.KML.writeMultiGeometry_ = function(node, geometry, objectStack) {
|
||||
goog.asserts.assert(
|
||||
(geometry instanceof ol.geom.GeometryCollection) ||
|
||||
(geometry instanceof ol.geom.MultiPoint) ||
|
||||
(geometry instanceof ol.geom.MultiLineString) ||
|
||||
(geometry instanceof ol.geom.MultiPolygon),
|
||||
'geometry should be one of: ol.geom.MultiPoint, ' +
|
||||
'ol.geom.MultiLineString or ol.geom.MultiPolygon');
|
||||
/** @type {ol.xml.NodeStackItem} */
|
||||
'geometry should be one of: ol.geom.GeometryCollection, ' +
|
||||
'ol.geom.MultiPoint, ol.geom.MultiLineString or ol.geom.MultiPolygon');
|
||||
/** @type {ol.xmlNodeStackItem} */
|
||||
var context = {node: node};
|
||||
var type = geometry.getType();
|
||||
/** @type {Array.<ol.geom.Geometry>} */
|
||||
var geometries;
|
||||
/** @type {function(*, Array.<*>, string=): (Node|undefined)} */
|
||||
var factory;
|
||||
if (type == ol.geom.GeometryType.MULTI_POINT) {
|
||||
if (type == ol.geom.GeometryType.GEOMETRY_COLLECTION) {
|
||||
geometries = geometry.getGeometries();
|
||||
factory = ol.format.KML.GEOMETRY_NODE_FACTORY_;
|
||||
} else if (type == ol.geom.GeometryType.MULTI_POINT) {
|
||||
geometries =
|
||||
(/** @type {ol.geom.MultiPoint} */ (geometry)).getPoints();
|
||||
factory = ol.format.KML.POINT_NODE_FACTORY_;
|
||||
@@ -2353,7 +2346,7 @@ ol.format.KML.writeMultiGeometry_ = function(node, geometry, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.writeBoundaryIs_ = function(node, linearRing, objectStack) {
|
||||
var /** @type {ol.xml.NodeStackItem} */ context = {node: node};
|
||||
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
|
||||
ol.xml.pushSerializeAndPop(context,
|
||||
ol.format.KML.BOUNDARY_IS_SERIALIZERS_,
|
||||
ol.format.KML.LINEAR_RING_NODE_FACTORY_, [linearRing], objectStack);
|
||||
@@ -2370,7 +2363,7 @@ ol.format.KML.writeBoundaryIs_ = function(node, linearRing, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.writePlacemark_ = function(node, feature, objectStack) {
|
||||
var /** @type {ol.xml.NodeStackItem} */ context = {node: node};
|
||||
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
|
||||
|
||||
// set id
|
||||
if (feature.getId()) {
|
||||
@@ -2428,7 +2421,7 @@ ol.format.KML.writePrimitiveGeometry_ = function(node, geometry, objectStack) {
|
||||
'geometry should be one of ol.geom.Point, ol.geom.LineString ' +
|
||||
'or ol.geom.LinearRing');
|
||||
var flatCoordinates = geometry.getFlatCoordinates();
|
||||
var /** @type {ol.xml.NodeStackItem} */ context = {node: node};
|
||||
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
|
||||
context['layout'] = geometry.getLayout();
|
||||
context['stride'] = geometry.getStride();
|
||||
ol.xml.pushSerializeAndPop(context,
|
||||
@@ -2451,7 +2444,7 @@ ol.format.KML.writePolygon_ = function(node, polygon, objectStack) {
|
||||
goog.asserts.assert(linearRings.length > 0,
|
||||
'linearRings should not be empty');
|
||||
var outerRing = linearRings.shift();
|
||||
var /** @type {ol.xml.NodeStackItem} */ context = {node: node};
|
||||
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
|
||||
// inner rings
|
||||
ol.xml.pushSerializeAndPop(context,
|
||||
ol.format.KML.POLYGON_SERIALIZERS_,
|
||||
@@ -2472,7 +2465,7 @@ ol.format.KML.writePolygon_ = function(node, polygon, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.writePolyStyle_ = function(node, style, objectStack) {
|
||||
var /** @type {ol.xml.NodeStackItem} */ context = {node: node};
|
||||
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
|
||||
ol.xml.pushSerializeAndPop(context, ol.format.KML.POLY_STYLE_SERIALIZERS_,
|
||||
ol.format.KML.COLOR_NODE_FACTORY_, [style.getColor()], objectStack);
|
||||
};
|
||||
@@ -2497,7 +2490,7 @@ ol.format.KML.writeScaleTextNode_ = function(node, scale) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.writeStyle_ = function(node, style, objectStack) {
|
||||
var /** @type {ol.xml.NodeStackItem} */ context = {node: node};
|
||||
var /** @type {ol.xmlNodeStackItem} */ context = {node: node};
|
||||
var properties = {};
|
||||
var fillStyle = style.getFill();
|
||||
var strokeStyle = style.getStroke();
|
||||
@@ -2525,7 +2518,7 @@ ol.format.KML.writeStyle_ = function(node, style, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node to append a TextNode with the Vec2 to.
|
||||
* @param {ol.format.KMLVec2_} vec2 Vec2.
|
||||
* @param {ol.KMLVec2_} vec2 Vec2.
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.writeVec2_ = function(node, vec2) {
|
||||
@@ -2549,7 +2542,7 @@ ol.format.KML.KML_SEQUENCE_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.KML_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -2561,7 +2554,7 @@ ol.format.KML.KML_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.DOCUMENT_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -2582,7 +2575,8 @@ ol.format.KML.GEOMETRY_TYPE_TO_NODENAME_ = {
|
||||
'Polygon': 'Polygon',
|
||||
'MultiPoint': 'MultiGeometry',
|
||||
'MultiLineString': 'MultiGeometry',
|
||||
'MultiPolygon': 'MultiGeometry'
|
||||
'MultiPolygon': 'MultiGeometry',
|
||||
'GeometryCollection': 'MultiGeometry'
|
||||
};
|
||||
|
||||
|
||||
@@ -2602,7 +2596,7 @@ ol.format.KML.ICON_SEQUENCE_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.ICON_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -2630,7 +2624,7 @@ ol.format.KML.ICON_STYLE_SEQUENCE_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.ICON_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -2655,7 +2649,7 @@ ol.format.KML.LABEL_STYLE_SEQUENCE_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.LABEL_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -2678,7 +2672,7 @@ ol.format.KML.LINE_STYLE_SEQUENCE_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.LINE_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -2690,7 +2684,7 @@ ol.format.KML.LINE_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.BOUNDARY_IS_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -2702,7 +2696,7 @@ ol.format.KML.BOUNDARY_IS_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.MULTI_GEOMETRY_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -2711,7 +2705,9 @@ ol.format.KML.MULTI_GEOMETRY_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
ol.format.KML.writePrimitiveGeometry_),
|
||||
'Point': ol.xml.makeChildAppender(
|
||||
ol.format.KML.writePrimitiveGeometry_),
|
||||
'Polygon': ol.xml.makeChildAppender(ol.format.KML.writePolygon_)
|
||||
'Polygon': ol.xml.makeChildAppender(ol.format.KML.writePolygon_),
|
||||
'GeometryCollection': ol.xml.makeChildAppender(
|
||||
ol.format.KML.writeMultiGeometry_)
|
||||
});
|
||||
|
||||
|
||||
@@ -2729,7 +2725,7 @@ ol.format.KML.PLACEMARK_SEQUENCE_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.PLACEMARK_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -2759,7 +2755,7 @@ ol.format.KML.PLACEMARK_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.PRIMITIVE_GEOMETRY_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -2771,7 +2767,7 @@ ol.format.KML.PRIMITIVE_GEOMETRY_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.POLYGON_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -2785,7 +2781,7 @@ ol.format.KML.POLYGON_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.POLY_STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -2807,7 +2803,7 @@ ol.format.KML.STYLE_SEQUENCE_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.KML.STYLE_SERIALIZERS_ = ol.xml.makeStructureNS(
|
||||
@@ -2954,7 +2950,8 @@ ol.format.KML.OUTER_BOUNDARY_NODE_FACTORY_ =
|
||||
|
||||
|
||||
/**
|
||||
* Encode an array of features in the KML format.
|
||||
* Encode an array of features in the KML format. GeometryCollections, MultiPoints,
|
||||
* MultiLineStrings, and MultiPolygons are output as MultiGeometries.
|
||||
*
|
||||
* @function
|
||||
* @param {Array.<ol.Feature>} features Features.
|
||||
@@ -2966,7 +2963,8 @@ ol.format.KML.prototype.writeFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* Encode an array of features in the KML format as an XML node.
|
||||
* Encode an array of features in the KML format as an XML node. GeometryCollections,
|
||||
* MultiPoints, MultiLineStrings, and MultiPolygons are output as MultiGeometries.
|
||||
*
|
||||
* @param {Array.<ol.Feature>} features Features.
|
||||
* @param {olx.format.WriteOptions=} opt_options Options.
|
||||
@@ -2984,7 +2982,7 @@ ol.format.KML.prototype.writeFeaturesNode = function(features, opt_options) {
|
||||
ol.xml.setAttributeNS(kml, xmlSchemaInstanceUri, 'xsi:schemaLocation',
|
||||
ol.format.KML.SCHEMA_LOCATION_);
|
||||
|
||||
var /** @type {ol.xml.NodeStackItem} */ context = {node: kml};
|
||||
var /** @type {ol.xmlNodeStackItem} */ context = {node: kml};
|
||||
var properties = {};
|
||||
if (features.length > 1) {
|
||||
properties['Document'] = features;
|
||||
|
||||
@@ -147,6 +147,7 @@ ol.format.MVT.prototype.readRenderFeature_ = function(rawFeature, layer) {
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
ol.format.MVT.prototype.readFeatures = function(source, opt_options) {
|
||||
goog.asserts.assertInstanceof(source, ArrayBuffer);
|
||||
@@ -180,6 +181,7 @@ ol.format.MVT.prototype.readFeatures = function(source, opt_options) {
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
ol.format.MVT.prototype.readProjection = function(source) {
|
||||
return this.defaultDataProjection;
|
||||
|
||||
638
src/ol/format/ogc/filter.js
Normal file
638
src/ol/format/ogc/filter.js
Normal file
@@ -0,0 +1,638 @@
|
||||
goog.provide('ol.format.ogc.filter');
|
||||
goog.provide('ol.format.ogc.filter.Filter');
|
||||
goog.provide('ol.format.ogc.filter.Logical');
|
||||
goog.provide('ol.format.ogc.filter.LogicalBinary');
|
||||
goog.provide('ol.format.ogc.filter.And');
|
||||
goog.provide('ol.format.ogc.filter.Or');
|
||||
goog.provide('ol.format.ogc.filter.Not');
|
||||
goog.provide('ol.format.ogc.filter.Bbox');
|
||||
goog.provide('ol.format.ogc.filter.Comparison');
|
||||
goog.provide('ol.format.ogc.filter.ComparisonBinary');
|
||||
goog.provide('ol.format.ogc.filter.EqualTo');
|
||||
goog.provide('ol.format.ogc.filter.NotEqualTo');
|
||||
goog.provide('ol.format.ogc.filter.LessThan');
|
||||
goog.provide('ol.format.ogc.filter.LessThanOrEqualTo');
|
||||
goog.provide('ol.format.ogc.filter.GreaterThan');
|
||||
goog.provide('ol.format.ogc.filter.GreaterThanOrEqualTo');
|
||||
goog.provide('ol.format.ogc.filter.IsNull');
|
||||
goog.provide('ol.format.ogc.filter.IsBetween');
|
||||
goog.provide('ol.format.ogc.filter.IsLike');
|
||||
|
||||
goog.require('ol.Extent');
|
||||
goog.require('ol.Object');
|
||||
|
||||
|
||||
/**
|
||||
* Create a logical `<And>` operator between two filter conditions.
|
||||
*
|
||||
* @param {!ol.format.ogc.filter.Filter} conditionA First filter condition.
|
||||
* @param {!ol.format.ogc.filter.Filter} conditionB Second filter condition.
|
||||
* @returns {!ol.format.ogc.filter.And} `<And>` operator.
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.and = function(conditionA, conditionB) {
|
||||
return new ol.format.ogc.filter.And(conditionA, conditionB);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Create a logical `<Or>` operator between two filter conditions.
|
||||
*
|
||||
* @param {!ol.format.ogc.filter.Filter} conditionA First filter condition.
|
||||
* @param {!ol.format.ogc.filter.Filter} conditionB Second filter condition.
|
||||
* @returns {!ol.format.ogc.filter.Or} `<Or>` operator.
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.or = function(conditionA, conditionB) {
|
||||
return new ol.format.ogc.filter.Or(conditionA, conditionB);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Represents a logical `<Not>` operator for a filter condition.
|
||||
*
|
||||
* @param {!ol.format.ogc.filter.Filter} condition Filter condition.
|
||||
* @returns {!ol.format.ogc.filter.Not} `<Not>` operator.
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.not = function(condition) {
|
||||
return new ol.format.ogc.filter.Not(condition);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Create a `<BBOX>` operator to test whether a geometry-valued property
|
||||
* intersects a fixed bounding box
|
||||
*
|
||||
* @param {!string} geometryName Geometry name to use.
|
||||
* @param {!ol.Extent} extent Extent.
|
||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||
* set on geometries when this is not provided.
|
||||
* @returns {!ol.format.ogc.filter.Bbox} `<BBOX>` operator.
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.bbox = function(geometryName, extent, opt_srsName) {
|
||||
return new ol.format.ogc.filter.Bbox(geometryName, extent, opt_srsName);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a `<PropertyIsEqualTo>` comparison operator.
|
||||
*
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!(string|number)} expression The value to compare.
|
||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||
* @returns {!ol.format.ogc.filter.EqualTo} `<PropertyIsEqualTo>` operator.
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.equalTo = function(propertyName, expression, opt_matchCase) {
|
||||
return new ol.format.ogc.filter.EqualTo(propertyName, expression, opt_matchCase);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a `<PropertyIsNotEqualTo>` comparison operator.
|
||||
*
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!(string|number)} expression The value to compare.
|
||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||
* @returns {!ol.format.ogc.filter.NotEqualTo} `<PropertyIsNotEqualTo>` operator.
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.notEqualTo = function(propertyName, expression, opt_matchCase) {
|
||||
return new ol.format.ogc.filter.NotEqualTo(propertyName, expression, opt_matchCase);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a `<PropertyIsLessThan>` comparison operator.
|
||||
*
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} expression The value to compare.
|
||||
* @returns {!ol.format.ogc.filter.LessThan} `<PropertyIsLessThan>` operator.
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.lessThan = function(propertyName, expression) {
|
||||
return new ol.format.ogc.filter.LessThan(propertyName, expression);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a `<PropertyIsLessThanOrEqualTo>` comparison operator.
|
||||
*
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} expression The value to compare.
|
||||
* @returns {!ol.format.ogc.filter.LessThanOrEqualTo} `<PropertyIsLessThanOrEqualTo>` operator.
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.lessThanOrEqualTo = function(propertyName, expression) {
|
||||
return new ol.format.ogc.filter.LessThanOrEqualTo(propertyName, expression);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a `<PropertyIsGreaterThan>` comparison operator.
|
||||
*
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} expression The value to compare.
|
||||
* @returns {!ol.format.ogc.filter.GreaterThan} `<PropertyIsGreaterThan>` operator.
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.greaterThan = function(propertyName, expression) {
|
||||
return new ol.format.ogc.filter.GreaterThan(propertyName, expression);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a `<PropertyIsGreaterThanOrEqualTo>` comparison operator.
|
||||
*
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} expression The value to compare.
|
||||
* @returns {!ol.format.ogc.filter.GreaterThanOrEqualTo} `<PropertyIsGreaterThanOrEqualTo>` operator.
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.greaterThanOrEqualTo = function(propertyName, expression) {
|
||||
return new ol.format.ogc.filter.GreaterThanOrEqualTo(propertyName, expression);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a `<PropertyIsNull>` comparison operator to test whether a property value
|
||||
* is null.
|
||||
*
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @returns {!ol.format.ogc.filter.IsNull} `<PropertyIsNull>` operator.
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.isNull = function(propertyName) {
|
||||
return new ol.format.ogc.filter.IsNull(propertyName);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Creates a `<PropertyIsBetween>` comparison operator to test whether an expression
|
||||
* value lies within a range given by a lower and upper bound (inclusive).
|
||||
*
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} lowerBoundary The lower bound of the range.
|
||||
* @param {!number} upperBoundary The upper bound of the range.
|
||||
* @returns {!ol.format.ogc.filter.IsBetween} `<PropertyIsBetween>` operator.
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.between = function(propertyName, lowerBoundary, upperBoundary) {
|
||||
return new ol.format.ogc.filter.IsBetween(propertyName, lowerBoundary, upperBoundary);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Represents a `<PropertyIsLike>` comparison operator that matches a string property
|
||||
* value against a text pattern.
|
||||
*
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!string} pattern Text pattern.
|
||||
* @param {string=} opt_wildCard Pattern character which matches any sequence of
|
||||
* zero or more string characters. Default is '*'.
|
||||
* @param {string=} opt_singleChar pattern character which matches any single
|
||||
* string character. Default is '.'.
|
||||
* @param {string=} opt_escapeChar Escape character which can be used to escape
|
||||
* the pattern characters. Default is '!'.
|
||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||
* @returns {!ol.format.ogc.filter.IsLike} `<PropertyIsLike>` operator.
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.like = function(propertyName, pattern,
|
||||
opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) {
|
||||
return new ol.format.ogc.filter.IsLike(propertyName, pattern,
|
||||
opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Abstract class; normally only used for creating subclasses and not instantiated in apps.
|
||||
* Base class for WFS GetFeature filters.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} tagName The XML tag name for this filter.
|
||||
* @extends {ol.Object}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.Filter = function(tagName) {
|
||||
|
||||
goog.base(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!string}
|
||||
*/
|
||||
this.tagName_ = tagName;
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.Filter, ol.Object);
|
||||
|
||||
/**
|
||||
* The XML tag name for a filter.
|
||||
* @returns {!string} Name.
|
||||
*/
|
||||
ol.format.ogc.filter.Filter.prototype.getTagName = function() {
|
||||
return this.tagName_;
|
||||
};
|
||||
|
||||
|
||||
// Logical filters
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Abstract class; normally only used for creating subclasses and not instantiated in apps.
|
||||
* Base class for WFS GetFeature logical filters.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} tagName The XML tag name for this filter.
|
||||
* @extends {ol.format.ogc.filter.Filter}
|
||||
*/
|
||||
ol.format.ogc.filter.Logical = function(tagName) {
|
||||
goog.base(this, tagName);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.Logical, ol.format.ogc.filter.Filter);
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Abstract class; normally only used for creating subclasses and not instantiated in apps.
|
||||
* Base class for WFS GetFeature binary logical filters.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} tagName The XML tag name for this filter.
|
||||
* @param {!ol.format.ogc.filter.Filter} conditionA First filter condition.
|
||||
* @param {!ol.format.ogc.filter.Filter} conditionB Second filter condition.
|
||||
* @extends {ol.format.ogc.filter.Logical}
|
||||
*/
|
||||
ol.format.ogc.filter.LogicalBinary = function(tagName, conditionA, conditionB) {
|
||||
|
||||
goog.base(this, tagName);
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {!ol.format.ogc.filter.Filter}
|
||||
*/
|
||||
this.conditionA = conditionA;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {!ol.format.ogc.filter.Filter}
|
||||
*/
|
||||
this.conditionB = conditionB;
|
||||
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.LogicalBinary, ol.format.ogc.filter.Logical);
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a logical `<And>` operator between two filter conditions.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!ol.format.ogc.filter.Filter} conditionA First filter condition.
|
||||
* @param {!ol.format.ogc.filter.Filter} conditionB Second filter condition.
|
||||
* @extends {ol.format.ogc.filter.LogicalBinary}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.And = function(conditionA, conditionB) {
|
||||
goog.base(this, 'And', conditionA, conditionB);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.And, ol.format.ogc.filter.LogicalBinary);
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a logical `<Or>` operator between two filter conditions.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!ol.format.ogc.filter.Filter} conditionA First filter condition.
|
||||
* @param {!ol.format.ogc.filter.Filter} conditionB Second filter condition.
|
||||
* @extends {ol.format.ogc.filter.LogicalBinary}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.Or = function(conditionA, conditionB) {
|
||||
goog.base(this, 'Or', conditionA, conditionB);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.Or, ol.format.ogc.filter.LogicalBinary);
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a logical `<Not>` operator for a filter condition.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!ol.format.ogc.filter.Filter} condition Filter condition.
|
||||
* @extends {ol.format.ogc.filter.Logical}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.Not = function(condition) {
|
||||
|
||||
goog.base(this, 'Not');
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {!ol.format.ogc.filter.Filter}
|
||||
*/
|
||||
this.condition = condition;
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.Not, ol.format.ogc.filter.Logical);
|
||||
|
||||
|
||||
// Spatial filters
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a `<BBOX>` operator to test whether a geometry-valued property
|
||||
* intersects a fixed bounding box
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} geometryName Geometry name to use.
|
||||
* @param {!ol.Extent} extent Extent.
|
||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||
* set on geometries when this is not provided.
|
||||
* @extends {ol.format.ogc.filter.Filter}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.Bbox = function(geometryName, extent, opt_srsName) {
|
||||
|
||||
goog.base(this, 'BBOX');
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {!string}
|
||||
*/
|
||||
this.geometryName = geometryName;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {!ol.Extent}
|
||||
*/
|
||||
this.extent = extent;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
this.srsName = opt_srsName;
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.Bbox, ol.format.ogc.filter.Filter);
|
||||
|
||||
|
||||
// Property comparison filters
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Abstract class; normally only used for creating subclasses and not instantiated in apps.
|
||||
* Base class for WFS GetFeature property comparison filters.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} tagName The XML tag name for this filter.
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @extends {ol.format.ogc.filter.Filter}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.Comparison = function(tagName, propertyName) {
|
||||
|
||||
goog.base(this, tagName);
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {!string}
|
||||
*/
|
||||
this.propertyName = propertyName;
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.Comparison, ol.format.ogc.filter.Filter);
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Abstract class; normally only used for creating subclasses and not instantiated in apps.
|
||||
* Base class for WFS GetFeature property binary comparison filters.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} tagName The XML tag name for this filter.
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!(string|number)} expression The value to compare.
|
||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||
* @extends {ol.format.ogc.filter.Comparison}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.ComparisonBinary = function(
|
||||
tagName, propertyName, expression, opt_matchCase) {
|
||||
|
||||
goog.base(this, tagName, propertyName);
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {!(string|number)}
|
||||
*/
|
||||
this.expression = expression;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {boolean|undefined}
|
||||
*/
|
||||
this.matchCase = opt_matchCase;
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.ComparisonBinary, ol.format.ogc.filter.Comparison);
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a `<PropertyIsEqualTo>` comparison operator.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!(string|number)} expression The value to compare.
|
||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||
* @extends {ol.format.ogc.filter.ComparisonBinary}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.EqualTo = function(propertyName, expression, opt_matchCase) {
|
||||
goog.base(this, 'PropertyIsEqualTo', propertyName, expression, opt_matchCase);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.EqualTo, ol.format.ogc.filter.ComparisonBinary);
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a `<PropertyIsNotEqualTo>` comparison operator.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!(string|number)} expression The value to compare.
|
||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||
* @extends {ol.format.ogc.filter.ComparisonBinary}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.NotEqualTo = function(propertyName, expression, opt_matchCase) {
|
||||
goog.base(this, 'PropertyIsNotEqualTo', propertyName, expression, opt_matchCase);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.NotEqualTo, ol.format.ogc.filter.ComparisonBinary);
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a `<PropertyIsLessThan>` comparison operator.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} expression The value to compare.
|
||||
* @extends {ol.format.ogc.filter.ComparisonBinary}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.LessThan = function(propertyName, expression) {
|
||||
goog.base(this, 'PropertyIsLessThan', propertyName, expression);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.LessThan, ol.format.ogc.filter.ComparisonBinary);
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a `<PropertyIsLessThanOrEqualTo>` comparison operator.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} expression The value to compare.
|
||||
* @extends {ol.format.ogc.filter.ComparisonBinary}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.LessThanOrEqualTo = function(propertyName, expression) {
|
||||
goog.base(this, 'PropertyIsLessThanOrEqualTo', propertyName, expression);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.LessThanOrEqualTo, ol.format.ogc.filter.ComparisonBinary);
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a `<PropertyIsGreaterThan>` comparison operator.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} expression The value to compare.
|
||||
* @extends {ol.format.ogc.filter.ComparisonBinary}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.GreaterThan = function(propertyName, expression) {
|
||||
goog.base(this, 'PropertyIsGreaterThan', propertyName, expression);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.GreaterThan, ol.format.ogc.filter.ComparisonBinary);
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a `<PropertyIsGreaterThanOrEqualTo>` comparison operator.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} expression The value to compare.
|
||||
* @extends {ol.format.ogc.filter.ComparisonBinary}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.GreaterThanOrEqualTo = function(propertyName, expression) {
|
||||
goog.base(this, 'PropertyIsGreaterThanOrEqualTo', propertyName, expression);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.GreaterThanOrEqualTo, ol.format.ogc.filter.ComparisonBinary);
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a `<PropertyIsNull>` comparison operator.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @extends {ol.format.ogc.filter.Comparison}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.IsNull = function(propertyName) {
|
||||
goog.base(this, 'PropertyIsNull', propertyName);
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.IsNull, ol.format.ogc.filter.Comparison);
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a `<PropertyIsBetween>` comparison operator.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!number} lowerBoundary The lower bound of the range.
|
||||
* @param {!number} upperBoundary The upper bound of the range.
|
||||
* @extends {ol.format.ogc.filter.Comparison}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.IsBetween = function(propertyName, lowerBoundary, upperBoundary) {
|
||||
goog.base(this, 'PropertyIsBetween', propertyName);
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {!number}
|
||||
*/
|
||||
this.lowerBoundary = lowerBoundary;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {!number}
|
||||
*/
|
||||
this.upperBoundary = upperBoundary;
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.IsBetween, ol.format.ogc.filter.Comparison);
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Represents a `<PropertyIsLike>` comparison operator.
|
||||
*
|
||||
* @constructor
|
||||
* @param {!string} propertyName Name of the context property to compare.
|
||||
* @param {!string} pattern Text pattern.
|
||||
* @param {string=} opt_wildCard Pattern character which matches any sequence of
|
||||
* zero or more string characters. Default is '*'.
|
||||
* @param {string=} opt_singleChar pattern character which matches any single
|
||||
* string character. Default is '.'.
|
||||
* @param {string=} opt_escapeChar Escape character which can be used to escape
|
||||
* the pattern characters. Default is '!'.
|
||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||
* @extends {ol.format.ogc.filter.Comparison}
|
||||
* @api
|
||||
*/
|
||||
ol.format.ogc.filter.IsLike = function(propertyName, pattern,
|
||||
opt_wildCard, opt_singleChar, opt_escapeChar, opt_matchCase) {
|
||||
goog.base(this, 'PropertyIsLike', propertyName);
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {!string}
|
||||
*/
|
||||
this.pattern = pattern;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {!string}
|
||||
*/
|
||||
this.wildCard = (opt_wildCard !== undefined) ? opt_wildCard : '*';
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {!string}
|
||||
*/
|
||||
this.singleChar = (opt_singleChar !== undefined) ? opt_singleChar : '.';
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {!string}
|
||||
*/
|
||||
this.escapeChar = (opt_escapeChar !== undefined) ? opt_escapeChar : '!';
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @type {boolean|undefined}
|
||||
*/
|
||||
this.matchCase = opt_matchCase;
|
||||
};
|
||||
goog.inherits(ol.format.ogc.filter.IsLike, ol.format.ogc.filter.Comparison);
|
||||
29
src/ol/format/ogc/filter.jsdoc
Normal file
29
src/ol/format/ogc/filter.jsdoc
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* This namespace contains convenience functions to create filters for
|
||||
* {@link ol.format.WFS#writeGetFeature}.
|
||||
*
|
||||
* For example to generate a `GetFeature` request with a `PropertyIsEqualTo` filter:
|
||||
*
|
||||
* var request = new ol.format.WFS().writeGetFeature({
|
||||
* srsName: 'urn:ogc:def:crs:EPSG::4326',
|
||||
* featureNS: 'http://www.openplans.org/topp',
|
||||
* featurePrefix: 'topp',
|
||||
* featureTypes: ['states'],
|
||||
* filter: ol.format.wfs.filter.equalTo('name', 'New York')
|
||||
* });
|
||||
*
|
||||
* Or to combine a `BBOX` filter with a `PropertyIsLike` filter:
|
||||
*
|
||||
* var f = ol.format.wfs.filter;
|
||||
* var request = new ol.format.WFS().writeGetFeature({
|
||||
* srsName: 'urn:ogc:def:crs:EPSG::4326',
|
||||
* featureNS: 'http://www.openplans.org/topp',
|
||||
* featurePrefix: 'topp',
|
||||
* featureTypes: ['states'],
|
||||
* filter: f.and(
|
||||
* f.bbox('the_geom', [1, 2, 3, 4], 'urn:ogc:def:crs:EPSG::4326'),
|
||||
* f.like('name', 'New*')
|
||||
* )
|
||||
* });
|
||||
* @namespace ol.format.ogc.filter
|
||||
*/
|
||||
@@ -165,7 +165,7 @@ ol.format.OSMXML.NAMESPACE_URIS_ = [
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OSMXML.WAY_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -177,7 +177,7 @@ ol.format.OSMXML.WAY_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OSMXML.PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -189,7 +189,7 @@ ol.format.OSMXML.PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OSMXML.NODE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
@@ -302,7 +302,7 @@ ol.format.OWS.NAMESPACE_URIS_ = [
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OWS.PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -318,7 +318,7 @@ ol.format.OWS.PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OWS.ADDRESS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -337,7 +337,7 @@ ol.format.OWS.ADDRESS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OWS.ALLOWED_VALUES_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -348,7 +348,7 @@ ol.format.OWS.ALLOWED_VALUES_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OWS.CONSTRAINT_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -360,7 +360,7 @@ ol.format.OWS.CONSTRAINT_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OWS.CONTACT_INFO_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -372,7 +372,7 @@ ol.format.OWS.CONTACT_INFO_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OWS.DCP_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -383,7 +383,7 @@ ol.format.OWS.DCP_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OWS.HTTP_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -395,7 +395,7 @@ ol.format.OWS.HTTP_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OWS.OPERATION_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -406,7 +406,7 @@ ol.format.OWS.OPERATION_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OWS.OPERATIONS_METADATA_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -417,7 +417,7 @@ ol.format.OWS.OPERATIONS_METADATA_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OWS.PHONE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -429,7 +429,7 @@ ol.format.OWS.PHONE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OWS.REQUEST_METHOD_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -441,7 +441,7 @@ ol.format.OWS.REQUEST_METHOD_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OWS.SERVICE_CONTACT_PARSERS_ =
|
||||
@@ -457,7 +457,7 @@ ol.format.OWS.SERVICE_CONTACT_PARSERS_ =
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_ =
|
||||
@@ -472,7 +472,7 @@ ol.format.OWS.SERVICE_IDENTIFICATION_PARSERS_ =
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.OWS.SERVICE_PROVIDER_PARSERS_ =
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* `readFeature` returning an `ol.Feature`
|
||||
* `readGeometry` returning an `ol.geom.Geometry`
|
||||
|
||||
Having different functions for multiple return types allows both the user to specify what type of data he wants and for the Compiler to properly type check the code. Depending on the format, it is entirely reasonable to leave one or more of these methods unimplemented, or provide sensible default implementations.
|
||||
Having different functions for multiple return types allows both the user to specify what type of data they want and for the compiler to properly type check the code. Depending on the format, it is entirely reasonable to leave one or more of these methods unimplemented, or provide sensible default implementations.
|
||||
|
||||
For example, `ol.format.GPX` only supports reading multiple features. Therefore `readFeature` and `readGeometry` are unimplemented and will raise an exception if called.
|
||||
|
||||
@@ -19,7 +19,7 @@ If a file cannot be parsed, then the return value should be `null` for all three
|
||||
# Implementing XML formats
|
||||
|
||||
This is an introduction for people looking to contribute an XML format reader to OpenLayers 3. After having read this document, you should read the code of and make sure that you understand the simpler XML format readers like `ol.format.GPX` before embarking on writing your own format reader.
|
||||
The document ends with guildelines for implementing a new format.
|
||||
The document ends with guidelines for implementing a new format.
|
||||
|
||||
The `ol.xml` namespace contains a number of useful functions for parsing XML documents. All code in OpenLayers 3 that reads data from XML documents should use it. It has several features:
|
||||
|
||||
|
||||
@@ -5,6 +5,14 @@ goog.require('goog.dom.NodeType');
|
||||
goog.require('ol');
|
||||
goog.require('ol.format.GML3');
|
||||
goog.require('ol.format.GMLBase');
|
||||
goog.require('ol.format.ogc.filter');
|
||||
goog.require('ol.format.ogc.filter.Bbox');
|
||||
goog.require('ol.format.ogc.filter.ComparisonBinary');
|
||||
goog.require('ol.format.ogc.filter.LogicalBinary');
|
||||
goog.require('ol.format.ogc.filter.Not');
|
||||
goog.require('ol.format.ogc.filter.IsBetween');
|
||||
goog.require('ol.format.ogc.filter.IsNull');
|
||||
goog.require('ol.format.ogc.filter.IsLike');
|
||||
goog.require('ol.format.XMLFeature');
|
||||
goog.require('ol.format.XSD');
|
||||
goog.require('ol.geom.Geometry');
|
||||
@@ -74,26 +82,6 @@ ol.format.WFS.FEATURE_PREFIX = 'feature';
|
||||
ol.format.WFS.XMLNS = 'http://www.w3.org/2000/xmlns/';
|
||||
|
||||
|
||||
/**
|
||||
* Number of features; bounds/extent.
|
||||
* @typedef {{numberOfFeatures: number,
|
||||
* bounds: ol.Extent}}
|
||||
* @api stable
|
||||
*/
|
||||
ol.format.WFS.FeatureCollectionMetadata;
|
||||
|
||||
|
||||
/**
|
||||
* Total deleted; total inserted; total updated; array of insert ids.
|
||||
* @typedef {{totalDeleted: number,
|
||||
* totalInserted: number,
|
||||
* totalUpdated: number,
|
||||
* insertIds: Array.<string>}}
|
||||
* @api stable
|
||||
*/
|
||||
ol.format.WFS.TransactionResponse;
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {string}
|
||||
@@ -205,7 +193,7 @@ ol.format.WFS.prototype.readFeatureCollectionMetadataFromDocument = function(doc
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.FEATURE_COLLECTION_PARSERS_ = {
|
||||
@@ -238,7 +226,7 @@ ol.format.WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.TRANSACTION_SUMMARY_PARSERS_ = {
|
||||
@@ -267,7 +255,7 @@ ol.format.WFS.readTransactionSummary_ = function(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.OGC_FID_PARSERS_ = {
|
||||
@@ -291,7 +279,7 @@ ol.format.WFS.fidParser_ = function(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.INSERT_RESULTS_PARSERS_ = {
|
||||
@@ -315,7 +303,7 @@ ol.format.WFS.readInsertResults_ = function(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.TRANSACTION_RESPONSE_PARSERS_ = {
|
||||
@@ -360,7 +348,7 @@ ol.format.WFS.prototype.readTransactionResponseFromNode = function(node) {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.QUERY_SERIALIZERS_ = {
|
||||
@@ -509,7 +497,7 @@ ol.format.WFS.writeNative_ = function(node, nativeElement, objectStack) {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.TRANSACTION_SERIALIZERS_ = {
|
||||
@@ -551,24 +539,163 @@ ol.format.WFS.writeQuery_ = function(node, featureType, objectStack) {
|
||||
ol.format.WFS.QUERY_SERIALIZERS_,
|
||||
ol.xml.makeSimpleNodeFactory('PropertyName'), propertyNames,
|
||||
objectStack);
|
||||
var bbox = context['bbox'];
|
||||
if (bbox) {
|
||||
var filter = context['filter'];
|
||||
if (filter) {
|
||||
var child = ol.xml.createElementNS('http://www.opengis.net/ogc', 'Filter');
|
||||
ol.format.WFS.writeOgcBBOX_(child, bbox, objectStack);
|
||||
node.appendChild(child);
|
||||
ol.format.WFS.writeFilterCondition_(child, filter, objectStack);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {string} value PropertyName value.
|
||||
* @param {ol.format.ogc.filter.Filter} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.writeOgcPropertyName_ = function(node, value, objectStack) {
|
||||
var property = ol.xml.createElementNS('http://www.opengis.net/ogc',
|
||||
'PropertyName');
|
||||
ol.format.WFS.writeFilterCondition_ = function(node, filter, objectStack) {
|
||||
var item = {node: node};
|
||||
ol.xml.pushSerializeAndPop(item,
|
||||
ol.format.WFS.GETFEATURE_SERIALIZERS_,
|
||||
ol.xml.makeSimpleNodeFactory(filter.getTagName()),
|
||||
[filter], objectStack);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {ol.format.ogc.filter.Filter} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.writeBboxFilter_ = function(node, filter, objectStack) {
|
||||
goog.asserts.assertInstanceof(filter, ol.format.ogc.filter.Bbox,
|
||||
'must be bbox filter');
|
||||
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
goog.asserts.assert(goog.isObject(context), 'context should be an Object');
|
||||
context.srsName = filter.srsName;
|
||||
|
||||
ol.format.WFS.writeOgcPropertyName_(node, filter.geometryName);
|
||||
ol.format.GML3.prototype.writeGeometryElement(node, filter.extent, objectStack);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {ol.format.ogc.filter.Filter} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.writeLogicalFilter_ = function(node, filter, objectStack) {
|
||||
goog.asserts.assertInstanceof(filter, ol.format.ogc.filter.LogicalBinary,
|
||||
'must be logical filter');
|
||||
var item = {node: node};
|
||||
var conditionA = filter.conditionA;
|
||||
ol.xml.pushSerializeAndPop(item,
|
||||
ol.format.WFS.GETFEATURE_SERIALIZERS_,
|
||||
ol.xml.makeSimpleNodeFactory(conditionA.getTagName()),
|
||||
[conditionA], objectStack);
|
||||
var conditionB = filter.conditionB;
|
||||
ol.xml.pushSerializeAndPop(item,
|
||||
ol.format.WFS.GETFEATURE_SERIALIZERS_,
|
||||
ol.xml.makeSimpleNodeFactory(conditionB.getTagName()),
|
||||
[conditionB], objectStack);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {ol.format.ogc.filter.Filter} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.writeNotFilter_ = function(node, filter, objectStack) {
|
||||
goog.asserts.assertInstanceof(filter, ol.format.ogc.filter.Not,
|
||||
'must be Not filter');
|
||||
var item = {node: node};
|
||||
var condition = filter.condition;
|
||||
ol.xml.pushSerializeAndPop(item,
|
||||
ol.format.WFS.GETFEATURE_SERIALIZERS_,
|
||||
ol.xml.makeSimpleNodeFactory(condition.getTagName()),
|
||||
[condition], objectStack);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {ol.format.ogc.filter.Filter} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.writeComparisonFilter_ = function(node, filter, objectStack) {
|
||||
goog.asserts.assertInstanceof(filter, ol.format.ogc.filter.ComparisonBinary,
|
||||
'must be binary comparison filter');
|
||||
if (filter.matchCase !== undefined) {
|
||||
node.setAttribute('matchCase', filter.matchCase.toString());
|
||||
}
|
||||
ol.format.WFS.writeOgcPropertyName_(node, filter.propertyName);
|
||||
ol.format.WFS.writeOgcLiteral_(node, '' + filter.expression);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {ol.format.ogc.filter.Filter} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.writeIsNullFilter_ = function(node, filter, objectStack) {
|
||||
goog.asserts.assertInstanceof(filter, ol.format.ogc.filter.IsNull,
|
||||
'must be IsNull comparison filter');
|
||||
ol.format.WFS.writeOgcPropertyName_(node, filter.propertyName);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {ol.format.ogc.filter.Filter} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.writeIsBetweenFilter_ = function(node, filter, objectStack) {
|
||||
goog.asserts.assertInstanceof(filter, ol.format.ogc.filter.IsBetween,
|
||||
'must be IsBetween comparison filter');
|
||||
ol.format.WFS.writeOgcPropertyName_(node, filter.propertyName);
|
||||
ol.format.WFS.writeOgcExpression_('LowerBoundary', node, '' + filter.lowerBoundary);
|
||||
ol.format.WFS.writeOgcExpression_('UpperBoundary', node, '' + filter.upperBoundary);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {ol.format.ogc.filter.Filter} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.writeIsLikeFilter_ = function(node, filter, objectStack) {
|
||||
goog.asserts.assertInstanceof(filter, ol.format.ogc.filter.IsLike,
|
||||
'must be IsLike comparison filter');
|
||||
node.setAttribute('wildCard', filter.wildCard);
|
||||
node.setAttribute('singleChar', filter.singleChar);
|
||||
node.setAttribute('escapeChar', filter.escapeChar);
|
||||
if (filter.matchCase !== undefined) {
|
||||
node.setAttribute('matchCase', filter.matchCase.toString());
|
||||
}
|
||||
ol.format.WFS.writeOgcPropertyName_(node, filter.propertyName);
|
||||
ol.format.WFS.writeOgcLiteral_(node, '' + filter.pattern);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} tagName Tag name.
|
||||
* @param {Node} node Node.
|
||||
* @param {string} value Value.
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.writeOgcExpression_ = function(tagName, node, value) {
|
||||
var property = ol.xml.createElementNS('http://www.opengis.net/ogc', tagName);
|
||||
ol.format.XSD.writeStringTextNode(property, value);
|
||||
node.appendChild(property);
|
||||
};
|
||||
@@ -576,29 +703,46 @@ ol.format.WFS.writeOgcPropertyName_ = function(node, value, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {ol.Extent} bbox Bounding box.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {string} value PropertyName value.
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.writeOgcBBOX_ = function(node, bbox, objectStack) {
|
||||
var context = objectStack[objectStack.length - 1];
|
||||
goog.asserts.assert(goog.isObject(context), 'context should be an Object');
|
||||
var geometryName = context['geometryName'];
|
||||
var bboxNode = ol.xml.createElementNS('http://www.opengis.net/ogc', 'BBOX');
|
||||
node.appendChild(bboxNode);
|
||||
ol.format.WFS.writeOgcPropertyName_(bboxNode, geometryName, objectStack);
|
||||
ol.format.GML3.prototype.writeGeometryElement(bboxNode, bbox, objectStack);
|
||||
ol.format.WFS.writeOgcPropertyName_ = function(node, value) {
|
||||
ol.format.WFS.writeOgcExpression_('PropertyName', node, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, ol.xml.Serializer>>}
|
||||
* @param {Node} node Node.
|
||||
* @param {string} value PropertyName value.
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.writeOgcLiteral_ = function(node, value) {
|
||||
ol.format.WFS.writeOgcExpression_('Literal', node, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, ol.xmlSerializer>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WFS.GETFEATURE_SERIALIZERS_ = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
'Query': ol.xml.makeChildAppender(
|
||||
ol.format.WFS.writeQuery_)
|
||||
'Query': ol.xml.makeChildAppender(ol.format.WFS.writeQuery_)
|
||||
},
|
||||
'http://www.opengis.net/ogc': {
|
||||
'And': ol.xml.makeChildAppender(ol.format.WFS.writeLogicalFilter_),
|
||||
'Or': ol.xml.makeChildAppender(ol.format.WFS.writeLogicalFilter_),
|
||||
'Not': ol.xml.makeChildAppender(ol.format.WFS.writeNotFilter_),
|
||||
'BBOX': ol.xml.makeChildAppender(ol.format.WFS.writeBboxFilter_),
|
||||
'PropertyIsEqualTo': ol.xml.makeChildAppender(ol.format.WFS.writeComparisonFilter_),
|
||||
'PropertyIsNotEqualTo': ol.xml.makeChildAppender(ol.format.WFS.writeComparisonFilter_),
|
||||
'PropertyIsLessThan': ol.xml.makeChildAppender(ol.format.WFS.writeComparisonFilter_),
|
||||
'PropertyIsLessThanOrEqualTo': ol.xml.makeChildAppender(ol.format.WFS.writeComparisonFilter_),
|
||||
'PropertyIsGreaterThan': ol.xml.makeChildAppender(ol.format.WFS.writeComparisonFilter_),
|
||||
'PropertyIsGreaterThanOrEqualTo': ol.xml.makeChildAppender(ol.format.WFS.writeComparisonFilter_),
|
||||
'PropertyIsNull': ol.xml.makeChildAppender(ol.format.WFS.writeIsNullFilter_),
|
||||
'PropertyIsBetween': ol.xml.makeChildAppender(ol.format.WFS.writeIsBetweenFilter_),
|
||||
'PropertyIsLike': ol.xml.makeChildAppender(ol.format.WFS.writeIsLikeFilter_)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -633,6 +777,7 @@ ol.format.WFS.prototype.writeGetFeature = function(options) {
|
||||
'GetFeature');
|
||||
node.setAttribute('service', 'WFS');
|
||||
node.setAttribute('version', '1.1.0');
|
||||
var filter;
|
||||
if (options) {
|
||||
if (options.handle) {
|
||||
node.setAttribute('handle', options.handle);
|
||||
@@ -652,6 +797,19 @@ ol.format.WFS.prototype.writeGetFeature = function(options) {
|
||||
if (options.count !== undefined) {
|
||||
node.setAttribute('count', options.count);
|
||||
}
|
||||
filter = options.filter;
|
||||
if (options.bbox) {
|
||||
goog.asserts.assert(options.geometryName,
|
||||
'geometryName must be set when using bbox filter');
|
||||
var bbox = ol.format.ogc.filter.bbox(
|
||||
options.geometryName, options.bbox, options.srsName);
|
||||
if (filter) {
|
||||
// if bbox and filter are both set, combine the two into a single filter
|
||||
filter = ol.format.ogc.filter.and(filter, bbox);
|
||||
} else {
|
||||
filter = bbox;
|
||||
}
|
||||
}
|
||||
}
|
||||
ol.xml.setAttributeNS(node, 'http://www.w3.org/2001/XMLSchema-instance',
|
||||
'xsi:schemaLocation', this.schemaLocation_);
|
||||
@@ -661,7 +819,7 @@ ol.format.WFS.prototype.writeGetFeature = function(options) {
|
||||
featureNS: options.featureNS ? options.featureNS : this.featureNS_,
|
||||
featurePrefix: options.featurePrefix,
|
||||
geometryName: options.geometryName,
|
||||
bbox: options.bbox,
|
||||
filter: filter,
|
||||
propertyNames: options.propertyNames ? options.propertyNames : []
|
||||
};
|
||||
goog.asserts.assert(Array.isArray(options.featureTypes),
|
||||
|
||||
@@ -366,12 +366,6 @@ ol.format.WKT.prototype.writeGeometryText = function(geometry, opt_options) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{type: number, value: (number|string|undefined), position: number}}
|
||||
*/
|
||||
ol.format.WKT.Token;
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @enum {number}
|
||||
@@ -451,7 +445,7 @@ ol.format.WKT.Lexer.prototype.nextChar_ = function() {
|
||||
|
||||
/**
|
||||
* Fetch and return the next token.
|
||||
* @return {!ol.format.WKT.Token} Next string token.
|
||||
* @return {!ol.WKTToken} Next string token.
|
||||
*/
|
||||
ol.format.WKT.Lexer.prototype.nextToken = function() {
|
||||
var c = this.nextChar_();
|
||||
@@ -537,7 +531,7 @@ ol.format.WKT.Parser = function(lexer) {
|
||||
this.lexer_ = lexer;
|
||||
|
||||
/**
|
||||
* @type {ol.format.WKT.Token}
|
||||
* @type {ol.WKTToken}
|
||||
* @private
|
||||
*/
|
||||
this.token_;
|
||||
@@ -561,7 +555,7 @@ ol.format.WKT.Parser.prototype.consume_ = function() {
|
||||
|
||||
/**
|
||||
* If the given type matches the current token, consume it.
|
||||
* @param {ol.format.WKT.TokenType.<number>} type Token type.
|
||||
* @param {ol.format.WKT.TokenType} type Token type.
|
||||
* @return {boolean} Whether the token matches the given type.
|
||||
*/
|
||||
ol.format.WKT.Parser.prototype.match = function(type) {
|
||||
@@ -838,7 +832,7 @@ ol.format.WKT.Parser.prototype.formatErrorMessage_ = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @enum {function (new:ol.geom.Geometry, Array, ol.geom.GeometryLayout.<string>=)}
|
||||
* @enum {function (new:ol.geom.Geometry, Array, ol.geom.GeometryLayout)}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WKT.Parser.GeometryConstructor_ = {
|
||||
|
||||
@@ -568,7 +568,7 @@ ol.format.WMSCapabilities.NAMESPACE_URIS_ = [
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -582,7 +582,7 @@ ol.format.WMSCapabilities.PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.CAPABILITY_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -598,7 +598,7 @@ ol.format.WMSCapabilities.CAPABILITY_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.SERVICE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -626,7 +626,7 @@ ol.format.WMSCapabilities.SERVICE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.CONTACT_INFORMATION_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -648,7 +648,7 @@ ol.format.WMSCapabilities.CONTACT_INFORMATION_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.CONTACT_PERSON_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -662,7 +662,7 @@ ol.format.WMSCapabilities.CONTACT_PERSON_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.CONTACT_ADDRESS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -679,7 +679,7 @@ ol.format.WMSCapabilities.CONTACT_ADDRESS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.EXCEPTION_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -690,7 +690,7 @@ ol.format.WMSCapabilities.EXCEPTION_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.LAYER_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -731,7 +731,7 @@ ol.format.WMSCapabilities.LAYER_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.ATTRIBUTION_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -746,7 +746,7 @@ ol.format.WMSCapabilities.ATTRIBUTION_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_ =
|
||||
@@ -764,7 +764,7 @@ ol.format.WMSCapabilities.EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS_ =
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.REQUEST_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -780,7 +780,7 @@ ol.format.WMSCapabilities.REQUEST_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.OPERATIONTYPE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -793,7 +793,7 @@ ol.format.WMSCapabilities.OPERATIONTYPE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.DCPTYPE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -805,7 +805,7 @@ ol.format.WMSCapabilities.DCPTYPE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.HTTP_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -819,7 +819,7 @@ ol.format.WMSCapabilities.HTTP_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.STYLE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -838,7 +838,7 @@ ol.format.WMSCapabilities.STYLE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_ =
|
||||
@@ -851,7 +851,7 @@ ol.format.WMSCapabilities.FORMAT_ONLINERESOURCE_PARSERS_ =
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMSCapabilities.KEYWORDLIST_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
@@ -149,10 +149,7 @@ ol.format.WMSGetFeatureInfo.prototype.readFeatures;
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.format.WMSGetFeatureInfo.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
var options = {
|
||||
'featureType': this.featureType,
|
||||
'featureNS': this.featureNS
|
||||
};
|
||||
var options = {};
|
||||
if (opt_options) {
|
||||
ol.object.assign(options, this.getReadOptions(node, opt_options));
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ ol.format.WMTSCapabilities.OWS_NAMESPACE_URIS_ = [
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -289,7 +289,7 @@ ol.format.WMTSCapabilities.PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.CONTENTS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -303,7 +303,7 @@ ol.format.WMTSCapabilities.CONTENTS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.LAYER_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -332,7 +332,7 @@ ol.format.WMTSCapabilities.LAYER_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.STYLE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -349,7 +349,7 @@ ol.format.WMTSCapabilities.STYLE_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.TMS_LINKS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -361,7 +361,7 @@ ol.format.WMTSCapabilities.TMS_LINKS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.DIMENSION_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -378,7 +378,7 @@ ol.format.WMTSCapabilities.DIMENSION_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.WGS84_BBOX_READERS_ = ol.xml.makeStructureNS(
|
||||
@@ -392,7 +392,7 @@ ol.format.WMTSCapabilities.WGS84_BBOX_READERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.TMS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
@@ -411,7 +411,7 @@ ol.format.WMTSCapabilities.TMS_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, ol.xml.Parser>>}
|
||||
* @type {Object.<string, Object.<string, ol.xmlParser>>}
|
||||
* @private
|
||||
*/
|
||||
ol.format.WMTSCapabilities.TM_PARSERS_ = ol.xml.makeStructureNS(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
goog.provide('ol.format.XSD');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.string');
|
||||
goog.require('ol');
|
||||
goog.require('ol.xml');
|
||||
goog.require('ol.string');
|
||||
|
||||
|
||||
/**
|
||||
@@ -142,11 +142,11 @@ ol.format.XSD.writeBooleanTextNode = function(node, bool) {
|
||||
ol.format.XSD.writeDateTimeTextNode = function(node, dateTime) {
|
||||
var date = new Date(dateTime * 1000);
|
||||
var string = date.getUTCFullYear() + '-' +
|
||||
goog.string.padNumber(date.getUTCMonth() + 1, 2) + '-' +
|
||||
goog.string.padNumber(date.getUTCDate(), 2) + 'T' +
|
||||
goog.string.padNumber(date.getUTCHours(), 2) + ':' +
|
||||
goog.string.padNumber(date.getUTCMinutes(), 2) + ':' +
|
||||
goog.string.padNumber(date.getUTCSeconds(), 2) + 'Z';
|
||||
ol.string.padNumber(date.getUTCMonth() + 1, 2) + '-' +
|
||||
ol.string.padNumber(date.getUTCDate(), 2) + 'T' +
|
||||
ol.string.padNumber(date.getUTCHours(), 2) + ':' +
|
||||
ol.string.padNumber(date.getUTCMinutes(), 2) + ':' +
|
||||
ol.string.padNumber(date.getUTCSeconds(), 2) + 'Z';
|
||||
node.appendChild(ol.xml.DOCUMENT.createTextNode(string));
|
||||
};
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
// FIXME factor out common code between usedTiles and wantedTiles
|
||||
|
||||
goog.provide('ol.PostRenderFunction');
|
||||
goog.provide('ol.PreRenderFunction');
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {function(ol.Map, ?olx.FrameState): boolean}
|
||||
*/
|
||||
ol.PostRenderFunction;
|
||||
|
||||
|
||||
/**
|
||||
* Function to perform manipulations before rendering. This function is called
|
||||
* with the {@link ol.Map} as first and an optional {@link olx.FrameState} as
|
||||
* second argument. Return `true` to keep this function for the next frame,
|
||||
* `false` to remove it.
|
||||
* @typedef {function(ol.Map, ?olx.FrameState): boolean}
|
||||
* @api
|
||||
*/
|
||||
ol.PreRenderFunction;
|
||||
@@ -5,7 +5,6 @@ goog.provide('ol.GeolocationProperty');
|
||||
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.events.EventType');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Object');
|
||||
goog.require('ol.geom.Geometry');
|
||||
goog.require('ol.geom.Polygon');
|
||||
@@ -135,12 +134,12 @@ ol.Geolocation.prototype.handleTrackingChanged_ = function() {
|
||||
if (ol.has.GEOLOCATION) {
|
||||
var tracking = this.getTracking();
|
||||
if (tracking && this.watchId_ === undefined) {
|
||||
this.watchId_ = goog.global.navigator.geolocation.watchPosition(
|
||||
this.watchId_ = ol.global.navigator.geolocation.watchPosition(
|
||||
this.positionChange_.bind(this),
|
||||
this.positionError_.bind(this),
|
||||
this.getTrackingOptions());
|
||||
} else if (!tracking && this.watchId_ !== undefined) {
|
||||
goog.global.navigator.geolocation.clearWatch(this.watchId_);
|
||||
ol.global.navigator.geolocation.clearWatch(this.watchId_);
|
||||
this.watchId_ = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
goog.provide('ol.geom.flat.geodesic');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('ol.TransformFunction');
|
||||
goog.require('ol.math');
|
||||
goog.require('ol.proj');
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ ol.has.MAC = ua.indexOf('macintosh') !== -1;
|
||||
* @type {number}
|
||||
* @api stable
|
||||
*/
|
||||
ol.has.DEVICE_PIXEL_RATIO = goog.global.devicePixelRatio || 1;
|
||||
ol.has.DEVICE_PIXEL_RATIO = ol.global.devicePixelRatio || 1;
|
||||
|
||||
|
||||
/**
|
||||
@@ -56,7 +56,7 @@ ol.has.CANVAS = ol.ENABLE_CANVAS && (
|
||||
* @return {boolean} Canvas supported.
|
||||
*/
|
||||
function() {
|
||||
if (!('HTMLCanvasElement' in goog.global)) {
|
||||
if (!('HTMLCanvasElement' in ol.global)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
@@ -81,7 +81,7 @@ ol.has.CANVAS = ol.ENABLE_CANVAS && (
|
||||
* @type {boolean}
|
||||
* @api stable
|
||||
*/
|
||||
ol.has.DEVICE_ORIENTATION = 'DeviceOrientationEvent' in goog.global;
|
||||
ol.has.DEVICE_ORIENTATION = 'DeviceOrientationEvent' in ol.global;
|
||||
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ ol.has.DOM = ol.ENABLE_DOM;
|
||||
* @type {boolean}
|
||||
* @api stable
|
||||
*/
|
||||
ol.has.GEOLOCATION = 'geolocation' in goog.global.navigator;
|
||||
ol.has.GEOLOCATION = 'geolocation' in ol.global.navigator;
|
||||
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ ol.has.GEOLOCATION = 'geolocation' in goog.global.navigator;
|
||||
* @type {boolean}
|
||||
* @api stable
|
||||
*/
|
||||
ol.has.TOUCH = ol.ASSUME_TOUCH || 'ontouchstart' in goog.global;
|
||||
ol.has.TOUCH = ol.ASSUME_TOUCH || 'ontouchstart' in ol.global;
|
||||
|
||||
|
||||
/**
|
||||
@@ -115,7 +115,7 @@ ol.has.TOUCH = ol.ASSUME_TOUCH || 'ontouchstart' in goog.global;
|
||||
* @const
|
||||
* @type {boolean}
|
||||
*/
|
||||
ol.has.POINTER = 'PointerEvent' in goog.global;
|
||||
ol.has.POINTER = 'PointerEvent' in ol.global;
|
||||
|
||||
|
||||
/**
|
||||
@@ -123,7 +123,7 @@ ol.has.POINTER = 'PointerEvent' in goog.global;
|
||||
* @const
|
||||
* @type {boolean}
|
||||
*/
|
||||
ol.has.MSPOINTER = !!(goog.global.navigator.msPointerEnabled);
|
||||
ol.has.MSPOINTER = !!(ol.global.navigator.msPointerEnabled);
|
||||
|
||||
|
||||
/**
|
||||
@@ -142,7 +142,7 @@ ol.has.WEBGL;
|
||||
var textureSize;
|
||||
var /** @type {Array.<string>} */ extensions = [];
|
||||
|
||||
if ('WebGLRenderingContext' in goog.global) {
|
||||
if ('WebGLRenderingContext' in ol.global) {
|
||||
try {
|
||||
var canvas = /** @type {HTMLCanvasElement} */
|
||||
(document.createElement('CANVAS'));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user