Compare commits
400 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb92c268ab | ||
|
|
518212ce7d | ||
|
|
bbfc93b1d8 | ||
|
|
d3e15e4394 | ||
|
|
0dbca294b2 | ||
|
|
c74d7171aa | ||
|
|
6ebc67f1c5 | ||
|
|
72568305c0 | ||
|
|
749660dd22 | ||
|
|
ed80d243fb | ||
|
|
0d26c33484 | ||
|
|
1775a5aeea | ||
|
|
f196ed8102 | ||
|
|
c56432cf2e | ||
|
|
17e11fb84a | ||
|
|
4154df9aa8 | ||
|
|
728e1dd1f2 | ||
|
|
6d41e87ff5 | ||
|
|
77e66221c1 | ||
|
|
b562f4d68a | ||
|
|
e7c2d9ab32 | ||
|
|
39de933e64 | ||
|
|
c43740a4ad | ||
|
|
7a43a667ce | ||
|
|
1b662ff048 | ||
|
|
93a98337d8 | ||
|
|
65c8eba59b | ||
|
|
059ac56fef | ||
|
|
64afa2eab5 | ||
|
|
13546d27f2 | ||
|
|
a2326f7180 | ||
|
|
ffe0529df8 | ||
|
|
38f7aef6b0 | ||
|
|
f549f1946c | ||
|
|
449ea370c0 | ||
|
|
bc506389fc | ||
|
|
5d85867fbf | ||
|
|
55edf4003f | ||
|
|
6b465902cd | ||
|
|
9453984f9a | ||
|
|
35129af7f0 | ||
|
|
3726b25ba2 | ||
|
|
7048de8e83 | ||
|
|
4b7cdffaf4 | ||
|
|
14cecb7163 | ||
|
|
29c8af7559 | ||
|
|
b19ac3c26d | ||
|
|
f26bcf5c3e | ||
|
|
e4168e3582 | ||
|
|
dd8dc8ad0f | ||
|
|
b8ce70fbf0 | ||
|
|
e916345e8c | ||
|
|
925a272fb8 | ||
|
|
eaa0d70289 | ||
|
|
030c0dad3d | ||
|
|
0fef14137c | ||
|
|
04287e0fd5 | ||
|
|
ea1c7a6551 | ||
|
|
6da5a1e9f7 | ||
|
|
ec12c34edd | ||
|
|
837c48a2e2 | ||
|
|
04c4b4efc1 | ||
|
|
96a14e0515 | ||
|
|
cd4f1c109b | ||
|
|
609c891524 | ||
|
|
5442c1f587 | ||
|
|
810c655940 | ||
|
|
9d5232d9af | ||
|
|
265068e782 | ||
|
|
44a4fbdda2 | ||
|
|
6902791dc5 | ||
|
|
95a3f42315 | ||
|
|
6fe1a58b26 | ||
|
|
466b02836b | ||
|
|
e5cc971dc9 | ||
|
|
bda673f389 | ||
|
|
fa995cf7f3 | ||
|
|
1a159f3ac4 | ||
|
|
6718fc982e | ||
|
|
2809df86ca | ||
|
|
1d20215bfa | ||
|
|
7d210948e8 | ||
|
|
3c50d12ad9 | ||
|
|
bb32b6ac55 | ||
|
|
103ff01456 | ||
|
|
d26ac55ed0 | ||
|
|
31dcb80725 | ||
|
|
f3acac5259 | ||
|
|
06249be6bd | ||
|
|
400484e663 | ||
|
|
ab4da04312 | ||
|
|
4bf1f56405 | ||
|
|
08f8cd0f16 | ||
|
|
40ead5b329 | ||
|
|
2c29512c80 | ||
|
|
09202cf95d | ||
|
|
e39ea746a7 | ||
|
|
54f7bb6958 | ||
|
|
27853ea7dd | ||
|
|
395f3c0756 | ||
|
|
e63b4d1f48 | ||
|
|
3935b7db24 | ||
|
|
e289bfbb7d | ||
|
|
a598737ec5 | ||
|
|
1f48198e95 | ||
|
|
072728b083 | ||
|
|
abec4f4ba7 | ||
|
|
edb3987054 | ||
|
|
c51fc84b72 | ||
|
|
de9c338fb1 | ||
|
|
26789d91d2 | ||
|
|
aa9dbb984a | ||
|
|
b2120b2bab | ||
|
|
b4b61e737f | ||
|
|
0dca194525 | ||
|
|
9e980663ee | ||
|
|
2ec4969ac7 | ||
|
|
ca07de422c | ||
|
|
eddd006fcf | ||
|
|
9e209a3362 | ||
|
|
30482f023e | ||
|
|
3d8ca68bac | ||
|
|
3b1c76a1da | ||
|
|
578b653c40 | ||
|
|
da5f47999f | ||
|
|
d51fecd827 | ||
|
|
370f810f6b | ||
|
|
d270643ce1 | ||
|
|
1e2ea333cc | ||
|
|
a9df88004c | ||
|
|
f477a6ccb9 | ||
|
|
2305991ee9 | ||
|
|
3bdcdb5937 | ||
|
|
bb8b43abce | ||
|
|
4877a7864c | ||
|
|
1b70931433 | ||
|
|
0acbaa20f9 | ||
|
|
d2c8823359 | ||
|
|
2cac34e938 | ||
|
|
15ede94380 | ||
|
|
bd0140f42d | ||
|
|
f3248e9c19 | ||
|
|
420374294b | ||
|
|
271e7c5bb1 | ||
|
|
b434a30603 | ||
|
|
ec1d21e29a | ||
|
|
4e1decab52 | ||
|
|
92632f1d63 | ||
|
|
2063c1be71 | ||
|
|
77baa67e71 | ||
|
|
f3e6630db3 | ||
|
|
1038b2abea | ||
|
|
e0cada9c5d | ||
|
|
a6a621834f | ||
|
|
4653a01ba4 | ||
|
|
7196e18479 | ||
|
|
e70ce9d624 | ||
|
|
0efb3994eb | ||
|
|
d666bb4a36 | ||
|
|
50408d7c1a | ||
|
|
d50082b860 | ||
|
|
ac4653ada5 | ||
|
|
feb6fe9dce | ||
|
|
b2b902e22f | ||
|
|
6f5965f6a5 | ||
|
|
9870e8c04c | ||
|
|
5542f045d5 | ||
|
|
025c063251 | ||
|
|
841c8a5747 | ||
|
|
81d5849207 | ||
|
|
bbd1af6056 | ||
|
|
e3f58b3e84 | ||
|
|
d52586d586 | ||
|
|
4044ae4cd0 | ||
|
|
be2fc808be | ||
|
|
d08cca5a0c | ||
|
|
2117f2e3b1 | ||
|
|
1345d049b1 | ||
|
|
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 | ||
|
|
cd32875f37 | ||
|
|
6fc4427f4f | ||
|
|
481bcbd5b3 | ||
|
|
880d4b89a2 | ||
|
|
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,78 @@
|
||||
## Upgrade notes
|
||||
|
||||
### v3.17.0
|
||||
|
||||
#### `ol.source.MapQuest` removal
|
||||
|
||||
Because of changes at MapQuest (see: https://lists.openstreetmap.org/pipermail/talk/2016-June/076106.html) we had to remove the MapQuest source for now (see https://github.com/openlayers/ol3/issues/5484 for details).
|
||||
|
||||
#### `ol.interaction.ModifyEvent` changes
|
||||
|
||||
The event object previously had a `mapBrowserPointerEvent` property, which has been renamed to `mapBrowserEvent`.
|
||||
|
||||
#### Removal of ol.raster namespace
|
||||
|
||||
Users compiling their code with the library and using types in the `ol.raster` namespace should note that this has now been removed. `ol.raster.Pixel` has been deleted, and the other types have been renamed as follows, and your code may need changing if you use these:
|
||||
* `ol.raster.Operation` to `ol.RasterOperation`
|
||||
* `ol.raster.OperationType` to `ol.RasterOperationType`
|
||||
|
||||
#### All typedefs now in ol namespace
|
||||
|
||||
Users compiling their code with the library should note that the following typedefs have been renamed; your code may need changing if you use these:
|
||||
* ol.events.ConditionType to ol.EventsConditionType
|
||||
* ol.events.EventTargetLike to ol.EventTargetLike
|
||||
* ol.events.Key to ol.EventsKey
|
||||
* ol.events.ListenerFunctionType to ol.EventsListenerFunctionType
|
||||
* ol.interaction.DragBoxEndConditionType to ol.DragBoxEndConditionType
|
||||
* ol.interaction.DrawGeometryFunctionType to ol.DrawGeometryFunctionType
|
||||
* ol.interaction.SegmentDataType to ol.ModifySegmentDataType
|
||||
* ol.interaction.SelectFilterFunction to ol.SelectFilterFunction
|
||||
* ol.interaction.SnapResultType to ol.SnapResultType
|
||||
* ol.interaction.SnapSegmentDataType to ol.SnapSegmentDataType
|
||||
* ol.proj.ProjectionLike to ol.ProjectionLike
|
||||
* ol.style.AtlasBlock to ol.AtlasBlock
|
||||
* ol.style.AtlasInfo to ol.AtlasInfo
|
||||
* ol.style.AtlasManagerInfo to ol.AtlasManagerInfo
|
||||
* ol.style.CircleRenderOptions to ol.CircleRenderOptions
|
||||
* ol.style.ImageOptions to ol.StyleImageOptions
|
||||
* ol.style.GeometryFunction to ol.StyleGeometryFunction
|
||||
* ol.style.RegularShapeRenderOptions to ol.RegularShapeRenderOptions
|
||||
* ol.style.StyleFunction to ol.StyleFunction
|
||||
|
||||
### v3.16.0
|
||||
|
||||
#### Rendering change for tile sources
|
||||
|
||||
Previously, if you called `source.setUrl()` on a tile source, all currently rendered tiles would be cleared before new tiles were loaded and rendered. This clearing of the map is undesirable if you are trying to smoothly update the tiles used by a source. This behavior has now changed, and calling `source.setUrl()` (or `source.setUrls()`) will *not* clear currently rendered tiles before loading and rendering new tiles. Instead, previously rendered tiles remain rendered until new tiles have loaded and can replace them. If you want to achieve the old behavior (render a blank map before loading new tiles), you can call `source.refresh()` or you can replace the old source with a new one (using `layer.setSource()`).
|
||||
|
||||
#### 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.
|
||||
Users compiling their code with the library should note that the following API `@typedef`s have been renamed; your code may need changing if you use these:
|
||||
* `ol.format.WFS.FeatureCollectionMetadata` to `ol.WFSFeatureCollectionMetadata`
|
||||
* `ol.format.WFS.TransactionResponse` to `ol.WFSTransactionResponse`
|
||||
|
||||
#### 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
|
||||
|
||||
9
changelog/v3.15.1.md
Normal file
9
changelog/v3.15.1.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# v3.15.1
|
||||
|
||||
## Summary
|
||||
|
||||
The v3.15.1 release is a patch release that addresses a regression in the v3.15.0 release. See the [v3.15.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.15.0) for details on upgrading from v3.14.x.
|
||||
|
||||
## Fixes
|
||||
|
||||
* [#5190](https://github.com/openlayers/ol3/pull/5190) - Revert "Batch polygon fill and stroke instructions" ([@ahocevar](https://github.com/ahocevar))
|
||||
148
changelog/v3.16.0.md
Normal file
148
changelog/v3.16.0.md
Normal file
@@ -0,0 +1,148 @@
|
||||
# v3.16.0
|
||||
|
||||
## Summary
|
||||
|
||||
The v3.16.0 release includes features and fixes from 95 pull requests since the v3.15.1 release. New features and improvements include:
|
||||
|
||||
* Add `ol.source.ImageArcGISRest` for ArcGIS REST image layer support (#3880)
|
||||
* New `finishCondition` option for `ol.interaction.Draw` to control which action should finish a geometry when drawing (#5261)
|
||||
* New filter API for `ol.format.WFS#writeGetFeature` for WFS queries with OGC filters (#5252)
|
||||
* New `renderMode` option for `ol.layer.VectorTile` to balance between rendering performance and rendering quality (#5177)
|
||||
* More flexibility for configuring attribution logos by allowing HTML elements (#5274)
|
||||
* UTFGrid updates, now supporting Mapbox API v4 (#5329)
|
||||
* New `condition` option for `ol.interaction.Modify` for better reliability when combining with other interactions (#5320)
|
||||
|
||||
In addition to these new features, the code base has been simplified and refactored in the process of removing the dependency on Closure Library and Compiler.
|
||||
|
||||
## Upgrade notes
|
||||
|
||||
#### Rendering change for tile sources
|
||||
|
||||
Previously, if you called `source.setUrl()` on a tile source, all currently rendered tiles would be cleared before new tiles were loaded and rendered. This clearing of the map is undesirable if you are trying to smoothly update the tiles used by a source. This behavior has now changed, and calling `source.setUrl()` (or `source.setUrls()`) will *not* clear currently rendered tiles before loading and rendering new tiles. Instead, previously rendered tiles remain rendered until new tiles have loaded and can replace them. If you want to achieve the old behavior (render a blank map before loading new tiles), you can call `source.refresh()` or you can replace the old source with a new one (using `layer.setSource()`).
|
||||
|
||||
#### 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.
|
||||
Users compiling their code with the library should note that the following API `@typedef`s have been renamed; your code may need changing if you use these:
|
||||
* `ol.format.WFS.FeatureCollectionMetadata` to `ol.WFSFeatureCollectionMetadata`
|
||||
* `ol.format.WFS.TransactionResponse` to `ol.WFSTransactionResponse`
|
||||
|
||||
#### 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'
|
||||
});
|
||||
```
|
||||
|
||||
## Full list of changes
|
||||
|
||||
* [#5377](https://github.com/openlayers/ol3/pull/5377) - Fix link to jspdf.min.js in export-pdf example ([@fredj](https://github.com/fredj))
|
||||
* [#5372](https://github.com/openlayers/ol3/pull/5372) - Update jquery to version 2.2.4 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5364](https://github.com/openlayers/ol3/pull/5364) - Make it so things don't flash so much when you change the tile source URL. ([@tschaub](https://github.com/tschaub))
|
||||
* [#5368](https://github.com/openlayers/ol3/pull/5368) - Move WFS typedefs to typedefs.js ([@probins](https://github.com/probins))
|
||||
* [#5369](https://github.com/openlayers/ol3/pull/5369) - format/igc: Remove duplicate regex exec() call ([@Turbo87](https://github.com/Turbo87))
|
||||
* [#5363](https://github.com/openlayers/ol3/pull/5363) - Convert all typedefs to CamelCase ([@probins](https://github.com/probins))
|
||||
* [#5362](https://github.com/openlayers/ol3/pull/5362) - Update vector-tile to version 1.2.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5352](https://github.com/openlayers/ol3/pull/5352) - Add getResolutions() to ol.View ([@marlowp](https://github.com/marlowp))
|
||||
* [#5359](https://github.com/openlayers/ol3/pull/5359) - Move upgrade notes to correct place ([@probins](https://github.com/probins))
|
||||
* [#5343](https://github.com/openlayers/ol3/pull/5343) - Rename non-api sub-namespace typedefs ([@probins](https://github.com/probins))
|
||||
* [#5361](https://github.com/openlayers/ol3/pull/5361) - Fix url to maki icons ([@fredj](https://github.com/fredj))
|
||||
* [#5358](https://github.com/openlayers/ol3/pull/5358) - Handle multiple featureMember elements for different types (WFS format) ([@tsauerwein](https://github.com/tsauerwein))
|
||||
* [#5355](https://github.com/openlayers/ol3/pull/5355) - Fix navigation-controls example description ([@fredj](https://github.com/fredj))
|
||||
* [#5353](https://github.com/openlayers/ol3/pull/5353) - Add API definition to docs landing page ([@probins](https://github.com/probins))
|
||||
* [#5356](https://github.com/openlayers/ol3/pull/5356) - Update rbush to version 1.4.3 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5354](https://github.com/openlayers/ol3/pull/5354) - Update eslint to version 2.10.2 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5347](https://github.com/openlayers/ol3/pull/5347) - Update eslint to version 2.10.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5344](https://github.com/openlayers/ol3/pull/5344) - Remove raster enum from test ([@probins](https://github.com/probins))
|
||||
* [#5329](https://github.com/openlayers/ol3/pull/5329) - UTFGrid updates. ([@tschaub](https://github.com/tschaub))
|
||||
* [#5335](https://github.com/openlayers/ol3/pull/5335) - Move typedefs to separate file ([@probins](https://github.com/probins))
|
||||
* [#5332](https://github.com/openlayers/ol3/pull/5332) - Warn when viewing an outdated example, and offer a redirect to latest ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5342](https://github.com/openlayers/ol3/pull/5342) - Fix incorrect source links ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5339](https://github.com/openlayers/ol3/pull/5339) - Use a div instead of alert for version warning ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5320](https://github.com/openlayers/ol3/pull/5320) - Add a 'condition' option to ol.interaction.Modify ([@fredj](https://github.com/fredj))
|
||||
* [#5333](https://github.com/openlayers/ol3/pull/5333) - Improve code readability with better comments ([@openlayers](https://github.com/openlayers))
|
||||
* [#5330](https://github.com/openlayers/ol3/pull/5330) - Fix source links, display version and warn about outdated docs ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5324](https://github.com/openlayers/ol3/pull/5324) - Remove unneeded goog.provides/requires for typedefs ([@probins](https://github.com/probins))
|
||||
* [#5328](https://github.com/openlayers/ol3/pull/5328) - Use Node 6 on Travis. ([@tschaub](https://github.com/tschaub))
|
||||
* [#5313](https://github.com/openlayers/ol3/pull/5313) - Rastersource framestate extent ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5326](https://github.com/openlayers/ol3/pull/5326) - Fix wording in tile-load-event example ([@tsauerwein](https://github.com/tsauerwein))
|
||||
* [#5327](https://github.com/openlayers/ol3/pull/5327) - Update closure-util to version 1.13.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5289](https://github.com/openlayers/ol3/pull/5289) - Update fs-extra to version 0.30.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5319](https://github.com/openlayers/ol3/pull/5319) - Remove outdated fixme from framestate.js. ([@probins](https://github.com/probins))
|
||||
* [#5274](https://github.com/openlayers/ol3/pull/5274) - Allow using elements in logo attribution options ([@samuellapointe](https://github.com/samuellapointe))
|
||||
* [#5162](https://github.com/openlayers/ol3/pull/5162) - Improve docs/examples for loadingstrategy ([@probins](https://github.com/probins))
|
||||
* [#5314](https://github.com/openlayers/ol3/pull/5314) - Update browserify to version 13.0.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5315](https://github.com/openlayers/ol3/pull/5315) - Remove unused ol.TileCoordTransformType ([@probins](https://github.com/probins))
|
||||
* [#5310](https://github.com/openlayers/ol3/pull/5310) - Get raster sources working again. ([@tschaub](https://github.com/tschaub))
|
||||
* [#5291](https://github.com/openlayers/ol3/pull/5291) - Allow once listeners to dispatch events of same type ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5309](https://github.com/openlayers/ol3/pull/5309) - Update metalsmith-layouts to version 1.6.5 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5052](https://github.com/openlayers/ol3/pull/5052) - Update fs-extra to version 0.26.7 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5306](https://github.com/openlayers/ol3/pull/5306) - Make olx.view.FitOptions.padding optional ([@gberaudo](https://github.com/gberaudo))
|
||||
* [#5302](https://github.com/openlayers/ol3/pull/5302) - Remove use of goog.partial ([@fredj](https://github.com/fredj))
|
||||
* [#5304](https://github.com/openlayers/ol3/pull/5304) - Update sinon to version 1.17.4 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#4644](https://github.com/openlayers/ol3/pull/4644) - Remove check-requires script ([@fredj](https://github.com/fredj))
|
||||
* [#5298](https://github.com/openlayers/ol3/pull/5298) - Update eslint to version 2.9.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5296](https://github.com/openlayers/ol3/pull/5296) - Document handling of KML MultiGeometries ([@probins](https://github.com/probins))
|
||||
* [#5293](https://github.com/openlayers/ol3/pull/5293) - Block removePoint while dragging ([@giohappy](https://github.com/giohappy))
|
||||
* [#5285](https://github.com/openlayers/ol3/pull/5285) - Add more tests for the scaleline control ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#5287](https://github.com/openlayers/ol3/pull/5287) - Add and fix vectortile tests ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5288](https://github.com/openlayers/ol3/pull/5288) - Expose removeVertex_ as removePoint ([@giohappy](https://github.com/giohappy))
|
||||
* [#5286](https://github.com/openlayers/ol3/pull/5286) - Skip unnecessary render functions ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5177](https://github.com/openlayers/ol3/pull/5177) - Add render options for vector tile layers ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5278](https://github.com/openlayers/ol3/pull/5278) - Fix invalid generics type instantiation ([@fredj](https://github.com/fredj))
|
||||
* [#5044](https://github.com/openlayers/ol3/pull/5044) - Snap interaction now handle feature without geometry properly ([@fblackburn](https://github.com/fblackburn))
|
||||
* [#5277](https://github.com/openlayers/ol3/pull/5277) - Type cleanup ([@fredj](https://github.com/fredj))
|
||||
* [#5275](https://github.com/openlayers/ol3/pull/5275) - Fix feature-layer association on replaced selections ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5252](https://github.com/openlayers/ol3/pull/5252) - Add filter option to ol.format.WFS#writeGetFeature ([@tsauerwein](https://github.com/tsauerwein))
|
||||
* [#5264](https://github.com/openlayers/ol3/pull/5264) - Fix for close draw polygon error ([@matjos](https://github.com/matjos))
|
||||
* [#5267](https://github.com/openlayers/ol3/pull/5267) - Use ol.functions instead of goog.functions ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5266](https://github.com/openlayers/ol3/pull/5266) - Document ol.colorlike ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5261](https://github.com/openlayers/ol3/pull/5261) - add finishCondition to ol.interaction.Draw ([@giohappy](https://github.com/giohappy))
|
||||
* [#5259](https://github.com/openlayers/ol3/pull/5259) - Include squash commit merges in changelog ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5257](https://github.com/openlayers/ol3/pull/5257) - Add readFeatures and readProjection as MVT experimental API ([@bjornharrtell](https://github.com/bjornharrtell))
|
||||
* [#3880](https://github.com/openlayers/ol3/pull/3880) - Add ol.source.ImageArcGISRest ([Anna Lambrechtsen](https://github.com/search?q=Anna Lambrechtsen&type=Users))
|
||||
* [#5239](https://github.com/openlayers/ol3/pull/5239) - Update eslint to version 2.8.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5230](https://github.com/openlayers/ol3/pull/5230) - Reuse frame state arrays ([@fredj](https://github.com/fredj))
|
||||
* [#5213](https://github.com/openlayers/ol3/pull/5213) - Remove unused ol.source.Source#setProjection function ([@fredj](https://github.com/fredj))
|
||||
* [#5223](https://github.com/openlayers/ol3/pull/5223) - Create tmpSize_ before calling calculateTileRanges_ ([@fredj](https://github.com/fredj))
|
||||
* [#5225](https://github.com/openlayers/ol3/pull/5225) - Remove unused ol.extent.transform2D function ([@fredj](https://github.com/fredj))
|
||||
* [#5212](https://github.com/openlayers/ol3/pull/5212) - KML: fix GeometryCollection write ([@probins](https://github.com/probins))
|
||||
* [#5228](https://github.com/openlayers/ol3/pull/5228) - Add 'layers' option to Translate interaction ([@adube](https://github.com/adube))
|
||||
* [#5221](https://github.com/openlayers/ol3/pull/5221) - Update jquery, bootstrap and proj4js in examples ([@fredj](https://github.com/fredj))
|
||||
* [#5227](https://github.com/openlayers/ol3/pull/5227) - Add a temporary ol.TileCoord in ol.renderer.canvas.TileLayer ([@fredj](https://github.com/fredj))
|
||||
* [#5222](https://github.com/openlayers/ol3/pull/5222) - Remove unused private variables in ol.renderer.canvas.Map ([@fredj](https://github.com/fredj))
|
||||
* [#5220](https://github.com/openlayers/ol3/pull/5220) - Externs cleanup ([@fredj](https://github.com/fredj))
|
||||
* [#5224](https://github.com/openlayers/ol3/pull/5224) - Fix jsdoc tags indentation ([@fredj](https://github.com/fredj))
|
||||
* [#5218](https://github.com/openlayers/ol3/pull/5218) - Add @api annotation to setConfig. ([@aisaacs](https://github.com/aisaacs))
|
||||
* [#5215](https://github.com/openlayers/ol3/pull/5215) - Add an optional feature filter to getClosestFeatureToCoordinate ([@fredj](https://github.com/fredj))
|
||||
* [#5132](https://github.com/openlayers/ol3/pull/5132) - Remove goog.string ([@nicholas-l](https://github.com/nicholas-l))
|
||||
* [#5206](https://github.com/openlayers/ol3/pull/5206) - Minor correction of StyleFunction docs ([@probins](https://github.com/probins))
|
||||
* [#4932](https://github.com/openlayers/ol3/pull/4932) - Remove undefined parameters to ol.format.WMSGetFeatureInfo#readFeatures_ ([@fredj](https://github.com/fredj))
|
||||
* [#5207](https://github.com/openlayers/ol3/pull/5207) - Update clean-css to version 3.4.12 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5201](https://github.com/openlayers/ol3/pull/5201) - Small clarification for vector source loader docs ([@probins](https://github.com/probins))
|
||||
* [#5200](https://github.com/openlayers/ol3/pull/5200) - Fix typo in rotate control for css classList ([@bartvde](https://github.com/bartvde))
|
||||
* [#5178](https://github.com/openlayers/ol3/pull/5178) - Remove goog.global ([Nicholas Latham](https://github.com/search?q=Nicholas Latham&type=Users))
|
||||
* [#5189](https://github.com/openlayers/ol3/pull/5189) - Add rendering tests to ensure correct circle and polygon rendering ([Andreas Hocevar](https://github.com/search?q=Andreas Hocevar&type=Users))
|
||||
* [#5183](https://github.com/openlayers/ol3/pull/5183) - Update istanbul to version 0.4.3 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5187](https://github.com/openlayers/ol3/pull/5187) - Remove goog.functions.and from ol.interaction.Modify ([@fredj](https://github.com/fredj))
|
||||
* [#5176](https://github.com/openlayers/ol3/pull/5176) - Update jquery to version 2.2.3 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5173](https://github.com/openlayers/ol3/pull/5173) - Use ol.dom.createCanvasContext2D ([@fredj](https://github.com/fredj))
|
||||
* [#5171](https://github.com/openlayers/ol3/pull/5171) - Move olx.source.AttributionOption out of externs/olx.js ([@fredj](https://github.com/fredj))
|
||||
* [#5170](https://github.com/openlayers/ol3/pull/5170) - Update eslint to version 2.7.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5167](https://github.com/openlayers/ol3/pull/5167) - Remove FastClick from mobile-full-screen example ([@fredj](https://github.com/fredj))
|
||||
* [#5166](https://github.com/openlayers/ol3/pull/5166) - Remove jquery dependency from measure example ([@fredj](https://github.com/fredj))
|
||||
* [#5164](https://github.com/openlayers/ol3/pull/5164) - Cartodb cleanup ([@fredj](https://github.com/fredj))
|
||||
107
changelog/v3.17.0.md
Normal file
107
changelog/v3.17.0.md
Normal file
@@ -0,0 +1,107 @@
|
||||
# v3.17.0
|
||||
|
||||
## Summary
|
||||
|
||||
The v3.17.0 release includes features and fixes from 60 pull requests since the v3.16.0 release. Most of the changes are bug fixes and continuing removal of the dependency on Closure Library.
|
||||
|
||||
## Upgrade notes
|
||||
|
||||
#### `ol.source.MapQuest` removal
|
||||
|
||||
Because of changes at MapQuest (see: https://lists.openstreetmap.org/pipermail/talk/2016-June/076106.html) we had to remove the MapQuest source for now (see https://github.com/openlayers/ol3/issues/5484 for details).
|
||||
|
||||
#### `ol.interaction.ModifyEvent` changes
|
||||
|
||||
The event object previously had a `mapBrowserPointerEvent` property, which has been renamed to `mapBrowserEvent`.
|
||||
|
||||
#### Removal of ol.raster namespace
|
||||
|
||||
Users compiling their code with the library and using types in the `ol.raster` namespace should note that this has now been removed. `ol.raster.Pixel` has been deleted, and the other types have been renamed as follows, and your code may need changing if you use these:
|
||||
* `ol.raster.Operation` to `ol.RasterOperation`
|
||||
* `ol.raster.OperationType` to `ol.RasterOperationType`
|
||||
|
||||
#### All typedefs now in ol namespace
|
||||
|
||||
Users compiling their code with the library should note that the following typedefs have been renamed; your code may need changing if you use these:
|
||||
* ol.events.ConditionType to ol.EventsConditionType
|
||||
* ol.events.EventTargetLike to ol.EventTargetLike
|
||||
* ol.events.Key to ol.EventsKey
|
||||
* ol.events.ListenerFunctionType to ol.EventsListenerFunctionType
|
||||
* ol.interaction.DragBoxEndConditionType to ol.DragBoxEndConditionType
|
||||
* ol.interaction.DrawGeometryFunctionType to ol.DrawGeometryFunctionType
|
||||
* ol.interaction.SegmentDataType to ol.ModifySegmentDataType
|
||||
* ol.interaction.SelectFilterFunction to ol.SelectFilterFunction
|
||||
* ol.interaction.SnapResultType to ol.SnapResultType
|
||||
* ol.interaction.SnapSegmentDataType to ol.SnapSegmentDataType
|
||||
* ol.proj.ProjectionLike to ol.ProjectionLike
|
||||
* ol.style.AtlasBlock to ol.AtlasBlock
|
||||
* ol.style.AtlasInfo to ol.AtlasInfo
|
||||
* ol.style.AtlasManagerInfo to ol.AtlasManagerInfo
|
||||
* ol.style.CircleRenderOptions to ol.CircleRenderOptions
|
||||
* ol.style.ImageOptions to ol.StyleImageOptions
|
||||
* ol.style.GeometryFunction to ol.StyleGeometryFunction
|
||||
* ol.style.RegularShapeRenderOptions to ol.RegularShapeRenderOptions
|
||||
* ol.style.StyleFunction to ol.StyleFunction
|
||||
|
||||
## Full list of changes
|
||||
|
||||
* [#5539](https://github.com/openlayers/ol3/pull/5539) - Remove outdated comments re goog.dom ([@probins](https://github.com/probins))
|
||||
* [#5543](https://github.com/openlayers/ol3/pull/5543) - Update rbush to 2.0.1 ([@tsauerwein](https://github.com/tsauerwein))
|
||||
* [#5540](https://github.com/openlayers/ol3/pull/5540) - Remove MapQuest source ([@bartvde](https://github.com/bartvde))
|
||||
* [#5538](https://github.com/openlayers/ol3/pull/5538) - Replace remaining goog.inherits ([@probins](https://github.com/probins))
|
||||
* [#5536](https://github.com/openlayers/ol3/pull/5536) - Update to layer-extent example ([@tschaub](https://github.com/tschaub))
|
||||
* [#5482](https://github.com/openlayers/ol3/pull/5482) - Fix for regression in tile layer extent ([@ischneider](https://github.com/ischneider))
|
||||
* [#5475](https://github.com/openlayers/ol3/pull/5475) - Remove goog.provide from enums only used internally or in olx.js ([@probins](https://github.com/probins))
|
||||
* [#5424](https://github.com/openlayers/ol3/pull/5424) - Don't dispatch select event if no feature is selected or deselected ([@fredj](https://github.com/fredj))
|
||||
* [#5522](https://github.com/openlayers/ol3/pull/5522) - Add 'condition' option to ol.interaction.DragPanOptions in olx.js ([@SamuelBerger](https://github.com/SamuelBerger))
|
||||
* [#5443](https://github.com/openlayers/ol3/pull/5443) - Remove olx.source.WMTSOptions#maxZoom option ([@fredj](https://github.com/fredj))
|
||||
* [#5497](https://github.com/openlayers/ol3/pull/5497) - Update istanbul to version 0.4.4 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5523](https://github.com/openlayers/ol3/pull/5523) - Update closure-util to version 1.15.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5508](https://github.com/openlayers/ol3/pull/5508) - Fix problems with ol.format.WFS in compiled mode ([@tsauerwein](https://github.com/tsauerwein))
|
||||
* [#5512](https://github.com/openlayers/ol3/pull/5512) - Use forEachTileCoord name instead of forEachTileCoordInExtentAndZ ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5513](https://github.com/openlayers/ol3/pull/5513) - Add getters for min and max resolution of the view ([@bartvde](https://github.com/bartvde))
|
||||
* [#5471](https://github.com/openlayers/ol3/pull/5471) - Fix GPX write of xsi ns ([@probins](https://github.com/probins))
|
||||
* [#5134](https://github.com/openlayers/ol3/pull/5134) - Remove goog.dom ([@nicholas-l](https://github.com/nicholas-l))
|
||||
* [#5511](https://github.com/openlayers/ol3/pull/5511) - Do not optimize lines away entirely ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5509](https://github.com/openlayers/ol3/pull/5509) - Make it easier to work with tile ranges in custom source implementations ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5498](https://github.com/openlayers/ol3/pull/5498) - Update eslint to version 2.13.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5495](https://github.com/openlayers/ol3/pull/5495) - Get rid of goog.isFunction ([@fredj](https://github.com/fredj))
|
||||
* [#5499](https://github.com/openlayers/ol3/pull/5499) - Update glob to version 7.0.5 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5125](https://github.com/openlayers/ol3/pull/5125) - Remove goog style ([@nicholas-l](https://github.com/nicholas-l))
|
||||
* [#5494](https://github.com/openlayers/ol3/pull/5494) - Remove goog.global ([@probins](https://github.com/probins))
|
||||
* [#5492](https://github.com/openlayers/ol3/pull/5492) - Update eslint to version 2.13.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5490](https://github.com/openlayers/ol3/pull/5490) - Update glob to version 7.0.4 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5460](https://github.com/openlayers/ol3/pull/5460) - Update eslint to version 2.12.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5479](https://github.com/openlayers/ol3/pull/5479) - Update slimerjs to version 0.906.2 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5474](https://github.com/openlayers/ol3/pull/5474) - Update clean-css to version 3.4.18 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5450](https://github.com/openlayers/ol3/pull/5450) - Remove sub-namespaces from all remaining typedefs ([@probins](https://github.com/probins))
|
||||
* [#5465](https://github.com/openlayers/ol3/pull/5465) - Fix custom icon positions and rotation ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5469](https://github.com/openlayers/ol3/pull/5469) - Fix typo ([@gberaudo](https://github.com/gberaudo))
|
||||
* [#5453](https://github.com/openlayers/ol3/pull/5453) - Reference ol.MapBrowserEvent instead of ol.MapBrowserPointerEvent ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5208](https://github.com/openlayers/ol3/pull/5208) - Stop GPX writing rtept properties ([@probins](https://github.com/probins))
|
||||
* [#5452](https://github.com/openlayers/ol3/pull/5452) - Update eslint-config-openlayers to version 5.0.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5432](https://github.com/openlayers/ol3/pull/5432) - Remove use of goog.uri ([@bjornharrtell](https://github.com/bjornharrtell))
|
||||
* [#5449](https://github.com/openlayers/ol3/pull/5449) - Make example data/ paths absolute for source view and JSFiddle ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5399](https://github.com/openlayers/ol3/pull/5399) - Remove ol.raster namespace ([@probins](https://github.com/probins))
|
||||
* [#5270](https://github.com/openlayers/ol3/pull/5270) - Load erroneous image in ol.Image#load and ol.ImageTile#load ([@fredj](https://github.com/fredj))
|
||||
* [#5194](https://github.com/openlayers/ol3/pull/5194) - Get rid of goog.inherits and goog.base ([@fredj](https://github.com/fredj))
|
||||
* [#5427](https://github.com/openlayers/ol3/pull/5427) - Document typedefs and enums used by API symbols ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#5438](https://github.com/openlayers/ol3/pull/5438) - Don't make ol.format.ogc.filter.Filter inherit from ol.Object ([@fredj](https://github.com/fredj))
|
||||
* [#5433](https://github.com/openlayers/ol3/pull/5433) - Update clean-css to version 3.4.17 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5434](https://github.com/openlayers/ol3/pull/5434) - Fix externs in closure compiler tutorial ([@tsauerwein](https://github.com/tsauerwein))
|
||||
* [#5426](https://github.com/openlayers/ol3/pull/5426) - Fix icon example to anchor popup to feature location ([@frankrowe](https://github.com/frankrowe))
|
||||
* [#5421](https://github.com/openlayers/ol3/pull/5421) - Correct typo in config/jsdoc/api/readme.md ([@probins](https://github.com/probins))
|
||||
* [#5417](https://github.com/openlayers/ol3/pull/5417) - Update clean-css to version 3.4.16 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5413](https://github.com/openlayers/ol3/pull/5413) - Update clean-css to version 3.4.15 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5410](https://github.com/openlayers/ol3/pull/5410) - Update eslint to version 2.11.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5408](https://github.com/openlayers/ol3/pull/5408) - Update pbf to version 2.0.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5404](https://github.com/openlayers/ol3/pull/5404) - Update eslint to version 2.11.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5402](https://github.com/openlayers/ol3/pull/5402) - Pass in srsName option to writeTransaction ([@anzhihun](https://github.com/anzhihun))
|
||||
* [#5393](https://github.com/openlayers/ol3/pull/5393) - Update mocha to version 2.5.3 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5394](https://github.com/openlayers/ol3/pull/5394) - Update resemblejs to version 2.2.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5390](https://github.com/openlayers/ol3/pull/5390) - Fix the requestEncoding automatic selection ([@fredj](https://github.com/fredj))
|
||||
* [#5392](https://github.com/openlayers/ol3/pull/5392) - Update closure-util to version 1.14.0 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5388](https://github.com/openlayers/ol3/pull/5388) - Update mocha to version 2.5.2 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5382](https://github.com/openlayers/ol3/pull/5382) - Handle UTC midnight wrap around, fixes #5371 ([@twpayne](https://github.com/twpayne))
|
||||
* [#5381](https://github.com/openlayers/ol3/pull/5381) - Update mocha to version 2.5.1 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#5383](https://github.com/openlayers/ol3/pull/5383) - Update clean-css to version 3.4.13 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
9
changelog/v3.17.1.md
Normal file
9
changelog/v3.17.1.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# v3.17.1
|
||||
|
||||
## Summary
|
||||
|
||||
The v3.17.1 release is a patch release that addresses a regression in the v3.17.0 release. See the [v3.17.0 release notes](https://github.com/openlayers/ol3/releases/tag/v3.17.0) for details on upgrading from v3.16.
|
||||
|
||||
## Fixes
|
||||
|
||||
* [#5548](https://github.com/openlayers/ol3/pull/5548) - Fix CHANGETYPE in ol.control.FullScreen ([@GaborFarkas](https://github.com/GaborFarkas))
|
||||
@@ -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",
|
||||
@@ -25,15 +24,12 @@
|
||||
"externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||
"goog.DEBUG=false"
|
||||
],
|
||||
"jscomp_error": [
|
||||
"*"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"unnecessaryCasts",
|
||||
"useOfGoogBase",
|
||||
"lintChecks",
|
||||
"analyzerChecks",
|
||||
"missingProvide",
|
||||
|
||||
@@ -17,24 +17,19 @@
|
||||
"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",
|
||||
"externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||
"goog.DEBUG=false"
|
||||
],
|
||||
"jscomp_error": [
|
||||
"*"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"unnecessaryCasts",
|
||||
"useOfGoogBase",
|
||||
"lintChecks",
|
||||
"analyzerChecks"
|
||||
],
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -11,6 +11,7 @@ exports.defineTags = function(dictionary) {
|
||||
canHaveType: false,
|
||||
canHaveName: false,
|
||||
onTagged: function(doclet, tag) {
|
||||
includeTypes(doclet);
|
||||
var level = tag.text || "experimental";
|
||||
if (levels.indexOf(level) >= 0) {
|
||||
doclet.stability = level;
|
||||
@@ -25,11 +26,15 @@ exports.defineTags = function(dictionary) {
|
||||
|
||||
|
||||
/*
|
||||
* Based on @stability annotations, and assuming that items with no @stability
|
||||
* annotation should not be documented, this plugin removes undocumented symbols
|
||||
* Based on @api annotations, and assuming that items with no @api annotation
|
||||
* should not be documented, this plugin removes undocumented symbols
|
||||
* from the documentation.
|
||||
*/
|
||||
|
||||
var api = [];
|
||||
var classes = {};
|
||||
var types = {};
|
||||
|
||||
function hasApiMembers(doclet) {
|
||||
return doclet.longname.split('#')[0] == this.longname;
|
||||
}
|
||||
@@ -71,8 +76,30 @@ function includeAugments(doclet) {
|
||||
}
|
||||
}
|
||||
|
||||
var api = [];
|
||||
var classes = {};
|
||||
function extractTypes(item) {
|
||||
item.type.names.forEach(function(type) {
|
||||
var match = type.match(/^(.*<)?([^>]*)>?$/);
|
||||
if (match) {
|
||||
types[match[2]] = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function includeTypes(doclet) {
|
||||
if (doclet.params && doclet.kind != 'class') {
|
||||
doclet.params.forEach(extractTypes);
|
||||
}
|
||||
if (doclet.returns) {
|
||||
doclet.returns.forEach(extractTypes);
|
||||
}
|
||||
if (doclet.isEnum) {
|
||||
types[doclet.meta.code.name] = true;
|
||||
}
|
||||
if (doclet.type && doclet.meta.code.type == 'MemberExpression') {
|
||||
// types in olx.js
|
||||
extractTypes(doclet);
|
||||
}
|
||||
}
|
||||
|
||||
exports.handlers = {
|
||||
|
||||
@@ -80,6 +107,9 @@ exports.handlers = {
|
||||
var doclet = e.doclet;
|
||||
// Keep track of api items - needed in parseComplete to determine classes
|
||||
// with api members.
|
||||
if (doclet.meta.filename == 'olx.js' && doclet.kind == 'typedef') {
|
||||
doclet.undocumented = false;
|
||||
}
|
||||
if (doclet.stability) {
|
||||
api.push(doclet);
|
||||
}
|
||||
@@ -120,7 +150,7 @@ exports.handlers = {
|
||||
// constructor from the docs.
|
||||
doclet._hideConstructor = true;
|
||||
includeAugments(doclet);
|
||||
} else if (!doclet._hideConstructor) {
|
||||
} else if (doclet.undocumented !== false && !doclet._hideConstructor && !(doclet.kind == 'typedef' && doclet.longname in types)) {
|
||||
// Remove all other undocumented symbols
|
||||
doclet.undocumented = true;
|
||||
}
|
||||
|
||||
@@ -89,10 +89,6 @@ exports.handlers = {
|
||||
newDoclet: function(e) {
|
||||
var doclet = e.doclet;
|
||||
if (doclet.meta.filename == 'olx.js') {
|
||||
// do nothing if not marked @api
|
||||
if (!doclet.stability) {
|
||||
return;
|
||||
}
|
||||
if (doclet.kind == 'typedef') {
|
||||
lastOlxTypedef = doclet;
|
||||
olxTypeNames.push(doclet.longname);
|
||||
|
||||
@@ -24,7 +24,7 @@ The second line tells the Closure compiler the type of the argument.
|
||||
|
||||
The third line (`@api`) marks the method as part of the api and thus exportable. The stability can be added as value, e.g. `@api stable`. Without such an api annotation, the method will not be documented in the generated API documentation. Symbols without an api annotation will also not be exportable (unless they are explicitly exported with a `goog.exportProperty` call).
|
||||
|
||||
The `@api` annotation can be used in conjunciton with the `@inheritDoc` annotation to export a symbol that is documented on a parent class (where the method may be abstract). In general, `@api` annotations should never be used on abstract methods (only on their implementations).
|
||||
The `@api` annotation can be used in conjunction with the `@inheritDoc` annotation to export a symbol that is documented on a parent class (where the method may be abstract). In general, `@api` annotations should never be used on abstract methods (only on their implementations).
|
||||
|
||||
### Events
|
||||
|
||||
|
||||
@@ -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 +
|
||||
textParts[0];
|
||||
el.innerHTML = '<a href="' + link + '">' + textParts[0] + '</a>, ' +
|
||||
'<a href="' + link + textParts[1].replace('line ', '#l') + '">' +
|
||||
textParts[1] + '</a>';
|
||||
});
|
||||
}
|
||||
srcLinks.each(function(i, el) {
|
||||
var textParts = el.innerHTML.trim().split(', ');
|
||||
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>
|
||||
|
||||
@@ -39,7 +39,7 @@ var self = this;
|
||||
<?js
|
||||
item.typedefs.forEach(function (v) {
|
||||
?>
|
||||
<li data-name="<?js= v.longname ?>" class="<?js= v.stability !== 'stable' ? 'unstable' : ''?>">
|
||||
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability !== 'stable') ? 'unstable' : ''?>">
|
||||
<?js= self.linkto(v.longname, v.name) ?>
|
||||
</li>
|
||||
<?js
|
||||
@@ -56,7 +56,7 @@ var self = this;
|
||||
|
||||
item.methods.forEach(function (v) {
|
||||
?>
|
||||
<li data-name="<?js= v.longname ?>" class="<?js= v.stability !== 'stable' ? 'unstable' : ''?>">
|
||||
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability !== 'stable') ? 'unstable' : ''?>">
|
||||
<?js= self.linkto(v.longname, v.name) ?>
|
||||
</li>
|
||||
<?js
|
||||
@@ -73,7 +73,7 @@ var self = this;
|
||||
item.fires.forEach(function (v) {
|
||||
v = self.find({longname: v})[0] || {longname: v, name: v.split(/#?event:/)[1]};
|
||||
?>
|
||||
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability != 'stable' ? 'unstable' : '') ?>">
|
||||
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability != 'stable') ? 'unstable' : '' ?>">
|
||||
<?js= self.linkto(v.longname, v.name) ?>
|
||||
</li>
|
||||
<?js
|
||||
@@ -84,4 +84,4 @@ var self = this;
|
||||
</li>
|
||||
<?js }); ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
var setter = prop.readonly ? 'no' : 'yes';
|
||||
?>
|
||||
|
||||
<tr class="<?js= prop.stability !== 'stable' ? 'unstable' : '' ?>">
|
||||
<tr class="<?js= (prop.stability && prop.stability !== 'stable') ? 'unstable' : '' ?>">
|
||||
<td class="name"><code><?js= prop.name ?></code></td>
|
||||
<td class="type">
|
||||
<?js if (prop.type && prop.type.names) {?>
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
var data = obj;
|
||||
var self = this;
|
||||
|
||||
if (data.stability != 'stable') { ?>
|
||||
if (data.stability && data.stability != 'stable') { ?>
|
||||
<span class="stability <?js= data.stability ?>"><?js= data.stability ?></span>
|
||||
<?js } ?>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<section>
|
||||
|
||||
|
||||
<header>
|
||||
<?js if (children.length > 0) { ?>
|
||||
<ul><?js
|
||||
@@ -10,10 +10,10 @@
|
||||
<?js } ?>
|
||||
|
||||
<h2><?js= header ?></h2>
|
||||
</header>
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<?js= content ?>
|
||||
</article>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -15,15 +15,12 @@
|
||||
"externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||
"goog.DEBUG=false"
|
||||
],
|
||||
"jscomp_error": [
|
||||
"*"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"unnecessaryCasts",
|
||||
"useOfGoogBase",
|
||||
"lintChecks",
|
||||
"analyzerChecks"
|
||||
],
|
||||
|
||||
@@ -31,7 +31,7 @@ Below you'll find a complete working example. Create a new file, copy in the co
|
||||
target: 'map',
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
view: new ol.View({
|
||||
@@ -85,7 +85,7 @@ The map in the application is contained in a [`<div>` HTML element](http://en.wi
|
||||
target: 'map',
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
view: new ol.View({
|
||||
@@ -95,7 +95,7 @@ The map in the application is contained in a [`<div>` HTML element](http://en.wi
|
||||
});
|
||||
```
|
||||
|
||||
With this JavaScript code, a map object is created with a MapQuest Open Aerial layer zoomed on the African East coast. Let's break this down:
|
||||
With this JavaScript code, a map object is created with an OSM layer zoomed on the African East coast. Let's break this down:
|
||||
|
||||
The following line creates an OpenLayers `Map` object. Just by itself, this does nothing since there's no layers or interaction attached to it.
|
||||
|
||||
@@ -114,7 +114,7 @@ The `layers: [ ... ]` array is used to define the list of layers available in th
|
||||
```js
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
]
|
||||
```
|
||||
|
||||
@@ -160,7 +160,9 @@ The minimum config file looks like this:
|
||||
"closure_entry_point": "app",
|
||||
"externs": [
|
||||
"node_modules/openlayers/externs/bingmaps.js",
|
||||
"node_modules/openlayers/externs/cartodb.js",
|
||||
"node_modules/openlayers/externs/closure-compiler.js",
|
||||
"node_modules/openlayers/externs/esrijson.js",
|
||||
"node_modules/openlayers/externs/geojson.js",
|
||||
"node_modules/openlayers/externs/proj4js.js",
|
||||
"node_modules/openlayers/externs/tilejson.js",
|
||||
@@ -210,14 +212,15 @@ Here is a version of `config.json` with more compilation checks enabled:
|
||||
"closure_entry_point": "app",
|
||||
"externs": [
|
||||
"node_modules/openlayers/externs/bingmaps.js",
|
||||
"node_modules/openlayers/externs/cartodb.js",
|
||||
"node_modules/openlayers/externs/closure-compiler.js",
|
||||
"node_modules/openlayers/externs/esrijson.js",
|
||||
"node_modules/openlayers/externs/geojson.js",
|
||||
"node_modules/openlayers/externs/proj4js.js",
|
||||
"node_modules/openlayers/externs/tilejson.js",
|
||||
"node_modules/openlayers/externs/topojson.js"
|
||||
],
|
||||
"define": [
|
||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||
"goog.DEBUG=false",
|
||||
"ol.ENABLE_DOM=false",
|
||||
"ol.ENABLE_WEBGL=false"
|
||||
@@ -230,8 +233,7 @@ Here is a version of `config.json` with more compilation checks enabled:
|
||||
"*"
|
||||
],
|
||||
"jscomp_off": [
|
||||
"unknownDefines"
|
||||
"useOfGoogBase",
|
||||
"unknownDefines",
|
||||
"lintChecks",
|
||||
"analyzerChecks"
|
||||
],
|
||||
|
||||
@@ -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>
|
||||
30
examples/arcgis-image.js
Normal file
30
examples/arcgis-image.js
Normal file
@@ -0,0 +1,30 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Image');
|
||||
goog.require('ol.source.OSM');
|
||||
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.OSM()
|
||||
}),
|
||||
new ol.layer.Image({
|
||||
source: new ol.source.ImageArcGISRest({
|
||||
ratio: 1,
|
||||
params: {},
|
||||
url: url
|
||||
})
|
||||
})
|
||||
];
|
||||
var map = new ol.Map({
|
||||
layers: layers,
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: [-10997148, 4569099],
|
||||
zoom: 4
|
||||
})
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.TileArcGISRest');
|
||||
|
||||
var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
||||
@@ -9,7 +9,7 @@ var url = 'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/' +
|
||||
|
||||
var layers = [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
extent: [-13884991, 2870341, -7455066, 6338219],
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -5,7 +5,7 @@ goog.require('ol.geom.Point');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.Cluster');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Circle');
|
||||
goog.require('ol.style.Fill');
|
||||
@@ -62,7 +62,7 @@ var clusters = new ol.layer.Vector({
|
||||
});
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
|
||||
@@ -22,8 +22,8 @@ var twoPi = 2 * Math.PI;
|
||||
|
||||
/**
|
||||
* Convert an RGB pixel into an HCL pixel.
|
||||
* @param {ol.raster.Pixel} pixel A pixel in RGB space.
|
||||
* @return {ol.raster.Pixel} A pixel in HCL space.
|
||||
* @param {Array.<number>} pixel A pixel in RGB space.
|
||||
* @return {Array.<number>} A pixel in HCL space.
|
||||
*/
|
||||
function rgb2hcl(pixel) {
|
||||
var red = rgb2xyz(pixel[0]);
|
||||
@@ -57,8 +57,8 @@ function rgb2hcl(pixel) {
|
||||
|
||||
/**
|
||||
* Convert an HCL pixel into an RGB pixel.
|
||||
* @param {ol.raster.Pixel} pixel A pixel in HCL space.
|
||||
* @return {ol.raster.Pixel} A pixel in RGB space.
|
||||
* @param {Array.<number>} pixel A pixel in HCL space.
|
||||
* @return {Array.<number>} A pixel in RGB space.
|
||||
*/
|
||||
function hcl2rgb(pixel) {
|
||||
var h = pixel[0];
|
||||
|
||||
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
|
||||
});
|
||||
@@ -3,7 +3,7 @@ goog.require('ol.View');
|
||||
goog.require('ol.interaction');
|
||||
goog.require('ol.interaction.DragRotateAndZoom');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
@@ -12,7 +12,7 @@ var map = new ol.Map({
|
||||
]),
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
|
||||
@@ -6,7 +6,7 @@ goog.require('ol.interaction.Draw');
|
||||
goog.require('ol.interaction.Modify');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Circle');
|
||||
goog.require('ol.style.Fill');
|
||||
@@ -14,7 +14,7 @@ goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
|
||||
@@ -4,7 +4,7 @@ goog.require('ol.geom.Polygon');
|
||||
goog.require('ol.interaction.Draw');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Circle');
|
||||
goog.require('ol.style.Fill');
|
||||
@@ -12,7 +12,7 @@ goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var source = new ol.source.Vector({wrapX: false});
|
||||
|
||||
@@ -4,7 +4,7 @@ goog.require('ol.View');
|
||||
goog.require('ol.geom.MultiPoint');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.style.Circle');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Stroke');
|
||||
@@ -14,7 +14,7 @@ goog.require('ol.style.Style');
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
|
||||
@@ -13,6 +13,12 @@ goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
|
||||
var symbol = [[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]];
|
||||
var scale;
|
||||
var scaleFunction = function(coordinate) {
|
||||
return [coordinate[0] * scale, coordinate[1] * scale];
|
||||
};
|
||||
|
||||
var styleCache = {};
|
||||
var styleFunction = function(feature) {
|
||||
// 2012_Earthquakes_Mag5.kml stores the magnitude of each earthquake in a
|
||||
@@ -21,23 +27,23 @@ var styleFunction = function(feature) {
|
||||
var name = feature.get('name');
|
||||
var magnitude = parseFloat(name.substr(2));
|
||||
var size = parseInt(10 + 40 * (magnitude - 5), 10);
|
||||
scale = size / 10;
|
||||
var style = styleCache[size];
|
||||
if (!style) {
|
||||
var canvas =
|
||||
/** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
|
||||
var vectorContext = ol.render.toContext(
|
||||
/** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')),
|
||||
{size: [size + 2, size + 2], pixelRatio: size / 10});
|
||||
{size: [size, size], pixelRatio: 1});
|
||||
vectorContext.setStyle(new ol.style.Style({
|
||||
fill: new ol.style.Fill({color: 'rgba(255, 153, 0, 0.4)'}),
|
||||
stroke: new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 1})
|
||||
stroke: new ol.style.Stroke({color: 'rgba(255, 204, 0, 0.2)', width: 2})
|
||||
}));
|
||||
vectorContext.drawGeometry(new ol.geom.Polygon(
|
||||
[[[0, 0], [4, 2], [6, 0], [10, 5], [6, 3], [4, 5], [0, 0]]]));
|
||||
vectorContext.drawGeometry(new ol.geom.Polygon([symbol.map(scaleFunction)]));
|
||||
style = new ol.style.Style({
|
||||
image: new ol.style.Icon({
|
||||
img: canvas,
|
||||
imgSize: [canvas.width, canvas.height],
|
||||
imgSize: [size, size],
|
||||
rotation: 1.2
|
||||
})
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ docs: >
|
||||
Example of exporting a map as a PDF using the <a href="https://github.com/MrRio/jsPDF" target="_blank">jsPDF</a> library.
|
||||
tags: "export, pdf, openstreetmap"
|
||||
resources:
|
||||
- http://mrrio.github.io/jsPDF/dist/jspdf.min.js
|
||||
- https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.2.61/jspdf.min.js
|
||||
---
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -59,7 +59,8 @@ var element = document.getElementById('popup');
|
||||
var popup = new ol.Overlay({
|
||||
element: element,
|
||||
positioning: 'bottom-center',
|
||||
stopEvent: false
|
||||
stopEvent: false,
|
||||
offset: [0, -50]
|
||||
});
|
||||
map.addOverlay(popup);
|
||||
|
||||
@@ -70,7 +71,8 @@ map.on('click', function(evt) {
|
||||
return feature;
|
||||
});
|
||||
if (feature) {
|
||||
popup.setPosition(evt.coordinate);
|
||||
var coordinates = feature.getGeometry().getCoordinates();
|
||||
popup.setPosition(coordinates);
|
||||
$(element).popover({
|
||||
'placement': 'top',
|
||||
'html': true,
|
||||
|
||||
@@ -155,7 +155,7 @@ map.on('click', function(evt) {
|
||||
var stroke = new ol.style.Stroke({
|
||||
color: 'rgba(255,0,0,0.9)',
|
||||
width: 1
|
||||
})
|
||||
});
|
||||
var style = new ol.style.Style({
|
||||
stroke: stroke,
|
||||
image: new ol.style.Circle({
|
||||
|
||||
@@ -5,7 +5,7 @@ goog.require('ol.layer.Image');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.ImageVector');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Stroke');
|
||||
@@ -15,7 +15,7 @@ goog.require('ol.style.Style');
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Image({
|
||||
source: new ol.source.ImageVector({
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -7,7 +7,7 @@ goog.require('ol.format.GeoJSON');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
|
||||
|
||||
@@ -39,9 +39,7 @@ var vectorLayer = new ol.layer.Vector({
|
||||
});
|
||||
|
||||
var rasterLayer = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({
|
||||
layer: 'osm'
|
||||
})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -4,13 +4,12 @@ title: Limited Layer Extent
|
||||
shortdesc: Restricting layer rendering to a limited extent.
|
||||
docs: >
|
||||
This example uses the <code>layer.setExtent()</code> method to
|
||||
modify the extent of the overlay layer. Use the controls below
|
||||
to limit rendering based on an extent.
|
||||
modify the extent of the overlay layer. Use the controls above
|
||||
to limit rendering based on an extent (approximate country bounds).
|
||||
tags: "extent, tilejson"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<button type="button" class="btn btn-default" id="northwest">northwest</button>
|
||||
<button type="button" class="btn btn-default" id="northeast">northeast</button>
|
||||
<button type="button" class="btn btn-default" id="southeast">southeast</button>
|
||||
<button type="button" class="btn btn-default" id="southwest">southwest</button>
|
||||
<button type="button" class="btn btn-default" id="world">world</button>
|
||||
<button type="button" class="btn btn-default" id="India">India</button>
|
||||
<button type="button" class="btn btn-default" id="Argentina">Argentina</button>
|
||||
<button type="button" class="btn btn-default" id="Nigeria">Nigeria</button>
|
||||
<button type="button" class="btn btn-default" id="Sweden">Sweden</button>
|
||||
|
||||
@@ -9,26 +9,25 @@ function transform(extent) {
|
||||
}
|
||||
|
||||
var extents = {
|
||||
northwest: transform([-180, 0, 0, 85]),
|
||||
northeast: transform([0, 0, 180, 85]),
|
||||
southeast: transform([0, -85, 180, 0]),
|
||||
southwest: transform([-180, -85, 0, 0]),
|
||||
world: transform([-180, -85, 180, 85])
|
||||
India: transform([68.17665, 7.96553, 97.40256, 35.49401]),
|
||||
Argentina: transform([-73.41544, -55.25, -53.62835, -21.83231]),
|
||||
Nigeria: transform([2.6917, 4.24059, 14.57718, 13.86592]),
|
||||
Sweden: transform([11.02737, 55.36174, 23.90338, 69.10625])
|
||||
};
|
||||
|
||||
var base = new ol.layer.Tile({
|
||||
source: new ol.source.TileJSON({
|
||||
url: 'http://api.tiles.mapbox.com/v3/' +
|
||||
'mapbox.world-black.json',
|
||||
'mapbox.world-light.json',
|
||||
crossOrigin: 'anonymous'
|
||||
})
|
||||
});
|
||||
|
||||
var overlay = new ol.layer.Tile({
|
||||
extent: extents.northwest,
|
||||
extent: extents.India,
|
||||
source: new ol.source.TileJSON({
|
||||
url: 'http://api.tiles.mapbox.com/v3/' +
|
||||
'mapbox.world-glass.json',
|
||||
'mapbox.world-black.json',
|
||||
crossOrigin: 'anonymous'
|
||||
})
|
||||
});
|
||||
|
||||
@@ -6,13 +6,13 @@ 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">
|
||||
<h5>Click on layer nodes below to change their properties.</h5>
|
||||
<ul>
|
||||
<li><span>OpenAerial layer</span>
|
||||
<li><span>OSM layer</span>
|
||||
<fieldset id="layer0">
|
||||
<label class="checkbox" for="visible0">
|
||||
<input id="visible0" class="visible" type="checkbox"/>visibility
|
||||
|
||||
@@ -3,13 +3,13 @@ goog.require('ol.View');
|
||||
goog.require('ol.layer.Group');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.TileJSON');
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}), new ol.layer.Group({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
var source = new ol.source.MapQuest({layer: 'sat'});
|
||||
var source = new ol.source.OSM();
|
||||
|
||||
var layer = new ol.layer.Tile();
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@ goog.require('ol.geom.Point');
|
||||
goog.require('ol.interaction.Draw');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Icon');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var source = new ol.source.Vector();
|
||||
|
||||
@@ -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> ' +
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: MapQuest
|
||||
shortdesc: Example of a MapQuest map.Shows how to create custom controls.
|
||||
docs: >
|
||||
Example of a MapQuest map.
|
||||
tags: "mapquest"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<select id="layer-select">
|
||||
<option value="Aerial">Aerial</option>
|
||||
<option value="AerialWithLabels">Aerial with labels</option>
|
||||
<option value="Road" selected>Road</option>
|
||||
</select>
|
||||
@@ -1,56 +0,0 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Group');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.MapQuest');
|
||||
|
||||
|
||||
var layers = [
|
||||
new ol.layer.Tile({
|
||||
style: 'Road',
|
||||
source: new ol.source.MapQuest({layer: 'osm'})
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
style: 'Aerial',
|
||||
visible: false,
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
}),
|
||||
new ol.layer.Group({
|
||||
style: 'AerialWithLabels',
|
||||
visible: false,
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'hyb'})
|
||||
})
|
||||
]
|
||||
})
|
||||
];
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: layers,
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
center: ol.proj.transform(
|
||||
[-73.979378, 40.702222], 'EPSG:4326', 'EPSG:3857'),
|
||||
zoom: 9
|
||||
})
|
||||
});
|
||||
|
||||
var select = document.getElementById('layer-select');
|
||||
|
||||
function onChange() {
|
||||
var style = select.value;
|
||||
var i, ii;
|
||||
for (i = 0, ii = layers.length; i < ii; ++i) {
|
||||
layers[i].set('visible', (layers[i].get('style') == style));
|
||||
}
|
||||
}
|
||||
|
||||
select.addEventListener('change', onChange);
|
||||
|
||||
onChange();
|
||||
@@ -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">
|
||||
|
||||
@@ -9,7 +9,7 @@ goog.require('ol.interaction.Draw');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Circle');
|
||||
goog.require('ol.style.Fill');
|
||||
@@ -20,7 +20,7 @@ goog.require('ol.style.Style');
|
||||
var wgs84Sphere = new ol.Sphere(6378137);
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var source = new ol.source.Vector();
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -6,14 +6,12 @@ goog.require('ol.interaction.Modify');
|
||||
goog.require('ol.interaction.Select');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({
|
||||
layer: 'sat'
|
||||
})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -4,11 +4,11 @@ title: Overlay
|
||||
shortdesc: Demonstrates overlays.
|
||||
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"
|
||||
tags: "overlay, popup, bootstrap, popover"
|
||||
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;">
|
||||
|
||||
@@ -4,11 +4,11 @@ goog.require('ol.View');
|
||||
goog.require('ol.coordinate');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
var layer = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
|
||||
@@ -6,7 +6,7 @@ docs: >
|
||||
<p>
|
||||
Click on the map to get a popup. The popup is composed of a few basic elements: a container, a close button, and a place for the content. To anchor the popup to the map, an <code>ol.Overlay</code> is created with the popup container. A listener is registered for the map's <code>click</code> event to display the popup, and another listener is set as the <code>click</code> handler for the close button to hide the popup.
|
||||
</p>
|
||||
tags: "overlay, popup, mapquest, openaerial"
|
||||
tags: "overlay, popup"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<div id="popup" class="ol-popup">
|
||||
|
||||
@@ -15,7 +15,7 @@ var bins = 10;
|
||||
/**
|
||||
* Calculate the Vegetation Greenness Index (VGI) from an input pixel. This
|
||||
* is a rough estimate assuming that pixel values correspond to reflectance.
|
||||
* @param {ol.raster.Pixel} pixel An array of [R, G, B, A] values.
|
||||
* @param {Array.<number>} pixel An array of [R, G, B, A] values.
|
||||
* @return {number} The VGI value for the given pixel.
|
||||
*/
|
||||
function vgi(pixel) {
|
||||
|
||||
@@ -21,7 +21,7 @@ var style = new ol.style.Style({
|
||||
fill: fill,
|
||||
stroke: stroke
|
||||
})
|
||||
})
|
||||
});
|
||||
vectorContext.setStyle(style);
|
||||
|
||||
vectorContext.drawGeometry(new ol.geom.LineString([[10, 10], [90, 90]]));
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
---
|
||||
layout: example.html
|
||||
title: Reprojection with EPSG.io Search
|
||||
shortdesc: Demonstrates client-side raster reprojection of MapQuest OSM to arbitrary projection
|
||||
shortdesc: Demonstrates client-side raster reprojection of OSM to arbitrary projection
|
||||
docs: >
|
||||
This example shows client-side raster reprojection capabilities from
|
||||
MapQuest OSM (EPSG:3857) to arbitrary projection by searching
|
||||
OSM (EPSG:3857) to arbitrary projection by searching
|
||||
in <a href="http://epsg.io/">EPSG.io</a> database.
|
||||
tags: "reprojection, projection, proj4js, mapquest, epsg.io"
|
||||
tags: "reprojection, projection, proj4js, 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">
|
||||
|
||||
@@ -3,14 +3,14 @@ goog.require('ol.View');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.TileImage');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'osm'})
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
|
||||
@@ -4,8 +4,8 @@ title: Image Reprojection
|
||||
shortdesc: Demonstrates client-side reprojection of single image source.
|
||||
docs: >
|
||||
This example shows client-side reprojection of single image source.
|
||||
tags: "reprojection, projection, proj4js, mapquest, image, imagestatic"
|
||||
tags: "reprojection, projection, proj4js, 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>
|
||||
|
||||
@@ -5,7 +5,7 @@ goog.require('ol.layer.Image');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.ImageStatic');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
proj4.defs('EPSG:27700', '+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 ' +
|
||||
@@ -17,7 +17,7 @@ var imageExtent = [0, 0, 700000, 1300000];
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'osm'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Image({
|
||||
source: new ol.source.ImageStatic({
|
||||
|
||||
@@ -4,16 +4,16 @@ title: Raster Reprojection
|
||||
shortdesc: Demonstrates client-side raster reprojection between various projections.
|
||||
docs: >
|
||||
This example shows client-side raster reprojection between various projections.
|
||||
tags: "reprojection, projection, proj4js, mapquest, wms, wmts, hidpi"
|
||||
tags: "reprojection, projection, proj4js, osm, 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">
|
||||
<div class="col-md-3">
|
||||
<label>Base map:</label>
|
||||
<select id="base-layer">
|
||||
<option value="mapquest">MapQuest (EPSG:3857)</option>
|
||||
<option value="osm">OSM (EPSG:3857)</option>
|
||||
<option value="wms4326">WMS (EPSG:4326)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@ goog.require('ol.extent');
|
||||
goog.require('ol.format.WMTSCapabilities');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.TileImage');
|
||||
goog.require('ol.source.TileWMS');
|
||||
goog.require('ol.source.WMTS');
|
||||
@@ -64,8 +64,8 @@ layers['bng'] = new ol.layer.Tile({
|
||||
})
|
||||
});
|
||||
|
||||
layers['mapquest'] = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'osm'})
|
||||
layers['osm'] = new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
layers['wms4326'] = new ol.layer.Tile({
|
||||
@@ -146,7 +146,7 @@ layers['states'] = new ol.layer.Tile({
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
layers['mapquest'],
|
||||
layers['osm'],
|
||||
layers['bng']
|
||||
],
|
||||
renderer: common.getRendererFromQueryString(),
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -5,11 +5,11 @@ goog.require('ol.format.GeoJSON');
|
||||
goog.require('ol.interaction.Select');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
|
||||
@@ -3,7 +3,7 @@ layout: example.html
|
||||
title: Semi-Transparent Layer
|
||||
shortdesc: Example of a map with a semi-transparent layer.
|
||||
docs: >
|
||||
This example will display a tiled MaxBox layer semi-transparently over a MapQuest background.
|
||||
tags: "transparent, mapquest, tilejson"
|
||||
This example will display a tiled MaxBox layer semi-transparently over an OSM background.
|
||||
tags: "transparent, osm, tilejson"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -2,14 +2,14 @@ goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.TileJSON');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.TileJSON({
|
||||
|
||||
@@ -2,13 +2,13 @@ goog.require('ol.Map');
|
||||
goog.require('ol.View');
|
||||
goog.require('ol.has');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
var map1 = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
renderer: 'dom',
|
||||
|
||||
@@ -7,7 +7,7 @@ goog.require('ol.interaction.Select');
|
||||
goog.require('ol.interaction.Snap');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Circle');
|
||||
goog.require('ol.style.Fill');
|
||||
@@ -15,7 +15,7 @@ goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
|
||||
@@ -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});
|
||||
|
||||
@@ -7,12 +7,12 @@ goog.require('ol.interaction.Select');
|
||||
goog.require('ol.interaction.Translate');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
|
||||
@@ -7,7 +7,7 @@ goog.require('ol.format.GeoJSON');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
|
||||
|
||||
@@ -44,9 +44,7 @@ var vectorLayer = new ol.layer.Vector({
|
||||
});
|
||||
|
||||
var rasterLayer = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({
|
||||
layer: 'osm'
|
||||
})
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -3,7 +3,7 @@ goog.require('ol.View');
|
||||
goog.require('ol.format.GeoJSON');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Circle');
|
||||
goog.require('ol.style.Fill');
|
||||
@@ -172,7 +172,7 @@ var vectorPoints = new ol.layer.Vector({
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'osm'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
vectorPolygons,
|
||||
vectorLines,
|
||||
|
||||
@@ -3,7 +3,7 @@ goog.require('ol.View');
|
||||
goog.require('ol.format.GeoJSON');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.source.MapQuest');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Stroke');
|
||||
@@ -45,7 +45,7 @@ var vectorLayer = new ol.layer.Vector({
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuest({layer: 'sat'})
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
vectorLayer
|
||||
],
|
||||
|
||||
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()));
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user