Compare commits
456 Commits
v3.0.0-gam
...
v3.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5df0b4ec3b | ||
|
|
f7f4c7b686 | ||
|
|
ad8a1f5fb6 | ||
|
|
f452f5545a | ||
|
|
91b567293e | ||
|
|
40fb661864 | ||
|
|
90604fab2a | ||
|
|
5c88d8d84e | ||
|
|
aa40504dd5 | ||
|
|
fc13499f31 | ||
|
|
f724cb65bc | ||
|
|
41ee554969 | ||
|
|
00bf5462ba | ||
|
|
1152b0327b | ||
|
|
7c9c4c6462 | ||
|
|
b099ac8e32 | ||
|
|
f8b9896dd3 | ||
|
|
52c5897ccc | ||
|
|
3338d56792 | ||
|
|
c8c59c3657 | ||
|
|
5eced4a015 | ||
|
|
de4131f207 | ||
|
|
ceb0cc54ce | ||
|
|
a09b5d61ae | ||
|
|
e0c173bd24 | ||
|
|
5120248188 | ||
|
|
1f9ab58623 | ||
|
|
bc2044d48b | ||
|
|
a0c76aa5ee | ||
|
|
80ea1772e2 | ||
|
|
507dd4d534 | ||
|
|
d2eceab25e | ||
|
|
99071b2bef | ||
|
|
4d933f0764 | ||
|
|
663fef3dfd | ||
|
|
e560f529c6 | ||
|
|
4e8abb62f9 | ||
|
|
95ba8c76e3 | ||
|
|
56d4d68459 | ||
|
|
42312c6c73 | ||
|
|
eaca8c1691 | ||
|
|
03d321ce1f | ||
|
|
9cc0841efb | ||
|
|
d3c2e40c84 | ||
|
|
b7ca592334 | ||
|
|
20131bf54a | ||
|
|
5cdd96b131 | ||
|
|
55005cfb21 | ||
|
|
1a4580f6f8 | ||
|
|
25093b371d | ||
|
|
e9457461af | ||
|
|
68b3691cd6 | ||
|
|
4005c986f6 | ||
|
|
df23bd1ff7 | ||
|
|
0d92d7abc1 | ||
|
|
89019ea233 | ||
|
|
dea670f754 | ||
|
|
a046dc1bab | ||
|
|
0e9744d967 | ||
|
|
b611aff8e4 | ||
|
|
9ecd60601c | ||
|
|
1e0b366202 | ||
|
|
8c8fd64ecb | ||
|
|
58e3561ba5 | ||
|
|
26df575bfe | ||
|
|
d3d41c8217 | ||
|
|
b83e639301 | ||
|
|
eef87fdaac | ||
|
|
c02793e42b | ||
|
|
db452759c9 | ||
|
|
43ee0158f8 | ||
|
|
dcd2e425a2 | ||
|
|
069a2d9f20 | ||
|
|
dda700c1e4 | ||
|
|
52e06a8ff7 | ||
|
|
8107a0582a | ||
|
|
6e3354ab7b | ||
|
|
b5a6ffc144 | ||
|
|
5aca42fe64 | ||
|
|
2e89d69743 | ||
|
|
b0e87fac76 | ||
|
|
e4fc8fa119 | ||
|
|
137d74e5a0 | ||
|
|
016daf3c68 | ||
|
|
cc4d793c64 | ||
|
|
522820fc97 | ||
|
|
a1d91042b1 | ||
|
|
c97e19b4ff | ||
|
|
759419593a | ||
|
|
250b588db4 | ||
|
|
c89ea54179 | ||
|
|
3533dba7ac | ||
|
|
f4c8f176ec | ||
|
|
cd4063b0d8 | ||
|
|
ddb4d9ae83 | ||
|
|
61d759acc7 | ||
|
|
79efcc78a5 | ||
|
|
38b2a46b59 | ||
|
|
38b58e9860 | ||
|
|
c899324eb5 | ||
|
|
73df93969a | ||
|
|
def1af4492 | ||
|
|
284031bd1e | ||
|
|
0010cb787f | ||
|
|
e17e909ffa | ||
|
|
a8999f601b | ||
|
|
ecaedff890 | ||
|
|
787688ef33 | ||
|
|
07b5b448dc | ||
|
|
9a4b45921d | ||
|
|
fa2206e7a4 | ||
|
|
5ce4e748f5 | ||
|
|
1b86a4967f | ||
|
|
32dce80fb6 | ||
|
|
886941b48e | ||
|
|
546b42df07 | ||
|
|
678d4ef01c | ||
|
|
f369f9a076 | ||
|
|
18a1c1c0d7 | ||
|
|
c2e93adae0 | ||
|
|
db546a60ea | ||
|
|
83b086db4f | ||
|
|
22fd6872f4 | ||
|
|
89e086e586 | ||
|
|
7a2bad543f | ||
|
|
8dab12f0d4 | ||
|
|
19843d301c | ||
|
|
90fc5b2a4d | ||
|
|
f11e5de156 | ||
|
|
947b049799 | ||
|
|
f17c33f631 | ||
|
|
c7ba6f4c6e | ||
|
|
1fd0bada51 | ||
|
|
403e87f697 | ||
|
|
bbeb4442a5 | ||
|
|
3ced2d8266 | ||
|
|
1085d4f152 | ||
|
|
ee745f8c9e | ||
|
|
e50ba2172f | ||
|
|
15487d1ce9 | ||
|
|
efc32b14df | ||
|
|
54ff843075 | ||
|
|
daf7715bc6 | ||
|
|
495d807aba | ||
|
|
b5dcfeac42 | ||
|
|
895694e8e8 | ||
|
|
96d91c684e | ||
|
|
3ee72c35a6 | ||
|
|
328f049d04 | ||
|
|
6724e1520f | ||
|
|
6bbb699771 | ||
|
|
580943e700 | ||
|
|
67c44b4e9e | ||
|
|
a7a255c235 | ||
|
|
3049b56db1 | ||
|
|
72aa61885a | ||
|
|
0fc4d0de98 | ||
|
|
50564f8d67 | ||
|
|
abe6fb7611 | ||
|
|
02dc7bcc9e | ||
|
|
68fc7e5251 | ||
|
|
cea9bd6a4a | ||
|
|
4cc9187414 | ||
|
|
e9c2e72000 | ||
|
|
16359b8af0 | ||
|
|
823dc41cdf | ||
|
|
69b99cb9ed | ||
|
|
7596133db1 | ||
|
|
f7088fc500 | ||
|
|
a5dd13c5f1 | ||
|
|
d71ca642d2 | ||
|
|
807ddccecf | ||
|
|
3e38b1d88a | ||
|
|
f3930d751e | ||
|
|
7383a1df06 | ||
|
|
9c4689206b | ||
|
|
525456e6cd | ||
|
|
9975d842f1 | ||
|
|
fc303cdec7 | ||
|
|
a9195771ca | ||
|
|
58a77478a3 | ||
|
|
a231086a8b | ||
|
|
fb1d7e0c50 | ||
|
|
15a516fd62 | ||
|
|
43bd2b740b | ||
|
|
b5a3e90bb4 | ||
|
|
2e29ae8bc5 | ||
|
|
89686b783f | ||
|
|
fbab52b09f | ||
|
|
939e167c0b | ||
|
|
d1bb2724a5 | ||
|
|
5a9d75a04f | ||
|
|
55db958290 | ||
|
|
a54a485faf | ||
|
|
4764cbc908 | ||
|
|
95d7598227 | ||
|
|
d17993794d | ||
|
|
47c1f1908e | ||
|
|
838415218f | ||
|
|
fb1c764a38 | ||
|
|
72bcb2db80 | ||
|
|
feba61af25 | ||
|
|
e9eb22bc47 | ||
|
|
b865958efb | ||
|
|
2c5464aa76 | ||
|
|
6ecd31fe62 | ||
|
|
ce7fda71af | ||
|
|
180c6aa7a9 | ||
|
|
516be9041e | ||
|
|
5ccb0fae07 | ||
|
|
9b0ce7b80c | ||
|
|
300146e15b | ||
|
|
b858421220 | ||
|
|
dcf05af210 | ||
|
|
44d9955dae | ||
|
|
fa512f1ed0 | ||
|
|
bc680ef101 | ||
|
|
dd2d896983 | ||
|
|
45d4f32078 | ||
|
|
81b66a7906 | ||
|
|
d906efa24c | ||
|
|
b034e114d6 | ||
|
|
42e8fb544a | ||
|
|
7f086e138a | ||
|
|
817862ef59 | ||
|
|
ac63a453c2 | ||
|
|
27ae50e673 | ||
|
|
7c14399133 | ||
|
|
113888120f | ||
|
|
c7f45819ae | ||
|
|
f498080d78 | ||
|
|
30bfa1bf19 | ||
|
|
7f5ed26d8d | ||
|
|
6bd0d7efae | ||
|
|
1ede97ae18 | ||
|
|
ee487ca308 | ||
|
|
239a90cd55 | ||
|
|
24651ba21e | ||
|
|
26ec1d5924 | ||
|
|
967bbebaa0 | ||
|
|
c3e0b5f282 | ||
|
|
d8afc96aa3 | ||
|
|
975e81a041 | ||
|
|
39431dff9e | ||
|
|
ecbf3bc692 | ||
|
|
602deafc86 | ||
|
|
7c01d3a57c | ||
|
|
365caa6f19 | ||
|
|
879ace1c9a | ||
|
|
27ad6c33bc | ||
|
|
2c9e822808 | ||
|
|
96269c0b24 | ||
|
|
1439ceafa1 | ||
|
|
102f214afe | ||
|
|
0f4e56978b | ||
|
|
35e4134047 | ||
|
|
59826ce490 | ||
|
|
db490e11b5 | ||
|
|
2b3e0bf699 | ||
|
|
ec81c05cce | ||
|
|
b30ed6b934 | ||
|
|
e97f79b4ab | ||
|
|
33b68123ac | ||
|
|
63ad916ca7 | ||
|
|
dd5e7693da | ||
|
|
711c4bbc8c | ||
|
|
7a5a5d75e7 | ||
|
|
8f7f814d32 | ||
|
|
d5e1c27fc1 | ||
|
|
e53213d730 | ||
|
|
344452bd22 | ||
|
|
e7864be2be | ||
|
|
539e4a23b9 | ||
|
|
b92a0338c9 | ||
|
|
a7e32469fa | ||
|
|
d7c2e27d50 | ||
|
|
e39e9c2230 | ||
|
|
139ea4c7d2 | ||
|
|
d7027a6a64 | ||
|
|
1d5c746974 | ||
|
|
0ac90e62b9 | ||
|
|
c83ae8a284 | ||
|
|
e7083aef1d | ||
|
|
c7bf94e69b | ||
|
|
9072fb1f2f | ||
|
|
b484801e4f | ||
|
|
8076401c0f | ||
|
|
c81dfdc69b | ||
|
|
0779b4ef79 | ||
|
|
ba035abb1f | ||
|
|
1fc620b7bb | ||
|
|
e35531e7c6 | ||
|
|
0d20b337a0 | ||
|
|
7b32b8e561 | ||
|
|
7097be3d00 | ||
|
|
db6c87a9bd | ||
|
|
a16a678ca7 | ||
|
|
14fc16b91d | ||
|
|
8c3a72497c | ||
|
|
abc01b5f10 | ||
|
|
5d31d2044a | ||
|
|
4b24eb6eb2 | ||
|
|
ff209d8759 | ||
|
|
1205d0fe1e | ||
|
|
3b817d8db3 | ||
|
|
fb242b5316 | ||
|
|
2b8426fb47 | ||
|
|
4fb905170a | ||
|
|
9cf653f0f2 | ||
|
|
f2638ddfbf | ||
|
|
c16622be9e | ||
|
|
5247903a4a | ||
|
|
45f24ee097 | ||
|
|
8bc5a928a7 | ||
|
|
e69f065a23 | ||
|
|
ed2f2befdf | ||
|
|
6ca3e83492 | ||
|
|
b3b5572763 | ||
|
|
294afe16fe | ||
|
|
ddd16b6985 | ||
|
|
3ff180b224 | ||
|
|
48ed2e861e | ||
|
|
d9976ca207 | ||
|
|
f8560df793 | ||
|
|
9bc70f3459 | ||
|
|
286db65d34 | ||
|
|
e294ca1868 | ||
|
|
8a56f455f1 | ||
|
|
63abbe2597 | ||
|
|
9780e9f0c0 | ||
|
|
a35f361683 | ||
|
|
9e814f119f | ||
|
|
e8eebd8846 | ||
|
|
9db936fe87 | ||
|
|
bdfceaad06 | ||
|
|
bfb6c2e3b8 | ||
|
|
b05f880f7c | ||
|
|
31dbbc6a8c | ||
|
|
e446738491 | ||
|
|
3090a0af37 | ||
|
|
281fd3c6a9 | ||
|
|
8959aaafd5 | ||
|
|
253d64d6f0 | ||
|
|
9d6fced8b4 | ||
|
|
9d9f29e1a2 | ||
|
|
b60609d93c | ||
|
|
54406f5b2f | ||
|
|
b8dca21286 | ||
|
|
134a4e220d | ||
|
|
190db934ee | ||
|
|
cf85079d22 | ||
|
|
66da8fc393 | ||
|
|
9e37aa796a | ||
|
|
18b3c3eee7 | ||
|
|
5e4cfe875b | ||
|
|
e06fe37607 | ||
|
|
0d6cc22bf0 | ||
|
|
d3b5a14a9b | ||
|
|
410b274b6a | ||
|
|
0a963d4615 | ||
|
|
08039e9894 | ||
|
|
2230349b52 | ||
|
|
52ee406938 | ||
|
|
a1e33eabc5 | ||
|
|
1864e03873 | ||
|
|
063532d509 | ||
|
|
ae98ee8b4a | ||
|
|
af05b3d031 | ||
|
|
d3683fcab9 | ||
|
|
1bd522d96f | ||
|
|
bf3770a9da | ||
|
|
9575396aad | ||
|
|
53e12e7e47 | ||
|
|
f0242a76c4 | ||
|
|
58f857bbb6 | ||
|
|
33a627b7ce | ||
|
|
a40170feb7 | ||
|
|
b2059b85d2 | ||
|
|
26dae36a0b | ||
|
|
46b74cedf8 | ||
|
|
94e2911697 | ||
|
|
9517c0d433 | ||
|
|
66bde546c0 | ||
|
|
1e79acac20 | ||
|
|
0d86e4a237 | ||
|
|
4cb60feb40 | ||
|
|
0b622ba5e7 | ||
|
|
8e6711835c | ||
|
|
b6fa8908e5 | ||
|
|
28c3993088 | ||
|
|
652fcede22 | ||
|
|
41e5aa07bd | ||
|
|
b88cb727c9 | ||
|
|
c86569684e | ||
|
|
7de98d8794 | ||
|
|
acf623f853 | ||
|
|
65346d716d | ||
|
|
c4fdbacc12 | ||
|
|
4825cba48a | ||
|
|
da0988f5f4 | ||
|
|
b8a834b437 | ||
|
|
46bba1fa3c | ||
|
|
ee5f85df9f | ||
|
|
68d572e062 | ||
|
|
464eb3ccf5 | ||
|
|
4c4a335448 | ||
|
|
8aa799850d | ||
|
|
b0d95b326a | ||
|
|
3245b8c6af | ||
|
|
0ea55b7f27 | ||
|
|
225791c969 | ||
|
|
d13261a21a | ||
|
|
534a178a49 | ||
|
|
819fd83e06 | ||
|
|
8d9dbcbb2a | ||
|
|
e69913900e | ||
|
|
86268bcf58 | ||
|
|
80c6e019a7 | ||
|
|
7a86bf58bf | ||
|
|
051da752f3 | ||
|
|
9b476e4ce3 | ||
|
|
0277026624 | ||
|
|
1048d59331 | ||
|
|
93218e5db4 | ||
|
|
f99e9e40b7 | ||
|
|
9e33ccad74 | ||
|
|
3fce080d5a | ||
|
|
53be13a658 | ||
|
|
7b7070d723 | ||
|
|
27d5a3cc4c | ||
|
|
40e16557a9 | ||
|
|
4fa9083854 | ||
|
|
06df648733 | ||
|
|
077bcdd778 | ||
|
|
77674c6728 | ||
|
|
ec8d3a45e4 | ||
|
|
707648b828 | ||
|
|
8079590b49 | ||
|
|
495ad3de93 | ||
|
|
2e37a34459 | ||
|
|
e729b3d423 | ||
|
|
cff8d4c668 | ||
|
|
76c883ea89 | ||
|
|
4d0fbaedc1 | ||
|
|
c3bddffecb | ||
|
|
2814abc59d | ||
|
|
49299dfe44 | ||
|
|
05e9a47fd1 | ||
|
|
9102647751 | ||
|
|
338f86f774 | ||
|
|
cb03648704 | ||
|
|
02ede1eafa | ||
|
|
312d5a87b8 | ||
|
|
2f9918f774 | ||
|
|
0309a620ea | ||
|
|
eb8dc15d8d |
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
[](http://travis-ci.org/#!/openlayers/ol3)
|
[](http://travis-ci.org/#!/openlayers/ol3)
|
||||||
|
|
||||||
Welcome to [OpenLayers 3](http://ol3js.org/)!
|
Welcome to [OpenLayers 3](http://openlayers.org/)!
|
||||||
|
|
||||||
Check out the [hosted examples](http://ol3js.org/en/master/examples/), the [workshop](http://ol3js.org/ol3-workshop/) or poke around the evolving [API docs](http://ol3js.org/en/master/apidoc/).
|
Check out the [hosted examples](http://openlayers.org/en/master/examples/), the [workshop](http://openlayers.org/ol3-workshop/) or poke around the evolving [API docs](http://openlayers.org/en/master/apidoc/).
|
||||||
|
|
||||||
Please don't ask questions in the github issue tracker but use [the mailing list](https://groups.google.com/forum/#!forum/ol3-dev) instead.
|
Please don't ask questions in the github issue tracker but use [the mailing list](https://groups.google.com/forum/#!forum/ol3-dev) instead.
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
* Loader to add ol.css, ol.js and the example-specific js file to the
|
|
||||||
* documents.
|
|
||||||
*
|
|
||||||
* This loader is used for the hosted examples. It is used in place of the
|
* This loader is used for the hosted examples. It is used in place of the
|
||||||
* development loader (examples/loader.js).
|
* development loader (examples/loader.js).
|
||||||
*
|
*
|
||||||
* The ol.js, ol-debug.js, and ol-deps.js scripts are built by OL3's
|
* The loader loads ol.js and the example's script in "production" mode; it
|
||||||
* build.py script. They are located in the ../build/ directory, relative to
|
* loads Closure Library's base.js, ol-deps.js, the example's "goog.require"
|
||||||
* this script.
|
* script, and the example's script in "development" mode.
|
||||||
|
*
|
||||||
|
* The ol.js and ol-deps.js scripts are built by OL3's build.py script.
|
||||||
|
* They are located in the ../build/ directory, relative to this script.
|
||||||
*
|
*
|
||||||
* The script must be named loader.js.
|
* The script must be named loader.js.
|
||||||
*
|
*
|
||||||
|
|||||||
36
build.py
36
build.py
@@ -101,6 +101,10 @@ SPEC = [path
|
|||||||
for path in ifind('test/spec')
|
for path in ifind('test/spec')
|
||||||
if path.endswith('.js')]
|
if path.endswith('.js')]
|
||||||
|
|
||||||
|
TASKS = [path
|
||||||
|
for path in ifind('tasks')
|
||||||
|
if path.endswith('.js')]
|
||||||
|
|
||||||
SRC = [path
|
SRC = [path
|
||||||
for path in ifind('src/ol')
|
for path in ifind('src/ol')
|
||||||
if path.endswith('.js')
|
if path.endswith('.js')
|
||||||
@@ -123,14 +127,14 @@ def report_sizes(t):
|
|||||||
virtual('default', 'build')
|
virtual('default', 'build')
|
||||||
|
|
||||||
|
|
||||||
virtual('ci', 'lint', 'jshint', 'build', 'test',
|
virtual('ci', 'lint', 'build', 'test',
|
||||||
'build/examples/all.combined.js', 'check-examples', 'apidoc')
|
'build/examples/all.combined.js', 'check-examples', 'apidoc')
|
||||||
|
|
||||||
|
|
||||||
virtual('build', 'build/ol.css', 'build/ol.js', 'build/ol-debug.js')
|
virtual('build', 'build/ol.css', 'build/ol.js', 'build/ol-debug.js')
|
||||||
|
|
||||||
|
|
||||||
virtual('check', 'lint', 'jshint', 'test')
|
virtual('check', 'lint', 'build/ol.js', 'test')
|
||||||
|
|
||||||
|
|
||||||
virtual('todo', 'fixme')
|
virtual('todo', 'fixme')
|
||||||
@@ -141,15 +145,15 @@ def build_ol_css(t):
|
|||||||
t.output('%(CLEANCSS)s', 'css/ol.css')
|
t.output('%(CLEANCSS)s', 'css/ol.css')
|
||||||
|
|
||||||
|
|
||||||
@target('build/ol.js', SRC, SHADER_SRC, 'buildcfg/ol.json')
|
@target('build/ol.js', SRC, SHADER_SRC, 'config/ol.json')
|
||||||
def build_ol_new_js(t):
|
def build_ol_new_js(t):
|
||||||
t.run('node', 'tasks/build.js', 'buildcfg/ol.json', 'build/ol.js')
|
t.run('node', 'tasks/build.js', 'config/ol.json', 'build/ol.js')
|
||||||
report_sizes(t)
|
report_sizes(t)
|
||||||
|
|
||||||
|
|
||||||
@target('build/ol-debug.js', SRC, SHADER_SRC, 'buildcfg/ol-debug.json')
|
@target('build/ol-debug.js', SRC, SHADER_SRC, 'config/ol-debug.json')
|
||||||
def build_ol_debug_js(t):
|
def build_ol_debug_js(t):
|
||||||
t.run('node', 'tasks/build.js', 'buildcfg/ol-debug.json', 'build/ol-debug.js')
|
t.run('node', 'tasks/build.js', 'config/ol-debug.json', 'build/ol-debug.js')
|
||||||
report_sizes(t)
|
report_sizes(t)
|
||||||
|
|
||||||
|
|
||||||
@@ -196,9 +200,9 @@ def examples_examples_list_js(t):
|
|||||||
|
|
||||||
|
|
||||||
@target('build/examples/all.combined.js', 'build/examples/all.js',
|
@target('build/examples/all.combined.js', 'build/examples/all.js',
|
||||||
SRC, SHADER_SRC, 'buildcfg/examples-all.json')
|
SRC, SHADER_SRC, 'config/examples-all.json')
|
||||||
def build_examples_all_combined_js(t):
|
def build_examples_all_combined_js(t):
|
||||||
t.run('node', 'tasks/build.js', 'buildcfg/examples-all.json',
|
t.run('node', 'tasks/build.js', 'config/examples-all.json',
|
||||||
'build/examples/all.combined.js')
|
'build/examples/all.combined.js')
|
||||||
report_sizes(t)
|
report_sizes(t)
|
||||||
|
|
||||||
@@ -214,7 +218,7 @@ def examples_star_json(name, match):
|
|||||||
# It would make more sense to use olx.js as an input file here. We use
|
# It would make more sense to use olx.js as an input file here. We use
|
||||||
# it as an externs file instead to prevent "Cannot read property '*' of
|
# it as an externs file instead to prevent "Cannot read property '*' of
|
||||||
# undefined" error when running examples in "raw" or "whitespace" mode.
|
# undefined" error when running examples in "raw" or "whitespace" mode.
|
||||||
# Note that we use the proper way in buildcfg/examples-all.json, which
|
# Note that we use the proper way in config/examples-all.json, which
|
||||||
# is only used to check the examples code using the compiler.
|
# is only used to check the examples code using the compiler.
|
||||||
content = json.dumps({
|
content = json.dumps({
|
||||||
"exports": [],
|
"exports": [],
|
||||||
@@ -236,6 +240,7 @@ def examples_star_json(name, match):
|
|||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||||
|
"goog.json.USE_NATIVE_JSON=true",
|
||||||
"goog.DEBUG=false"
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
@@ -254,6 +259,7 @@ def examples_star_json(name, match):
|
|||||||
"duplicate",
|
"duplicate",
|
||||||
"duplicateMessage",
|
"duplicateMessage",
|
||||||
"es3",
|
"es3",
|
||||||
|
"es5Strict",
|
||||||
"externsValidation",
|
"externsValidation",
|
||||||
"fileoverviewTags",
|
"fileoverviewTags",
|
||||||
"globalThis",
|
"globalThis",
|
||||||
@@ -276,9 +282,6 @@ def examples_star_json(name, match):
|
|||||||
"extra_annotation_name": [
|
"extra_annotation_name": [
|
||||||
"api", "observable"
|
"api", "observable"
|
||||||
],
|
],
|
||||||
"jscomp_off": [
|
|
||||||
"es5Strict"
|
|
||||||
],
|
|
||||||
"compilation_level": "ADVANCED",
|
"compilation_level": "ADVANCED",
|
||||||
"output_wrapper": "// OpenLayers 3. See http://ol3.js.org/\n(function(){%output%})();",
|
"output_wrapper": "// OpenLayers 3. See http://ol3.js.org/\n(function(){%output%})();",
|
||||||
"use_types_for_optimization": True,
|
"use_types_for_optimization": True,
|
||||||
@@ -308,7 +311,7 @@ def serve(t):
|
|||||||
|
|
||||||
|
|
||||||
virtual('lint', 'build/lint-timestamp', 'build/check-requires-timestamp',
|
virtual('lint', 'build/lint-timestamp', 'build/check-requires-timestamp',
|
||||||
'build/check-whitespace-timestamp')
|
'build/check-whitespace-timestamp', 'jshint')
|
||||||
|
|
||||||
|
|
||||||
@target('build/lint-timestamp', SRC, EXAMPLES_SRC, SPEC, precious=True)
|
@target('build/lint-timestamp', SRC, EXAMPLES_SRC, SPEC, precious=True)
|
||||||
@@ -323,7 +326,7 @@ def build_lint_src_timestamp(t):
|
|||||||
|
|
||||||
virtual('jshint', 'build/jshint-timestamp')
|
virtual('jshint', 'build/jshint-timestamp')
|
||||||
|
|
||||||
@target('build/jshint-timestamp', SRC, EXAMPLES_SRC, SPEC,
|
@target('build/jshint-timestamp', SRC, EXAMPLES_SRC, SPEC, TASKS,
|
||||||
precious=True)
|
precious=True)
|
||||||
def build_jshint_timestamp(t):
|
def build_jshint_timestamp(t):
|
||||||
t.run(variables.JSHINT, '--verbose', t.newer(t.dependencies))
|
t.run(variables.JSHINT, '--verbose', t.newer(t.dependencies))
|
||||||
@@ -530,9 +533,10 @@ virtual('apidoc', 'build/jsdoc-%(BRANCH)s-timestamp' % vars(variables))
|
|||||||
|
|
||||||
|
|
||||||
@target('build/jsdoc-%(BRANCH)s-timestamp' % vars(variables), 'host-resources',
|
@target('build/jsdoc-%(BRANCH)s-timestamp' % vars(variables), 'host-resources',
|
||||||
SRC, SHADER_SRC, ifind('apidoc/template'))
|
SRC, SHADER_SRC, ifind('config/jsdoc/api/template'))
|
||||||
def jsdoc_BRANCH_timestamp(t):
|
def jsdoc_BRANCH_timestamp(t):
|
||||||
t.run('%(JSDOC)s', 'apidoc/index.md', '-c', 'apidoc/conf.json',
|
t.run('%(JSDOC)s', 'config/jsdoc/api/index.md',
|
||||||
|
'-c', 'config/jsdoc/api/conf.json',
|
||||||
'-d', 'build/hosted/%(BRANCH)s/apidoc')
|
'-d', 'build/hosted/%(BRANCH)s/apidoc')
|
||||||
t.touch()
|
t.touch()
|
||||||
|
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
/**
|
|
||||||
* @fileoverview Generates JSON output based on exportable symbols (those with
|
|
||||||
* an api tag) and boolean defines (with a define tag and a default value).
|
|
||||||
*/
|
|
||||||
var assert = require('assert');
|
|
||||||
var fs = require('fs');
|
|
||||||
var path = require('path');
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Publish hook for the JSDoc template. Writes to JSON stdout.
|
|
||||||
* @param {function} data The root of the Taffy DB containing doclet records.
|
|
||||||
* @param {Object} opts Options.
|
|
||||||
*/
|
|
||||||
exports.publish = function(data, opts) {
|
|
||||||
var cwd = process.cwd();
|
|
||||||
|
|
||||||
// get all doclets with the "api" property or define (excluding enums,
|
|
||||||
// typedefs and events)
|
|
||||||
var docs = data(
|
|
||||||
[{define: {isObject: true}}, {api: {isString: true}}],
|
|
||||||
{isEnum: {'!is': true}},
|
|
||||||
{kind: {'!is': 'typedef'}},
|
|
||||||
{kind: {'!is': 'event'}}).get();
|
|
||||||
|
|
||||||
// get symbols data, filter out those that are members of private classes
|
|
||||||
var symbols = [];
|
|
||||||
var defines = [];
|
|
||||||
docs.filter(function(doc) {
|
|
||||||
var include = true;
|
|
||||||
var constructor = doc.memberof;
|
|
||||||
if (constructor && constructor.substr(-1) === '_') {
|
|
||||||
assert.strictEqual(doc.inherited, true,
|
|
||||||
'Unexpected export on private class: ' + doc.longname);
|
|
||||||
include = false;
|
|
||||||
}
|
|
||||||
return include;
|
|
||||||
}).forEach(function(doc) {
|
|
||||||
if (doc.define) {
|
|
||||||
defines.push({
|
|
||||||
name: doc.longname,
|
|
||||||
description: doc.description,
|
|
||||||
path: path.join(doc.meta.path, doc.meta.filename),
|
|
||||||
default: doc.define.default
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
symbols.push({
|
|
||||||
name: doc.longname,
|
|
||||||
kind: doc.kind,
|
|
||||||
description: doc.classdesc || doc.description,
|
|
||||||
path: path.join(doc.meta.path, doc.meta.filename)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
process.stdout.write(
|
|
||||||
JSON.stringify({symbols: symbols, defines: defines}, null, 2));
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# Build configs
|
|
||||||
|
|
||||||
This directory includes configuration files (json) for the build scripts in tasks/.
|
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"library_url": "https://github.com/google/closure-library/archive/ab89cf45c216615d73a2f5dea720afb9d3415d1f.zip"
|
"library_url": "https://github.com/google/closure-library/archive/946a7d39d4ffe08676c755b21d901e71d9904a3b.zip"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||||
|
"goog.json.USE_NATIVE_JSON=true",
|
||||||
"goog.DEBUG=false"
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
@@ -33,6 +34,7 @@
|
|||||||
"deprecated",
|
"deprecated",
|
||||||
"duplicateMessage",
|
"duplicateMessage",
|
||||||
"es3",
|
"es3",
|
||||||
|
"es5Strict",
|
||||||
"externsValidation",
|
"externsValidation",
|
||||||
"fileoverviewTags",
|
"fileoverviewTags",
|
||||||
"globalThis",
|
"globalThis",
|
||||||
@@ -58,9 +60,6 @@
|
|||||||
"extra_annotation_name": [
|
"extra_annotation_name": [
|
||||||
"api", "observable"
|
"api", "observable"
|
||||||
],
|
],
|
||||||
"jscomp_off": [
|
|
||||||
"es5Strict"
|
|
||||||
],
|
|
||||||
"compilation_level": "ADVANCED",
|
"compilation_level": "ADVANCED",
|
||||||
"output_wrapper": "// OpenLayers 3. See http://ol3.js.org/\n(function(){%output%})();",
|
"output_wrapper": "// OpenLayers 3. See http://ol3.js.org/\n(function(){%output%})();",
|
||||||
"use_types_for_optimization": true,
|
"use_types_for_optimization": true,
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"opts": {
|
"opts": {
|
||||||
"recurse": true,
|
"recurse": true,
|
||||||
"template": "apidoc/template"
|
"template": "config/jsdoc/api/template"
|
||||||
},
|
},
|
||||||
"tags": {
|
"tags": {
|
||||||
"allowUnknownTags": true
|
"allowUnknownTags": true
|
||||||
@@ -17,12 +17,12 @@
|
|||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"node_modules/jsdoc/plugins/markdown",
|
"node_modules/jsdoc/plugins/markdown",
|
||||||
"apidoc/plugins/inheritdoc",
|
"config/jsdoc/api/plugins/inheritdoc",
|
||||||
"apidoc/plugins/interface",
|
"config/jsdoc/api/plugins/interface",
|
||||||
"apidoc/plugins/typedefs",
|
"config/jsdoc/api/plugins/typedefs",
|
||||||
"apidoc/plugins/events",
|
"config/jsdoc/api/plugins/events",
|
||||||
"apidoc/plugins/observable",
|
"config/jsdoc/api/plugins/observable",
|
||||||
"apidoc/plugins/api"
|
"config/jsdoc/api/plugins/api"
|
||||||
],
|
],
|
||||||
"markdown": {
|
"markdown": {
|
||||||
"parser": "gfm"
|
"parser": "gfm"
|
||||||
@@ -34,6 +34,9 @@ exports.handlers = {
|
|||||||
} else if (doclet.name.indexOf('set') === 0) {
|
} else if (doclet.name.indexOf('set') === 0) {
|
||||||
observable.readonly = false;
|
observable.readonly = false;
|
||||||
}
|
}
|
||||||
|
if (doclet.stability) {
|
||||||
|
observable.stability = doclet.stability;
|
||||||
|
}
|
||||||
if (!cls.observables) {
|
if (!cls.observables) {
|
||||||
cls.observables = [];
|
cls.observables = [];
|
||||||
}
|
}
|
||||||
@@ -28,6 +28,10 @@ exports.handlers = {
|
|||||||
newDoclet: function(e) {
|
newDoclet: function(e) {
|
||||||
var doclet = e.doclet;
|
var doclet = e.doclet;
|
||||||
if (doclet.meta.filename == 'olx.js') {
|
if (doclet.meta.filename == 'olx.js') {
|
||||||
|
// do nothing if not marked @api
|
||||||
|
if (!doclet.stability) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (doclet.kind == 'typedef') {
|
if (doclet.kind == 'typedef') {
|
||||||
lastOlxTypedef = doclet;
|
lastOlxTypedef = doclet;
|
||||||
olxTypes[doclet.longname] = [];
|
olxTypes[doclet.longname] = [];
|
||||||
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
@@ -52,4 +52,13 @@ $(function () {
|
|||||||
|
|
||||||
$(window).on('resize', _onResize);
|
$(window).on('resize', _onResize);
|
||||||
_onResize();
|
_onResize();
|
||||||
});
|
|
||||||
|
// show/hide unstable items
|
||||||
|
var unstable = $('.unstable');
|
||||||
|
var stabilityToggle = $('#stability-toggle');
|
||||||
|
stabilityToggle.change(function() {
|
||||||
|
unstable.toggle(!this.checked);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
unstable.toggle(!stabilityToggle[0].checked);
|
||||||
|
});
|
||||||
@@ -183,6 +183,10 @@ li {
|
|||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
padding: 2px 4px;
|
padding: 2px 4px;
|
||||||
}
|
}
|
||||||
|
td.description span.stability {
|
||||||
|
float: left;
|
||||||
|
margin-right: 0.5em;
|
||||||
|
}
|
||||||
span.type-signature.static {
|
span.type-signature.static {
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
}
|
}
|
||||||
@@ -282,7 +286,6 @@ span.type-signature.static {
|
|||||||
width: 110px;
|
width: 110px;
|
||||||
}
|
}
|
||||||
.main table .type {
|
.main table .type {
|
||||||
width: 60px;
|
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
@@ -369,3 +372,12 @@ footer {
|
|||||||
.main .readme table ul li {
|
.main .readme table ul li {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
.unstable {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#stability {
|
||||||
|
color: white;
|
||||||
|
position: absolute;
|
||||||
|
top: 1em;
|
||||||
|
right: 8em;
|
||||||
|
}
|
||||||
@@ -18,8 +18,11 @@
|
|||||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
<div class="navbar-inner">
|
<div class="navbar-inner">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="brand" href="/"><img src="../resources/logo.png"> OpenLayers 3</a>
|
<a class="brand" href="/"><img src="../resources/logo.png" width="40"> OpenLayers 3</a>
|
||||||
<a class="brand" href="index.html">API Documentation</a>
|
<a class="brand" href="index.html">API Documentation</a>
|
||||||
|
<label id="stability">
|
||||||
|
<input type="checkbox" id="stability-toggle" checked> Stable Only
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -9,7 +9,7 @@ if (data.type && data.type.names) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<dt>
|
<dt class="<?js= (data.stability && data.stability !== 'stable') ? 'unstable' : '' ?>">
|
||||||
<div class="nameContainer">
|
<div class="nameContainer">
|
||||||
<h4 class="name" id="<?js= id ?>">
|
<h4 class="name" id="<?js= id ?>">
|
||||||
<?js= data.attribs + (data.scope === 'static' ? longname : name) + typeSignature ?>
|
<?js= data.attribs + (data.scope === 'static' ? longname : name) + typeSignature ?>
|
||||||
@@ -20,7 +20,7 @@ if (data.type && data.type.names) {
|
|||||||
<p class="summary"><?js= summary ?></p>
|
<p class="summary"><?js= summary ?></p>
|
||||||
<?js } ?>
|
<?js } ?>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd class="<?js= (data.stability && data.stability !== 'stable') ? 'unstable' : '' ?>">
|
||||||
<?js if (data.description) { ?>
|
<?js if (data.description) { ?>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<?js= data.description ?>
|
<?js= data.description ?>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
var data = obj;
|
var data = obj;
|
||||||
var self = this;
|
var self = this;
|
||||||
?>
|
?>
|
||||||
<dt>
|
<dt class="<?js= (data.stability && data.stability !== 'stable') ? 'unstable' : '' ?>">
|
||||||
<div class="nameContainer<?js if (data.inherited) { ?> inherited<?js } ?>">
|
<div class="nameContainer<?js if (data.inherited) { ?> inherited<?js } ?>">
|
||||||
<?js if (data.stability || kind !== 'class') { ?>
|
<?js if (data.stability || kind !== 'class') { ?>
|
||||||
<h4 class="name" id="<?js= id ?>">
|
<h4 class="name" id="<?js= id ?>">
|
||||||
@@ -23,7 +23,7 @@ var self = this;
|
|||||||
<p class="summary"><?js= summary ?></p>
|
<p class="summary"><?js= summary ?></p>
|
||||||
<?js } ?>
|
<?js } ?>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd class="<?js= (data.stability && data.stability !== 'stable') ? 'unstable' : '' ?>">
|
||||||
|
|
||||||
<?js if (data.description) { ?>
|
<?js if (data.description) { ?>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
@@ -67,7 +67,7 @@ var self = this;
|
|||||||
description = eventDoclet.description.replace(/<[^>]*>/g, '');
|
description = eventDoclet.description.replace(/<[^>]*>/g, '');
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<li>
|
<li class="<?js= (eventDoclet || data).stability !== 'stable' ? 'unstable' : '' ?>">
|
||||||
<code><?js= self.linkto(f, type) ?></code>
|
<code><?js= self.linkto(f, type) ?></code>
|
||||||
<?js if (eventClassName) {
|
<?js if (eventClassName) {
|
||||||
var eventClass = self.find({longname: eventClassName})[0];
|
var eventClass = self.find({longname: eventClassName})[0];
|
||||||
@@ -39,7 +39,9 @@ var self = this;
|
|||||||
<?js
|
<?js
|
||||||
item.typedefs.forEach(function (v) {
|
item.typedefs.forEach(function (v) {
|
||||||
?>
|
?>
|
||||||
<li data-name="<?js= v.longname ?>"><?js= self.linkto(v.longname, v.name) ?></li>
|
<li data-name="<?js= v.longname ?>" class="<?js= v.stability !== 'stable' ? 'unstable' : ''?>">
|
||||||
|
<?js= self.linkto(v.longname, v.name) ?>
|
||||||
|
</li>
|
||||||
<?js
|
<?js
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -54,36 +56,9 @@ var self = this;
|
|||||||
|
|
||||||
item.methods.forEach(function (v) {
|
item.methods.forEach(function (v) {
|
||||||
?>
|
?>
|
||||||
<li data-name="<?js= v.longname ?>"><?js= self.linkto(v.longname, v.name) ?></li>
|
<li data-name="<?js= v.longname ?>" class="<?js= v.stability !== 'stable' ? 'unstable' : ''?>">
|
||||||
<?js
|
<?js= self.linkto(v.longname, v.name) ?>
|
||||||
});
|
</li>
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
<ul class="fires itemMembers">
|
|
||||||
<?js
|
|
||||||
if (item.fires && item.fires.length) {
|
|
||||||
?>
|
|
||||||
<span class="subtitle">Fires</span>
|
|
||||||
<?js
|
|
||||||
item.fires.forEach(function (v) {
|
|
||||||
v = self.find({longname: v})[0] || {longname: v, name: v.split(/#?event:/)[1]};
|
|
||||||
?>
|
|
||||||
<li data-name="<?js= v.longname ?>"><?js= self.linkto(v.longname, v.name) ?></li>
|
|
||||||
<?js
|
|
||||||
});
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
<ul class="events itemMembers">
|
|
||||||
<?js
|
|
||||||
if (item.events.length) {
|
|
||||||
?>
|
|
||||||
<span class="subtitle">Events</span>
|
|
||||||
<?js
|
|
||||||
item.events.forEach(function (v) {
|
|
||||||
?>
|
|
||||||
<li data-name="<?js= v.longname ?>"><?js= self.linkto(v.longname, v.name) ?></li>
|
|
||||||
<?js
|
<?js
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
var setter = prop.readonly ? 'no' : 'yes';
|
var setter = prop.readonly ? 'no' : 'yes';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr>
|
<tr class="<?js= prop.stability !== 'stable' ? 'unstable' : '' ?>">
|
||||||
<td class="name"><code><?js= prop.name ?></code></td>
|
<td class="name"><code><?js= prop.name ?></code></td>
|
||||||
<td class="type">
|
<td class="type">
|
||||||
<?js if (prop.type && prop.type.names) {?>
|
<?js if (prop.type && prop.type.names) {?>
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
if (!param) { return; }
|
if (!param) { return; }
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr>
|
<tr class="<?js= (param.stability && param.stability !== 'stable') ? 'unstable' : '' ?>">
|
||||||
<?js if (params.hasName) {?>
|
<?js if (params.hasName) {?>
|
||||||
<td class="name"><code><?js= param.name.replace(/^opt_/, "") ?></code></td>
|
<td class="name"><code><?js= param.name.replace(/^opt_/, "") ?></code></td>
|
||||||
<?js } ?>
|
<?js } ?>
|
||||||
@@ -93,17 +93,8 @@
|
|||||||
<?js } ?>
|
<?js } ?>
|
||||||
|
|
||||||
<td<?js= (param.subparams ? ' colspan=' + colspan : ' ') ?> class="description last">
|
<td<?js= (param.subparams ? ' colspan=' + colspan : ' ') ?> class="description last">
|
||||||
<?js if (params.hasAttributes) {?>
|
<?js if (param.stability) { ?>
|
||||||
<?js if (param.optional) { ?>
|
<?js= self.partial('stability.tmpl', param) ?>
|
||||||
<span class="optional">optional</span>
|
|
||||||
<?js } ?>
|
|
||||||
<?js if (param.nullable) { ?>
|
|
||||||
<span class="nullable">nullable</span>
|
|
||||||
<?js } ?>
|
|
||||||
|
|
||||||
<?js if (param.variable) { ?>
|
|
||||||
<span class="repeatable">repeatable</span>
|
|
||||||
<?js } ?>
|
|
||||||
<?js } ?>
|
<?js } ?>
|
||||||
<?js= param.description ?><?js if (param.subparams) { ?>
|
<?js= param.description ?><?js if (param.subparams) { ?>
|
||||||
<?js= self.partial('params.tmpl', param.subparams) ?>
|
<?js= self.partial('params.tmpl', param.subparams) ?>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"opts": {
|
"opts": {
|
||||||
"recurse": true,
|
"recurse": true,
|
||||||
"template": "buildcfg/jsdoc/info"
|
"template": "config/jsdoc/info"
|
||||||
},
|
},
|
||||||
"tags": {
|
"tags": {
|
||||||
"allowUnknownTags": true
|
"allowUnknownTags": true
|
||||||
@@ -10,7 +10,8 @@
|
|||||||
"includePattern": "\\.js$"
|
"includePattern": "\\.js$"
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"buildcfg/jsdoc/info/api-plugin",
|
"config/jsdoc/info/api-plugin",
|
||||||
"buildcfg/jsdoc/info/define-plugin"
|
"config/jsdoc/info/define-plugin",
|
||||||
|
"config/jsdoc/info/virtual-plugin"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
192
config/jsdoc/info/publish.js
Normal file
192
config/jsdoc/info/publish.js
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
/**
|
||||||
|
* @fileoverview Generates JSON output based on exportable symbols (those with
|
||||||
|
* an api tag) and boolean defines (with a define tag and a default value).
|
||||||
|
*/
|
||||||
|
var assert = require('assert');
|
||||||
|
var fs = require('fs');
|
||||||
|
var path = require('path');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Publish hook for the JSDoc template. Writes to JSON stdout.
|
||||||
|
* @param {function} data The root of the Taffy DB containing doclet records.
|
||||||
|
* @param {Object} opts Options.
|
||||||
|
*/
|
||||||
|
exports.publish = function(data, opts) {
|
||||||
|
|
||||||
|
function getTypes(data) {
|
||||||
|
var types = [];
|
||||||
|
data.forEach(function(name) {
|
||||||
|
types.push(name.replace(/^function$/, 'Function'));
|
||||||
|
});
|
||||||
|
return types;
|
||||||
|
}
|
||||||
|
|
||||||
|
function replaceUnknownTypes(item) {
|
||||||
|
item.types.forEach(function(type, index) {
|
||||||
|
if (!(type in names)) {
|
||||||
|
item.types[index] = '*';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// get all doclets with the "api" property or define (excluding events) or
|
||||||
|
// with olx namespace
|
||||||
|
var classes = {};
|
||||||
|
var docs = data(
|
||||||
|
[
|
||||||
|
{define: {isObject: true}},
|
||||||
|
function() {
|
||||||
|
if (this.kind == 'class') {
|
||||||
|
if (!('extends' in this) || typeof this.api == 'string') {
|
||||||
|
classes[this.longname] = this;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (typeof this.api == 'string' ||
|
||||||
|
this.meta && (/[\\\/]externs$/).test(this.meta.path));
|
||||||
|
}
|
||||||
|
],
|
||||||
|
{kind: {'!is': 'file'}},
|
||||||
|
{kind: {'!is': 'event'}}).get();
|
||||||
|
|
||||||
|
// get symbols data, filter out those that are members of private classes
|
||||||
|
var symbols = [];
|
||||||
|
var defines = [];
|
||||||
|
var typedefs = [];
|
||||||
|
var externs = [];
|
||||||
|
var base = [];
|
||||||
|
var augments = {};
|
||||||
|
var names = {};
|
||||||
|
docs.filter(function(doc) {
|
||||||
|
var include = true;
|
||||||
|
var constructor = doc.memberof;
|
||||||
|
if (constructor && constructor.substr(-1) === '_') {
|
||||||
|
assert.strictEqual(doc.inherited, true,
|
||||||
|
'Unexpected export on private class: ' + doc.longname);
|
||||||
|
include = false;
|
||||||
|
}
|
||||||
|
return include;
|
||||||
|
}).forEach(function(doc) {
|
||||||
|
var isExterns = (/[\\\/]externs$/).test(doc.meta.path);
|
||||||
|
if (isExterns && doc.longname.indexOf('olx.') === 0) {
|
||||||
|
if (doc.kind == 'typedef') {
|
||||||
|
typedefs.push({
|
||||||
|
name: doc.longname,
|
||||||
|
types: ['{}']
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
var typedef = typedefs[typedefs.length - 1];
|
||||||
|
var type = typedef.types[0];
|
||||||
|
typedef.types[0] = type
|
||||||
|
.replace(/\}$/, ', ' + doc.longname.split('#')[1] +
|
||||||
|
': (' + getTypes(doc.type.names).join('|') + ')}')
|
||||||
|
.replace('{, ', '{');
|
||||||
|
}
|
||||||
|
} else if (doc.define) {
|
||||||
|
defines.push({
|
||||||
|
name: doc.longname,
|
||||||
|
description: doc.description,
|
||||||
|
path: path.join(doc.meta.path, doc.meta.filename),
|
||||||
|
default: doc.define.default
|
||||||
|
});
|
||||||
|
} else if (doc.kind == 'typedef' || doc.isEnum === true) {
|
||||||
|
typedefs.push({
|
||||||
|
name: doc.longname,
|
||||||
|
types: getTypes(doc.type.names)
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
var types;
|
||||||
|
var symbol = {
|
||||||
|
name: doc.longname,
|
||||||
|
kind: doc.kind,
|
||||||
|
description: doc.classdesc || doc.description,
|
||||||
|
stability: doc.api,
|
||||||
|
path: path.join(doc.meta.path, doc.meta.filename)
|
||||||
|
};
|
||||||
|
if (doc.augments) {
|
||||||
|
symbol.extends = doc.augments[0];
|
||||||
|
}
|
||||||
|
if (doc.virtual) {
|
||||||
|
symbol.virtual = true;
|
||||||
|
}
|
||||||
|
if (doc.type) {
|
||||||
|
symbol.types = getTypes(doc.type.names);
|
||||||
|
}
|
||||||
|
if (doc.params) {
|
||||||
|
var params = [];
|
||||||
|
doc.params.forEach(function(param) {
|
||||||
|
var paramInfo = {
|
||||||
|
name: param.name
|
||||||
|
};
|
||||||
|
params.push(paramInfo);
|
||||||
|
paramInfo.types = getTypes(param.type.names);
|
||||||
|
if (typeof param.variable == 'boolean') {
|
||||||
|
paramInfo.variable = param.variable;
|
||||||
|
}
|
||||||
|
if (typeof param.optional == 'boolean') {
|
||||||
|
paramInfo.optional = param.optional;
|
||||||
|
}
|
||||||
|
if (typeof param.nullable == 'boolean') {
|
||||||
|
paramInfo.nullable = param.nullable;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
symbol.params = params;
|
||||||
|
}
|
||||||
|
if (doc.returns) {
|
||||||
|
symbol.returns = {
|
||||||
|
types: getTypes(doc.returns[0].type.names)
|
||||||
|
};
|
||||||
|
if (typeof doc.returns[0].nullable == 'boolean') {
|
||||||
|
symbol.returns.nullable = doc.returns[0].nullable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (doc.tags) {
|
||||||
|
doc.tags.every(function(tag) {
|
||||||
|
if (tag.title == 'template') {
|
||||||
|
symbol.template = tag.value;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var target = isExterns ? externs : (doc.api ? symbols : base);
|
||||||
|
target.push(symbol);
|
||||||
|
names[symbol.name] = true;
|
||||||
|
|
||||||
|
if (doc.api && symbol.extends) {
|
||||||
|
while (symbol.extends in classes && !classes[symbol.extends].api &&
|
||||||
|
classes[symbol.extends].augments) {
|
||||||
|
symbol.extends = classes[symbol.extends].augments[0];
|
||||||
|
}
|
||||||
|
if (symbol.extends) {
|
||||||
|
augments[symbol.extends] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
base = base.filter(function(symbol) {
|
||||||
|
var pass = symbol.name in augments || symbol.virtual;
|
||||||
|
if (pass) {
|
||||||
|
if (symbol.params) {
|
||||||
|
symbol.params.forEach(replaceUnknownTypes);
|
||||||
|
}
|
||||||
|
if (symbol.returns) {
|
||||||
|
symbol.returns.forEach(replaceUnknownTypes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pass;
|
||||||
|
});
|
||||||
|
|
||||||
|
process.stdout.write(
|
||||||
|
JSON.stringify({
|
||||||
|
symbols: symbols,
|
||||||
|
defines: defines,
|
||||||
|
typedefs: typedefs,
|
||||||
|
externs: externs,
|
||||||
|
base: base
|
||||||
|
}, null, 2));
|
||||||
|
|
||||||
|
};
|
||||||
16
config/jsdoc/info/virtual-plugin.js
Normal file
16
config/jsdoc/info/virtual-plugin.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* Handle the interface and abstract annotations.
|
||||||
|
* @param {Object} dictionary The tag dictionary.
|
||||||
|
*/
|
||||||
|
exports.defineTags = function(dictionary) {
|
||||||
|
|
||||||
|
var classTag = dictionary.lookUp('class');
|
||||||
|
dictionary.defineTag('interface', {
|
||||||
|
mustHaveValue: false,
|
||||||
|
onTagged: function(doclet, tag) {
|
||||||
|
classTag.onTagged.apply(this, arguments);
|
||||||
|
doclet.virtual = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
],
|
],
|
||||||
"define": [
|
"define": [
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
||||||
|
"goog.json.USE_NATIVE_JSON=true",
|
||||||
"goog.DEBUG=false"
|
"goog.DEBUG=false"
|
||||||
],
|
],
|
||||||
"jscomp_error": [
|
"jscomp_error": [
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
"deprecated",
|
"deprecated",
|
||||||
"duplicateMessage",
|
"duplicateMessage",
|
||||||
"es3",
|
"es3",
|
||||||
|
"es5Strict",
|
||||||
"externsValidation",
|
"externsValidation",
|
||||||
"fileoverviewTags",
|
"fileoverviewTags",
|
||||||
"globalThis",
|
"globalThis",
|
||||||
@@ -54,11 +56,8 @@
|
|||||||
"extra_annotation_name": [
|
"extra_annotation_name": [
|
||||||
"api", "observable"
|
"api", "observable"
|
||||||
],
|
],
|
||||||
"jscomp_off": [
|
|
||||||
"es5Strict"
|
|
||||||
],
|
|
||||||
"compilation_level": "ADVANCED",
|
"compilation_level": "ADVANCED",
|
||||||
"output_wrapper": "// OpenLayers 3. See http://ol3.js.org/\n(function(){%output%})();",
|
"output_wrapper": "(function(){%output%})();",
|
||||||
"use_types_for_optimization": true,
|
"use_types_for_optimization": true,
|
||||||
"manage_closure_dependencies": true
|
"manage_closure_dependencies": true
|
||||||
}
|
}
|
||||||
3
config/readme.md
Normal file
3
config/readme.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Configuration Files
|
||||||
|
|
||||||
|
This directory includes configuration files for the build scripts in and documentation templates.
|
||||||
@@ -191,6 +191,7 @@ button.ol-full-screen-true:after {
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
bottom: .5em;
|
bottom: .5em;
|
||||||
right: .5em;
|
right: .5em;
|
||||||
|
max-width: calc(100% - 1.3em);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ol-attribution ul {
|
.ol-attribution ul {
|
||||||
@@ -200,6 +201,7 @@ button.ol-full-screen-true:after {
|
|||||||
line-height: 1.375em;
|
line-height: 1.375em;
|
||||||
color: #000;
|
color: #000;
|
||||||
text-shadow: 0 0 2px #fff;
|
text-shadow: 0 0 2px #fff;
|
||||||
|
max-width: calc(100% - 3.6em);
|
||||||
}
|
}
|
||||||
.ol-attribution li {
|
.ol-attribution li {
|
||||||
display: inline;
|
display: inline;
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ Below you'll find a complete working example. Create a new file, copy in the co
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="http://ol3js.org/en/{{ latest }}/css/ol.css" type="text/css">
|
<link rel="stylesheet" href="http://openlayers.org/en/{{ latest }}/css/ol.css" type="text/css">
|
||||||
<style>
|
<style>
|
||||||
.map {
|
.map {
|
||||||
height: 400px;
|
height: 400px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script src="http://ol3js.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
|
<script src="http://openlayers.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
|
||||||
<title>OpenLayers 3 example</title>
|
<title>OpenLayers 3 example</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -55,10 +55,10 @@ To include a map a web page you will need 3 things:
|
|||||||
### Include OpenLayers
|
### Include OpenLayers
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<script src="http://ol3js.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
|
<script src="http://openlayers.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
The first part is to include the JavaScript library. For the purpose of this tutorial, here we simply point to the ol3js.org website to get the whole library. In a production environment, we would build a custom version of the library including only the module needed for our application.
|
The first part is to include the JavaScript library. For the purpose of this tutorial, here we simply point to the openlayers.org website to get the whole library. In a production environment, we would build a custom version of the library including only the module needed for our application.
|
||||||
|
|
||||||
|
|
||||||
### `<div>` to contain the map
|
### `<div>` to contain the map
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
goog.require('ol.BrowserFeature');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.control');
|
goog.require('ol.control');
|
||||||
goog.require('ol.dom.Input');
|
goog.require('ol.dom.Input');
|
||||||
|
goog.require('ol.has');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
|
|
||||||
|
|
||||||
function checkWebGL(evt) {
|
function checkWebGL(evt) {
|
||||||
document.getElementById('no-webgl').style.display =
|
document.getElementById('no-webgl').style.display =
|
||||||
ol.BrowserFeature.HAS_WEBGL ? 'none' : '';
|
ol.has.WEBGL ? 'none' : '';
|
||||||
document.getElementById('has-webgl').style.display =
|
document.getElementById('has-webgl').style.display =
|
||||||
ol.BrowserFeature.HAS_WEBGL && !evt.glContext ? '' : 'none';
|
ol.has.WEBGL && !evt.glContext ? '' : 'none';
|
||||||
document.getElementById('webgl').style.display =
|
document.getElementById('webgl').style.display =
|
||||||
evt.glContext ? '' : 'none';
|
evt.glContext ? '' : 'none';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
goog.require('ol.BrowserFeature');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
|
goog.require('ol.has');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.source.MapQuest');
|
goog.require('ol.source.MapQuest');
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ function setResetContrastButtonHTML() {
|
|||||||
resetContrast.innerHTML = 'Contrast (' + layer.getContrast().toFixed(3) + ')';
|
resetContrast.innerHTML = 'Contrast (' + layer.getContrast().toFixed(3) + ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ol.BrowserFeature.HAS_WEBGL) {
|
if (!ol.has.WEBGL) {
|
||||||
var info = document.getElementById('no-webgl');
|
var info = document.getElementById('no-webgl');
|
||||||
/**
|
/**
|
||||||
* display error message
|
* display error message
|
||||||
|
|||||||
51
examples/cluster.html
Normal file
51
examples/cluster.html
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
<title>Clustering example</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span12">
|
||||||
|
<h4 id="title">Clustering example</h4>
|
||||||
|
<p id="shortdesc">Example of using <code>ol.Cluster</code>.</p>
|
||||||
|
<div id="docs">
|
||||||
|
<p>See the <a href="cluster.js" target="_blank">cluster.js source</a> to see how this is done.</p>
|
||||||
|
</div>
|
||||||
|
<div id="tags">cluster vector</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="jquery.min.js" type="text/javascript"></script>
|
||||||
|
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||||
|
<script src="loader.js?id=cluster" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
80
examples/cluster.js
Normal file
80
examples/cluster.js
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
goog.require('ol.Feature');
|
||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.View');
|
||||||
|
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.Vector');
|
||||||
|
goog.require('ol.style.Circle');
|
||||||
|
goog.require('ol.style.Fill');
|
||||||
|
goog.require('ol.style.Stroke');
|
||||||
|
goog.require('ol.style.Style');
|
||||||
|
goog.require('ol.style.Text');
|
||||||
|
|
||||||
|
|
||||||
|
var count = 20000;
|
||||||
|
var features = new Array(count);
|
||||||
|
var e = 4500000;
|
||||||
|
for (var i = 0; i < count; ++i) {
|
||||||
|
var coordinates = [2 * e * Math.random() - e, 2 * e * Math.random() - e];
|
||||||
|
features[i] = new ol.Feature(new ol.geom.Point(coordinates));
|
||||||
|
}
|
||||||
|
|
||||||
|
var source = new ol.source.Vector({
|
||||||
|
features: features
|
||||||
|
});
|
||||||
|
|
||||||
|
var clusterSource = new ol.source.Cluster({
|
||||||
|
distance: 40,
|
||||||
|
source: source
|
||||||
|
});
|
||||||
|
|
||||||
|
var styleCache = {};
|
||||||
|
var clusters = new ol.layer.Vector({
|
||||||
|
source: clusterSource,
|
||||||
|
style: function(feature, resolution) {
|
||||||
|
var size = feature.get('features').length;
|
||||||
|
var style = styleCache[size];
|
||||||
|
if (!style) {
|
||||||
|
style = [new ol.style.Style({
|
||||||
|
image: new ol.style.Circle({
|
||||||
|
radius: 10,
|
||||||
|
stroke: new ol.style.Stroke({
|
||||||
|
color: '#fff'
|
||||||
|
}),
|
||||||
|
fill: new ol.style.Fill({
|
||||||
|
color: '#3399CC'
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
text: new ol.style.Text({
|
||||||
|
text: size.toString(),
|
||||||
|
fill: new ol.style.Fill({
|
||||||
|
color: '#fff'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})];
|
||||||
|
styleCache[size] = style;
|
||||||
|
}
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var raster = new ol.layer.Tile({
|
||||||
|
source: new ol.source.MapQuest({layer: 'sat'})
|
||||||
|
});
|
||||||
|
|
||||||
|
var raw = new ol.layer.Vector({
|
||||||
|
source: source
|
||||||
|
});
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
layers: [raster, clusters],
|
||||||
|
renderer: 'canvas',
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 2
|
||||||
|
})
|
||||||
|
});
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h4 id="title">Drag-and-Drop example</h4>
|
<h4 id="title">Drag-and-Drop example</h4>
|
||||||
<p id="shortdesc">Example of using the drag-and-drop interaction. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map.</p>
|
<p id="shortdesc">Example of using the drag-and-drop interaction. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. There is no projection transform support, so this will only work with data in EPSG:4326 and EPSG:3857.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>See the <a href="drag-and-drop.js" target="_blank">drag-and-drop.js source</a> to see how this is done.</p>
|
<p>See the <a href="drag-and-drop.js" target="_blank">drag-and-drop.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,11 +9,9 @@ goog.require('ol.source.TileWMS');
|
|||||||
var layers = [
|
var layers = [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.TileWMS({
|
source: new ol.source.TileWMS({
|
||||||
url: 'http://vmap0.tiles.osgeo.org/wms/vmap0',
|
url: 'http://demo.opengeo.org/geoserver/wms',
|
||||||
params: {
|
params: {
|
||||||
'VERSION': '1.1.1',
|
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
|
||||||
'LAYERS': 'basic',
|
|
||||||
'FORMAT': 'image/jpeg'
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -47,13 +47,13 @@ var positions = new ol.geom.LineString([],
|
|||||||
|
|
||||||
// Geolocation Control
|
// Geolocation Control
|
||||||
var geolocation = new ol.Geolocation(/** @type {olx.GeolocationOptions} */ ({
|
var geolocation = new ol.Geolocation(/** @type {olx.GeolocationOptions} */ ({
|
||||||
|
projection: view.getProjection(),
|
||||||
trackingOptions: {
|
trackingOptions: {
|
||||||
maximumAge: 10000,
|
maximumAge: 10000,
|
||||||
enableHighAccuracy: true,
|
enableHighAccuracy: true,
|
||||||
timeout: 600000
|
timeout: 600000
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
geolocation.bindTo('projection', view);
|
|
||||||
|
|
||||||
var deltaMean = 500; // the geolocation sampling period mean in ms
|
var deltaMean = 500; // the geolocation sampling period mean in ms
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,9 @@ var map = new ol.Map({
|
|||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
|
|
||||||
var geolocation = new ol.Geolocation();
|
var geolocation = new ol.Geolocation({
|
||||||
geolocation.bindTo('projection', view);
|
projection: view.getProjection()
|
||||||
|
});
|
||||||
|
|
||||||
var track = new ol.dom.Input(document.getElementById('track'));
|
var track = new ol.dom.Input(document.getElementById('track'));
|
||||||
track.bindTo('checked', geolocation, 'tracking');
|
track.bindTo('checked', geolocation, 'tracking');
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
<title>Get feature info example</title>
|
<title>GetFeatureInfo example (image layer)</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
@@ -32,10 +32,10 @@
|
|||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h4 id="title">GetFeatureInfo example</h4>
|
<h4 id="title">GetFeatureInfo example (image layer)</h4>
|
||||||
<p id="shortdesc">This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS image layer.</p>
|
<p id="shortdesc">This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS image layer.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>See the <a href="getfeatureinfo.js" target="_blank">getfeatureinfo.js source</a> to see how this is done.</p>
|
<p>See the <a href="getfeatureinfo-image.js" target="_blank">getfeatureinfo-image.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="tags">getfeatureinfo</div>
|
<div id="tags">getfeatureinfo</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
<script src="jquery.min.js" type="text/javascript"></script>
|
<script src="jquery.min.js" type="text/javascript"></script>
|
||||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||||
<script src="loader.js?id=getfeatureinfo" type="text/javascript"></script>
|
<script src="loader.js?id=getfeatureinfo-image" type="text/javascript"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
38
examples/getfeatureinfo-image.js
Normal file
38
examples/getfeatureinfo-image.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.View');
|
||||||
|
goog.require('ol.layer.Image');
|
||||||
|
goog.require('ol.source.ImageWMS');
|
||||||
|
|
||||||
|
|
||||||
|
var wmsSource = new ol.source.ImageWMS({
|
||||||
|
url: 'http://demo.opengeo.org/geoserver/wms',
|
||||||
|
params: {'LAYERS': 'ne:ne'},
|
||||||
|
serverType: 'geoserver'
|
||||||
|
});
|
||||||
|
|
||||||
|
var wmsLayer = new ol.layer.Image({
|
||||||
|
source: wmsSource
|
||||||
|
});
|
||||||
|
|
||||||
|
var view = new ol.View({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 1
|
||||||
|
});
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
layers: [wmsLayer],
|
||||||
|
target: 'map',
|
||||||
|
view: view
|
||||||
|
});
|
||||||
|
|
||||||
|
map.on('singleclick', function(evt) {
|
||||||
|
document.getElementById('info').innerHTML = '';
|
||||||
|
var viewResolution = /** @type {number} */ (view.getResolution());
|
||||||
|
var url = wmsSource.getGetFeatureInfoUrl(
|
||||||
|
evt.coordinate, viewResolution, 'EPSG:3857',
|
||||||
|
{'INFO_FORMAT': 'text/html'});
|
||||||
|
if (url) {
|
||||||
|
document.getElementById('info').innerHTML =
|
||||||
|
'<iframe seamless src="' + url + '"></iframe>';
|
||||||
|
}
|
||||||
|
});
|
||||||
57
examples/getfeatureinfo-tile.html
Normal file
57
examples/getfeatureinfo-tile.html
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
<title>WMS GetFeatureInfo example (tile layer)</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span4">
|
||||||
|
<h4 id="title">WMS GetFeatureInfo example (tile layer)</h4>
|
||||||
|
<p id="shortdesc">This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS tile layer.</p>
|
||||||
|
<div id="docs">
|
||||||
|
<p>See the <a href="getfeatureinfo-tile.js" target="_blank">getfeatureinfo-tile.js source</a> to see how this is done.</p>
|
||||||
|
</div>
|
||||||
|
<div id="tags">getfeatureinfo</div>
|
||||||
|
</div>
|
||||||
|
<div class="span4 offset4">
|
||||||
|
<div id="info" class="alert alert-success">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="jquery.min.js" type="text/javascript"></script>
|
||||||
|
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||||
|
<script src="loader.js?id=getfeatureinfo-tile" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -6,7 +6,8 @@ goog.require('ol.source.TileWMS');
|
|||||||
|
|
||||||
var wmsSource = new ol.source.TileWMS({
|
var wmsSource = new ol.source.TileWMS({
|
||||||
url: 'http://demo.opengeo.org/geoserver/wms',
|
url: 'http://demo.opengeo.org/geoserver/wms',
|
||||||
params: {'LAYERS': 'ne:ne'}
|
params: {'LAYERS': 'ne:ne'},
|
||||||
|
serverType: 'geoserver'
|
||||||
});
|
});
|
||||||
|
|
||||||
var wmsLayer = new ol.layer.Tile({
|
var wmsLayer = new ol.layer.Tile({
|
||||||
@@ -18,9 +19,6 @@ var view = new ol.View({
|
|||||||
zoom: 1
|
zoom: 1
|
||||||
});
|
});
|
||||||
|
|
||||||
var viewProjection = /** @type {ol.proj.Projection} */
|
|
||||||
(view.getProjection());
|
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [wmsLayer],
|
layers: [wmsLayer],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
@@ -31,7 +29,7 @@ map.on('singleclick', function(evt) {
|
|||||||
document.getElementById('info').innerHTML = '';
|
document.getElementById('info').innerHTML = '';
|
||||||
var viewResolution = /** @type {number} */ (view.getResolution());
|
var viewResolution = /** @type {number} */ (view.getResolution());
|
||||||
var url = wmsSource.getGetFeatureInfoUrl(
|
var url = wmsSource.getGetFeatureInfoUrl(
|
||||||
evt.coordinate, viewResolution, viewProjection,
|
evt.coordinate, viewResolution, 'EPSG:3857',
|
||||||
{'INFO_FORMAT': 'text/html'});
|
{'INFO_FORMAT': 'text/html'});
|
||||||
if (url) {
|
if (url) {
|
||||||
document.getElementById('info').innerHTML =
|
document.getElementById('info').innerHTML =
|
||||||
@@ -4,6 +4,7 @@ goog.require('ol.View');
|
|||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.proj');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
|
goog.require('ol.style.Stroke');
|
||||||
|
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
@@ -21,5 +22,12 @@ var map = new ol.Map({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Create the graticule component
|
// Create the graticule component
|
||||||
var graticule = new ol.Graticule();
|
var graticule = new ol.Graticule({
|
||||||
|
// the style to use for the lines, optional.
|
||||||
|
strokeStyle: new ol.style.Stroke({
|
||||||
|
color: 'rgba(255,120,0,0.9)',
|
||||||
|
width: 2,
|
||||||
|
lineDash: [0.5, 4]
|
||||||
|
})
|
||||||
|
});
|
||||||
graticule.setMap(map);
|
graticule.setMap(map);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ goog.require('ol.source.Stamen');
|
|||||||
|
|
||||||
var vector = new ol.layer.Heatmap({
|
var vector = new ol.layer.Heatmap({
|
||||||
source: new ol.source.KML({
|
source: new ol.source.KML({
|
||||||
|
extractStyles: false,
|
||||||
projection: 'EPSG:3857',
|
projection: 'EPSG:3857',
|
||||||
url: 'data/kml/2012_Earthquakes_Mag5.kml'
|
url: 'data/kml/2012_Earthquakes_Mag5.kml'
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
goog.require('ol.BrowserFeature');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
|
goog.require('ol.has');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.proj');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.BingMaps');
|
goog.require('ol.source.BingMaps');
|
||||||
@@ -15,7 +15,7 @@ function setResetSaturationButtonHTML() {
|
|||||||
layer.getSaturation().toFixed(2) + ')';
|
layer.getSaturation().toFixed(2) + ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ol.BrowserFeature.HAS_WEBGL) {
|
if (!ol.has.WEBGL) {
|
||||||
var info = document.getElementById('no-webgl');
|
var info = document.getElementById('no-webgl');
|
||||||
/**
|
/**
|
||||||
* display error message
|
* display error message
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ var styleFunction = function(feature, resolution) {
|
|||||||
|
|
||||||
var vector = new ol.layer.Vector({
|
var vector = new ol.layer.Vector({
|
||||||
source: new ol.source.KML({
|
source: new ol.source.KML({
|
||||||
|
extractStyles: false,
|
||||||
projection: 'EPSG:3857',
|
projection: 'EPSG:3857',
|
||||||
url: 'data/kml/2012_Earthquakes_Mag5.kml'
|
url: 'data/kml/2012_Earthquakes_Mag5.kml'
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ var styleFunction = function(feature, resolution) {
|
|||||||
|
|
||||||
var vector = new ol.layer.Vector({
|
var vector = new ol.layer.Vector({
|
||||||
source: new ol.source.KML({
|
source: new ol.source.KML({
|
||||||
|
extractStyles: false,
|
||||||
projection: 'EPSG:3857',
|
projection: 'EPSG:3857',
|
||||||
url: 'data/kml/timezones.kml'
|
url: 'data/kml/timezones.kml'
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
goog.require('ol.BrowserFeature');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.control');
|
goog.require('ol.control');
|
||||||
|
goog.require('ol.has');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
|
|
||||||
if (!ol.BrowserFeature.HAS_WEBGL) {
|
if (!ol.has.WEBGL) {
|
||||||
var info = document.getElementById('no-webgl');
|
var info = document.getElementById('no-webgl');
|
||||||
/**
|
/**
|
||||||
* display error message
|
* display error message
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.layer.Image');
|
goog.require('ol.layer.Image');
|
||||||
goog.require('ol.source.MapGuide');
|
goog.require('ol.source.ImageMapGuide');
|
||||||
|
|
||||||
var mdf = 'Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition';
|
var mdf = 'Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition';
|
||||||
var agentUrl =
|
var agentUrl =
|
||||||
@@ -16,7 +16,7 @@ var map = new ol.Map({
|
|||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Image({
|
new ol.layer.Image({
|
||||||
extent: bounds,
|
extent: bounds,
|
||||||
source: new ol.source.MapGuide({
|
source: new ol.source.ImageMapGuide({
|
||||||
projection: 'EPSG:4326',
|
projection: 'EPSG:4326',
|
||||||
url: agentUrl,
|
url: agentUrl,
|
||||||
useOverlay: false,
|
useOverlay: false,
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ var map = new ol.Map({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var geolocation = new ol.Geolocation({
|
var geolocation = new ol.Geolocation({
|
||||||
|
projection: view.getProjection(),
|
||||||
tracking: true
|
tracking: true
|
||||||
});
|
});
|
||||||
geolocation.bindTo('projection', view);
|
|
||||||
geolocation.once('change:position', function() {
|
geolocation.once('change:position', function() {
|
||||||
view.setCenter(geolocation.getPosition());
|
view.setCenter(geolocation.getPosition());
|
||||||
view.setResolution(2.388657133911758);
|
view.setResolution(2.388657133911758);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Although the main purpose of these examples is to demonstrate how to use the API, they also serve other purposes in the development cycle, and so are not exactly as they would be in normal application code:
|
Although the main purpose of these examples is to demonstrate how to use the API, they also serve other purposes in the development cycle, and so are not exactly as they would be in normal application code:
|
||||||
|
|
||||||
* every time the library changes, they are compiled together with the library as a basic check that they remain in sync with the library
|
* every time the library changes, they are compiled together with the library as a basic check that they remain in sync with the library
|
||||||
* they use a special loader script to enable defining at run time which build mode (debug/whitespace/simple/advanced) to use
|
* they use a special loader script to enable defining at run time which build mode (raw/debug/advanced) to use
|
||||||
|
|
||||||
To enable this, examples have the following, not needed in application code:
|
To enable this, examples have the following, not needed in application code:
|
||||||
|
|
||||||
@@ -13,4 +13,4 @@ To enable this, examples have the following, not needed in application code:
|
|||||||
* html files load `example-behaviour.js` and some js files define the Map renderer option as `exampleNS.getRendererFromQueryString()`; application code would not need these
|
* html files load `example-behaviour.js` and some js files define the Map renderer option as `exampleNS.getRendererFromQueryString()`; application code would not need these
|
||||||
* in addition, examples use Twitter Bootstrap and jQuery; this is of course not a requirement - you may use whichever presentation/helper libraries you wish
|
* in addition, examples use Twitter Bootstrap and jQuery; this is of course not a requirement - you may use whichever presentation/helper libraries you wish
|
||||||
|
|
||||||
See [Quick Start tutorial](http://ol3js.org/en/master/doc/quickstart.html) for a simple example of how application code would use the library.
|
See [Quick Start tutorial](http://openlayers.org/en/master/doc/quickstart.html) for a simple example of how application code would use the library.
|
||||||
|
|||||||
@@ -27,7 +27,9 @@
|
|||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<select id="units">
|
<select id="units">
|
||||||
<option value="degrees">degrees</option>
|
<option value="degrees">degrees</option>
|
||||||
<option value="imperial">imperial</option>
|
<option value="imperial">imperial inch</option>
|
||||||
|
<option value="us">us inch</option>
|
||||||
|
<option value="nautical">nautical mile</option>
|
||||||
<option value="metric">metric</option>
|
<option value="metric">metric</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
goog.require('ol.BrowserFeature');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
|
goog.require('ol.has');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.source.MapQuest');
|
goog.require('ol.source.MapQuest');
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ var domMap = new ol.Map({
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
if (ol.BrowserFeature.HAS_WEBGL) {
|
if (ol.has.WEBGL) {
|
||||||
var webglMap = new ol.Map({
|
var webglMap = new ol.Map({
|
||||||
renderer: 'webgl',
|
renderer: 'webgl',
|
||||||
target: 'webglMap'
|
target: 'webglMap'
|
||||||
|
|||||||
@@ -9,6 +9,12 @@
|
|||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
<title>Tile vector example</title>
|
<title>Tile vector example</title>
|
||||||
|
<style>
|
||||||
|
#map {
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
@@ -36,6 +42,16 @@
|
|||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>See the <a href="tile-vector.js" target="_blank">tile-vector.js source</a> to see how this is done.</p>
|
<p>See the <a href="tile-vector.js" target="_blank">tile-vector.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="alert">
|
||||||
|
<strong>Warning</strong> Map is becoming unresponsive with too many layers.
|
||||||
|
</div>
|
||||||
|
<fieldset>
|
||||||
|
<legend>Layers</legend>
|
||||||
|
<label class="checkbox"><input type="checkbox" id="landuse"/> Landuse</label>
|
||||||
|
<label class="checkbox"><input type="checkbox" id="buildings"/> Buildings</label>
|
||||||
|
<label class="checkbox"><input type="checkbox" id="water" checked/> Water</label>
|
||||||
|
<label class="checkbox"><input type="checkbox" id="roads" checked/> Roads</label>
|
||||||
|
</fieldset>
|
||||||
<div id="tags">tile-vector, openstreetmap</div>
|
<div id="tags">tile-vector, openstreetmap</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ goog.require('ol.tilegrid.XYZ');
|
|||||||
|
|
||||||
var waterLayer = new ol.layer.Vector({
|
var waterLayer = new ol.layer.Vector({
|
||||||
source: new ol.source.TileVector({
|
source: new ol.source.TileVector({
|
||||||
format: new ol.format.TopoJSON({
|
format: new ol.format.TopoJSON(),
|
||||||
defaultProjection: 'EPSG:4326'
|
|
||||||
}),
|
|
||||||
projection: 'EPSG:3857',
|
projection: 'EPSG:3857',
|
||||||
tileGrid: new ol.tilegrid.XYZ({
|
tileGrid: new ol.tilegrid.XYZ({
|
||||||
maxZoom: 19
|
maxZoom: 19
|
||||||
@@ -31,9 +29,7 @@ var waterLayer = new ol.layer.Vector({
|
|||||||
var roadStyleCache = {};
|
var roadStyleCache = {};
|
||||||
var roadLayer = new ol.layer.Vector({
|
var roadLayer = new ol.layer.Vector({
|
||||||
source: new ol.source.TileVector({
|
source: new ol.source.TileVector({
|
||||||
format: new ol.format.TopoJSON({
|
format: new ol.format.TopoJSON(),
|
||||||
defaultProjection: 'EPSG:4326'
|
|
||||||
}),
|
|
||||||
projection: 'EPSG:3857',
|
projection: 'EPSG:3857',
|
||||||
tileGrid: new ol.tilegrid.XYZ({
|
tileGrid: new ol.tilegrid.XYZ({
|
||||||
maxZoom: 19
|
maxZoom: 19
|
||||||
@@ -73,13 +69,101 @@ var roadLayer = new ol.layer.Vector({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var buildingStyle = [
|
||||||
|
new ol.style.Style({
|
||||||
|
fill: new ol.style.Fill({
|
||||||
|
color: '#666',
|
||||||
|
opacity: 0.4
|
||||||
|
}),
|
||||||
|
stroke: new ol.style.Stroke({
|
||||||
|
color: '#444',
|
||||||
|
width: 1
|
||||||
|
})
|
||||||
|
})
|
||||||
|
];
|
||||||
|
var buildingLayer = new ol.layer.Vector({
|
||||||
|
source: new ol.source.TileVector({
|
||||||
|
format: new ol.format.TopoJSON({
|
||||||
|
defaultProjection: 'EPSG:4326'
|
||||||
|
}),
|
||||||
|
projection: 'EPSG:3857',
|
||||||
|
tileGrid: new ol.tilegrid.XYZ({
|
||||||
|
maxZoom: 19
|
||||||
|
}),
|
||||||
|
url: 'http://{a-c}.tile.openstreetmap.us/' +
|
||||||
|
'vectiles-buildings/{z}/{x}/{y}.topojson'
|
||||||
|
}),
|
||||||
|
visible: false,
|
||||||
|
style: function(f, resolution) {
|
||||||
|
return (resolution < 10) ? buildingStyle : [];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var landuseStyleCache = {};
|
||||||
|
var landuseLayer = new ol.layer.Vector({
|
||||||
|
source: new ol.source.TileVector({
|
||||||
|
format: new ol.format.TopoJSON({
|
||||||
|
defaultProjection: 'EPSG:4326'
|
||||||
|
}),
|
||||||
|
projection: 'EPSG:3857',
|
||||||
|
tileGrid: new ol.tilegrid.XYZ({
|
||||||
|
maxZoom: 19
|
||||||
|
}),
|
||||||
|
url: 'http://{a-c}.tile.openstreetmap.us/' +
|
||||||
|
'vectiles-land-usages/{z}/{x}/{y}.topojson'
|
||||||
|
}),
|
||||||
|
visible: false,
|
||||||
|
style: function(feature, resolution) {
|
||||||
|
var kind = feature.get('kind');
|
||||||
|
var styleKey = kind;
|
||||||
|
var styleArray = landuseStyleCache[styleKey];
|
||||||
|
if (!styleArray) {
|
||||||
|
var color, width;
|
||||||
|
color = {
|
||||||
|
'parking': '#ddd',
|
||||||
|
'industrial': '#aaa',
|
||||||
|
'urban area': '#aaa',
|
||||||
|
'park': '#76C759',
|
||||||
|
'school': '#DA10E7',
|
||||||
|
'garden': '#76C759',
|
||||||
|
'pitch': '#D58F8D',
|
||||||
|
'scrub': '#3E7D28',
|
||||||
|
'residential': '#4C9ED9'
|
||||||
|
}[kind];
|
||||||
|
width = kind == 'highway' ? 1.5 : 1;
|
||||||
|
styleArray = [new ol.style.Style({
|
||||||
|
stroke: new ol.style.Stroke({
|
||||||
|
color: color,
|
||||||
|
width: width
|
||||||
|
}),
|
||||||
|
fill: new ol.style.Fill({
|
||||||
|
color: color,
|
||||||
|
opacity: 0.5
|
||||||
|
})
|
||||||
|
})];
|
||||||
|
landuseStyleCache[styleKey] = styleArray;
|
||||||
|
}
|
||||||
|
return styleArray;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [waterLayer, roadLayer],
|
layers: [landuseLayer, buildingLayer, waterLayer, roadLayer],
|
||||||
renderer: 'canvas',
|
renderer: 'canvas',
|
||||||
target: document.getElementById('map'),
|
target: document.getElementById('map'),
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
center: ol.proj.transform([-74.0064, 40.7142], 'EPSG:4326', 'EPSG:3857'),
|
center: ol.proj.transform([-74.0064, 40.7142], 'EPSG:4326', 'EPSG:3857'),
|
||||||
maxZoom: 19,
|
maxZoom: 19,
|
||||||
zoom: 14
|
zoom: 15
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('input[type=checkbox]').on('change', function() {
|
||||||
|
var layer = {
|
||||||
|
landuse: landuseLayer,
|
||||||
|
buildings: buildingLayer,
|
||||||
|
water: waterLayer,
|
||||||
|
roads: roadLayer
|
||||||
|
}[$(this).attr('id')];
|
||||||
|
layer.setVisible(!layer.getVisible());
|
||||||
|
});
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.Sphere');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.geom.Polygon');
|
goog.require('ol.geom.Polygon');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.layer.Vector');
|
goog.require('ol.layer.Vector');
|
||||||
goog.require('ol.source.TileWMS');
|
goog.require('ol.source.TileWMS');
|
||||||
goog.require('ol.source.Vector');
|
goog.require('ol.source.Vector');
|
||||||
goog.require('ol.sphere.WGS84');
|
|
||||||
|
|
||||||
var vectorSource = new ol.source.Vector();
|
var vectorSource = new ol.source.Vector();
|
||||||
|
|
||||||
@@ -14,11 +14,9 @@ var map = new ol.Map({
|
|||||||
layers: [
|
layers: [
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
source: new ol.source.TileWMS({
|
source: new ol.source.TileWMS({
|
||||||
url: 'http://vmap0.tiles.osgeo.org/wms/vmap0',
|
url: 'http://demo.opengeo.org/geoserver/wms',
|
||||||
params: {
|
params: {
|
||||||
'VERSION': '1.1.1',
|
'LAYERS': 'ne:NE1_HR_LC_SR_W_DR'
|
||||||
'LAYERS': 'basic',
|
|
||||||
'FORMAT': 'image/jpeg'
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
@@ -35,11 +33,12 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var wgs84Sphere = new ol.Sphere(6378137);
|
||||||
|
|
||||||
var radius = 800000;
|
var radius = 800000;
|
||||||
for (var x = -180; x < 180; x += 30) {
|
for (var x = -180; x < 180; x += 30) {
|
||||||
for (var y = -90; y < 90; y += 30) {
|
for (var y = -90; y < 90; y += 30) {
|
||||||
var circle = ol.geom.Polygon.circular(ol.sphere.WGS84, [x, y], radius, 64);
|
var circle = ol.geom.Polygon.circular(wgs84Sphere, [x, y], radius, 64);
|
||||||
vectorSource.addFeature(new ol.Feature(circle));
|
vectorSource.addFeature(new ol.Feature(circle));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
<script src="jquery.min.js" type="text/javascript"></script>
|
<script src="jquery.min.js" type="text/javascript"></script>
|
||||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.2.1/proj4.js" type="text/javascript"></script>
|
<script src="http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.2.1/proj4.js" type="text/javascript"></script>
|
||||||
<script src="http://epsg.io/21781.js" type="text/javascript"></script>
|
<script src="http://epsg.io/21781-1753.js" type="text/javascript"></script>
|
||||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||||
<script src="loader.js?id=wms-image-custom-proj" type="text/javascript"></script>
|
<script src="loader.js?id=wms-image-custom-proj" type="text/javascript"></script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
goog.require('ol.BrowserFeature');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
|
goog.require('ol.has');
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.source.WMTS');
|
goog.require('ol.source.WMTS');
|
||||||
goog.require('ol.tilegrid.WMTS');
|
goog.require('ol.tilegrid.WMTS');
|
||||||
@@ -20,7 +20,7 @@ var urls = [
|
|||||||
// HiDPI support:
|
// HiDPI support:
|
||||||
// * Use 'bmaphidpi' layer (pixel ratio 2) for device pixel ratio > 1
|
// * Use 'bmaphidpi' layer (pixel ratio 2) for device pixel ratio > 1
|
||||||
// * Use 'geolandbasemap' layer (pixel ratio 1) for device pixel ratio == 1
|
// * Use 'geolandbasemap' layer (pixel ratio 1) for device pixel ratio == 1
|
||||||
var hiDPI = ol.BrowserFeature.DEVICE_PIXEL_RATIO > 1;
|
var hiDPI = ol.has.DEVICE_PIXEL_RATIO > 1;
|
||||||
|
|
||||||
var source = new ol.source.WMTS({
|
var source = new ol.source.WMTS({
|
||||||
projection: 'EPSG:3857',
|
projection: 'EPSG:3857',
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ goog.require('ol.source.XYZ');
|
|||||||
|
|
||||||
|
|
||||||
var attribution = new ol.Attribution({
|
var attribution = new ol.Attribution({
|
||||||
html: 'Tiles rendered with <a href="http://www.maptiler.com/"> © USGS'
|
html: 'Tiles © USGS, rendered with ' +
|
||||||
|
'<a href="http://www.maptiler.com/">MapTiler</a>'
|
||||||
});
|
});
|
||||||
|
|
||||||
var mapMinZoom = 1;
|
var mapMinZoom = 1;
|
||||||
@@ -22,11 +23,11 @@ var map = new ol.Map({
|
|||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
}),
|
}),
|
||||||
new ol.layer.Tile({
|
new ol.layer.Tile({
|
||||||
|
extent: ol.proj.transformExtent(mapExtent, 'EPSG:4326', 'EPSG:3857'),
|
||||||
source: new ol.source.XYZ({
|
source: new ol.source.XYZ({
|
||||||
|
attributions: [attribution],
|
||||||
url: 'http://tileserver.maptiler.com/grandcanyon@2x/{z}/{x}/{y}.png',
|
url: 'http://tileserver.maptiler.com/grandcanyon@2x/{z}/{x}/{y}.png',
|
||||||
tilePixelRatio: 2, // THIS IS IMPORTANT
|
tilePixelRatio: 2, // THIS IS IMPORTANT
|
||||||
maxExtent: ol.proj.transformExtent(
|
|
||||||
mapExtent, 'EPSG:4326', 'EPSG:3857'),
|
|
||||||
minZoom: mapMinZoom,
|
minZoom: mapMinZoom,
|
||||||
maxZoom: mapMaxZoom
|
maxZoom: mapMaxZoom
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -52,6 +52,13 @@ GeoJSONCRS.prototype.properties;
|
|||||||
var GeoJSONCRSCode = function() {};
|
var GeoJSONCRSCode = function() {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
var GeoJSONCRSName = function() {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {string}
|
* @type {string}
|
||||||
* TODO: remove this when http://jira.codehaus.org/browse/GEOS-5996 is fixed
|
* TODO: remove this when http://jira.codehaus.org/browse/GEOS-5996 is fixed
|
||||||
@@ -60,13 +67,6 @@ var GeoJSONCRSCode = function() {};
|
|||||||
GeoJSONCRSName.prototype.code;
|
GeoJSONCRSName.prototype.code;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
var GeoJSONCRSName = function() {};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
|
|||||||
12
externs/jquery-1.7.js
vendored
12
externs/jquery-1.7.js
vendored
@@ -1017,17 +1017,21 @@ $.get = function(url, data, success, dataType) {};
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} url
|
* @param {string} url
|
||||||
* @param {(Object.<string,*>|function(Object,string,jQuery.jqXHR))=} data
|
* @param {(Object.<string,*>|
|
||||||
* @param {function(Object,string,jQuery.jqXHR)=} success
|
* function(Object.<string,*>,string,jQuery.jqXHR))=} data
|
||||||
|
* @param {function(Object.<string,*>,string,jQuery.jqXHR)=} success
|
||||||
* @return {jQuery.jqXHR}
|
* @return {jQuery.jqXHR}
|
||||||
|
* @see http://api.jquery.com/jquery.getjson/#jQuery-getJSON-url-data-success
|
||||||
*/
|
*/
|
||||||
jQuery.getJSON = function(url, data, success) {};
|
jQuery.getJSON = function(url, data, success) {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} url
|
* @param {string} url
|
||||||
* @param {(Object.<string,*>|function(Object,string,jQuery.jqXHR))=} data
|
* @param {(Object.<string,*>|
|
||||||
* @param {function(Object,string,jQuery.jqXHR)=} success
|
* function(Object.<string,*>,string,jQuery.jqXHR))=} data
|
||||||
|
* @param {function(Object.<string,*>,string,jQuery.jqXHR)=} success
|
||||||
* @return {jQuery.jqXHR}
|
* @return {jQuery.jqXHR}
|
||||||
|
* @see http://api.jquery.com/jquery.getjson/#jQuery-getJSON-url-data-success
|
||||||
*/
|
*/
|
||||||
$.getJSON = function(url, data, success) {};
|
$.getJSON = function(url, data, success) {};
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user