Compare commits
524 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
290b8ec1dd | ||
|
|
ff9246168b | ||
|
|
eef8ee3934 | ||
|
|
6342756105 | ||
|
|
25d28ad9e2 | ||
|
|
5613a96cc2 | ||
|
|
42d251e8cb | ||
|
|
151bed799f | ||
|
|
3436302abf | ||
|
|
b0baf72462 | ||
|
|
79916df991 | ||
|
|
015d173d9b | ||
|
|
5d37b53c02 | ||
|
|
fd092aa4dd | ||
|
|
c36d62e0d1 | ||
|
|
88d8a7ed8a | ||
|
|
6b98cb7d89 | ||
|
|
eef08827e5 | ||
|
|
1207262c72 | ||
|
|
5c5c08f5c4 | ||
|
|
c24a9c1631 | ||
|
|
4c2be99dc9 | ||
|
|
b2efa815f6 | ||
|
|
92727cc75d | ||
|
|
707e1c4069 | ||
|
|
b4520369be | ||
|
|
6bd2239e95 | ||
|
|
b4014eec64 | ||
|
|
3b01288c46 | ||
|
|
7032428f09 | ||
|
|
c7219da70e | ||
|
|
69ad616a5f | ||
|
|
b18f42a5a8 | ||
|
|
272ead2518 | ||
|
|
f7bdc420bf | ||
|
|
43b52de5d8 | ||
|
|
14d67da9fa | ||
|
|
a20fc2ef11 | ||
|
|
d29fd500e5 | ||
|
|
e1191f68ae | ||
|
|
36e4116d39 | ||
|
|
43cfcd4a81 | ||
|
|
332a694d65 | ||
|
|
76fa6bdfc6 | ||
|
|
efd85ea3d9 | ||
|
|
e09af9502a | ||
|
|
fce9791cd6 | ||
|
|
575c2c2b34 | ||
|
|
7b0a5249b7 | ||
|
|
002877ff5f | ||
|
|
4f69560cf3 | ||
|
|
e86bf54d8a | ||
|
|
d89a402375 | ||
|
|
f570105920 | ||
|
|
3011e6acda | ||
|
|
59e8dea217 | ||
|
|
ae7c7b1910 | ||
|
|
cf234cd7ca | ||
|
|
4fb99aaf28 | ||
|
|
7e09e4f2e8 | ||
|
|
d428b689ba | ||
|
|
3c0ca26b67 | ||
|
|
84ccf9d1bc | ||
|
|
5442e67518 | ||
|
|
6fb02ec055 | ||
|
|
825cd05150 | ||
|
|
9357cf380b | ||
|
|
670883701d | ||
|
|
86794c8838 | ||
|
|
c4003bab33 | ||
|
|
f5f77157c9 | ||
|
|
8e0d467ceb | ||
|
|
044c8ce74f | ||
|
|
87dc04251d | ||
|
|
0a2f47ee57 | ||
|
|
172664c55b | ||
|
|
cd90e95a4a | ||
|
|
b3f18a92d2 | ||
|
|
774ceced8b | ||
|
|
2ea8e006a3 | ||
|
|
f04b8d36f8 | ||
|
|
37363b31da | ||
|
|
44a1756229 | ||
|
|
a184e25348 | ||
|
|
6f64e97faf | ||
|
|
30ad6f1cef | ||
|
|
bd965750a9 | ||
|
|
f076544993 | ||
|
|
bb03b40075 | ||
|
|
634a2e5c0d | ||
|
|
c3203b3cb4 | ||
|
|
a82275315c | ||
|
|
12a58e5827 | ||
|
|
9895921a5c | ||
|
|
ba8b800ee0 | ||
|
|
8be9211ed6 | ||
|
|
b8983007d2 | ||
|
|
bd24ba12d5 | ||
|
|
5de7070f15 | ||
|
|
e2c901d1e5 | ||
|
|
156fda15cd | ||
|
|
425e5dac61 | ||
|
|
8f15859f9b | ||
|
|
6d29d11499 | ||
|
|
6da37d481d | ||
|
|
62015eee0b | ||
|
|
e62e27cf22 | ||
|
|
76bf76a090 | ||
|
|
e906305910 | ||
|
|
08b94a0c42 | ||
|
|
c508bde844 | ||
|
|
d4b7e34d17 | ||
|
|
d5543bd7ef | ||
|
|
354bc16ead | ||
|
|
8889235690 | ||
|
|
9b43d7f498 | ||
|
|
ef2d2dd197 | ||
|
|
1245158ba3 | ||
|
|
ef5f7acbdf | ||
|
|
e1c24ee8cf | ||
|
|
9f5ddd2381 | ||
|
|
1fbc501bef | ||
|
|
d7c69e12d6 | ||
|
|
1fa86b5e07 | ||
|
|
efed81bdeb | ||
|
|
a308eb48ac | ||
|
|
5926dd3e65 | ||
|
|
a11e620792 | ||
|
|
6850eff26c | ||
|
|
ddf94ae2ca | ||
|
|
22ed9653ec | ||
|
|
3bb8ce00c5 | ||
|
|
b9cbd97c40 | ||
|
|
6801b895e4 | ||
|
|
c0d5f4a0ca | ||
|
|
2859a18d72 | ||
|
|
869446ad13 | ||
|
|
b2fd22885e | ||
|
|
7d6c623a80 | ||
|
|
6bea801bf6 | ||
|
|
d446a3448b | ||
|
|
d006ba5361 | ||
|
|
0eb4f3752f | ||
|
|
789c280fc2 | ||
|
|
a881eec9b1 | ||
|
|
1bc1d88464 | ||
|
|
1c18221f05 | ||
|
|
f4162acf04 | ||
|
|
1138978c22 | ||
|
|
bd43baba20 | ||
|
|
2e6da74af8 | ||
|
|
f6561d2a2e | ||
|
|
45a42bb242 | ||
|
|
3043173814 | ||
|
|
cde5d898c7 | ||
|
|
58f6215c0f | ||
|
|
d7d6fa57ac | ||
|
|
57bf615ab7 | ||
|
|
9bf3161010 | ||
|
|
98a977ea72 | ||
|
|
661bc08bbf | ||
|
|
804c8c4603 | ||
|
|
e103c38e3e | ||
|
|
e3b4ff502e | ||
|
|
6116ebb348 | ||
|
|
5c3a728d05 | ||
|
|
2070145880 | ||
|
|
e9a670f274 | ||
|
|
e5c87ba06e | ||
|
|
fa992b93f5 | ||
|
|
bf67074cf3 | ||
|
|
074320d6d2 | ||
|
|
6616c22a32 | ||
|
|
1ddba0fe8f | ||
|
|
0a374bc635 | ||
|
|
8602b5780a | ||
|
|
ab32f25a7c | ||
|
|
ebfb7bd85d | ||
|
|
ed739c59f5 | ||
|
|
238a5f8f14 | ||
|
|
126c47dfd7 | ||
|
|
e8389e6887 | ||
|
|
81f526dc56 | ||
|
|
23ae072ed6 | ||
|
|
20f4fad7f3 | ||
|
|
1805e86173 | ||
|
|
8acda4fbf5 | ||
|
|
65d8bd9675 | ||
|
|
34ea0af92d | ||
|
|
2d64186a1a | ||
|
|
4604f07042 | ||
|
|
52f47bd797 | ||
|
|
50f885b5f8 | ||
|
|
742405a193 | ||
|
|
18ee0a393f | ||
|
|
29634d29b5 | ||
|
|
635d5bacdd | ||
|
|
1156976ea5 | ||
|
|
964736d60f | ||
|
|
2de19ef080 | ||
|
|
0faf3eca66 | ||
|
|
c239d8c1b7 | ||
|
|
c28aec5f59 | ||
|
|
e0efff50a8 | ||
|
|
8364ff83d1 | ||
|
|
5d7a4e0954 | ||
|
|
2785d22a3a | ||
|
|
2768f84a5f | ||
|
|
1ede5c5456 | ||
|
|
5778d0e74a | ||
|
|
6672c57f05 | ||
|
|
c1fbdb42be | ||
|
|
841b3af042 | ||
|
|
bdd08e3486 | ||
|
|
68679c6dc0 | ||
|
|
9f280a41c0 | ||
|
|
65c8d5199f | ||
|
|
2b8326f465 | ||
|
|
488b350671 | ||
|
|
5285b0c272 | ||
|
|
ebe98c8990 | ||
|
|
c30095c59d | ||
|
|
f449a0a6fb | ||
|
|
74dfa07c81 | ||
|
|
bf6b325ce8 | ||
|
|
b43dfc53e4 | ||
|
|
883ed23272 | ||
|
|
0a0c2b3ce0 | ||
|
|
c783255b97 | ||
|
|
c689ad9e67 | ||
|
|
0fabe4c738 | ||
|
|
d4a95dad19 | ||
|
|
4405b6235a | ||
|
|
766b0d9914 | ||
|
|
412cacd1c2 | ||
|
|
299592d352 | ||
|
|
d512731d06 | ||
|
|
b2a8d3040a | ||
|
|
892ea92580 | ||
|
|
f7acfd9017 | ||
|
|
701ac43746 | ||
|
|
b926310296 | ||
|
|
49d1e7bafc | ||
|
|
6f697ed6f8 | ||
|
|
cdcae29ae1 | ||
|
|
a13c4a3793 | ||
|
|
031a3bfa00 | ||
|
|
7122e1fbc5 | ||
|
|
6ed00d9a94 | ||
|
|
327d6f1466 | ||
|
|
17a135813b | ||
|
|
0dd82cb68f | ||
|
|
ae04fa83f6 | ||
|
|
4bfcdadb76 | ||
|
|
fa5a72f20d | ||
|
|
d81eb3d706 | ||
|
|
97332e3e73 | ||
|
|
e4a4857eb8 | ||
|
|
80018de754 | ||
|
|
01bb7ca074 | ||
|
|
a8f5eee505 | ||
|
|
644cf9dcb6 | ||
|
|
cb0109ba42 | ||
|
|
2fa5afec11 | ||
|
|
69ea1e414a | ||
|
|
4866abe38e | ||
|
|
4c10d5848b | ||
|
|
faed3d05a5 | ||
|
|
88a9a9ee7f | ||
|
|
3915e3343d | ||
|
|
b22c023f1a | ||
|
|
5de7c9ec38 | ||
|
|
14c485914c | ||
|
|
c20922b5f5 | ||
|
|
1294ff9fea | ||
|
|
992d9c8e66 | ||
|
|
948449b3ec | ||
|
|
0c1c06c1bb | ||
|
|
7ad3f4a0b1 | ||
|
|
c5836adc17 | ||
|
|
107a429517 | ||
|
|
2cb0a80c47 | ||
|
|
db9f83120a | ||
|
|
5facdb9888 | ||
|
|
3f3caa1912 | ||
|
|
03b9f224b2 | ||
|
|
c013465d49 | ||
|
|
c91833519e | ||
|
|
055cd54beb | ||
|
|
3eaad42903 | ||
|
|
6ab98419df | ||
|
|
a9e18a2add | ||
|
|
83aed13683 | ||
|
|
5779d10632 | ||
|
|
85e818d788 | ||
|
|
cc1d4cf6d9 | ||
|
|
0404effca3 | ||
|
|
eef1a8c779 | ||
|
|
527fc3d42d | ||
|
|
53b262f190 | ||
|
|
dcb7b0d10c | ||
|
|
e6137163b9 | ||
|
|
2cf9a4a472 | ||
|
|
55d8797f37 | ||
|
|
653c6489b9 | ||
|
|
c19e06b718 | ||
|
|
5de4c6b7ab | ||
|
|
900448f8d3 | ||
|
|
4be42dbc0f | ||
|
|
72ba3d6429 | ||
|
|
f5815203c4 | ||
|
|
0c050c7405 | ||
|
|
71bf1390f6 | ||
|
|
368cf1ff4a | ||
|
|
c526599e20 | ||
|
|
fcf7272f2e | ||
|
|
cf2bdb251b | ||
|
|
551c0231a0 | ||
|
|
70741d8f5b | ||
|
|
9209afba01 | ||
|
|
9e81473d36 | ||
|
|
ffeaf1b81c | ||
|
|
efab21f4f2 | ||
|
|
a6ce05034a | ||
|
|
634d67a206 | ||
|
|
30ae0fb48f | ||
|
|
5740290a9b | ||
|
|
149d5d9057 | ||
|
|
fe2d806d73 | ||
|
|
63ccf0dcfa | ||
|
|
5f1c3c3186 | ||
|
|
b98505c815 | ||
|
|
5979161611 | ||
|
|
d6e55edd8e | ||
|
|
431eadaa87 | ||
|
|
df82ebfaa6 | ||
|
|
b5ee7c1b46 | ||
|
|
54b7884fa3 | ||
|
|
e5bc7c7564 | ||
|
|
cf49591d4f | ||
|
|
71f94f3f79 | ||
|
|
db6be82ce2 | ||
|
|
ba65786b5a | ||
|
|
036d63c9dd | ||
|
|
07e86d24f6 | ||
|
|
2cbd92a01b | ||
|
|
ba0e737c7b | ||
|
|
45b59eb6df | ||
|
|
a7d50fa8fa | ||
|
|
2f27803fc5 | ||
|
|
71a4ba1c19 | ||
|
|
271cab1212 | ||
|
|
1051aacc7c | ||
|
|
fb8e6dab20 | ||
|
|
4e37ae26c9 | ||
|
|
905f27b2c2 | ||
|
|
9d6935cf48 | ||
|
|
6b0e521c75 | ||
|
|
c906c468f8 | ||
|
|
f7272dcdcd | ||
|
|
14283ff5cc | ||
|
|
e4608b17c3 | ||
|
|
d81c32b97c | ||
|
|
e69c5724bf | ||
|
|
da0a5673d2 | ||
|
|
4cdd2a2bfb | ||
|
|
80afa86ae4 | ||
|
|
311cc19134 | ||
|
|
9809398517 | ||
|
|
7498d58878 | ||
|
|
73e17ef4a1 | ||
|
|
bda48858ba | ||
|
|
4d35b72b25 | ||
|
|
8faa374303 | ||
|
|
573ec687ac | ||
|
|
4b685819d1 | ||
|
|
889ce83bdf | ||
|
|
30304a8ddc | ||
|
|
4b12e28f3c | ||
|
|
f92fc4b405 | ||
|
|
b5076c9cd2 | ||
|
|
5eda5b78a6 | ||
|
|
207993a6e2 | ||
|
|
4162d9b488 | ||
|
|
8bfca4917a | ||
|
|
2aedfaba34 | ||
|
|
4811abb3d3 | ||
|
|
f6e51898b7 | ||
|
|
12070cee74 | ||
|
|
6af46cf8cc | ||
|
|
5b58e5282b | ||
|
|
0e54dc715c | ||
|
|
627a316e4d | ||
|
|
2efa8808c0 | ||
|
|
b9c7d4cbb1 | ||
|
|
f348296a8c | ||
|
|
7cfbe1c115 | ||
|
|
31077cb637 | ||
|
|
8e685b7ebb | ||
|
|
ca3871eb61 | ||
|
|
ebe4095438 | ||
|
|
ec50f11e3e | ||
|
|
446d0133cf | ||
|
|
b4a98ef1a9 | ||
|
|
ba123910a4 | ||
|
|
23d65486e6 | ||
|
|
c0c8abe3a7 | ||
|
|
f599a14506 | ||
|
|
46349724a8 | ||
|
|
915cdae09c | ||
|
|
bac510370a | ||
|
|
45cf4057d1 | ||
|
|
f6f00c2521 | ||
|
|
f6af3d7410 | ||
|
|
7c2976819f | ||
|
|
eb3efa7a69 | ||
|
|
16132f7ae3 | ||
|
|
c06b2712a0 | ||
|
|
28b16a3232 | ||
|
|
0a8e56ea05 | ||
|
|
1f0b5509ed | ||
|
|
777d33a4de | ||
|
|
5887d5c6a2 | ||
|
|
a443e732f5 | ||
|
|
fc452a76e7 | ||
|
|
48a5c36c31 | ||
|
|
bab34aab2b | ||
|
|
98ab1f7100 | ||
|
|
1734f3f87a | ||
|
|
3a8e50d703 | ||
|
|
235decb041 | ||
|
|
6bbedd0f2b | ||
|
|
ce87e89b4f | ||
|
|
1af38a7306 | ||
|
|
d219632825 | ||
|
|
84d6b311ea | ||
|
|
c32652c066 | ||
|
|
11a5d841f9 | ||
|
|
25c75a009d | ||
|
|
b611b979e4 | ||
|
|
540d6c23f9 | ||
|
|
5eb27b7553 | ||
|
|
ef87bae51f | ||
|
|
8c2f788069 | ||
|
|
cae68ffec9 | ||
|
|
929d1fc78b | ||
|
|
608edc2d46 | ||
|
|
a0c7a70e00 | ||
|
|
a3cdace8d2 | ||
|
|
de2fe89ecd | ||
|
|
73b530a807 | ||
|
|
4b418b9bb9 | ||
|
|
e514e29010 | ||
|
|
8d34090eb8 | ||
|
|
93d6c1bf14 | ||
|
|
a1c45d1dc3 | ||
|
|
69421c0381 | ||
|
|
1efed2bef8 | ||
|
|
98474b187d | ||
|
|
abd08ab884 | ||
|
|
e18f3577f0 | ||
|
|
8ac26e9567 | ||
|
|
c984eae2d5 | ||
|
|
d806d6bcca | ||
|
|
a62d77583b | ||
|
|
6f4ab468a7 | ||
|
|
20352f2053 | ||
|
|
357ec99b44 | ||
|
|
0271e9df23 | ||
|
|
04a18f82e1 | ||
|
|
576d5f741d | ||
|
|
01958b7d34 | ||
|
|
41d5d21bc6 | ||
|
|
b0f155a377 | ||
|
|
a517b76e9e | ||
|
|
70dd6554c3 | ||
|
|
62132937da | ||
|
|
2784d78737 | ||
|
|
b5036f4cfd | ||
|
|
2388c352d5 | ||
|
|
09a6cf2497 | ||
|
|
e20b941eb9 | ||
|
|
1dba14ec9a | ||
|
|
e773d868f1 | ||
|
|
07afebba4e | ||
|
|
7146875c05 | ||
|
|
42627d5881 | ||
|
|
bb87c8a51b | ||
|
|
b69570aa68 | ||
|
|
699e9e37f3 | ||
|
|
63b62e3c82 | ||
|
|
6a2b2afdba | ||
|
|
292c092be3 | ||
|
|
85c604c1ee | ||
|
|
a530070ecf | ||
|
|
f853e54d77 | ||
|
|
928ece7853 | ||
|
|
9524c9d74d | ||
|
|
61318bff8a | ||
|
|
7c2d2d3759 | ||
|
|
34f4432818 | ||
|
|
596679d1f9 | ||
|
|
14c6b6fe8f | ||
|
|
e6006a0228 | ||
|
|
f44f083378 | ||
|
|
f258bae8fd | ||
|
|
47f9251c87 | ||
|
|
650a82a681 | ||
|
|
219b943d59 | ||
|
|
98717e7b46 | ||
|
|
bb924181b4 | ||
|
|
7c92d1045a | ||
|
|
e0f6afaf43 | ||
|
|
d36320967c | ||
|
|
33528a3e61 | ||
|
|
131e1a183c | ||
|
|
6fa1c5aa94 | ||
|
|
62055a1aa1 | ||
|
|
da09a62605 | ||
|
|
7a7ceb6d60 | ||
|
|
3bba870c90 | ||
|
|
272ce1d9b6 | ||
|
|
de259c27d7 | ||
|
|
74a7150cff |
32
.github/workflows/android.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
name: Android CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "master" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "master" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: set up JDK 11
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
java-version: '11'
|
||||||
|
distribution: 'temurin'
|
||||||
|
cache: gradle
|
||||||
|
|
||||||
|
- name: Grant execute permission for gradlew
|
||||||
|
run: chmod +x gradlew
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: ./gradlew build
|
||||||
|
- name: Publish
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
env:
|
||||||
|
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
|
||||||
|
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
|
||||||
|
run: ./gradlew -PSONATYPE_USERNAME="$SONATYPE_USERNAME" -PSONATYPE_PASSWORD="$SONATYPE_PASSWORD" publish
|
||||||
32
.travis.yml
@@ -1,32 +0,0 @@
|
|||||||
sudo: false
|
|
||||||
language: android
|
|
||||||
jdk:
|
|
||||||
- oraclejdk8
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- ANDROID=28
|
|
||||||
- ANDROID_BUILD_TOOLS=28.0.2
|
|
||||||
- GRADLE_OPTS="-Xmx2048m"
|
|
||||||
- secure: sW674wuFZOuoX7jHQHDbX3j8NxL8JxR07cyq+CrrqJ537dU9lxWQmMBRUpOb+p/q7sQ74PUtiKJkmFgKCSJSAKY+nr6GJ8P/q6u5TUKbmUWODSn8znehX2zualfvFwpF4PILok/wUzXBQE62jn4lUua7cMdsHRMNHbLmKqBoVL0meObDDjsaJ/RCbOPuruy3FmgvXPp0+Y4zl1GsklDSyjFzg4LBzjAk9Ryvh1O4zvJBkkyfCgurLKCnOKIPy3v5fPMS9oDfO1aarAVGoZZe416pvTW4hb8cdB6kn9XWYDob4NDFX/sP5k7XIhd/NAIn9LrKFg0sLtATaKLX+BcasF1CgDR/u6+SEeQd5QaRF7Go2Nq5Ltuu4OIFONI2qhEeVDDK6Otf2WSWj9KPno2GHuumBfbg4ypWoJgmZrMXk8JeVV/OP/0jIQz3p/7yfF21X1XBEqYaVHPAMKdEYYkCSa46KfACyOt6LfnkuCHtoTOpFo7sq0omIA2HOtpIx1u3vMBUyAbQqT6cokkKB1b6gNTFwhHc+8ybfLFPljJB8cWshI+V/b06S6fekRmvTNxvDykWNsdlkENBYqc9hMfjcT4hO4K+76SWN62mimQYODvFyfTVMC7WkQ3k/XEnmqUPV5XkbaILbS1d/tA57N148FiJ5/QXtI6Y94imubYyVqU=
|
|
||||||
- secure: AdKSZKA4gMuKXI4X4dQNJqcMv5OmPIHdN8fpy55Y9yoOQPQHZE3Zwc4QDWBh20q298jyEC854tVTPTysdZ7h+2s2FhsprYv1Bt/QNzKIrLpeIMj2quuVGMbdPuk08y55gost94KwVLJv0sIDpRlB/PEQkA7Mg/UDsT9zR8E1Ms5x+ul2C8e1ag0zzNl1wVnT5jY8WCp74uA/XXCcJl/80qT1stUERazCKwbKNo007hi7rdm4HA7YGevORq8e2r67je+WIBZUAwrHT0Zjuo4ibwUii4LdwvjuN3w0Z6e9Wf4x5bBqGgnih0T31uom2yPjNx+U/c2AWI+Nxfy/SEF2U+9bjBEZ3ZhI7F1B9ofXo2mhvvsVDiUrymMBbG2V64C9kAzeUh7xIBTqIrbdtpAEBV9FlLAtF2swVTwtCgZgcVTOt3RKXCi3X3nk3cuH7PAorFa/QGfT4xxVu2011FVAt2Rm7SD0ZWztZTSTz/4Nt/egtGBOJfrCc7oLEygLzDmLqsqCwCROITVQjWLjrtqDyLteaNiSXeNIQMKun3izApbXnHmXB+FV3R3EZocboqk3v5bmPTahnG6Ghc2zknWyyxSx+O9qIfOpHUL8JMJiT82lUQUeibtCn7DCE8wVQ/gYC5i+a+KO/d3NemSzIFlZ8aoUiEPYq18dYlsDXeLXwF0=
|
|
||||||
android:
|
|
||||||
components:
|
|
||||||
- tools
|
|
||||||
- platform-tools
|
|
||||||
- tools
|
|
||||||
- build-tools-$ANDROID_BUILD_TOOLS
|
|
||||||
- android-$ANDROID
|
|
||||||
before_install:
|
|
||||||
- yes | sdkmanager "platforms;android-$ANDROID"
|
|
||||||
script:
|
|
||||||
- ./gradlew clean build
|
|
||||||
after_success:
|
|
||||||
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
|
||||||
./gradlew uploadArchives -PSONATYPE_USERNAME="${SONATYPE_USERNAME}" -PSONATYPE_PASSWORD="${SONATYPE_PASSWORD}";
|
|
||||||
fi
|
|
||||||
notifications:
|
|
||||||
email:
|
|
||||||
recipients:
|
|
||||||
- secure: fOInp4SGBqiIMgnsGceQTa0SuFLaAoxAF15W0crhuljGlqSgnbnBjh0xFEF4P5+q3VT3DgDZs53GVVo6S9gEl8AWJy84KGuUX1M/CQKUQC4bwNXJdHfY3MIy6D50da6UfwWeNS4ienKh2Rj6w2TapN9M8C9nJJZk9aJFc9NWZmWTVboHZd4oUDeeRBJ6KSk1Ay7L/mmxv4cMCXaW7pPJixvUFESKNYgK4KAN3zYpym2UijrQ8zf7OVcYnTorcAuXUZDk8EvwdHl3rIAdlbVqvyZ8rmoQ2Da/Q2VlWUL/HrHUVJtCPZ+T+dNUag4a8joIDqWKwcyk76PElmgft3azb7GERb+bkZz1ToQc2IvuOeUk2SsuXWZugoEQImKWl/yWeirWBLrwzieaVh4j04dMSn/Npc1yL5kjX9EuiM6MFHdYPianMpvhFiaYKihjzW0GPV6sfuY7xS8cA9L9DjAsXoHIXIxc/+hRA+bpPUl+qMaQdGjJmNJJ2VPFnOY0XCsDDQDIVa3nZOA6aXMUG2c4H26RJZPe7uvfRiuL86n3KAmkoXSwne9t8WYMgl89LMsU5XxjBvwz2Qa1HqG09tVs6nhB23easrhEYEf/ZsGg0DIIL1FImUHj+wUUfZXeyFmbiE6lD/i2+3a5DqzZGHbXUDCoUIagObMf8fe2z5+0K/Q=
|
|
||||||
on_success: always
|
|
||||||
on_failure: always
|
|
||||||
46
README.md
@@ -1,16 +1,17 @@
|
|||||||
[](https://search.maven.org/search?q=g:org.mapsforge)
|
[](https://search.maven.org/search?q=g:org.mapsforge)
|
||||||
[](https://travis-ci.org/mapsforge/vtm)
|
|
||||||
[](http://www.gnu.org/licenses/lgpl-3.0)
|
[](http://www.gnu.org/licenses/lgpl-3.0)
|
||||||
|
|
||||||
# V™
|
# V™
|
||||||
|
|
||||||
VTM was developed within the [OpenScienceMap](https://github.com/opensciencemap) project.
|
<img src="docs/logo/VTM.svg" style="bottom:0;" width="200" align="right">
|
||||||
|
|
||||||
**This fork continues VTM development. And provides compatibility with latest [Mapsforge](https://github.com/mapsforge/mapsforge).**
|
VTM (Vector Tile Map) was developed within the [OpenScienceMap](https://github.com/opensciencemap) project.
|
||||||
|
|
||||||
See the **[integration guide](docs/Integration.md)** and [changelog](docs/Changelog.md). And read through [how to contribute](.github/CONTRIBUTING.md) guidelines.
|
**This fork continues VTM development and provides compatibility with [Mapsforge](https://github.com/mapsforge/mapsforge).**
|
||||||
|
|
||||||
If you have any questions or problems, don't hesitate to ask our public [mailing list](https://groups.google.com/group/mapsforge-dev) for help.
|
See the **[integration guide](docs/Integration.md)** and [changelog](docs/Changelog.md). And read through [how to contribute](docs/CONTRIBUTING.md) guidelines.
|
||||||
|
|
||||||
|
If you have any questions or problems, don't hesitate to ask the Discussions for help.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
- Java map library
|
- Java map library
|
||||||
@@ -19,7 +20,8 @@ If you have any questions or problems, don't hesitate to ask our public [mailing
|
|||||||
- Support for multiple tile sources:
|
- Support for multiple tile sources:
|
||||||
- OpenScienceMap vector tiles
|
- OpenScienceMap vector tiles
|
||||||
- Mapsforge vector maps
|
- Mapsforge vector maps
|
||||||
- Mapbox vector tiles (e.g. Mapzen, Nextzen, OpenMapTiles)
|
- MBTiles vector & raster maps
|
||||||
|
- Mapbox vector tiles (e.g. Mapilion, Mapzen, Nextzen, OpenMapTiles)
|
||||||
- GeoJSON vector tiles (e.g. Mapzen, Nextzen)
|
- GeoJSON vector tiles (e.g. Mapzen, Nextzen)
|
||||||
- Raster tiles: any quadtree-scheme tiles as texture
|
- Raster tiles: any quadtree-scheme tiles as texture
|
||||||
- Backends:
|
- Backends:
|
||||||
@@ -27,6 +29,7 @@ If you have any questions or problems, don't hesitate to ask our public [mailing
|
|||||||
- iOS (libGDX/RoboVM, [instructions](docs/ios.md))
|
- iOS (libGDX/RoboVM, [instructions](docs/ios.md))
|
||||||
- Desktop (libGDX/LWJGL, [instructions](docs/desktop.md))
|
- Desktop (libGDX/LWJGL, [instructions](docs/desktop.md))
|
||||||
- HTML5/WebGL (libGDX/GWT, [instructions](docs/web.md))
|
- HTML5/WebGL (libGDX/GWT, [instructions](docs/web.md))
|
||||||
|
- Building VTM: set `ANDROID_HOME` environment variable with the Android SDK installation directory
|
||||||
|
|
||||||
### Projects
|
### Projects
|
||||||
- **vtm** core library
|
- **vtm** core library
|
||||||
@@ -35,6 +38,8 @@ If you have any questions or problems, don't hesitate to ask our public [mailing
|
|||||||
- **vtm-gdx** common libGDX backend
|
- **vtm-gdx** common libGDX backend
|
||||||
- **vtm-android-gdx** Android libGDX backend
|
- **vtm-android-gdx** Android libGDX backend
|
||||||
- **vtm-desktop** Desktop libGDX backend
|
- **vtm-desktop** Desktop libGDX backend
|
||||||
|
- **vtm-desktop-lwjgl** Desktop LWJGL backend
|
||||||
|
- **vtm-desktop-lwjgl3** Desktop LWJGL 3 backend
|
||||||
- **vtm-playground** Desktop examples
|
- **vtm-playground** Desktop examples
|
||||||
- **vtm-ios** iOS libGDX backend
|
- **vtm-ios** iOS libGDX backend
|
||||||
- **vtm-ios-example** iOS examples
|
- **vtm-ios-example** iOS examples
|
||||||
@@ -42,8 +47,7 @@ If you have any questions or problems, don't hesitate to ask our public [mailing
|
|||||||
- **vtm-web-app** HTML5/GWT application
|
- **vtm-web-app** HTML5/GWT application
|
||||||
|
|
||||||
## WebGL Demo
|
## WebGL Demo
|
||||||
[OpenScienceMap](http://opensciencemap.org/s3db/#scale=17,rot=61,tilt=51,lat=53.075,lon=8.807) view of Bremen.
|
[OpenScienceMap](https://oscim.ogiqvo.com/vtm/#scale=17,rot=61,tilt=51,lat=53.075,lon=8.807) view of Bremen. Running [nextzen2oscimv4](https://github.com/schedul-xor/nextzen2oscimv4) server which contains OSM data in Germany. Notice: nextzen2oscimv4 server is still unstable.
|
||||||
- Hold right mouse button to change view direction.
|
|
||||||
|
|
||||||
## Applications
|
## Applications
|
||||||
- VTM is used by many [applications](docs/Applications.md).
|
- VTM is used by many [applications](docs/Applications.md).
|
||||||
@@ -59,16 +63,24 @@ This library contains code from several projects:
|
|||||||
- **osmdroid** (Apache 2.0): some overlay classes (https://github.com/osmdroid/osmdroid)
|
- **osmdroid** (Apache 2.0): some overlay classes (https://github.com/osmdroid/osmdroid)
|
||||||
- **tessellate** (SGI Free Software License B 2.0): (https://github.com/cscheid/tessellate)
|
- **tessellate** (SGI Free Software License B 2.0): (https://github.com/cscheid/tessellate)
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
VTM library is under [LGPL v3 license](http://www.gnu.org/licenses/lgpl-3.0), with an important simplification: the constraints mentioned in sections LGPL v3 §4(d) and §4(e) are waived.
|
||||||
|
|
||||||
|
This means that you are allowed to convey a Combined Work without providing the user any way to recombine or relink the application and without providing any shared library mechanism.
|
||||||
|
|
||||||
|
In other words, you are allowed to include VTM library in your Android application, without making your application open source.
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
### Android
|
| Android | iOS |
|
||||||

|
| ------------- | ------------- |
|
||||||
|
|<img src="docs/images/android.png" width="1000">|<img src="docs/images/ios.png" width="1000">|
|
||||||
|
|
||||||
### iOS
|
| Desktop |
|
||||||

|
| ------------- |
|
||||||
|
||
|
||||||
|
|
||||||
### Desktop
|
| Browser |
|
||||||

|
| ------------- |
|
||||||
|
||
|
||||||
### Browser
|
|
||||||

|
|
||||||
|
|||||||
42
build.gradle
@@ -1,23 +1,14 @@
|
|||||||
buildscript {
|
plugins {
|
||||||
repositories {
|
id 'com.android.application' version '7.4.2' apply false
|
||||||
google()
|
|
||||||
jcenter()
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
|
||||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
group = 'org.mapsforge'
|
group = 'org.mapsforge'
|
||||||
version = 'master-SNAPSHOT'
|
version = 'master-SNAPSHOT'
|
||||||
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
|
|
||||||
|
|
||||||
ext.androidBuildVersionTools = "28.0.2"
|
ext.gdxVersion = "1.11.0"
|
||||||
ext.gdxVersion = "1.9.8"
|
ext.gwtVersion = "2.8.2"
|
||||||
ext.gwtVersion = "2.8.0"
|
ext.slf4jVersion = "1.7.28"
|
||||||
ext.slf4jVersion = "1.7.25"
|
|
||||||
|
|
||||||
if (JavaVersion.current().isJava8Compatible()) {
|
if (JavaVersion.current().isJava8Compatible()) {
|
||||||
tasks.withType(Javadoc) {
|
tasks.withType(Javadoc) {
|
||||||
@@ -28,28 +19,29 @@ allprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static def androidCompileSdk() { return 28 }
|
static def androidCompileSdk() { return 33 }
|
||||||
|
|
||||||
// 14 for Support Library, 16 for sqlite-android
|
// 14 for Support Library, 16 for sqlite-android
|
||||||
static def androidMinSdk() { return 16 }
|
static def androidMinSdk() { return 21 }
|
||||||
|
|
||||||
static def androidTargetSdk() { return 22 }
|
static def androidTargetSdk() { return 33 }
|
||||||
|
|
||||||
static def versionCode() { return 1 }
|
static def versionCode() { return 1 }
|
||||||
|
|
||||||
def versionName() { return version }
|
def versionName() { return version }
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
maven { url 'https://repo.boundlessgeo.com/main/' }
|
|
||||||
jcenter()
|
|
||||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
||||||
maven { url 'https://jitpack.io' }
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_7
|
sourceCompatibility = JavaVersion.VERSION_1_7
|
||||||
targetCompatibility = JavaVersion.VERSION_1_7
|
targetCompatibility = JavaVersion.VERSION_1_7
|
||||||
|
options.encoding = 'UTF-8'
|
||||||
|
if (JavaVersion.current().isJava9Compatible()) {
|
||||||
|
if (!project.properties.containsKey('android')) {
|
||||||
|
if (project.name == 'vtm-desktop-lwjgl3' || project.name == 'vtm-playground' || project.name == 'vtm-theme-comparator')
|
||||||
|
options.compilerArgs.addAll(['--release', '8'])
|
||||||
|
else
|
||||||
|
options.compilerArgs.addAll(['--release', '7'])
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
110
deploy.gradle
@@ -1,83 +1,63 @@
|
|||||||
apply plugin: 'signing'
|
apply plugin: 'signing'
|
||||||
|
|
||||||
if (project.hasProperty("android")) {
|
java {
|
||||||
task sourcesJar(type: Jar) {
|
withJavadocJar()
|
||||||
classifier = 'sources'
|
withSourcesJar()
|
||||||
from android.sourceSets.main.java.srcDirs
|
|
||||||
}
|
|
||||||
|
|
||||||
task javadoc(type: Javadoc) {
|
|
||||||
source = android.sourceSets.main.java.srcDirs
|
|
||||||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
task sourcesJar(type: Jar) {
|
|
||||||
classifier = 'sources'
|
|
||||||
from sourceSets.main.allSource
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
publishing {
|
||||||
classifier = 'javadoc'
|
publications {
|
||||||
from javadoc.destinationDir
|
maven(MavenPublication) {
|
||||||
}
|
pom {
|
||||||
|
name = 'VTM'
|
||||||
artifacts {
|
description = 'OpenGL vector map library - running on Android, iOS, Desktop and browser.'
|
||||||
archives javadocJar
|
url = 'https://github.com/mapsforge/vtm'
|
||||||
archives sourcesJar
|
|
||||||
}
|
|
||||||
|
|
||||||
signing {
|
|
||||||
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
|
|
||||||
sign configurations.archives
|
|
||||||
}
|
|
||||||
|
|
||||||
uploadArchives {
|
|
||||||
repositories {
|
|
||||||
mavenDeployer {
|
|
||||||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
|
||||||
|
|
||||||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
|
|
||||||
authentication(userName: SONATYPE_USERNAME, password: SONATYPE_PASSWORD)
|
|
||||||
}
|
|
||||||
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
|
|
||||||
authentication(userName: SONATYPE_USERNAME, password: SONATYPE_PASSWORD)
|
|
||||||
}
|
|
||||||
|
|
||||||
pom.project {
|
|
||||||
packaging 'jar'
|
|
||||||
|
|
||||||
name 'vtm'
|
|
||||||
description 'OpenGL vector map library written in Java - running on Android, iOS, Desktop and within the browser.'
|
|
||||||
url 'https://github.com/mapsforge/vtm'
|
|
||||||
|
|
||||||
licenses {
|
licenses {
|
||||||
license {
|
license {
|
||||||
name 'GNU Lesser GPL'
|
name = 'GNU Lesser GPL'
|
||||||
url 'http://www.gnu.org/licenses/lgpl.html'
|
url = 'https://www.gnu.org/licenses/lgpl.html'
|
||||||
distribution 'repo'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scm {
|
|
||||||
connection 'scm:git:https://github.com/mapsforge/vtm'
|
|
||||||
developerConnection 'scm:git:https://github.com/mapsforge/vtm'
|
|
||||||
url 'https://github.com/mapsforge/vtm'
|
|
||||||
}
|
|
||||||
|
|
||||||
developers {
|
developers {
|
||||||
developer {
|
developer {
|
||||||
id 'hannes.janetzek'
|
id = 'hannes.janetzek'
|
||||||
name 'Hannes Janetzek'
|
name = 'Hannes Janetzek'
|
||||||
email 'hannes.janetzek@gmail.com'
|
email = 'hannes.janetzek@gmail.com'
|
||||||
}
|
}
|
||||||
developer {
|
developer {
|
||||||
id 'devemux86'
|
id = 'devemux86'
|
||||||
name 'Emux'
|
name = 'Emux'
|
||||||
email 'devemux86@gmail.com'
|
email = 'devemux86@gmail.com'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
scm {
|
||||||
|
connection = 'scm:git:https://github.com/mapsforge/vtm'
|
||||||
|
developerConnection = 'scm:git:https://github.com/mapsforge/vtm'
|
||||||
|
url = 'https://github.com/mapsforge/vtm'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
|
||||||
|
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
|
||||||
|
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
||||||
|
credentials {
|
||||||
|
username = SONATYPE_USERNAME
|
||||||
|
password = SONATYPE_PASSWORD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signing {
|
||||||
|
required { !version.endsWith('SNAPSHOT') }
|
||||||
|
sign publishing.publications.maven
|
||||||
|
}
|
||||||
|
|
||||||
|
javadoc {
|
||||||
|
if (JavaVersion.current().isJava9Compatible()) {
|
||||||
|
options.addBooleanOption('html5', true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,18 +3,22 @@
|
|||||||
|**Name**|**Type**|**License/Cost**|**Platforms**|**Sources**|
|
|**Name**|**Type**|**License/Cost**|**Platforms**|**Sources**|
|
||||||
|--------|--------|----------------|-------------|-----------|
|
|--------|--------|----------------|-------------|-----------|
|
||||||
| [AdvRider WD](https://play.google.com/store/apps/details?id=com.abware.watchdog_client) | Tool-set for the adventure rider | Proprietary/Free | Android | Closed |
|
| [AdvRider WD](https://play.google.com/store/apps/details?id=com.abware.watchdog_client) | Tool-set for the adventure rider | Proprietary/Free | Android | Closed |
|
||||||
| [Cachebox 3.0](https://github.com/Longri/cachebox3.0) | Geocaching application | Apache 2.0/Free | Android, Desktop, iOS | Open |
|
| [Cachebox 3.0](https://github.com/Longri/cachebox3.0) | Geocaching application | Apache 2.0/Free | Android, iOS, Desktop | Open |
|
||||||
| [Cruiser](http://wiki.openstreetmap.org/wiki/Cruiser) | Map and navigation application | Proprietary/Free | Android, Desktop | Closed |
|
| [Cartograph Maps 3](https://www.cartograph.eu) | Map viewing and track recording | Proprietary/Free (in-app purchases) | Android, iOS, Desktop | Closed |
|
||||||
|
| [Cruiser](https://wiki.openstreetmap.org/wiki/Cruiser) | Map and navigation platform | Proprietary/Free | Android, Desktop | Closed |
|
||||||
| [GCDroid](https://play.google.com/store/apps/details?id=com.gcdroid) | Geocaching App | Proprietary/Free and Commercial | Android | Closed |
|
| [GCDroid](https://play.google.com/store/apps/details?id=com.gcdroid) | Geocaching App | Proprietary/Free and Commercial | Android | Closed |
|
||||||
|
| [GPSLogger II](https://play.google.com/store/apps/details?id=com.emacberry.gpslogger) | Map and navigation, Fitness & Cycling application | Proprietary/Free | Android | Closed |
|
||||||
|
| [HabanaTrans](https://play.google.com/store/apps/details?id=cu.pabloapk.habanatrans&hl=es_419) | Public transport, map offline, gps, routing | Proprietary/Free | Android | Closed |
|
||||||
| [Hunt Cyprus](https://play.google.com/store/apps/developer?id=Talent+S.A.) | Map and navigation application for hunters | Proprietary/Free and Commercial | Android | Closed |
|
| [Hunt Cyprus](https://play.google.com/store/apps/developer?id=Talent+S.A.) | Map and navigation application for hunters | Proprietary/Free and Commercial | Android | Closed |
|
||||||
| [Kurviger](https://kurviger.de/en) | Route planner specialized on motorcyclists | Proprietary/Free and Commercial | Android | Closed |
|
| [Kurviger](https://play.google.com/store/apps/details?id=gr.talent.kurviger) | Route planner specialized on motorcyclists | Proprietary/Free (in-app purchases) | Android | Closed |
|
||||||
| [MapTrek](http://maptrek.mobi) | Application for outdoor activities | GPL3/Free and Commercial | Android | Open |
|
| [MyRunningApp](https://play.google.com/store/apps/details?id=it.nimarsolutions.rungpstracker) | Fitness app | Proprietary/Free | Android | Closed |
|
||||||
| [MyTourbook](http://mytourbook.sourceforge.net/mytourbook/) | Visualize and analyze tours | GPL2/Free | Desktop | Open |
|
| [MyTourbook](http://mytourbook.sourceforge.net/mytourbook/) | Visualize and analyze tours | GPL2/Free | Desktop | Open |
|
||||||
| [Navi Cyprus](https://play.google.com/store/apps/developer?id=Talent+S.A.) | Map and navigation application | Proprietary/Free and Commercial | Android | Closed |
|
| [Navi Cyprus](https://play.google.com/store/apps/developer?id=Talent+S.A.) | Map and navigation application | Proprietary/Free and Commercial | Android | Closed |
|
||||||
|
| [Pocket Maps](https://github.com/junjunguo/PocketMaps) | Offline maps, routing & tracking functions | MIT/Free | Android | Open |
|
||||||
| Tokyo Ogiqvo | Visualize App | Commercial | [Android](https://play.google.com/store/apps/details?id=com.ogiqvo.view.tokyo&hl=ja), [iOS](https://itunes.apple.com/us/app/tokyo-ogiqvo/id1097100677?mt=8) | Closed |
|
| Tokyo Ogiqvo | Visualize App | Commercial | [Android](https://play.google.com/store/apps/details?id=com.ogiqvo.view.tokyo&hl=ja), [iOS](https://itunes.apple.com/us/app/tokyo-ogiqvo/id1097100677?mt=8) | Closed |
|
||||||
| [topoGuide](http://www.topoguide.gr/index-en.php) | Digital guides for the outdoor | Proprietary/Free and Commercial | Android | Closed |
|
| [topoGuide](http://www.topoguide.gr/index-en.php) | Digital guides for the outdoor | Proprietary/Free and Commercial | Android | Closed |
|
||||||
|
| [Trekarta](https://github.com/andreynovikov/trekarta) | Application for outdoor activities | GPL3/Free and Commercial | Android | Open |
|
||||||
| [Ubitrek](https://play.google.com/store/apps/details?id=ubicarta.ubitrek) | Hiking with IGN maps | Proprietary/Free | Android | Closed |
|
| [Ubitrek](https://play.google.com/store/apps/details?id=ubicarta.ubitrek) | Hiking with IGN maps | Proprietary/Free | Android | Closed |
|
||||||
| [VTM with Eclipse RCP](https://github.com/wolfgang-ch/vtm-with-rcp) | VTM with an Eclipse RCP application | GPL3/Free | Desktop | Open |
|
| [VTM with Eclipse RCP](https://github.com/wolfgang-ch/vtm-with-rcp) | VTM with an Eclipse RCP application | GPL3/Free | Desktop | Open |
|
||||||
|
| [Walkaholic](https://play.google.com/store/apps/details?id=com.walkaholic.hikeapp) | Hiking app with official routes and online/offline maps | Proprietary/Free (in-app purchases) | Android | Closed |
|
||||||
| [XCTrack](http://xctrack.org/) | Flight computer for paraglider pilots | Proprietary/Free | Android | Closed |
|
| [XCTrack](http://xctrack.org/) | Flight computer for paraglider pilots | Proprietary/Free | Android | Closed |
|
||||||
|
|
||||||
You know an application that is missing here? Please inform us by sending a message via our public [mailing list](https://groups.google.com/group/mapsforge-dev).
|
|
||||||
|
|||||||
@@ -2,14 +2,12 @@
|
|||||||
|
|
||||||
As an open source project, we welcome new contributors and appreciate your help.
|
As an open source project, we welcome new contributors and appreciate your help.
|
||||||
|
|
||||||
Before you start working on an unresolved issue or try to implement a new feature, please contact us via our public [mailing list](https://groups.google.com/group/mapsforge-dev).
|
Before you start working on an unresolved issue or try to implement a new feature, please contact us via the Discussions. We will then discuss the best way to realize your proposal and figure out how we can help you to get started quickly.
|
||||||
|
|
||||||
You may also create a new issue on [Github](https://github.com/mapsforge/vtm/issues) or comment on an existing one to describe your ideas. We will then discuss the best way to realize your proposal and figure out how we can help you to get started quickly.
|
|
||||||
|
|
||||||
If you are only requesting a small change in the code, you may attach a patch file to the corresponding issue, but it is best to create a pull request on Github. Make sure that your patch is derived from the latest version in our **master** repository, otherwise we might be unable to apply it. Important is to keep pull requests simple with one feature in each. Please follow our code and style conventions.
|
If you are only requesting a small change in the code, you may attach a patch file to the corresponding issue, but it is best to create a pull request on Github. Make sure that your patch is derived from the latest version in our **master** repository, otherwise we might be unable to apply it. Important is to keep pull requests simple with one feature in each. Please follow our code and style conventions.
|
||||||
|
|
||||||
Also please keep the pull request commits squashed, in order to avoid the clutter in repository and have only the finally changed files together. One way is described [here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html).
|
Also please keep the pull request commits squashed, in order to avoid the clutter in repository and have only the finally changed files together. One way is described [here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html).
|
||||||
|
|
||||||
Regarding syntax make sure your IDE uses for indentation 4 spaces (no tabs) and follow the conventions you already see in the code.
|
Regarding code make sure your IDE uses UTF-8 encoding, for indentation 4 spaces (no tabs) and follow the conventions you already see in the code.
|
||||||
|
|
||||||
Please note that the VTM project is licenced under the [GNU LGPL3 licence](http://www.gnu.org/licenses/lgpl.html). Thus, all your contributions are going to be published under this license.
|
Please note that the VTM project is licenced under the [GNU LGPL3 licence](http://www.gnu.org/licenses/lgpl.html). Thus, all your contributions are going to be published under this license.
|
||||||
@@ -1,5 +1,137 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## New since 0.19.0
|
||||||
|
|
||||||
|
- Minor improvements and bug fixes
|
||||||
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.20.0)
|
||||||
|
|
||||||
|
## Version 0.19.0 (2023-04-26)
|
||||||
|
|
||||||
|
- Render themes: line texture improvements [#1008](https://github.com/mapsforge/vtm/pull/1008)
|
||||||
|
- Biker map theme [#995](https://github.com/mapsforge/vtm/pull/995)
|
||||||
|
- MVT simplification [#956](https://github.com/mapsforge/vtm/pull/956)
|
||||||
|
- `Parameters.SIMPLIFICATION_TOLERANCE`, `Parameters.SIMPLIFICATION_EXCEPTIONS`
|
||||||
|
- libGDX 1.11.0 [#972](https://github.com/mapsforge/vtm/pull/972) [#977](https://github.com/mapsforge/vtm/pull/977)
|
||||||
|
- Disable `vtm-jeo` [#997](https://github.com/mapsforge/vtm/pull/997)
|
||||||
|
- Minor improvements and bug fixes
|
||||||
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.19.0)
|
||||||
|
|
||||||
|
## Version 0.18.0 (2022-06-18)
|
||||||
|
|
||||||
|
- Mapsforge: deduplicate maps [#903](https://github.com/mapsforge/vtm/pull/903)
|
||||||
|
- Fix overlapping map regions [#903](https://github.com/mapsforge/vtm/pull/903) [#905](https://github.com/mapsforge/vtm/pull/905)
|
||||||
|
- Fix `vtm-jni64.dll` [#911](https://github.com/mapsforge/vtm/pull/911)
|
||||||
|
- Mapsforge: simplification exceptions [#906](https://github.com/mapsforge/vtm/pull/906)
|
||||||
|
- `Parameters.SIMPLIFICATION_EXCEPTIONS`
|
||||||
|
- Minor improvements and bug fixes
|
||||||
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.18.0)
|
||||||
|
|
||||||
|
## Version 0.17.0 (2022-01-03)
|
||||||
|
|
||||||
|
- Drawable style point reduction option [#862](https://github.com/mapsforge/vtm/pull/862)
|
||||||
|
- Drawable style texture repeat option [#862](https://github.com/mapsforge/vtm/pull/862)
|
||||||
|
- Draggable marker Android sample [#869](https://github.com/mapsforge/vtm/pull/869)
|
||||||
|
- Move cluster experiment in samples [#858](https://github.com/mapsforge/vtm/pull/858)
|
||||||
|
- Minor improvements and bug fixes
|
||||||
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.17.0)
|
||||||
|
|
||||||
|
## Version 0.16.0 (2021-05-27)
|
||||||
|
|
||||||
|
- Android: scoped storage map / theme example [#804](https://github.com/mapsforge/vtm/pull/804)
|
||||||
|
- Render theme from zip archive [#804](https://github.com/mapsforge/vtm/pull/804)
|
||||||
|
- Render themes: custom resource providers [#804](https://github.com/mapsforge/vtm/pull/804)
|
||||||
|
- Nautical unit adapter with feet [#803](https://github.com/mapsforge/vtm/pull/803)
|
||||||
|
- Distant labels rendering option [#844](https://github.com/mapsforge/vtm/pull/844)
|
||||||
|
- `Parameters.DISTANT_LABELS`
|
||||||
|
- Minor improvements and bug fixes
|
||||||
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.16.0)
|
||||||
|
|
||||||
|
## Version 0.15.0 (2021-01-01)
|
||||||
|
|
||||||
|
- Android: scoped storage map example [#785](https://github.com/mapsforge/vtm/pull/785)
|
||||||
|
- Mapsforge: map stream support [#784](https://github.com/mapsforge/vtm/pull/784)
|
||||||
|
- Render theme from Android content providers [#783](https://github.com/mapsforge/vtm/pull/783)
|
||||||
|
- Render theme xml pull parser [#786](https://github.com/mapsforge/vtm/pull/786)
|
||||||
|
- Symbol scale option [#790](https://github.com/mapsforge/vtm/pull/790)
|
||||||
|
- `Parameters.SYMBOL_SCALING`
|
||||||
|
- Minor improvements and bug fixes
|
||||||
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.15.0)
|
||||||
|
|
||||||
|
## Version 0.14.0 (2020-08-25)
|
||||||
|
|
||||||
|
- Render themes: symbol styles [#769](https://github.com/mapsforge/vtm/pull/769)
|
||||||
|
- More mutable itemized layer [#771](https://github.com/mapsforge/vtm/pull/771)
|
||||||
|
- Marker renderer sort option
|
||||||
|
- `Parameters.MARKER_SORT`
|
||||||
|
- Update vtm-jeo module [#770](https://github.com/mapsforge/vtm/pull/770)
|
||||||
|
- Minor improvements and bug fixes
|
||||||
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.14.0)
|
||||||
|
|
||||||
|
## Version 0.13.0 (2020-01-12)
|
||||||
|
|
||||||
|
- Render themes: symbols on lines with billboard / rotation [#743](https://github.com/mapsforge/vtm/pull/743)
|
||||||
|
- Location texture renderer: rewrite and optimize [#750](https://github.com/mapsforge/vtm/pull/750)
|
||||||
|
- Fix stroke cap line ending [#758](https://github.com/mapsforge/vtm/pull/758)
|
||||||
|
- Mapsforge: fix ways precision loss [#752](https://github.com/mapsforge/vtm/pull/752)
|
||||||
|
- Mapsforge: additional simplification [#757](https://github.com/mapsforge/vtm/pull/757)
|
||||||
|
- `Parameters.SIMPLIFICATION_TOLERANCE`
|
||||||
|
- Android: OpenGL ES 2.0 default for performance / stability [#749](https://github.com/mapsforge/vtm/pull/749)
|
||||||
|
- `MapView.OPENGL_VERSION`
|
||||||
|
- Android: threaded system initialization
|
||||||
|
- `Parameters.THREADED_INIT`
|
||||||
|
- Minor improvements and bug fixes
|
||||||
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.13.0)
|
||||||
|
|
||||||
|
## Version 0.12.0 (2019-09-17)
|
||||||
|
|
||||||
|
- MBTiles vector tile source (Android) [#740](https://github.com/mapsforge/vtm/pull/740)
|
||||||
|
- vtm-android-mvt module
|
||||||
|
- Render themes: text background color [#737](https://github.com/mapsforge/vtm/pull/737)
|
||||||
|
- vtm-desktop-lwjgl module [#714](https://github.com/mapsforge/vtm/pull/714)
|
||||||
|
- vtm-desktop-lwjgl3 module [#717](https://github.com/mapsforge/vtm/pull/717)
|
||||||
|
- Fix marker touch events [#723](https://github.com/mapsforge/vtm/issues/723)
|
||||||
|
- Calculation of centroids for all polygons [#734](https://github.com/mapsforge/vtm/pull/734)
|
||||||
|
- `Parameters.POLY_CENTROID`
|
||||||
|
- Disable optimal placement of labels or symbols on polygons
|
||||||
|
- `Parameters.POLY_LABEL`
|
||||||
|
- Android 10 compatibility [#728](https://github.com/mapsforge/vtm/issues/728)
|
||||||
|
- libGDX 1.9.10 [#731](https://github.com/mapsforge/vtm/issues/731)
|
||||||
|
- Minor improvements and bug fixes
|
||||||
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.12.0)
|
||||||
|
|
||||||
|
## Version 0.11.1 (2019-04-12)
|
||||||
|
|
||||||
|
- MBTiles raster tile source (Android) [#708](https://github.com/mapsforge/vtm/pull/708)
|
||||||
|
- Fix Android 4.2 crash [#713](https://github.com/mapsforge/vtm/issues/713)
|
||||||
|
- Minor improvements and bug fixes
|
||||||
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.11.1)
|
||||||
|
|
||||||
|
## Version 0.11.0 (2019-03-25)
|
||||||
|
|
||||||
|
- Render themes: tag transform [#420](https://github.com/mapsforge/vtm/issues/420)
|
||||||
|
- Render themes: PNG scaling [#595](https://github.com/mapsforge/vtm/issues/595)
|
||||||
|
- Building shadows [#575](https://github.com/mapsforge/vtm/issues/575)
|
||||||
|
- Map scaling improvements [#401](https://github.com/mapsforge/vtm/issues/401)
|
||||||
|
- PathLayer(s) scaled width [#594](https://github.com/mapsforge/vtm/issues/594)
|
||||||
|
- Mapilion MVT vector tiles & Hillshading [#614](https://github.com/mapsforge/vtm/issues/614)
|
||||||
|
- Overpass tile source [#663](https://github.com/mapsforge/vtm/issues/663)
|
||||||
|
- vtm-gdx-poi3d module [#600](https://github.com/mapsforge/vtm/pull/600)
|
||||||
|
- vtm-models module [#580](https://github.com/mapsforge/vtm/issues/580)
|
||||||
|
- `ViewController` refactor [#625](https://github.com/mapsforge/vtm/pull/625)
|
||||||
|
- `getMapViewCenter`, `setMapViewCenter` with pivotX, pivotY
|
||||||
|
- `ThemeCallback.getColor` refactor [#274](https://github.com/mapsforge/vtm/issues/274)
|
||||||
|
- Enable physical fling and fling on rotation / scale
|
||||||
|
- `Parameters.ANIMATOR2`
|
||||||
|
- Enable optimal placement of labels or symbols on polygons
|
||||||
|
- `Parameters.POLY_LABEL`
|
||||||
|
- Enable placement of symbols on polygons
|
||||||
|
- `Parameters.POLY_SYMBOL`
|
||||||
|
- OpenGL ES 3.0 support [#646](https://github.com/mapsforge/vtm/issues/646)
|
||||||
|
- OpenGL ES 2.0 complete [#642](https://github.com/mapsforge/vtm/pull/642)
|
||||||
|
- libGDX 1.9.9 [#635](https://github.com/mapsforge/vtm/issues/635)
|
||||||
|
- Minor improvements and bug fixes
|
||||||
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.11.0)
|
||||||
|
|
||||||
## Version 0.10.0 (2018-08-28)
|
## Version 0.10.0 (2018-08-28)
|
||||||
|
|
||||||
- Map overzoom [#393](https://github.com/mapsforge/vtm/issues/393)
|
- Map overzoom [#393](https://github.com/mapsforge/vtm/issues/393)
|
||||||
@@ -15,11 +147,11 @@
|
|||||||
- Internal render themes improvements [#488](https://github.com/mapsforge/vtm/pull/488)
|
- Internal render themes improvements [#488](https://github.com/mapsforge/vtm/pull/488)
|
||||||
- Map view roll [#474](https://github.com/mapsforge/vtm/pull/474)
|
- Map view roll [#474](https://github.com/mapsforge/vtm/pull/474)
|
||||||
- Physical fling and fling on rotation / scale [#497](https://github.com/mapsforge/vtm/pull/497) [#499](https://github.com/mapsforge/vtm/pull/499)
|
- Physical fling and fling on rotation / scale [#497](https://github.com/mapsforge/vtm/pull/497) [#499](https://github.com/mapsforge/vtm/pull/499)
|
||||||
- `Parameters.ANIMATOR2 = true;`
|
- `Parameters.ANIMATOR2`
|
||||||
- Scale factor for short vertices calculation [#537](https://github.com/mapsforge/vtm/issues/537)
|
- Scale factor for short vertices calculation [#537](https://github.com/mapsforge/vtm/issues/537)
|
||||||
- `Parameters.CUSTOM_COORD_SCALE = false;`
|
- `Parameters.CUSTOM_COORD_SCALE`
|
||||||
- Polygon symbols default disabled [#405](https://github.com/mapsforge/vtm/issues/405)
|
- Polygon symbols default disabled [#405](https://github.com/mapsforge/vtm/issues/405)
|
||||||
- `Parameters.POLY_SYMBOL = true;`
|
- `Parameters.POLY_SYMBOL`
|
||||||
- Map fractional zoom [#487](https://github.com/mapsforge/vtm/issues/487)
|
- Map fractional zoom [#487](https://github.com/mapsforge/vtm/issues/487)
|
||||||
- Render theme fallback internal resources [#477](https://github.com/mapsforge/vtm/issues/477)
|
- Render theme fallback internal resources [#477](https://github.com/mapsforge/vtm/issues/477)
|
||||||
- Fix layers synchronization [#507](https://github.com/mapsforge/vtm/issues/507)
|
- Fix layers synchronization [#507](https://github.com/mapsforge/vtm/issues/507)
|
||||||
@@ -33,7 +165,7 @@
|
|||||||
- Android 9 compatibility [#550](https://github.com/mapsforge/vtm/issues/550)
|
- Android 9 compatibility [#550](https://github.com/mapsforge/vtm/issues/550)
|
||||||
- JTS (LocationTech) [#484](https://github.com/mapsforge/vtm/issues/484)
|
- JTS (LocationTech) [#484](https://github.com/mapsforge/vtm/issues/484)
|
||||||
- SVG Salamander (JitPack) [#560](https://github.com/mapsforge/vtm/issues/560)
|
- SVG Salamander (JitPack) [#560](https://github.com/mapsforge/vtm/issues/560)
|
||||||
- Many other minor improvements and bug fixes
|
- Minor improvements and bug fixes
|
||||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.10.0)
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.10.0)
|
||||||
|
|
||||||
## Version 0.9.2 (2018-01-04)
|
## Version 0.9.2 (2018-01-04)
|
||||||
@@ -46,7 +178,7 @@
|
|||||||
|
|
||||||
- LwHttp engine fix http headers [#460](https://github.com/mapsforge/vtm/issues/460)
|
- LwHttp engine fix http headers [#460](https://github.com/mapsforge/vtm/issues/460)
|
||||||
- S3DBLayer renamed to S3DBTileLayer [#452](https://github.com/mapsforge/vtm/issues/452)
|
- S3DBLayer renamed to S3DBTileLayer [#452](https://github.com/mapsforge/vtm/issues/452)
|
||||||
- Many other minor improvements and bug fixes
|
- Minor improvements and bug fixes
|
||||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.9.1)
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.9.1)
|
||||||
|
|
||||||
## Version 0.9.0 (2017-12-03)
|
## Version 0.9.0 (2017-12-03)
|
||||||
@@ -68,26 +200,26 @@
|
|||||||
- BuildingLayer expects height tags in meters
|
- BuildingLayer expects height tags in meters
|
||||||
- Polygon symbol positioning [#405](https://github.com/mapsforge/vtm/issues/405)
|
- Polygon symbol positioning [#405](https://github.com/mapsforge/vtm/issues/405)
|
||||||
- PolyLabel default disabled [#402](https://github.com/mapsforge/vtm/issues/402)
|
- PolyLabel default disabled [#402](https://github.com/mapsforge/vtm/issues/402)
|
||||||
- `Parameters.POLY_LABEL = true;`
|
- `Parameters.POLY_LABEL`
|
||||||
- vtm-theme-comparator module [#387](https://github.com/mapsforge/vtm/issues/387)
|
- vtm-theme-comparator module [#387](https://github.com/mapsforge/vtm/issues/387)
|
||||||
- Feature parameters [#403](https://github.com/mapsforge/vtm/issues/403)
|
- Feature parameters [#403](https://github.com/mapsforge/vtm/issues/403)
|
||||||
- vtm-android-gdx module enhancements [#435](https://github.com/mapsforge/vtm/issues/435)
|
- vtm-android-gdx module enhancements [#435](https://github.com/mapsforge/vtm/issues/435)
|
||||||
- Gradle 4 / Android plugin 3 support [#433](https://github.com/mapsforge/vtm/issues/433)
|
- Gradle 4 / Android plugin 3 support [#433](https://github.com/mapsforge/vtm/issues/433)
|
||||||
- libGDX 1.9.7 [#434](https://github.com/mapsforge/vtm/issues/434)
|
- libGDX 1.9.7 [#434](https://github.com/mapsforge/vtm/issues/434)
|
||||||
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
|
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
|
||||||
- Many other minor improvements and bug fixes
|
- Minor improvements and bug fixes
|
||||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.9.0)
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.9.0)
|
||||||
|
|
||||||
## Version 0.8.0 (2017-07-19)
|
## Version 0.8.0 (2017-07-19)
|
||||||
|
|
||||||
- Real time (SVG) texture atlas [#63](https://github.com/mapsforge/vtm/issues/63)
|
- Real time (SVG) texture atlas [#63](https://github.com/mapsforge/vtm/issues/63)
|
||||||
- `Parameters.TEXTURE_ATLAS = true;`
|
- `Parameters.TEXTURE_ATLAS`
|
||||||
- Marker clustering [#312](https://github.com/mapsforge/vtm/issues/312)
|
- Marker clustering [#312](https://github.com/mapsforge/vtm/issues/312)
|
||||||
- Osmagray theme [#300](https://github.com/mapsforge/vtm/issues/300)
|
- Osmagray theme [#300](https://github.com/mapsforge/vtm/issues/300)
|
||||||
- Symbol rotation [#294](https://github.com/mapsforge/vtm/issues/294)
|
- Symbol rotation [#294](https://github.com/mapsforge/vtm/issues/294)
|
||||||
- Location renderer improvements [#317](https://github.com/mapsforge/vtm/issues/317)
|
- Location renderer improvements [#317](https://github.com/mapsforge/vtm/issues/317)
|
||||||
- POT textures [#334](https://github.com/mapsforge/vtm/issues/334)
|
- POT textures [#334](https://github.com/mapsforge/vtm/issues/334)
|
||||||
- `Parameters.POT_TEXTURES = true;`
|
- `Parameters.POT_TEXTURES`
|
||||||
- OkHttp external cache [#135](https://github.com/mapsforge/vtm/issues/135)
|
- OkHttp external cache [#135](https://github.com/mapsforge/vtm/issues/135)
|
||||||
- Texture atlas improvements [#301](https://github.com/mapsforge/vtm/pull/301) [#304](https://github.com/mapsforge/vtm/pull/304)
|
- Texture atlas improvements [#301](https://github.com/mapsforge/vtm/pull/301) [#304](https://github.com/mapsforge/vtm/pull/304)
|
||||||
- vtm-json module [#367](https://github.com/mapsforge/vtm/issues/367)
|
- vtm-json module [#367](https://github.com/mapsforge/vtm/issues/367)
|
||||||
@@ -101,14 +233,14 @@
|
|||||||
- Gretty plugin at web modules [#338](https://github.com/mapsforge/vtm/issues/338)
|
- Gretty plugin at web modules [#338](https://github.com/mapsforge/vtm/issues/338)
|
||||||
- libGDX 1.9.6 [#333](https://github.com/mapsforge/vtm/issues/333)
|
- libGDX 1.9.6 [#333](https://github.com/mapsforge/vtm/issues/333)
|
||||||
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
|
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
|
||||||
- Many other minor improvements and bug fixes
|
- Minor improvements and bug fixes
|
||||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.8.0)
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.8.0)
|
||||||
|
|
||||||
## Version 0.7.0 (2017-02-26)
|
## Version 0.7.0 (2017-02-26)
|
||||||
|
|
||||||
- Mapsforge multiple map files [#208](https://github.com/mapsforge/vtm/issues/208)
|
- Mapsforge multiple map files [#208](https://github.com/mapsforge/vtm/issues/208)
|
||||||
- New gestures implementation [#253](https://github.com/mapsforge/vtm/issues/253)
|
- New gestures implementation [#253](https://github.com/mapsforge/vtm/issues/253)
|
||||||
- `Parameters.MAP_EVENT_LAYER2 = true;`
|
- `Parameters.MAP_EVENT_LAYER2`
|
||||||
- Polygon label position enhancements [#80](https://github.com/mapsforge/vtm/issues/80)
|
- Polygon label position enhancements [#80](https://github.com/mapsforge/vtm/issues/80)
|
||||||
- vtm-web modules update [#51](https://github.com/mapsforge/vtm/issues/51)
|
- vtm-web modules update [#51](https://github.com/mapsforge/vtm/issues/51)
|
||||||
- Mapzen MVT vector tiles [#57](https://github.com/mapsforge/vtm/issues/57)
|
- Mapzen MVT vector tiles [#57](https://github.com/mapsforge/vtm/issues/57)
|
||||||
@@ -129,10 +261,10 @@
|
|||||||
- Fix theme parsing in non-Latin locales [#297](https://github.com/mapsforge/vtm/issues/297)
|
- Fix theme parsing in non-Latin locales [#297](https://github.com/mapsforge/vtm/issues/297)
|
||||||
- libGDX 1.9.5 [#270](https://github.com/mapsforge/vtm/issues/270)
|
- libGDX 1.9.5 [#270](https://github.com/mapsforge/vtm/issues/270)
|
||||||
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
|
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
|
||||||
- Many other minor improvements and bug fixes
|
- Minor improvements and bug fixes
|
||||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.7.0)
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.7.0)
|
||||||
|
|
||||||
## Version 0.6.0 (2016-10-28) - VTM revive
|
## Version 0.6.0 (2016-10-28) - VTM revival
|
||||||
|
|
||||||
- Mapsforge maps **v4** support [#34](https://github.com/mapsforge/vtm/issues/34)
|
- Mapsforge maps **v4** support [#34](https://github.com/mapsforge/vtm/issues/34)
|
||||||
- Render theme SVG resources [#60](https://github.com/mapsforge/vtm/issues/60)
|
- Render theme SVG resources [#60](https://github.com/mapsforge/vtm/issues/60)
|
||||||
@@ -140,14 +272,17 @@
|
|||||||
- vtm-ios module update [#29](https://github.com/mapsforge/vtm/issues/29)
|
- vtm-ios module update [#29](https://github.com/mapsforge/vtm/issues/29)
|
||||||
- Native libraries for all platforms [#14](https://github.com/mapsforge/vtm/issues/14)
|
- Native libraries for all platforms [#14](https://github.com/mapsforge/vtm/issues/14)
|
||||||
- Line stipple and texture rendering [#105](https://github.com/mapsforge/vtm/issues/105)
|
- Line stipple and texture rendering [#105](https://github.com/mapsforge/vtm/issues/105)
|
||||||
- Layer groups [#99](https://github.com/mapsforge/vtm/issues/99) [#103](https://github.com/mapsforge/vtm/issues/103)
|
- Group layer implementation [#99](https://github.com/mapsforge/vtm/issues/99)
|
||||||
|
- Layer groups implementation [#103](https://github.com/mapsforge/vtm/issues/103)
|
||||||
- Location renderer and layer [#171](https://github.com/mapsforge/vtm/issues/171)
|
- Location renderer and layer [#171](https://github.com/mapsforge/vtm/issues/171)
|
||||||
- Map scale bar [#84](https://github.com/mapsforge/vtm/issues/84)
|
- Map scale bar [#84](https://github.com/mapsforge/vtm/issues/84)
|
||||||
- Tile size based on scale factor [#183](https://github.com/mapsforge/vtm/issues/183)
|
- Tile size based on scale factor [#183](https://github.com/mapsforge/vtm/issues/183)
|
||||||
- `Parameters.CUSTOM_TILE_SIZE = false;`
|
- `Parameters.CUSTOM_TILE_SIZE`
|
||||||
- libGDX layer gestures [#151](https://github.com/mapsforge/vtm/issues/151)
|
- libGDX layer gestures [#151](https://github.com/mapsforge/vtm/issues/151)
|
||||||
- Render theme area tessellation option [#37](https://github.com/mapsforge/vtm/issues/37)
|
- Render theme area tessellation option [#37](https://github.com/mapsforge/vtm/issues/37)
|
||||||
- Render theme resources optional location prefixes [#66](https://github.com/mapsforge/vtm/issues/66)
|
- Render theme resources optional location prefixes [#66](https://github.com/mapsforge/vtm/issues/66)
|
||||||
|
- Render theme from input stream [#161](https://github.com/mapsforge/vtm/issues/161)
|
||||||
|
- Render theme from Android assets [#162](https://github.com/mapsforge/vtm/issues/162)
|
||||||
- Graphics API platform enhancements [#92](https://github.com/mapsforge/vtm/issues/92)
|
- Graphics API platform enhancements [#92](https://github.com/mapsforge/vtm/issues/92)
|
||||||
- GeoPoint & BoundingBox improvements [#201](https://github.com/mapsforge/vtm/issues/201) [#200](https://github.com/mapsforge/vtm/issues/200)
|
- GeoPoint & BoundingBox improvements [#201](https://github.com/mapsforge/vtm/issues/201) [#200](https://github.com/mapsforge/vtm/issues/200)
|
||||||
- vtm-jts module [#53](https://github.com/mapsforge/vtm/issues/53)
|
- vtm-jts module [#53](https://github.com/mapsforge/vtm/issues/53)
|
||||||
@@ -157,5 +292,5 @@
|
|||||||
- SNAPSHOT builds publish to Sonatype OSSRH [#165](https://github.com/mapsforge/vtm/issues/165)
|
- SNAPSHOT builds publish to Sonatype OSSRH [#165](https://github.com/mapsforge/vtm/issues/165)
|
||||||
- libGDX 1.9.4 [#164](https://github.com/mapsforge/vtm/issues/164)
|
- libGDX 1.9.4 [#164](https://github.com/mapsforge/vtm/issues/164)
|
||||||
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
|
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
|
||||||
- Many other minor improvements and bug fixes
|
- Minor improvements and bug fixes
|
||||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.6.0)
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.6.0)
|
||||||
|
|||||||
1
docs/ISSUE_TEMPLATE.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
For questions, reports and feature requests please use the Discussions.
|
||||||
@@ -10,35 +10,35 @@ Current version is [
|
### Android (libGDX)
|
||||||
```groovy
|
```groovy
|
||||||
|
runtimeOnly 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-armeabi-v7a'
|
||||||
|
runtimeOnly 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-arm64-v8a'
|
||||||
|
runtimeOnly 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86'
|
||||||
|
runtimeOnly 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86_64'
|
||||||
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]'
|
||||||
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-armeabi-v7a'
|
|
||||||
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-arm64-v8a'
|
|
||||||
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86'
|
|
||||||
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86_64'
|
|
||||||
implementation 'org.mapsforge:vtm-gdx:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-gdx:[CURRENT-VERSION]'
|
||||||
|
runtimeOnly 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-armeabi-v7a'
|
||||||
|
runtimeOnly 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-arm64-v8a'
|
||||||
|
runtimeOnly 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86'
|
||||||
|
runtimeOnly 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86_64'
|
||||||
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]'
|
||||||
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-armeabi-v7a'
|
implementation 'com.badlogicgames.gdx:gdx:1.11.0'
|
||||||
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-arm64-v8a'
|
implementation 'com.badlogicgames.gdx:gdx-backend-android:1.11.0'
|
||||||
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86'
|
implementation 'com.caverock:androidsvg:1.4'
|
||||||
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86_64'
|
|
||||||
implementation 'com.badlogicgames.gdx:gdx:1.9.8'
|
|
||||||
implementation 'com.badlogicgames.gdx:gdx-backend-android:1.9.8'
|
|
||||||
implementation 'com.caverock:androidsvg:1.3'
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### iOS
|
### iOS
|
||||||
@@ -47,83 +47,95 @@ Detailed iOS instructions can be found [here](ios.md).
|
|||||||
|
|
||||||
### Desktop
|
### Desktop
|
||||||
```groovy
|
```groovy
|
||||||
repositories {
|
|
||||||
maven { url 'https://jitpack.io' }
|
|
||||||
}
|
|
||||||
|
|
||||||
implementation 'org.mapsforge:vtm-gdx:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-gdx:[CURRENT-VERSION]'
|
||||||
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]'
|
||||||
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-linux'
|
runtimeOnly 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-linux'
|
||||||
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-osx'
|
runtimeOnly 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-osx'
|
||||||
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-windows'
|
runtimeOnly 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-windows'
|
||||||
implementation 'com.badlogicgames.gdx:gdx:1.9.8'
|
implementation 'com.badlogicgames.gdx:gdx:1.11.0'
|
||||||
implementation 'com.badlogicgames.gdx:gdx-platform:1.9.8:natives-desktop'
|
runtimeOnly 'com.badlogicgames.gdx:gdx-platform:1.11.0:natives-desktop'
|
||||||
implementation 'com.badlogicgames.gdx:gdx-backend-lwjgl:1.9.8'
|
implementation 'guru.nidi.com.kitfox:svgSalamander:1.1.3'
|
||||||
|
implementation 'net.sf.kxml:kxml2:2.3.0'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Desktop (LWJGL)
|
||||||
|
```groovy
|
||||||
|
implementation 'org.mapsforge:vtm-desktop-lwjgl:[CURRENT-VERSION]'
|
||||||
|
implementation 'com.badlogicgames.gdx:gdx-backend-lwjgl:1.11.0'
|
||||||
implementation 'org.lwjgl.lwjgl:lwjgl:2.9.3'
|
implementation 'org.lwjgl.lwjgl:lwjgl:2.9.3'
|
||||||
implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-linux'
|
runtimeOnly 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-linux'
|
||||||
implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-osx'
|
runtimeOnly 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-osx'
|
||||||
implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-windows'
|
runtimeOnly 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-windows'
|
||||||
implementation 'com.github.blackears:svgSalamander:v1.1.1'
|
```
|
||||||
|
|
||||||
|
### Desktop (LWJGL 3)
|
||||||
|
```groovy
|
||||||
|
implementation 'org.mapsforge:vtm-desktop-lwjgl3:[CURRENT-VERSION]'
|
||||||
|
implementation 'com.badlogicgames.gdx:gdx-backend-lwjgl3:1.11.0'
|
||||||
|
implementation 'org.lwjgl:lwjgl:3.3.1'
|
||||||
|
runtimeOnly 'org.lwjgl:lwjgl:3.3.1:natives-linux'
|
||||||
|
runtimeOnly 'org.lwjgl:lwjgl:3.3.1:natives-macos'
|
||||||
|
runtimeOnly 'org.lwjgl:lwjgl:3.3.1:natives-windows'
|
||||||
```
|
```
|
||||||
|
|
||||||
### JTS geometries
|
### JTS geometries
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
implementation 'org.mapsforge:vtm-jts:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-jts:[CURRENT-VERSION]'
|
||||||
implementation 'org.locationtech.jts:jts-core:1.15.0'
|
// https://github.com/locationtech/jts/issues/145
|
||||||
|
implementation 'org.locationtech.jts:jts-core:1.15.1'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Online tiles
|
### Online tiles
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
implementation 'org.mapsforge:vtm-http:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-http:[CURRENT-VERSION]'
|
||||||
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
|
// https://github.com/square/okhttp/issues/4481
|
||||||
implementation 'com.squareup.okio:okio:1.13.0'
|
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
|
||||||
|
implementation 'com.squareup.okio:okio:1.15.0'
|
||||||
|
```
|
||||||
|
|
||||||
|
### MBTiles (Android)
|
||||||
|
|
||||||
|
```groovy
|
||||||
|
implementation 'org.mapsforge:vtm-android-mvt:[CURRENT-VERSION]'
|
||||||
|
implementation 'org.mapsforge:vtm-mvt:[CURRENT-VERSION]'
|
||||||
|
implementation 'com.google.protobuf:protobuf-java:3.6.1'
|
||||||
|
implementation 'com.wdtinc:mapbox-vector-tile:3.1.0'
|
||||||
|
// https://github.com/locationtech/jts/issues/145
|
||||||
|
implementation 'org.locationtech.jts:jts-core:1.15.1'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Mapbox vector tiles
|
### Mapbox vector tiles
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
implementation 'org.mapsforge:vtm-mvt:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-mvt:[CURRENT-VERSION]'
|
||||||
implementation 'com.google.protobuf:protobuf-java:3.5.1'
|
implementation 'com.google.protobuf:protobuf-java:3.6.1'
|
||||||
implementation 'com.wdtinc:mapbox-vector-tile:3.0.0'
|
implementation 'com.wdtinc:mapbox-vector-tile:3.1.0'
|
||||||
implementation 'org.locationtech.jts:jts-core:1.15.0'
|
// https://github.com/locationtech/jts/issues/145
|
||||||
|
implementation 'org.locationtech.jts:jts-core:1.15.1'
|
||||||
```
|
```
|
||||||
|
|
||||||
### GeoJSON vector tiles
|
### GeoJSON vector tiles
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
implementation 'org.mapsforge:vtm-json:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-json:[CURRENT-VERSION]'
|
||||||
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.8.4'
|
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.9.9'
|
||||||
implementation 'com.fasterxml.jackson.core:jackson-core:2.8.4'
|
implementation 'com.fasterxml.jackson.core:jackson-core:2.9.9'
|
||||||
implementation 'com.fasterxml.jackson.core:jackson-databind:2.8.4'
|
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.9'
|
||||||
```
|
```
|
||||||
|
|
||||||
### jeo (indoor maps)
|
### jeo (indoor maps)
|
||||||
|
|
||||||
Add _first_ the Boundless repository:
|
|
||||||
```groovy
|
```groovy
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'https://repo.boundlessgeo.com/main/' }
|
maven { url 'https://jitpack.io' }
|
||||||
jcenter()
|
|
||||||
...
|
|
||||||
}
|
}
|
||||||
```
|
|
||||||
|
|
||||||
```groovy
|
|
||||||
implementation 'org.mapsforge:vtm-jeo:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-jeo:[CURRENT-VERSION]'
|
||||||
implementation('org.jeo:jeo:0-SNAPSHOT') {
|
implementation('com.github.jeo.jeo:jeo-carto:master-SNAPSHOT') {
|
||||||
exclude group: 'org.slf4j', module: 'slf4j-jdk14'
|
exclude group: 'org.slf4j', module: 'slf4j-jdk14'
|
||||||
}
|
}
|
||||||
implementation('org.jeo:jeo-carto:0-SNAPSHOT') {
|
|
||||||
exclude group: 'org.slf4j', module: 'slf4j-jdk14'
|
|
||||||
}
|
|
||||||
implementation('org.jeo:jeo-render:0-SNAPSHOT') {
|
|
||||||
exclude group: 'org.slf4j', module: 'slf4j-jdk14'
|
|
||||||
}
|
|
||||||
implementation 'org.osgeo:proj4j:0.1.0:jeo'
|
|
||||||
implementation 'com.metaweb:lessen:1.0'
|
|
||||||
implementation 'com.vividsolutions:jts:1.13'
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Snapshots
|
## Snapshots
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# Mapsforge map providers (in lexical order)
|
# Mapsforge map providers (in lexical order)
|
||||||
|
|
||||||
- [AndroidMaps](http://www.androidmaps.co.uk/)
|
- [AndroidMaps](https://www.androidmaps.co.uk/)
|
||||||
- [Freizeitkarte](http://www.freizeitkarte-osm.de/android/en/index.html)
|
- [BBBike](https://extract.bbbike.org/?format=mapsforge-osm.zip)
|
||||||
- [Kurviger](https://offline-maps.kurviger.de/)
|
- [Freizeitkarte](https://www.freizeitkarte-osm.de/android/en/index.html)
|
||||||
- [Locusvectormaps](http://www.locusvectormaps.com)
|
- [Kurviger](https://download.kurviger.de/)
|
||||||
- [Mapsforge](http://download.mapsforge.org/)
|
- [Mapsforge](https://download.mapsforge.org/) | [Mirror (fast)](http://ftp-stud.hs-esslingen.de/pub/Mirrors/download.mapsforge.org/)
|
||||||
- [OpenAndroMaps](http://www.openandromaps.org/en/)
|
- [OpenAndroMaps](https://www.openandromaps.org/en/)
|
||||||
- [OpenMaps](http://openmaps.eu/)
|
- [OpenMaps](https://openmaps.eu/)
|
||||||
|
- [paws.cz](https://osm.paws.cz/)
|
||||||
You know a Mapsforge map provider that is missing here? Please inform us by sending a message via our public [mailing list](https://groups.google.com/group/mapsforge-dev).
|
- [vector.city](https://vector.city/)
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
# RenderTheme
|
# RenderTheme
|
||||||
|
|
||||||
**This article describes how to use XML-based render-themes to style maps.**
|
This article describes how to use XML-based render-themes to style maps.
|
||||||
|
|
||||||
If you have any questions or problems, don't hesitate to ask our public [mapsforge-dev](https://groups.google.com/group/mapsforge-dev) mailing list for help. You can also report bugs and improvement requests via our [issue tracker](https://github.com/mapsforge/vtm/issues).
|
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
@@ -14,13 +12,13 @@ It is always recommended to study the [default](https://github.com/mapsforge/vtm
|
|||||||
|
|
||||||
## Rules
|
## Rules
|
||||||
|
|
||||||
A rule element `<m/>` has several attributes to specify which map elements the rule matches. Non of them is required.
|
A rule element `<m/>` (_match_) has several attributes to specify which map elements the rule matches. Non of them is required.
|
||||||
|
|
||||||
|**Attribute**|**Valid values**|**Description**|**Default**|
|
|**Attribute**|**Valid values**|**Description**|**Default**|
|
||||||
|-------------|----------------|---------------|------------|
|
|-------------|----------------|---------------|------------|
|
||||||
|e|<ul><li>node</li><li>way</li><li>any</li></ul>|Defines which map element type will be matched.|*any*|
|
|e|<ul><li>node</li><li>way</li><li>any</li></ul>|Defines which map element type will be matched.|*any*|
|
||||||
|k|[string](http://www.w3.org/TR/xmlschema-2/#string)|The key of the OpenStreetMap tag. <ul><li>A vertical bar "`\|`" can be used to specify multiple keys.</li>|any key|
|
|k|[string](http://www.w3.org/TR/xmlschema-2/#string)|The key of the tile source tag. <ul><li>A vertical bar "`\|`" can be used to specify multiple keys.</li>|any key|
|
||||||
|v|[string](http://www.w3.org/TR/xmlschema-2/#string)|The value of the OpenStreetMap tag. <ul><li>A vertical bar "`\|`" can be used to specify multiple values.</li><li>A minus sign "`-`" excludes the other values after "`\|`". It never works alone.</li><li>A tilde "`~`" matches if the map element does not have a tag with the specified key.</li>|any value|
|
|v|[string](http://www.w3.org/TR/xmlschema-2/#string)|The value of the tile source tag. <ul><li>A vertical bar "`\|`" can be used to specify multiple values.</li><li>A minus sign "`-`" excludes the other values after "`\|`". It never works alone.</li><li>A tilde "`~`" matches if the map element does not have a tag with the specified key.</li>|any value|
|
||||||
|closed|<ul><li>yes</li><li>no</li><li>any</li></ul>|Defines which ways will be matched. A way is considered as closed if its first node and its last node are equal.|*any*|
|
|closed|<ul><li>yes</li><li>no</li><li>any</li></ul>|Defines which ways will be matched. A way is considered as closed if its first node and its last node are equal.|*any*|
|
||||||
|select|<ul><li>first</li><li>when-matched</li><li>any</li></ul>|<ul><li>Only add the first matching sub-rule in this rule section (the others are ignored)</li><li>Select all matches of the enclosing rule section</li><li>Select all (whether it was matched or not)</li></ul>|*any*|
|
|select|<ul><li>first</li><li>when-matched</li><li>any</li></ul>|<ul><li>Only add the first matching sub-rule in this rule section (the others are ignored)</li><li>Select all matches of the enclosing rule section</li><li>Select all (whether it was matched or not)</li></ul>|*any*|
|
||||||
|zoom-min|[unsigned byte](http://www.w3.org/TR/xmlschema-2/#unsignedByte)|The minimum zoom level on which the rule will be matched.|*0*|
|
|zoom-min|[unsigned byte](http://www.w3.org/TR/xmlschema-2/#unsignedByte)|The minimum zoom level on which the rule will be matched.|*0*|
|
||||||
@@ -109,11 +107,12 @@ There are different possibilities to simplify and accelerate map styling or chan
|
|||||||
|
|
||||||
### Style patterns
|
### Style patterns
|
||||||
|
|
||||||
If you want to use a specific style multiple times you not have to rewrite it for each text, area, or line rule.
|
If you want to use a specific style multiple times you not have to rewrite it for each text, line, area or symbol rule.
|
||||||
If you define a style set an `id` and use it with `use` in your rendering instructions:
|
If you define a style set an `id` and use it with `use` in your rendering instructions:
|
||||||
- `style-text`
|
- `style-text`
|
||||||
- `style-line`
|
- `style-line`
|
||||||
- `style-area`
|
- `style-area`
|
||||||
|
- `style-symbol`
|
||||||
|
|
||||||
This example styles all areas with the_residential_ style, which haven't the `highway` or `building` key.
|
This example styles all areas with the_residential_ style, which haven't the `highway` or `building` key.
|
||||||
|
|
||||||
|
|||||||
@@ -6,3 +6,14 @@ e.g. for `vtm-playground` can change the [mainClassName](../vtm-playground/build
|
|||||||
```groovy
|
```groovy
|
||||||
./gradlew :vtm-playground:run -Pargs=/path/to/map
|
./gradlew :vtm-playground:run -Pargs=/path/to/map
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To create a standalone executable jar, adapt the main class in [build gradle](../vtm-playground/build.gradle), then run:
|
||||||
|
```groovy
|
||||||
|
./gradlew :vtm-playground:fatJar
|
||||||
|
```
|
||||||
|
The jar file can be found in `build/libs` folder. Depending on the main class, pass args on execution via command line:
|
||||||
|
```
|
||||||
|
java -jar vtm-playground-master-SNAPSHOT-jar-with-dependencies.jar /path/to/map
|
||||||
|
```
|
||||||
|
|
||||||
|
To change the libGDX backend can replace the dependency: `vtm-desktop-lwjgl` or `vtm-desktop-lwjgl3`.
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 717 KiB After Width: | Height: | Size: 2.5 MiB |
|
Before Width: | Height: | Size: 791 KiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 580 KiB After Width: | Height: | Size: 1.6 MiB |
22
docs/web.md
@@ -5,3 +5,25 @@
|
|||||||
Then go to [http://localhost:8080/vtm-web-app](http://localhost:8080/vtm-web-app) in the web browser to see the map.
|
Then go to [http://localhost:8080/vtm-web-app](http://localhost:8080/vtm-web-app) in the web browser to see the map.
|
||||||
|
|
||||||
Hold right mouse button to change view direction.
|
Hold right mouse button to change view direction.
|
||||||
|
|
||||||
|
#### Debugging GWT app
|
||||||
|
|
||||||
|
Using GWT SuperDevMode is the recommended way for development. Debugging in IDE is often not possible.
|
||||||
|
|
||||||
|
For an introduction see [GWT](http://www.gwtproject.org/articles/superdevmode.html) and [libGDX](http://www.badlogicgames.com/wordpress/?p=3073) documentations.
|
||||||
|
|
||||||
|
- Serve the website as usual with `./gradlew :vtm-web-app:farmRun` command.
|
||||||
|
|
||||||
|
- The codeserver must be executed on another shell.
|
||||||
|
```bash
|
||||||
|
export _JAVA_OPTIONS="-Xmx1024m"
|
||||||
|
./gradlew :vtm-web-app:gwtSuperDev
|
||||||
|
```
|
||||||
|
|
||||||
|
- Open the link of codeserver: `The code server is ready at http://127.0.0.1:xxxx/`
|
||||||
|
|
||||||
|
- Drag the two bookmarklets to your browser's bookmark bar.
|
||||||
|
|
||||||
|
- Visit your [web page](http://localhost:8080/vtm-web-app) and click **Dev Mode On** to start development mode.
|
||||||
|
|
||||||
|
- Press **F12** to open the developer tools of your browser. Now you can debug your code under **Sources**.
|
||||||
@@ -6,8 +6,16 @@
|
|||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
org.gradle.jvmargs=-Xmx1536m
|
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
# org.gradle.parallel=true
|
# org.gradle.parallel=true
|
||||||
|
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||||
|
# Android operating system, and which are packaged with your app's APK
|
||||||
|
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||||
|
android.useAndroidX=true
|
||||||
|
# Enables namespacing of each library's R class so that its R class includes only the
|
||||||
|
# resources declared in the library itself and none from the library's dependencies,
|
||||||
|
# thereby reducing the size of the R class for that library
|
||||||
|
android.nonTransitiveRClass=true
|
||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,5 @@
|
|||||||
#Wed Mar 28 09:56:50 EEST 2018
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
|
||||||
|
|||||||
53
gradlew
vendored
@@ -1,5 +1,21 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright 2015 the original author or authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##
|
##
|
||||||
## Gradle start up script for UN*X
|
## Gradle start up script for UN*X
|
||||||
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
|
|||||||
APP_BASE_NAME=`basename "$0"`
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS=""
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD="maximum"
|
||||||
@@ -66,6 +82,7 @@ esac
|
|||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
@@ -109,10 +126,11 @@ if $darwin; then
|
|||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# For Cygwin, switch paths to Windows format before running java
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
if $cygwin ; then
|
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
@@ -138,19 +156,19 @@ if $cygwin ; then
|
|||||||
else
|
else
|
||||||
eval `echo args$i`="\"$arg\""
|
eval `echo args$i`="\"$arg\""
|
||||||
fi
|
fi
|
||||||
i=$((i+1))
|
i=`expr $i + 1`
|
||||||
done
|
done
|
||||||
case $i in
|
case $i in
|
||||||
(0) set -- ;;
|
0) set -- ;;
|
||||||
(1) set -- "$args0" ;;
|
1) set -- "$args0" ;;
|
||||||
(2) set -- "$args0" "$args1" ;;
|
2) set -- "$args0" "$args1" ;;
|
||||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -159,14 +177,9 @@ save () {
|
|||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
echo " "
|
echo " "
|
||||||
}
|
}
|
||||||
APP_ARGS=$(save "$@")
|
APP_ARGS=`save "$@"`
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||||
|
|
||||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
|
||||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
exec "$JAVACMD" "$@"
|
||||||
|
|||||||
43
gradlew.bat
vendored
@@ -1,3 +1,19 @@
|
|||||||
|
@rem
|
||||||
|
@rem Copyright 2015 the original author or authors.
|
||||||
|
@rem
|
||||||
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@rem you may not use this file except in compliance with the License.
|
||||||
|
@rem You may obtain a copy of the License at
|
||||||
|
@rem
|
||||||
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@rem
|
||||||
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@rem See the License for the specific language governing permissions and
|
||||||
|
@rem limitations under the License.
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%" == "" @echo off
|
@if "%DEBUG%" == "" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@@ -13,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=.
|
|||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
set DEFAULT_JVM_OPTS=
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
@rem Find java.exe
|
@rem Find java.exe
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if "%ERRORLEVEL%" == "0" goto init
|
if "%ERRORLEVEL%" == "0" goto execute
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
@@ -35,7 +54,7 @@ goto fail
|
|||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto init
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
@@ -45,28 +64,14 @@ echo location of your Java installation.
|
|||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:init
|
|
||||||
@rem Get command-line arguments, handling Windows variants
|
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
||||||
|
|
||||||
:win9xME_args
|
|
||||||
@rem Slurp the command line arguments.
|
|
||||||
set CMD_LINE_ARGS=
|
|
||||||
set _SKIP=2
|
|
||||||
|
|
||||||
:win9xME_args_slurp
|
|
||||||
if "x%~1" == "x" goto execute
|
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
apply plugin: 'java-library'
|
apply plugin: 'java'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api "com.badlogicgames.gdx:gdx-jnigen:$gdxVersion"
|
implementation "com.badlogicgames.gdx:gdx-jnigen:$gdxVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main.java.srcDirs = ['src']
|
main.java.srcDirs = ['src']
|
||||||
main.resources.srcDirs = ['src']
|
|
||||||
}
|
}
|
||||||
|
|||||||
203
jni/jni/build-windows64.xml
Normal file
@@ -0,0 +1,203 @@
|
|||||||
|
<project name="vtm-jni-Windows-64" basedir="." default="postcompile">
|
||||||
|
|
||||||
|
<!-- include the environment -->
|
||||||
|
<property environment="env"/>
|
||||||
|
|
||||||
|
<!-- output directory for temporary object files -->
|
||||||
|
<property name="buildDir" value="target/windows64" />
|
||||||
|
|
||||||
|
<!-- output directory for the shared library -->
|
||||||
|
<property name="libsDir" value="../libs/windows64" />
|
||||||
|
|
||||||
|
<!-- the name of the shared library -->
|
||||||
|
<property name="libName" value="vtm-jni64.dll"/>
|
||||||
|
|
||||||
|
<!-- the jni header jniPlatform to use -->
|
||||||
|
<property name="jniPlatform" value="win32"/>
|
||||||
|
|
||||||
|
<!-- the compiler to use when compiling c files -->
|
||||||
|
<property name="cCompiler" value="gcc"/>
|
||||||
|
|
||||||
|
<!-- the compiler to use when compiling c++ files -->
|
||||||
|
<property name="cppCompiler" value="g++"/>
|
||||||
|
|
||||||
|
<!-- the command to use when archiving files -->
|
||||||
|
<property name="archiver" value="ar"/>
|
||||||
|
|
||||||
|
<!-- the compilerPrefix for the C & C++ compilers -->
|
||||||
|
<property name="compilerPrefix" value="x86_64-w64-mingw32-"/>
|
||||||
|
|
||||||
|
<!-- the compilerSuffix for the C & C++ compilers -->
|
||||||
|
<property name="compilerSuffix" value=".exe" />
|
||||||
|
|
||||||
|
<!-- define gcc compiler, options and files to compile -->
|
||||||
|
<property name="gcc" value="${compilerPrefix}${cCompiler}${compilerSuffix}"/>
|
||||||
|
<property name="gcc-opts" value="-c -Wall -O2 -mfpmath=sse -msse2 -fmessage-length=0 -m64 -Wall -std=c99 -O2 -ffast-math -DNDEBUG"/>
|
||||||
|
<fileset id="gcc-files" dir="./">
|
||||||
|
<exclude name="target/"/>
|
||||||
|
<include name="memcpy_wrap.c"/>
|
||||||
|
<include name="gl/utils.c"/>
|
||||||
|
<include name="libtess2/Source/bucketalloc.c"/>
|
||||||
|
<include name="libtess2/Source/dict.c"/>
|
||||||
|
<include name="libtess2/Source/geom.c"/>
|
||||||
|
<include name="libtess2/Source/mesh.c"/>
|
||||||
|
<include name="libtess2/Source/priorityq.c"/>
|
||||||
|
<include name="libtess2/Source/sweep.c"/>
|
||||||
|
<include name="libtess2/Source/tess.c"/>
|
||||||
|
</fileset>
|
||||||
|
|
||||||
|
<!-- define g++ compiler, options and files to compile -->
|
||||||
|
<property name="g++" value="${compilerPrefix}${cppCompiler}${compilerSuffix}"/>
|
||||||
|
<property name="g++-opts" value="-c -Wall -O2 -mfpmath=sse -msse2 -fmessage-length=0 -m64 -Wall -std=c99 -O2 -ffast-math -DNDEBUG -fpermissive"/>
|
||||||
|
<fileset id="g++-files" dir="./">
|
||||||
|
<exclude name="target/"/>
|
||||||
|
<include name="**/*.cpp"/>
|
||||||
|
</fileset>
|
||||||
|
|
||||||
|
<!-- define linker and options -->
|
||||||
|
<property name="linker" value="${compilerPrefix}${cppCompiler}${compilerSuffix}"/>
|
||||||
|
<property name="linker-opts" value="-Wl,--kill-at -shared -static -static-libgcc -static-libstdc++ -m64"/>
|
||||||
|
<property name="libraries" value=""/>
|
||||||
|
|
||||||
|
<!-- define stripper -->
|
||||||
|
<property name="stripper" value="${compilerPrefix}strip${compilerSuffix}"/>
|
||||||
|
|
||||||
|
<!-- cleans the build directory, removes all object files and shared libs -->
|
||||||
|
<target name="clean">
|
||||||
|
<delete includeemptydirs="true" quiet="true">
|
||||||
|
<fileset dir="${buildDir}"/>
|
||||||
|
<fileset dir="${libsDir}" includes="**/*"/>
|
||||||
|
</delete>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="precompile" depends="clean">
|
||||||
|
<condition property="compiler-found">
|
||||||
|
<and>
|
||||||
|
<or>
|
||||||
|
<!-- Include both b/c Windows might be either -->
|
||||||
|
<available file="${g++}" filepath="${env.PATH}"/>
|
||||||
|
<available file="${g++}" filepath="${env.Path}"/>
|
||||||
|
</or>
|
||||||
|
<or>
|
||||||
|
<!-- Include both b/c Windows might be either -->
|
||||||
|
<available file="${gcc}" filepath="${env.PATH}"/>
|
||||||
|
<available file="${gcc}" filepath="${env.Path}"/>
|
||||||
|
</or>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
<condition property="has-compiler">
|
||||||
|
<equals arg1="${compiler-found}" arg2="true"/>
|
||||||
|
</condition>
|
||||||
|
<condition property="stripper-found">
|
||||||
|
<or>
|
||||||
|
<!-- Include both b/c Windows might be either -->
|
||||||
|
<available file="${stripper}" filepath="${env.PATH}"/>
|
||||||
|
<available file="${stripper}" filepath="${env.Path}"/>
|
||||||
|
</or>
|
||||||
|
</condition>
|
||||||
|
<condition property="should-strip">
|
||||||
|
<and>
|
||||||
|
<equals arg1="${stripper-found}" arg2="true"/>
|
||||||
|
<equals arg1="${release}" arg2="true"/>
|
||||||
|
<!-- Don't strip mac osx libs -->
|
||||||
|
<not>
|
||||||
|
<contains string="${libName}" substring="dylib"/>
|
||||||
|
</not>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="create-build-dir" depends="precompile" if="has-compiler">
|
||||||
|
<!-- FIXME this is pretty nasty :/ -->
|
||||||
|
<copy todir="${buildDir}">
|
||||||
|
<fileset refid="g++-files"/>
|
||||||
|
<fileset refid="gcc-files"/>
|
||||||
|
</copy>
|
||||||
|
<delete>
|
||||||
|
<fileset dir="${buildDir}">
|
||||||
|
<include name="*"/>
|
||||||
|
<exclude name="*.o"/>
|
||||||
|
</fileset>
|
||||||
|
</delete>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- compiles all C and C++ files to object files in the build directory -->
|
||||||
|
<target name="compile" depends="create-build-dir" if="has-compiler">
|
||||||
|
<mkdir dir="${buildDir}"/>
|
||||||
|
<apply failonerror="true" executable="${g++}" dest="${buildDir}" verbose="true">
|
||||||
|
<arg line="${g++-opts}"/>
|
||||||
|
<arg value="-Ijni-headers"/>
|
||||||
|
<arg value="-Ijni-headers/${jniPlatform}"/>
|
||||||
|
<arg value="-I."/>
|
||||||
|
<arg value="-I."/>
|
||||||
|
<arg value="-Ilibtess2/Include"/>
|
||||||
|
|
||||||
|
<srcfile/>
|
||||||
|
<arg value="-o"/>
|
||||||
|
<targetfile/>
|
||||||
|
<fileset refid="g++-files"/>
|
||||||
|
<compositemapper>
|
||||||
|
<mapper type="glob" from="*.cpp" to="*.o"/>
|
||||||
|
<mapper type="glob" from="*.mm" to="*.o"/>
|
||||||
|
</compositemapper>
|
||||||
|
</apply>
|
||||||
|
<apply failonerror="true" executable="${gcc}" dest="${buildDir}" verbose="true">
|
||||||
|
<arg line="${gcc-opts}"/>
|
||||||
|
<arg value="-Ijni-headers"/>
|
||||||
|
<arg value="-Ijni-headers/${jniPlatform}"/>
|
||||||
|
<arg value="-I."/>
|
||||||
|
<arg value="-I."/>
|
||||||
|
<arg value="-Ilibtess2/Include"/>
|
||||||
|
<arg value="-Ilibtess2/Source"/>
|
||||||
|
|
||||||
|
<srcfile/>
|
||||||
|
<arg value="-o"/>
|
||||||
|
<targetfile/>
|
||||||
|
<fileset refid="gcc-files"/>
|
||||||
|
<compositemapper>
|
||||||
|
<mapper type="glob" from="*.c" to="*.o"/>
|
||||||
|
<mapper type="glob" from="*.m" to="*.o"/>
|
||||||
|
</compositemapper>
|
||||||
|
</apply>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- links the shared library based on the previously compiled object files -->
|
||||||
|
<target name="link" depends="compile" if="has-compiler">
|
||||||
|
<fileset dir="${buildDir}" id="objFileSet">
|
||||||
|
<patternset>
|
||||||
|
<include name="**/*.o" />
|
||||||
|
</patternset>
|
||||||
|
</fileset>
|
||||||
|
<pathconvert pathsep=" " property="objFiles" refid="objFileSet" />
|
||||||
|
<mkdir dir="${libsDir}" />
|
||||||
|
<exec executable="${linker}" failonerror="true" dir="${buildDir}">
|
||||||
|
<arg line="${linker-opts}" />
|
||||||
|
<arg value="-o" />
|
||||||
|
<arg path="${libsDir}/${libName}" />
|
||||||
|
<arg line="${objFiles}"/>
|
||||||
|
<arg line="${libraries}" />
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- strips the shared library of debug symbols -->
|
||||||
|
<target name="strip" depends="link" if="should-strip">
|
||||||
|
<exec executable="${stripper}" failonerror="true" dir="${buildDir}">
|
||||||
|
<arg value="--strip-unneeded"/>
|
||||||
|
<arg path="${libsDir}/${libName}" />
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- copy dll into dev environment
|
||||||
|
<target name="copyDLL" depends="link">
|
||||||
|
<copy
|
||||||
|
file ="${libsDir}/${libName}"
|
||||||
|
todir ="C:/DAT/MT/mytourbook/bundles/net.tourbook.ext.vtm.windows/natives"
|
||||||
|
/>
|
||||||
|
</target>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<target name="postcompile" depends="strip">
|
||||||
|
|
||||||
|
</target>
|
||||||
|
</project>
|
||||||
@@ -102,7 +102,7 @@ matrix4_proj2D(float* mat, float* vec, float *out);
|
|||||||
|
|
||||||
jlong JNI(alloc)(JNIEnv *env, jclass* clazz)
|
jlong JNI(alloc)(JNIEnv *env, jclass* clazz)
|
||||||
{
|
{
|
||||||
return (long) calloc(16, sizeof(float));
|
return (jlong) calloc(16, sizeof(float));
|
||||||
}
|
}
|
||||||
|
|
||||||
jobject JNI(getBuffer)(JNIEnv *env, jclass* clazz,jlong ptr){
|
jobject JNI(getBuffer)(JNIEnv *env, jclass* clazz,jlong ptr){
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
//@line:131
|
//@line:131
|
||||||
{
|
{
|
||||||
if (size <= 0)
|
if (size <= 0)
|
||||||
return (long)tessNewTess(0);
|
return (jlong)tessNewTess(0);
|
||||||
if (size > 10)
|
if (size > 10)
|
||||||
size = 10;
|
size = 10;
|
||||||
TESSalloc ma;
|
TESSalloc ma;
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
ma.regionBucketSize = 1 << size; // 256
|
ma.regionBucketSize = 1 << size; // 256
|
||||||
ma.extraVertices = 8;
|
ma.extraVertices = 8;
|
||||||
//ma.extraVertices = 256;
|
//ma.extraVertices = 256;
|
||||||
return (long)tessNewTess(&ma);
|
return (jlong)tessNewTess(&ma);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,6 +150,7 @@
|
|||||||
<xs:attribute name="font-family" default="default" type="tns:fontFamily" use="optional" />
|
<xs:attribute name="font-family" default="default" type="tns:fontFamily" use="optional" />
|
||||||
<xs:attribute name="style" default="normal" type="tns:fontStyle" use="optional" />
|
<xs:attribute name="style" default="normal" type="tns:fontStyle" use="optional" />
|
||||||
<xs:attribute name="size" default="0" type="tns:nonNegativeFloat" use="optional" />
|
<xs:attribute name="size" default="0" type="tns:nonNegativeFloat" use="optional" />
|
||||||
|
<xs:attribute name="bg-fill" default="#00000000" type="tns:color" use="optional" />
|
||||||
<xs:attribute name="fill" default="#000000" type="tns:color" use="optional" />
|
<xs:attribute name="fill" default="#000000" type="tns:color" use="optional" />
|
||||||
<xs:attribute name="stroke" default="#000000" type="tns:color" use="optional" />
|
<xs:attribute name="stroke" default="#000000" type="tns:color" use="optional" />
|
||||||
<xs:attribute name="stroke-width" default="0" type="tns:nonNegativeFloat" use="optional" />
|
<xs:attribute name="stroke-width" default="0" type="tns:nonNegativeFloat" use="optional" />
|
||||||
@@ -219,6 +220,7 @@
|
|||||||
<xs:attribute name="font-family" default="default" type="tns:fontFamily" use="optional" />
|
<xs:attribute name="font-family" default="default" type="tns:fontFamily" use="optional" />
|
||||||
<xs:attribute name="style" default="normal" type="tns:fontStyle" use="optional" />
|
<xs:attribute name="style" default="normal" type="tns:fontStyle" use="optional" />
|
||||||
<xs:attribute name="size" default="0" type="tns:nonNegativeFloat" use="optional" />
|
<xs:attribute name="size" default="0" type="tns:nonNegativeFloat" use="optional" />
|
||||||
|
<xs:attribute name="bg-fill" default="#00000000" type="tns:color" use="optional" />
|
||||||
<xs:attribute name="fill" default="#000000" type="tns:color" use="optional" />
|
<xs:attribute name="fill" default="#000000" type="tns:color" use="optional" />
|
||||||
<xs:attribute name="stroke" default="#000000" type="tns:color" use="optional" />
|
<xs:attribute name="stroke" default="#000000" type="tns:color" use="optional" />
|
||||||
<xs:attribute name="stroke-width" default="0" type="tns:nonNegativeFloat" use="optional" />
|
<xs:attribute name="stroke-width" default="0" type="tns:nonNegativeFloat" use="optional" />
|
||||||
@@ -231,13 +233,21 @@
|
|||||||
|
|
||||||
<xs:complexType name="symbol">
|
<xs:complexType name="symbol">
|
||||||
<xs:attribute name="cat" type="xs:string" use="optional" />
|
<xs:attribute name="cat" type="xs:string" use="optional" />
|
||||||
<xs:attribute name="src" type="tns:src" use="required" />
|
|
||||||
|
<xs:attribute name="id" default="0" type="xs:string" use="optional" />
|
||||||
|
<xs:attribute name="use" default="0" type="xs:string" use="optional" />
|
||||||
|
|
||||||
|
<xs:attribute name="src" type="tns:src" use="optional" />
|
||||||
<xs:attribute name="symbol-width" type="xs:positiveInteger" use="optional" />
|
<xs:attribute name="symbol-width" type="xs:positiveInteger" use="optional" />
|
||||||
<xs:attribute name="symbol-height" type="xs:positiveInteger" use="optional" />
|
<xs:attribute name="symbol-height" type="xs:positiveInteger" use="optional" />
|
||||||
<xs:attribute name="symbol-percent" type="xs:positiveInteger" use="optional" />
|
<xs:attribute name="symbol-percent" type="xs:positiveInteger" use="optional" />
|
||||||
|
|
||||||
|
<!-- symbols on lines -->
|
||||||
|
<xs:attribute name="billboard" default="false" type="xs:boolean" use="optional" />
|
||||||
<xs:attribute name="repeat" default="false" type="xs:boolean" use="optional" />
|
<xs:attribute name="repeat" default="false" type="xs:boolean" use="optional" />
|
||||||
<xs:attribute name="repeat-gap" default="200" type="xs:float" use="optional" />
|
<xs:attribute name="repeat-gap" default="200" type="xs:float" use="optional" />
|
||||||
<xs:attribute name="repeat-start" default="30" type="xs:float" use="optional" />
|
<xs:attribute name="repeat-start" default="30" type="xs:float" use="optional" />
|
||||||
|
<xs:attribute name="rotate" default="true" type="xs:boolean" use="optional" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|
||||||
<xs:complexType name="extrusion">
|
<xs:complexType name="extrusion">
|
||||||
@@ -245,6 +255,9 @@
|
|||||||
<xs:attribute name="line-color" type="tns:color" use="optional" />
|
<xs:attribute name="line-color" type="tns:color" use="optional" />
|
||||||
<xs:attribute name="side-color" type="tns:color" use="required" />
|
<xs:attribute name="side-color" type="tns:color" use="required" />
|
||||||
<xs:attribute name="top-color" type="tns:color" use="required" />
|
<xs:attribute name="top-color" type="tns:color" use="required" />
|
||||||
|
<xs:attribute name="hsv-h" default="0" type="xs:double" use="optional" />
|
||||||
|
<xs:attribute name="hsv-s" default="1" type="xs:double" use="optional" />
|
||||||
|
<xs:attribute name="hsv-v" default="1" type="xs:double" use="optional" />
|
||||||
<!-- 12m default -->
|
<!-- 12m default -->
|
||||||
<xs:attribute name="default-height" default="12" type="xs:positiveInteger" use="optional" />
|
<xs:attribute name="default-height" default="12" type="xs:positiveInteger" use="optional" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
@@ -301,15 +314,29 @@
|
|||||||
<xs:attribute name="id" type="xs:string" use="required" />
|
<xs:attribute name="id" type="xs:string" use="required" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|
||||||
|
<!-- tag-transform element -->
|
||||||
|
<xs:complexType name="tag-transform">
|
||||||
|
<xs:attribute name="k" type="xs:string" use="required" />
|
||||||
|
<xs:attribute name="v" type="xs:string" use="optional" />
|
||||||
|
<xs:attribute name="k-lib" type="xs:string" use="required" />
|
||||||
|
<xs:attribute name="v-lib" type="xs:string" use="optional" />
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
<!-- rendertheme element -->
|
<!-- rendertheme element -->
|
||||||
<xs:complexType name="rendertheme">
|
<xs:complexType name="rendertheme">
|
||||||
<xs:sequence maxOccurs="1" minOccurs="0">
|
<xs:sequence maxOccurs="1" minOccurs="0">
|
||||||
<xs:element name="stylemenu" maxOccurs="1" minOccurs="0" type="tns:stylemenu" />
|
<xs:element name="stylemenu" maxOccurs="1" minOccurs="0" type="tns:stylemenu" />
|
||||||
|
|
||||||
|
<!-- tag definitions -->
|
||||||
|
<xs:choice maxOccurs="unbounded" minOccurs="0">
|
||||||
|
<xs:element name="tag-transform" type="tns:tag-transform" />
|
||||||
|
</xs:choice>
|
||||||
|
|
||||||
<!-- style definitions -->
|
<!-- style definitions -->
|
||||||
<xs:sequence maxOccurs="256" minOccurs="0">
|
<xs:sequence maxOccurs="256" minOccurs="0">
|
||||||
<xs:choice maxOccurs="unbounded" minOccurs="0">
|
<xs:choice maxOccurs="unbounded" minOccurs="0">
|
||||||
<xs:element name="style-text" type="tns:text" />
|
<xs:element name="style-text" type="tns:text" />
|
||||||
|
<xs:element name="style-symbol" type="tns:symbol" />
|
||||||
<xs:element name="style-area" type="tns:area" />
|
<xs:element name="style-area" type="tns:area" />
|
||||||
<xs:element name="style-line" type="tns:line" />
|
<xs:element name="style-line" type="tns:line" />
|
||||||
<!-- <xs:element name="style-outline" type="tns:line" /> -->
|
<!-- <xs:element name="style-outline" type="tns:line" /> -->
|
||||||
|
|||||||
@@ -1,18 +1,39 @@
|
|||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
gradlePluginPortal()
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||||
|
maven { url 'https://jitpack.io' }
|
||||||
|
}
|
||||||
|
}
|
||||||
rootProject.name = 'vtm-parent'
|
rootProject.name = 'vtm-parent'
|
||||||
include ':vtm'
|
include ':vtm'
|
||||||
include ':vtm-android'
|
include ':vtm-android'
|
||||||
include ':vtm-android-example'
|
include ':vtm-android-example'
|
||||||
include ':vtm-android-gdx'
|
include ':vtm-android-gdx'
|
||||||
|
include ':vtm-android-mvt'
|
||||||
include ':vtm-app'
|
include ':vtm-app'
|
||||||
include ':vtm-desktop'
|
include ':vtm-desktop'
|
||||||
|
include ':vtm-desktop-lwjgl'
|
||||||
|
include ':vtm-desktop-lwjgl3'
|
||||||
include ':vtm-extras'
|
include ':vtm-extras'
|
||||||
include ':vtm-gdx'
|
include ':vtm-gdx'
|
||||||
|
include ':vtm-gdx-poi3d'
|
||||||
include ':vtm-http'
|
include ':vtm-http'
|
||||||
include ':vtm-ios'
|
include ':vtm-ios'
|
||||||
include ':vtm-ios-example'
|
include ':vtm-ios-example'
|
||||||
include ':vtm-jeo'
|
//include ':vtm-jeo'
|
||||||
include ':vtm-json'
|
include ':vtm-json'
|
||||||
include ':vtm-jts'
|
include ':vtm-jts'
|
||||||
|
include ':vtm-models'
|
||||||
include ':vtm-mvt'
|
include ':vtm-mvt'
|
||||||
include ':vtm-playground'
|
include ':vtm-playground'
|
||||||
include ':vtm-tests'
|
include ':vtm-tests'
|
||||||
|
|||||||
@@ -1,45 +1,46 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.oscim.android.test"
|
|
||||||
android:installLocation="auto"
|
android:installLocation="auto"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0">
|
android:versionName="1.0">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission
|
||||||
|
android:name="android.permission.READ_EXTERNAL_STORAGE"
|
||||||
|
android:maxSdkVersion="18" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
|
android:requestLegacyExternalStorage="true"
|
||||||
android:usesCleartextTraffic="true">
|
android:usesCleartextTraffic="true">
|
||||||
<activity
|
<activity
|
||||||
android:name=".Samples"
|
android:name=".Samples"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize">
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
|
||||||
android:name=".Animator2Activity"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
|
||||||
<activity
|
|
||||||
android:name=".AtlasMarkerOverlayActivity"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".AtlasMultiTextureActivity"
|
android:name=".AtlasMultiTextureActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
|
||||||
android:name=".AtlasThemeActivity"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".BitmapTileActivity"
|
android:name=".BitmapTileActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ClusterMarkerOverlayActivity"
|
android:name=".ClusterMarkerOverlayActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<activity
|
||||||
|
android:name=".DraggableMarkerOverlayActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<activity
|
||||||
|
android:name=".FragmentActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".GettingStarted"
|
android:name=".GettingStarted"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
@@ -47,11 +48,11 @@
|
|||||||
android:name=".GdxActivity"
|
android:name=".GdxActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
|
android:name=".GdxPoi3DActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<!--<activity
|
||||||
android:name=".JeoIndoorActivity"
|
android:name=".JeoIndoorActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />-->
|
||||||
<activity
|
|
||||||
android:name=".LayerGroupActivity"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".LineTexActivity"
|
android:name=".LineTexActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
@@ -62,20 +63,11 @@
|
|||||||
android:name=".LocationTextureActivity"
|
android:name=".LocationTextureActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MapEventLayer2Activity"
|
android:name=".MapilionMvtActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MapsforgeActivity"
|
android:name=".MapsforgeActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
|
||||||
android:name=".MapsforgeActivity$MapFilePicker"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
|
||||||
<activity
|
|
||||||
android:name=".MapsforgeActivity$ThemeFilePicker"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
|
||||||
<activity
|
|
||||||
android:name=".MapsforgePolyLabelActivity"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MapsforgeS3DBActivity"
|
android:name=".MapsforgeS3DBActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
@@ -92,7 +84,10 @@
|
|||||||
android:name=".MarkerOverlayActivity"
|
android:name=".MarkerOverlayActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MultiMapViewActivity"
|
android:name=".MBTilesBitmapActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<activity
|
||||||
|
android:name=".MBTilesMvtActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".NextzenGeojsonActivity"
|
android:name=".NextzenGeojsonActivity"
|
||||||
@@ -104,7 +99,7 @@
|
|||||||
android:name=".OpenMapTilesMvtActivity"
|
android:name=".OpenMapTilesMvtActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".OSciMapS3DBActivity"
|
android:name=".OverpassActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".PathOverlayActivity"
|
android:name=".PathOverlayActivity"
|
||||||
@@ -115,14 +110,11 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".PoiSearchActivity$PoiFilePicker"
|
android:name=".PoiSearchActivity$PoiFilePicker"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
|
||||||
android:name=".POTTextureActivity"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ReverseGeocodeActivity"
|
android:name=".ReverseGeocodeActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".RotateMarkerOverlayActivity"
|
android:name=".ShadowActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".SimpleMapActivity"
|
android:name=".SimpleMapActivity"
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
/*
|
|
||||||
configurations.all {
|
|
||||||
// Check latest snapshot on every build
|
|
||||||
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(':vtm-android')
|
implementation project(':vtm-android')
|
||||||
|
implementation project(':vtm-android-mvt')
|
||||||
|
implementation project(':vtm-extras')
|
||||||
implementation project(':vtm-http')
|
implementation project(':vtm-http')
|
||||||
implementation project(':vtm-jeo')
|
//implementation project(':vtm-jeo')
|
||||||
implementation project(':vtm-json')
|
implementation project(':vtm-json')
|
||||||
implementation project(':vtm-jts')
|
implementation project(':vtm-jts')
|
||||||
implementation project(':vtm-mvt')
|
implementation project(':vtm-mvt')
|
||||||
@@ -19,36 +14,35 @@ dependencies {
|
|||||||
|
|
||||||
implementation project(':vtm-android-gdx')
|
implementation project(':vtm-android-gdx')
|
||||||
implementation project(':vtm-gdx')
|
implementation project(':vtm-gdx')
|
||||||
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
|
implementation project(':vtm-gdx-poi3d')
|
||||||
|
|
||||||
implementation 'org.mapsforge:mapsforge-poi-android:master-SNAPSHOT'
|
implementation 'org.mapsforge:mapsforge-poi-android:master-SNAPSHOT'
|
||||||
implementation 'org.mapsforge:sqlite-android:master-SNAPSHOT:natives-armeabi-v7a'
|
runtimeOnly 'org.mapsforge:sqlite-android:master-SNAPSHOT:natives-armeabi-v7a'
|
||||||
implementation 'org.mapsforge:sqlite-android:master-SNAPSHOT:natives-arm64-v8a'
|
runtimeOnly 'org.mapsforge:sqlite-android:master-SNAPSHOT:natives-arm64-v8a'
|
||||||
implementation 'org.mapsforge:sqlite-android:master-SNAPSHOT:natives-x86'
|
runtimeOnly 'org.mapsforge:sqlite-android:master-SNAPSHOT:natives-x86'
|
||||||
implementation 'org.mapsforge:sqlite-android:master-SNAPSHOT:natives-x86_64'
|
runtimeOnly 'org.mapsforge:sqlite-android:master-SNAPSHOT:natives-x86_64'
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion androidCompileSdk()
|
namespace 'org.oscim.android.test'
|
||||||
buildToolsVersion "$androidBuildVersionTools"
|
compileSdk androidCompileSdk()
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_7
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_1_7
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
versionCode versionCode()
|
versionCode project.versionCode()
|
||||||
versionName versionName()
|
versionName project.versionName()
|
||||||
minSdkVersion androidMinSdk()
|
minSdk androidMinSdk()
|
||||||
targetSdkVersion androidTargetSdk()
|
targetSdk androidTargetSdk()
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
manifest.srcFile 'AndroidManifest.xml'
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
java.srcDirs = ['src']
|
java.srcDirs = ['src']
|
||||||
resources.srcDirs = ['src']
|
|
||||||
res.srcDirs = ['res']
|
res.srcDirs = ['res']
|
||||||
assets.srcDirs = ['assets']
|
assets.srcDirs = ['assets']
|
||||||
file("${rootDir}/vtm-android/natives").eachDir() { dir ->
|
file("${rootDir}/vtm-android/natives").eachDir() { dir ->
|
||||||
@@ -62,12 +56,14 @@ android {
|
|||||||
release.setRoot('build-types/release')
|
release.setRoot('build-types/release')
|
||||||
}
|
}
|
||||||
|
|
||||||
lintOptions { abortOnError false }
|
lint {
|
||||||
|
abortOnError false
|
||||||
|
}
|
||||||
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
exclude 'META-INF/services/org.jeo.data.Driver'
|
resources {
|
||||||
exclude 'META-INF/LICENSE'
|
excludes += ['META-INF/services/io.jeo.data.Driver', 'META-INF/LICENSE', 'META-INF/NOTICE']
|
||||||
exclude 'META-INF/NOTICE'
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*buildTypes {
|
/*buildTypes {
|
||||||
@@ -90,3 +86,7 @@ task run(dependsOn: 'installDebug') {
|
|||||||
proc.waitFor()
|
proc.waitFor()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (System.getenv('ANDROID_HOME') == null) {
|
||||||
|
throw new GradleException("Environment variable ANDROID_HOME needs to be set to SDK folder")
|
||||||
|
}
|
||||||
|
|||||||
10
vtm-android-example/res/layout/activity_map_draggable.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<org.oscim.android.drag.DragMapView
|
||||||
|
android:id="@+id/mapView"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
58
vtm-android-example/res/layout/activity_map_poi.xml
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<org.oscim.android.MapView
|
||||||
|
android:id="@+id/mapView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ToggleButton
|
||||||
|
android:id="@+id/toggleControls"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="top|start"
|
||||||
|
android:onClick="onToggleControls" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/controls"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#bb000000"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/search_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/add_item"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/add" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/start_search"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/search" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
36
vtm-android-example/res/layout/activity_shadow.xml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<org.oscim.android.MapView
|
||||||
|
android:id="@+id/mapView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#cc000000"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<SeekBar
|
||||||
|
android:id="@+id/seekBarShadow"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:max="2000"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:progress="400" />
|
||||||
|
|
||||||
|
<ToggleButton
|
||||||
|
android:id="@+id/toggleCurrentSun"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical|center_horizontal"
|
||||||
|
android:onClick="onToggleCurrentSun"
|
||||||
|
android:textOn="@string/now" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
12
vtm-android-example/res/layout/fragment_blank.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@android:color/white">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="@string/empty_fragment_text" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/white">
|
android:background="@android:color/white">
|
||||||
|
|
||||||
<org.oscim.android.MapView
|
<RelativeLayout
|
||||||
android:id="@+id/mapView"
|
android:id="@+id/mapView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|||||||
33
vtm-android-example/res/layout/item_poi_search.xml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/key"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:hint="@string/search_key"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@android:color/white" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/value"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:hint="@string/search_value"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@android:color/white" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/remove"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/remove" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
9
vtm-android-example/res/menu/fragment_menu.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/replace_fragment"
|
||||||
|
android:showAsAction="never"
|
||||||
|
android:title="@string/replace_fragment" />
|
||||||
|
|
||||||
|
</menu>
|
||||||
@@ -20,6 +20,9 @@
|
|||||||
<item
|
<item
|
||||||
android:id="@+id/theme_newtron"
|
android:id="@+id/theme_newtron"
|
||||||
android:title="@string/theme_newtron" />
|
android:title="@string/theme_newtron" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/theme_external_archive"
|
||||||
|
android:title="@string/theme_external_archive" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/theme_external"
|
android:id="@+id/theme_external"
|
||||||
android:title="@string/theme_external" />
|
android:title="@string/theme_external" />
|
||||||
|
|||||||
15
vtm-android-example/res/raw/marker.svg
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="580" width="580" version="1.0" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<title>other</title>
|
||||||
|
<metadata>
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
|
||||||
|
<dc:title>other</dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<circle opacity=".8" cx="290" cy="290" r="145" fill="#fff"/>
|
||||||
|
<circle cy="290" cx="290" r="116" fill="#0092DA"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 651 B |
@@ -6,11 +6,8 @@
|
|||||||
<string name="theme_osmagray">Osmagray</string>
|
<string name="theme_osmagray">Osmagray</string>
|
||||||
<string name="theme_tubes">Tubes</string>
|
<string name="theme_tubes">Tubes</string>
|
||||||
<string name="theme_newtron">NewTron</string>
|
<string name="theme_newtron">NewTron</string>
|
||||||
<string name="theme_external">External theme</string>
|
<string name="theme_external">External theme (Android 5)</string>
|
||||||
<string name="ok">OK</string>
|
<string name="theme_external_archive">External theme archive</string>
|
||||||
<string name="cancel">Cancel</string>
|
|
||||||
<string name="error">Error</string>
|
|
||||||
<string name="file_invalid">The selected file is invalid.</string>
|
|
||||||
<string name="styler_mode_line">Line</string>
|
<string name="styler_mode_line">Line</string>
|
||||||
<string name="styler_mode_area">Area</string>
|
<string name="styler_mode_area">Area</string>
|
||||||
<string name="styler_mode_outline">Outline</string>
|
<string name="styler_mode_outline">Outline</string>
|
||||||
@@ -19,5 +16,21 @@
|
|||||||
<string name="style_2">Hide nature</string>
|
<string name="style_2">Hide nature</string>
|
||||||
<string name="menu_gridlayer">Grid</string>
|
<string name="menu_gridlayer">Grid</string>
|
||||||
<string name="dialog_reverse_geocoding_title">Reverse Geocoding</string>
|
<string name="dialog_reverse_geocoding_title">Reverse Geocoding</string>
|
||||||
|
<string name="dialog_theme_title">Select a theme</string>
|
||||||
|
<string name="add">Add</string>
|
||||||
|
<string name="cancel">Cancel</string>
|
||||||
|
<string name="error">Error</string>
|
||||||
|
<string name="file_invalid">The selected file is invalid.</string>
|
||||||
|
<string name="ok">OK</string>
|
||||||
|
<string name="remove">Remove</string>
|
||||||
|
<string name="search">Search</string>
|
||||||
|
<string name="search_key">\'*\' or OSM key</string>
|
||||||
|
<string name="search_value">void or value</string>
|
||||||
|
<string name="now">Now</string>
|
||||||
|
<string name="warning">Warning</string>
|
||||||
|
<string name="startup_message_mbtiles">To run this sample activity, you need an MBTiles database installed on storage.</string>
|
||||||
|
<string name="exit">Exit</string>
|
||||||
|
<string name="replace_fragment">Replace fragment</string>
|
||||||
|
<string name="empty_fragment_text">This is a fragment to test the back stack behaviour of the map fragment.</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -19,13 +19,13 @@
|
|||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.oscim.layers.marker;
|
package org.oscim.android.cluster;
|
||||||
|
|
||||||
import org.oscim.backend.canvas.Bitmap;
|
import org.oscim.backend.canvas.Bitmap;
|
||||||
import org.oscim.core.MercatorProjection;
|
import org.oscim.core.MercatorProjection;
|
||||||
import org.oscim.core.PointF;
|
import org.oscim.core.PointF;
|
||||||
import org.oscim.core.Tile;
|
import org.oscim.core.Tile;
|
||||||
import org.oscim.layers.marker.utils.ScreenUtils;
|
import org.oscim.layers.marker.*;
|
||||||
import org.oscim.layers.marker.utils.SparseIntArray;
|
import org.oscim.layers.marker.utils.SparseIntArray;
|
||||||
import org.oscim.renderer.GLViewport;
|
import org.oscim.renderer.GLViewport;
|
||||||
import org.oscim.renderer.bucket.SymbolItem;
|
import org.oscim.renderer.bucket.SymbolItem;
|
||||||
@@ -45,7 +45,7 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
|||||||
/**
|
/**
|
||||||
* default color of number inside the icon. Would be super-cool to cook this into the map theme
|
* default color of number inside the icon. Would be super-cool to cook this into the map theme
|
||||||
*/
|
*/
|
||||||
private static int CLUSTER_COLORTEXT = 0xff8000c0;
|
private static final int CLUSTER_COLORTEXT = 0xff8000c0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* default color of circle background
|
* default color of circle background
|
||||||
@@ -84,12 +84,12 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
|||||||
* We use a flat Sparse array to calculate the clusters. The sparse array models a 2D map where every (x,y) denotes
|
* We use a flat Sparse array to calculate the clusters. The sparse array models a 2D map where every (x,y) denotes
|
||||||
* a grid slot, ie. 64x64dp. For efficiency I use a linear sparsearray with ARRindex = SLOTypos * max_x + SLOTxpos"
|
* a grid slot, ie. 64x64dp. For efficiency I use a linear sparsearray with ARRindex = SLOTypos * max_x + SLOTxpos"
|
||||||
*/
|
*/
|
||||||
private SparseIntArray mGridMap = new SparseIntArray(200); // initial space for 200 markers, that's not a lot of memory, and in most cases will avoid resizing the array
|
private final SparseIntArray mGridMap = new SparseIntArray(200); // initial space for 200 markers, that's not a lot of memory, and in most cases will avoid resizing the array
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to enable clustering or disable the functionality
|
* Whether to enable clustering or disable the functionality
|
||||||
*/
|
*/
|
||||||
private boolean mClusteringEnabled = false;
|
private final boolean mClusteringEnabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a clustered marker renderer
|
* Constructs a clustered marker renderer
|
||||||
@@ -98,7 +98,7 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
|||||||
* @param defaultSymbol The default symbol
|
* @param defaultSymbol The default symbol
|
||||||
* @param style The desired style, or NULL to disable clustering
|
* @param style The desired style, or NULL to disable clustering
|
||||||
*/
|
*/
|
||||||
public ClusterMarkerRenderer(MarkerLayer<MarkerInterface> markerLayer, MarkerSymbol defaultSymbol, ClusterMarkerRenderer.ClusterStyle style) {
|
public ClusterMarkerRenderer(MarkerLayer markerLayer, MarkerSymbol defaultSymbol, ClusterMarkerRenderer.ClusterStyle style) {
|
||||||
super(markerLayer, defaultSymbol);
|
super(markerLayer, defaultSymbol);
|
||||||
|
|
||||||
mClusteringEnabled = style != null;
|
mClusteringEnabled = style != null;
|
||||||
@@ -139,28 +139,28 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
|||||||
*/
|
*/
|
||||||
private void repopulateCluster(int size, double scale) {
|
private void repopulateCluster(int size, double scale) {
|
||||||
/* the grid slot size in px. increase to group more aggressively. currently set to marker size */
|
/* the grid slot size in px. increase to group more aggressively. currently set to marker size */
|
||||||
final int GRIDSIZE = ScreenUtils.getPixels(MAP_GRID_SIZE_DP);
|
final int GRIDSIZE = ClusterUtils.getPixels(MAP_GRID_SIZE_DP);
|
||||||
|
|
||||||
/* the factor to map into Grid Coordinates (discrete squares of GRIDSIZE x GRIDSIZE) */
|
/* the factor to map into Grid Coordinates (discrete squares of GRIDSIZE x GRIDSIZE) */
|
||||||
final double factor = (scale / GRIDSIZE);
|
final double factor = (scale / GRIDSIZE);
|
||||||
|
|
||||||
InternalItem.Clustered[] tmp = new InternalItem.Clustered[size];
|
Clustered[] tmp = new Clustered[size];
|
||||||
|
|
||||||
// clear grid map to count items that share the same "grid slot"
|
// clear grid map to count items that share the same "grid slot"
|
||||||
mGridMap.clear();
|
mGridMap.clear();
|
||||||
|
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
InternalItem.Clustered it = tmp[i] = new InternalItem.Clustered();
|
Clustered it = tmp[i] = new Clustered();
|
||||||
|
|
||||||
it.item = mMarkerLayer.createItem(i);
|
it.item = mMarkerLayer.createItem(i);
|
||||||
|
|
||||||
/* pre-project points */
|
/* pre-project points */
|
||||||
MercatorProjection.project(it.item.getPoint(), mMapPoint);
|
MercatorProjection.project(it.item.getPoint(), mMapPoint);
|
||||||
it.px = mMapPoint.x;
|
it.px = mMapPoint.x;
|
||||||
it.py = mMapPoint.y;
|
it.py = mMapPoint.y;
|
||||||
|
|
||||||
// items can be declared non-clusterable
|
// items can be declared non-clusterable
|
||||||
if (!(it.item instanceof MarkerItem.NonClusterable)) {
|
if (!(it.item instanceof NonClusterable)) {
|
||||||
|
|
||||||
final int
|
final int
|
||||||
absposx = (int) (it.px * factor), // absolute item X position in the grid
|
absposx = (int) (it.px * factor), // absolute item X position in the grid
|
||||||
@@ -244,7 +244,7 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
|||||||
int numVisible = 0;
|
int numVisible = 0;
|
||||||
|
|
||||||
// Increase view to show items that are partially visible
|
// Increase view to show items that are partially visible
|
||||||
mMarkerLayer.map().viewport().getMapExtents(mBox, Tile.SIZE / 2);
|
mMarkerLayer.map().viewport().getMapExtents(mBox, Tile.SIZE >> 1);
|
||||||
|
|
||||||
long flip = (long) (Tile.SIZE * v.pos.scale) >> 1;
|
long flip = (long) (Tile.SIZE * v.pos.scale) >> 1;
|
||||||
|
|
||||||
@@ -260,9 +260,9 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
|||||||
float cos = (float) Math.cos(angle);
|
float cos = (float) Math.cos(angle);
|
||||||
float sin = (float) Math.sin(angle);
|
float sin = (float) Math.sin(angle);
|
||||||
|
|
||||||
/* check visibility */
|
/* check visibility */
|
||||||
for (InternalItem itm : mItems) {
|
for (InternalItem itm : mItems) {
|
||||||
InternalItem.Clustered it = (InternalItem.Clustered) itm;
|
Clustered it = (Clustered) itm;
|
||||||
|
|
||||||
it.changes = false;
|
it.changes = false;
|
||||||
it.x = (float) ((it.px - mx) * scale);
|
it.x = (float) ((it.px - mx) * scale);
|
||||||
@@ -299,7 +299,7 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
|||||||
|
|
||||||
//log.debug(numVisible + " " + changedVisible + " " + changesInvisible);
|
//log.debug(numVisible + " " + changedVisible + " " + changesInvisible);
|
||||||
|
|
||||||
/* only update when zoomlevel changed, new items are visible
|
/* only update when zoomlevel changed, new items are visible
|
||||||
* or more than 10 of the current items became invisible */
|
* or more than 10 of the current items became invisible */
|
||||||
//if ((numVisible == 0) && (changedVisible == 0 && changesInvisible < 10))
|
//if ((numVisible == 0) && (changedVisible == 0 && changesInvisible < 10))
|
||||||
// return;
|
// return;
|
||||||
@@ -318,7 +318,7 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
|||||||
//log.debug(Arrays.toString(mItems));
|
//log.debug(Arrays.toString(mItems));
|
||||||
|
|
||||||
for (InternalItem itm : mItems) {
|
for (InternalItem itm : mItems) {
|
||||||
InternalItem.Clustered it = (InternalItem.Clustered) itm;
|
Clustered it = (Clustered) itm;
|
||||||
|
|
||||||
// skip invisible AND clustered-out
|
// skip invisible AND clustered-out
|
||||||
if ((!it.visible) || (it.clusteredOut))
|
if ((!it.visible) || (it.clusteredOut))
|
||||||
@@ -387,7 +387,7 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
|||||||
// create and cache bitmap. This is unacceptable inside the GL thread,
|
// create and cache bitmap. This is unacceptable inside the GL thread,
|
||||||
// so we'll call this routine at the beginning to pre-cache all bitmaps
|
// so we'll call this routine at the beginning to pre-cache all bitmaps
|
||||||
|
|
||||||
ScreenUtils.ClusterDrawable drawable = new ScreenUtils.ClusterDrawable(
|
ClusterUtils.ClusterDrawable drawable = new ClusterUtils.ClusterDrawable(
|
||||||
MAP_MARKER_CLUSTER_SIZE_DP - CLUSTER_MAXSIZE + size, // make size dependent on cluster size
|
MAP_MARKER_CLUSTER_SIZE_DP - CLUSTER_MAXSIZE + size, // make size dependent on cluster size
|
||||||
mStyleForeground,
|
mStyleForeground,
|
||||||
mStyleBackground,
|
mStyleBackground,
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.oscim.layers.marker.utils;
|
package org.oscim.android.cluster;
|
||||||
|
|
||||||
import org.oscim.backend.CanvasAdapter;
|
import org.oscim.backend.CanvasAdapter;
|
||||||
import org.oscim.backend.canvas.Bitmap;
|
import org.oscim.backend.canvas.Bitmap;
|
||||||
@@ -25,7 +25,7 @@ import org.oscim.backend.canvas.Paint;
|
|||||||
* A simple utility class to make clustered markers functionality self-contained.
|
* A simple utility class to make clustered markers functionality self-contained.
|
||||||
* Includes a method to translate between DPs and PXs and a circular icon generator.
|
* Includes a method to translate between DPs and PXs and a circular icon generator.
|
||||||
*/
|
*/
|
||||||
public class ScreenUtils {
|
public class ClusterUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get pixels from DPs
|
* Get pixels from DPs
|
||||||
@@ -38,8 +38,9 @@ public class ScreenUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class ClusterDrawable {
|
public static class ClusterDrawable {
|
||||||
private Paint mPaintText = CanvasAdapter.newPaint();
|
private final Paint mPaintText = CanvasAdapter.newPaint();
|
||||||
private Paint mPaintCircle = CanvasAdapter.newPaint(), mPaintBorder = CanvasAdapter.newPaint();
|
private final Paint mPaintCircle = CanvasAdapter.newPaint();
|
||||||
|
private final Paint mPaintBorder = CanvasAdapter.newPaint();
|
||||||
private int mSize;
|
private int mSize;
|
||||||
private String mText;
|
private String mText;
|
||||||
|
|
||||||
@@ -57,8 +58,8 @@ public class ScreenUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setup(int sizedp, int foregroundColor, int backgroundColor) {
|
private void setup(int sizedp, int foregroundColor, int backgroundColor) {
|
||||||
mSize = ScreenUtils.getPixels(sizedp);
|
mSize = ClusterUtils.getPixels(sizedp);
|
||||||
mPaintText.setTextSize(ScreenUtils.getPixels((int) (sizedp * 0.6666666)));
|
mPaintText.setTextSize(ClusterUtils.getPixels((int) (sizedp * 0.6666666)));
|
||||||
mPaintText.setColor(foregroundColor);
|
mPaintText.setColor(foregroundColor);
|
||||||
|
|
||||||
mPaintCircle.setColor(backgroundColor);
|
mPaintCircle.setColor(backgroundColor);
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017 Longri
|
* Copyright 2017 nebular
|
||||||
* Copyright 2017 devemux86
|
* Copyright 2017 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
@@ -15,19 +13,21 @@
|
|||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.oscim.test;
|
package org.oscim.android.cluster;
|
||||||
|
|
||||||
import org.oscim.gdx.GdxMapApp;
|
import org.oscim.layers.marker.InternalItem;
|
||||||
import org.oscim.utils.Parameters;
|
|
||||||
|
|
||||||
public class POTTextureTest extends SimpleMapTest {
|
/**
|
||||||
|
* Extension for clustered items.
|
||||||
|
*/
|
||||||
|
public class Clustered extends InternalItem {
|
||||||
|
/**
|
||||||
|
* If this is >0, this item will be displayed as a cluster circle, with size clusterSize+1.
|
||||||
|
*/
|
||||||
|
public int clusterSize;
|
||||||
|
|
||||||
private POTTextureTest() {
|
/**
|
||||||
Parameters.POT_TEXTURES = true;
|
* If this is true, this item is hidden (because it's represented by another InternalItem acting as cluster.
|
||||||
}
|
*/
|
||||||
|
public boolean clusteredOut;
|
||||||
public static void main(String[] args) {
|
|
||||||
GdxMapApp.init();
|
|
||||||
GdxMapApp.run(new POTTextureTest());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2017 nebular
|
||||||
|
* Copyright 2017 devemux86
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.oscim.android.cluster;
|
||||||
|
|
||||||
|
import org.oscim.core.GeoPoint;
|
||||||
|
import org.oscim.layers.marker.MarkerItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If a MarkerItem is created using this convenience class instead of MarkerItem,
|
||||||
|
* this specific item will not be clusterable.
|
||||||
|
*/
|
||||||
|
public class NonClusterable extends MarkerItem {
|
||||||
|
public NonClusterable(String title, String description, GeoPoint geoPoint) {
|
||||||
|
super(null, title, description, geoPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NonClusterable(Object uid, String title, String description, GeoPoint geoPoint) {
|
||||||
|
super(uid, title, description, geoPoint);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017 Longri
|
* Copyright 2021 Frank Knoll
|
||||||
* Copyright 2017 devemux86
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -13,19 +12,15 @@
|
|||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.oscim.test;
|
package org.oscim.android.drag;
|
||||||
|
|
||||||
import org.oscim.gdx.GdxMapApp;
|
import org.oscim.core.GeoPoint;
|
||||||
import org.oscim.utils.Parameters;
|
|
||||||
|
|
||||||
public class AtlasThemeTest extends SimpleMapTest {
|
public interface DragAndDropListener {
|
||||||
|
|
||||||
private AtlasThemeTest() {
|
void startDragItemAtGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint);
|
||||||
Parameters.TEXTURE_ATLAS = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
void ongoingDragItemToGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint);
|
||||||
GdxMapApp.init();
|
|
||||||
GdxMapApp.run(new AtlasThemeTest());
|
void dropItemAtGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2013 Hannes Janetzek
|
||||||
|
* Copyright 2016 devemux86
|
||||||
|
* Copyright 2021 Frank Knoll
|
||||||
|
*
|
||||||
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.oscim.android.drag;
|
||||||
|
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import org.oscim.android.input.AndroidMotionEvent;
|
||||||
|
import org.oscim.android.input.GestureHandler;
|
||||||
|
import org.oscim.event.Gesture;
|
||||||
|
import org.oscim.map.Map;
|
||||||
|
|
||||||
|
class DragGestureHandler extends GestureHandler {
|
||||||
|
|
||||||
|
public static final Gesture START_DRAG = new Gesture() {
|
||||||
|
};
|
||||||
|
public static final Gesture ONGOING_DRAG = new Gesture() {
|
||||||
|
};
|
||||||
|
public static final Gesture END_DRAG = new Gesture() {
|
||||||
|
};
|
||||||
|
|
||||||
|
private final AndroidMotionEvent mMotionEvent;
|
||||||
|
private final Map mMap;
|
||||||
|
private boolean scrolling = false;
|
||||||
|
|
||||||
|
public DragGestureHandler(Map map) {
|
||||||
|
super(map);
|
||||||
|
mMotionEvent = new AndroidMotionEvent();
|
||||||
|
mMap = map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isScrolling() {
|
||||||
|
return scrolling;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScrolling(boolean scrolling) {
|
||||||
|
this.scrolling = scrolling;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShowPress(MotionEvent e) {
|
||||||
|
scrolling = true;
|
||||||
|
mMap.handleGesture(START_DRAG, mMotionEvent.wrap(e));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
|
||||||
|
scrolling = true;
|
||||||
|
return mMap.handleGesture(ONGOING_DRAG, mMotionEvent.wrap(e2));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012 Hannes Janetzek
|
||||||
|
* Copyright 2016-2020 devemux86
|
||||||
|
* Copyright 2018-2019 Gustl22
|
||||||
|
* Copyright 2021 Frank Knoll
|
||||||
|
*
|
||||||
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.oscim.android.drag;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.GestureDetector;
|
||||||
|
import org.oscim.android.MapView;
|
||||||
|
import org.oscim.map.Map;
|
||||||
|
import org.oscim.utils.Parameters;
|
||||||
|
|
||||||
|
public class DragMapView extends MapView {
|
||||||
|
|
||||||
|
private DragGestureHandler gestureHandler;
|
||||||
|
|
||||||
|
public DragMapView(Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DragMapView(Context context, AttributeSet attributeSet) {
|
||||||
|
super(context, attributeSet);
|
||||||
|
|
||||||
|
if (!Parameters.MAP_EVENT_LAYER2) {
|
||||||
|
gestureHandler = new DragGestureHandler(mMap);
|
||||||
|
mGestureDetector = new GestureDetector(context, gestureHandler);
|
||||||
|
mGestureDetector.setOnDoubleTapListener(gestureHandler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onTouchEvent(android.view.MotionEvent motionEvent) {
|
||||||
|
if (!isClickable()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (motionEvent.getAction() == android.view.MotionEvent.ACTION_UP) {
|
||||||
|
if (gestureHandler.isScrolling()) {
|
||||||
|
gestureHandler.setScrolling(false);
|
||||||
|
return ((Map) mMap).handleGesture(DragGestureHandler.END_DRAG, mMotionEvent.wrap(motionEvent));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onTouchEvent(motionEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012 osmdroid authors: Nicolas Gramlich, Theodore Hong, Fred Eisele
|
||||||
|
*
|
||||||
|
* Copyright 2013 Hannes Janetzek
|
||||||
|
* Copyright 2016-2021 devemux86
|
||||||
|
* Copyright 2016 Stephan Leuschner
|
||||||
|
* Copyright 2016 Pedinel
|
||||||
|
* Copyright 2019 Carlos Alberto Martínez Gadea
|
||||||
|
* Copyright 2021 Frank Knoll
|
||||||
|
*
|
||||||
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.oscim.android.drag;
|
||||||
|
|
||||||
|
import org.oscim.core.GeoPoint;
|
||||||
|
import org.oscim.event.Gesture;
|
||||||
|
import org.oscim.event.GestureListener;
|
||||||
|
import org.oscim.event.MotionEvent;
|
||||||
|
import org.oscim.layers.marker.ItemizedLayer;
|
||||||
|
import org.oscim.layers.marker.MarkerInterface;
|
||||||
|
import org.oscim.layers.marker.MarkerSymbol;
|
||||||
|
import org.oscim.map.Map;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static org.oscim.android.drag.DragGestureHandler.*;
|
||||||
|
|
||||||
|
public class DraggableItemizedLayer extends ItemizedLayer implements GestureListener {
|
||||||
|
|
||||||
|
private final ItemDragger itemDragger;
|
||||||
|
|
||||||
|
public DraggableItemizedLayer(Map map,
|
||||||
|
List<MarkerInterface> markerItems,
|
||||||
|
MarkerSymbol defaultMarker,
|
||||||
|
OnItemGestureListener<MarkerInterface> listener) {
|
||||||
|
super(map, markerItems, defaultMarker, listener);
|
||||||
|
itemDragger = new ItemDragger(this, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean activateSelectedItems(MotionEvent event, ActiveItem task) {
|
||||||
|
return super.activateSelectedItems(event, task);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected List<MarkerInterface> getMarkerItems() {
|
||||||
|
return mItemList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onGesture(Gesture gesture, MotionEvent event) {
|
||||||
|
if (!isEnabled()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gesture == START_DRAG) {
|
||||||
|
return itemDragger.startDragItem(event, getGeoPoint(event));
|
||||||
|
} else if (gesture == ONGOING_DRAG) {
|
||||||
|
return itemDragger.ongoingDragItemTo(getGeoPoint(event));
|
||||||
|
} else if (gesture == END_DRAG) {
|
||||||
|
return itemDragger.dropItemAt(getGeoPoint(event));
|
||||||
|
} else {
|
||||||
|
itemDragger.noDrag();
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onGesture(gesture, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
private GeoPoint getGeoPoint(MotionEvent event) {
|
||||||
|
return map().viewport().fromScreenPoint(event.getX(), event.getY());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012 osmdroid authors:
|
||||||
|
* Copyright 2012 Nicolas Gramlich
|
||||||
|
* Copyright 2012 Theodore Hong
|
||||||
|
* Copyright 2012 Fred Eisele
|
||||||
|
*
|
||||||
|
* Copyright 2014 Hannes Janetzek
|
||||||
|
* Copyright 2016 devemux86
|
||||||
|
* Copyright 2016 Erik Duisters
|
||||||
|
* Copyright 2017 Longri
|
||||||
|
* Copyright 2021 Frank Knoll
|
||||||
|
*
|
||||||
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.oscim.android.drag;
|
||||||
|
|
||||||
|
import org.oscim.core.GeoPoint;
|
||||||
|
import org.oscim.layers.marker.MarkerItem;
|
||||||
|
|
||||||
|
public class DraggableMarkerItem extends MarkerItem {
|
||||||
|
|
||||||
|
private final DragAndDropListener dragAndDropListener;
|
||||||
|
|
||||||
|
public DraggableMarkerItem(String title, String description, GeoPoint geoPoint, DragAndDropListener dragAndDropListener) {
|
||||||
|
super(title, description, geoPoint);
|
||||||
|
this.dragAndDropListener = dragAndDropListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DragAndDropListener getDragAndDropListener() {
|
||||||
|
return dragAndDropListener;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 Frank Knoll
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.oscim.android.drag;
|
||||||
|
|
||||||
|
import org.oscim.core.GeoPoint;
|
||||||
|
import org.oscim.event.MotionEvent;
|
||||||
|
import org.oscim.layers.marker.ItemizedLayer;
|
||||||
|
import org.oscim.layers.marker.MarkerItem;
|
||||||
|
import org.oscim.layers.marker.MarkerLayer;
|
||||||
|
import org.oscim.map.Map;
|
||||||
|
|
||||||
|
class ItemDragger {
|
||||||
|
|
||||||
|
private final DraggableItemizedLayer draggableItemizedLayer;
|
||||||
|
private final DragAndDropListener dragItemAndRedrawListener;
|
||||||
|
private DraggableMarkerItem dragItem;
|
||||||
|
|
||||||
|
public ItemDragger(DraggableItemizedLayer draggableItemizedLayer, Map map) {
|
||||||
|
this.draggableItemizedLayer = draggableItemizedLayer;
|
||||||
|
this.dragItemAndRedrawListener = createDragItemAndRedrawListener(draggableItemizedLayer, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean startDragItem(MotionEvent event, final GeoPoint geoPoint) {
|
||||||
|
dragItem = null;
|
||||||
|
return draggableItemizedLayer.activateSelectedItems(
|
||||||
|
event,
|
||||||
|
new ItemizedLayer.ActiveItem() {
|
||||||
|
@Override
|
||||||
|
public boolean run(int index) {
|
||||||
|
dragItem = (DraggableMarkerItem) draggableItemizedLayer.getMarkerItems().get(index);
|
||||||
|
dragItemAndRedrawListener.startDragItemAtGeoPoint(dragItem, geoPoint);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean ongoingDragItemTo(GeoPoint geoPoint) {
|
||||||
|
if (dragItem == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
dragItemAndRedrawListener.ongoingDragItemToGeoPoint(dragItem, geoPoint);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean dropItemAt(GeoPoint geoPoint) {
|
||||||
|
if (dragItem == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
dragItemAndRedrawListener.dropItemAtGeoPoint(dragItem, geoPoint);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void noDrag() {
|
||||||
|
dragItem = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private DragAndDropListener createDragItemAndRedrawListener(final MarkerLayer markerLayer, final Map map) {
|
||||||
|
return new DragAndDropListener() {
|
||||||
|
@Override
|
||||||
|
public void startDragItemAtGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint) {
|
||||||
|
item.getDragAndDropListener().startDragItemAtGeoPoint(item, geoPoint);
|
||||||
|
updateLocationOfMarkerItemAndRedraw(item, geoPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ongoingDragItemToGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint) {
|
||||||
|
item.getDragAndDropListener().ongoingDragItemToGeoPoint(item, geoPoint);
|
||||||
|
updateLocationOfMarkerItemAndRedraw(item, geoPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dropItemAtGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint) {
|
||||||
|
item.getDragAndDropListener().dropItemAtGeoPoint(item, geoPoint);
|
||||||
|
updateLocationOfMarkerItemAndRedraw(item, geoPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateLocationOfMarkerItemAndRedraw(MarkerItem markerItem, GeoPoint location) {
|
||||||
|
markerItem.geoPoint = location;
|
||||||
|
markerLayer.populate();
|
||||||
|
map.render();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, 2011, 2012 mapsforge.org
|
* Copyright 2010, 2011, 2012 mapsforge.org
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-2019 devemux86
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -22,11 +22,9 @@ import android.content.Intent;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.SharedPreferences.Editor;
|
import android.content.SharedPreferences.Editor;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.GridView;
|
import android.widget.GridView;
|
||||||
|
|
||||||
import org.oscim.android.test.R;
|
import org.oscim.android.test.R;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -60,7 +58,6 @@ public class FilePicker extends Activity implements AdapterView.OnItemClickListe
|
|||||||
|
|
||||||
private static final String PREFERENCES_FILE = "FilePicker";
|
private static final String PREFERENCES_FILE = "FilePicker";
|
||||||
private static final String CURRENT_DIRECTORY = "currentDirectory";
|
private static final String CURRENT_DIRECTORY = "currentDirectory";
|
||||||
private static final String DEFAULT_DIRECTORY = Environment.getExternalStorageDirectory().getAbsolutePath();
|
|
||||||
private static final int DIALOG_FILE_INVALID = 0;
|
private static final int DIALOG_FILE_INVALID = 0;
|
||||||
|
|
||||||
// private static final int DIALOG_FILE_SELECT = 1;
|
// private static final int DIALOG_FILE_SELECT = 1;
|
||||||
@@ -122,6 +119,7 @@ public class FilePicker extends Activity implements AdapterView.OnItemClickListe
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String mDefaultDirectory;
|
||||||
private File mDirectory;
|
private File mDirectory;
|
||||||
private FilePickerIconAdapter mFilePickerIconAdapter;
|
private FilePickerIconAdapter mFilePickerIconAdapter;
|
||||||
private File[] mFiles;
|
private File[] mFiles;
|
||||||
@@ -164,7 +162,7 @@ public class FilePicker extends Activity implements AdapterView.OnItemClickListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if a parent directory exists, add it at the first position
|
// if a parent directory exists, add it at the first position
|
||||||
if (mDirectory.getParentFile() != null) {
|
if (mDirectory.getParentFile() != null && mDirectory.getParentFile().canRead()) {
|
||||||
mFilesWithParentFolder = new File[mFiles.length + 1];
|
mFilesWithParentFolder = new File[mFiles.length + 1];
|
||||||
mFilesWithParentFolder[0] = mDirectory.getParentFile();
|
mFilesWithParentFolder[0] = mDirectory.getParentFile();
|
||||||
System.arraycopy(mFiles, 0, mFilesWithParentFolder, 1,
|
System.arraycopy(mFiles, 0, mFilesWithParentFolder, 1,
|
||||||
@@ -182,6 +180,7 @@ public class FilePicker extends Activity implements AdapterView.OnItemClickListe
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_file_picker);
|
setContentView(R.layout.activity_file_picker);
|
||||||
|
|
||||||
|
mDefaultDirectory = getExternalFilesDir(null) != null ? getExternalFilesDir(null).getAbsolutePath() : "/sdcard/";
|
||||||
mFilePickerIconAdapter = new FilePickerIconAdapter(this);
|
mFilePickerIconAdapter = new FilePickerIconAdapter(this);
|
||||||
GridView gridView = (GridView) findViewById(R.id.filePickerView);
|
GridView gridView = (GridView) findViewById(R.id.filePickerView);
|
||||||
gridView.setOnItemClickListener(this);
|
gridView.setOnItemClickListener(this);
|
||||||
@@ -193,6 +192,7 @@ public class FilePicker extends Activity implements AdapterView.OnItemClickListe
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
protected Dialog onCreateDialog(int id) {
|
protected Dialog onCreateDialog(int id) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
@@ -239,10 +239,9 @@ public class FilePicker extends Activity implements AdapterView.OnItemClickListe
|
|||||||
// restore the current directory
|
// restore the current directory
|
||||||
SharedPreferences preferences = getSharedPreferences(PREFERENCES_FILE,
|
SharedPreferences preferences = getSharedPreferences(PREFERENCES_FILE,
|
||||||
MODE_PRIVATE);
|
MODE_PRIVATE);
|
||||||
mDirectory = new File(preferences.getString(CURRENT_DIRECTORY,
|
mDirectory = new File(preferences.getString(CURRENT_DIRECTORY, mDefaultDirectory));
|
||||||
DEFAULT_DIRECTORY));
|
|
||||||
if (!mDirectory.exists() || !mDirectory.canRead()) {
|
if (!mDirectory.exists() || !mDirectory.canRead()) {
|
||||||
mDirectory = new File(DEFAULT_DIRECTORY);
|
mDirectory = new File(mDefaultDirectory);
|
||||||
}
|
}
|
||||||
browseToCurrentDirectory();
|
browseToCurrentDirectory();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, 2011, 2012 mapsforge.org
|
* Copyright 2010, 2011, 2012 mapsforge.org
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2020 devemux86
|
||||||
* Copyright 2017 Longri
|
* Copyright 2017 Longri
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
@@ -16,18 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.android.filepicker;
|
package org.oscim.android.filepicker;
|
||||||
|
|
||||||
import org.oscim.theme.ExternalRenderTheme;
|
import org.oscim.theme.ThemeLoader;
|
||||||
import org.oscim.theme.ThemeFile;
|
|
||||||
import org.oscim.theme.XmlThemeBuilder;
|
|
||||||
import org.oscim.tiling.TileSource.OpenResult;
|
import org.oscim.tiling.TileSource.OpenResult;
|
||||||
import org.xml.sax.InputSource;
|
|
||||||
import org.xml.sax.XMLReader;
|
|
||||||
import org.xml.sax.helpers.DefaultHandler;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import javax.xml.parsers.SAXParserFactory;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accepts all valid render theme XML files.
|
* Accepts all valid render theme XML files.
|
||||||
*/
|
*/
|
||||||
@@ -36,13 +29,8 @@ public final class ValidRenderTheme implements ValidFileFilter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(File file) {
|
public boolean accept(File file) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ThemeFile theme = new ExternalRenderTheme(file.getAbsolutePath());
|
ThemeLoader.load(file.getAbsolutePath());
|
||||||
DefaultHandler renderThemeHandler = new XmlThemeBuilder(theme);
|
|
||||||
XMLReader xmlReader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
|
|
||||||
xmlReader.setContentHandler(renderThemeHandler);
|
|
||||||
xmlReader.parse(new InputSource(theme.getRenderThemeAsStream()));
|
|
||||||
mOpenResult = OpenResult.SUCCESS;
|
mOpenResult = OpenResult.SUCCESS;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
mOpenResult = new OpenResult(e.getMessage());
|
mOpenResult = new OpenResult(e.getMessage());
|
||||||
|
|||||||
@@ -1,91 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2014 Hannes Janetzek
|
|
||||||
* Copyright 2016-2018 devemux86
|
|
||||||
* Copyright 2017 Longri
|
|
||||||
*
|
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
|
||||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package org.oscim.android.test;
|
|
||||||
|
|
||||||
import org.oscim.backend.canvas.Bitmap;
|
|
||||||
import org.oscim.core.GeoPoint;
|
|
||||||
import org.oscim.layers.marker.ItemizedLayer;
|
|
||||||
import org.oscim.layers.marker.MarkerItem;
|
|
||||||
import org.oscim.layers.marker.MarkerSymbol;
|
|
||||||
import org.oscim.layers.marker.MarkerSymbol.HotspotPlace;
|
|
||||||
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
|
||||||
import org.oscim.renderer.atlas.TextureAtlas;
|
|
||||||
import org.oscim.renderer.atlas.TextureRegion;
|
|
||||||
import org.oscim.tiling.TileSource;
|
|
||||||
import org.oscim.tiling.source.OkHttpEngine;
|
|
||||||
import org.oscim.tiling.source.bitmap.DefaultSources;
|
|
||||||
import org.oscim.utils.TextureAtlasUtils;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static org.oscim.android.canvas.AndroidGraphics.drawableToBitmap;
|
|
||||||
|
|
||||||
public class AtlasMarkerOverlayActivity extends MarkerOverlayActivity {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
void createLayers() {
|
|
||||||
// Map events receiver
|
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
|
||||||
|
|
||||||
TileSource tileSource = DefaultSources.OPENSTREETMAP
|
|
||||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
|
||||||
.build();
|
|
||||||
mMap.layers().add(new BitmapTileLayer(mMap, tileSource));
|
|
||||||
|
|
||||||
Bitmap bitmapPoi = drawableToBitmap(getResources().getDrawable(R.drawable.marker_poi));
|
|
||||||
Bitmap bitmapFocus = drawableToBitmap(getResources().getDrawable(R.drawable.marker_focus));
|
|
||||||
|
|
||||||
// Create Atlas from Bitmaps
|
|
||||||
java.util.Map<Object, Bitmap> inputMap = new LinkedHashMap<>();
|
|
||||||
java.util.Map<Object, TextureRegion> regionsMap = new LinkedHashMap<>();
|
|
||||||
List<TextureAtlas> atlasList = new ArrayList<>();
|
|
||||||
|
|
||||||
inputMap.put("poi", bitmapPoi);
|
|
||||||
inputMap.put("focus", bitmapFocus);
|
|
||||||
|
|
||||||
// Bitmaps will never used any more
|
|
||||||
// With iOS we must flip the Y-Axis
|
|
||||||
TextureAtlasUtils.createTextureRegions(inputMap, regionsMap, atlasList, true, false);
|
|
||||||
|
|
||||||
MarkerSymbol symbol;
|
|
||||||
if (BILLBOARDS)
|
|
||||||
symbol = new MarkerSymbol(regionsMap.get("poi"), HotspotPlace.BOTTOM_CENTER);
|
|
||||||
else
|
|
||||||
symbol = new MarkerSymbol(regionsMap.get("poi"), HotspotPlace.CENTER, false);
|
|
||||||
|
|
||||||
if (BILLBOARDS)
|
|
||||||
mFocusMarker = new MarkerSymbol(regionsMap.get("focus"), HotspotPlace.BOTTOM_CENTER);
|
|
||||||
else
|
|
||||||
mFocusMarker = new MarkerSymbol(regionsMap.get("focus"), HotspotPlace.CENTER, false);
|
|
||||||
|
|
||||||
mMarkerLayer = new ItemizedLayer<>(mMap, new ArrayList<MarkerItem>(), symbol, this);
|
|
||||||
mMap.layers().add(mMarkerLayer);
|
|
||||||
|
|
||||||
List<MarkerItem> pts = new ArrayList<>();
|
|
||||||
|
|
||||||
for (double lat = -90; lat <= 90; lat += 5) {
|
|
||||||
for (double lon = -180; lon <= 180; lon += 5)
|
|
||||||
pts.add(new MarkerItem(lat + "/" + lon, "", new GeoPoint(lat, lon)));
|
|
||||||
}
|
|
||||||
|
|
||||||
mMarkerLayer.addItems(pts);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 Hannes Janetzek
|
* Copyright 2014 Hannes Janetzek
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2020 devemux86
|
||||||
* Copyright 2017 Longri
|
* Copyright 2017 Longri
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
@@ -19,7 +19,6 @@
|
|||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.oscim.backend.CanvasAdapter;
|
import org.oscim.backend.CanvasAdapter;
|
||||||
import org.oscim.backend.canvas.Bitmap;
|
import org.oscim.backend.canvas.Bitmap;
|
||||||
import org.oscim.backend.canvas.Canvas;
|
import org.oscim.backend.canvas.Canvas;
|
||||||
@@ -27,18 +26,20 @@ import org.oscim.backend.canvas.Color;
|
|||||||
import org.oscim.backend.canvas.Paint;
|
import org.oscim.backend.canvas.Paint;
|
||||||
import org.oscim.core.GeoPoint;
|
import org.oscim.core.GeoPoint;
|
||||||
import org.oscim.layers.marker.ItemizedLayer;
|
import org.oscim.layers.marker.ItemizedLayer;
|
||||||
|
import org.oscim.layers.marker.MarkerInterface;
|
||||||
import org.oscim.layers.marker.MarkerItem;
|
import org.oscim.layers.marker.MarkerItem;
|
||||||
import org.oscim.layers.marker.MarkerSymbol;
|
import org.oscim.layers.marker.MarkerSymbol;
|
||||||
import org.oscim.layers.marker.MarkerSymbol.HotspotPlace;
|
import org.oscim.layers.marker.MarkerSymbol.HotspotPlace;
|
||||||
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
||||||
import org.oscim.renderer.atlas.TextureAtlas;
|
import org.oscim.renderer.atlas.TextureAtlas;
|
||||||
import org.oscim.renderer.atlas.TextureRegion;
|
import org.oscim.renderer.atlas.TextureRegion;
|
||||||
import org.oscim.tiling.TileSource;
|
|
||||||
import org.oscim.tiling.source.OkHttpEngine;
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
|
import org.oscim.tiling.source.UrlTileSource;
|
||||||
import org.oscim.tiling.source.bitmap.DefaultSources;
|
import org.oscim.tiling.source.bitmap.DefaultSources;
|
||||||
import org.oscim.utils.TextureAtlasUtils;
|
import org.oscim.utils.TextureAtlasUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -49,9 +50,10 @@ public class AtlasMultiTextureActivity extends MarkerOverlayActivity {
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
TileSource tileSource = DefaultSources.OPENSTREETMAP
|
UrlTileSource tileSource = DefaultSources.OPENSTREETMAP
|
||||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
.build();
|
.build();
|
||||||
|
tileSource.setHttpRequestHeaders(Collections.singletonMap("User-Agent", "vtm-android-example"));
|
||||||
mMap.layers().add(new BitmapTileLayer(mMap, tileSource));
|
mMap.layers().add(new BitmapTileLayer(mMap, tileSource));
|
||||||
|
|
||||||
// Create Atlas from Bitmaps
|
// Create Atlas from Bitmaps
|
||||||
@@ -65,7 +67,7 @@ public class AtlasMultiTextureActivity extends MarkerOverlayActivity {
|
|||||||
paint.setTextSize(12 * CanvasAdapter.getScale());
|
paint.setTextSize(12 * CanvasAdapter.getScale());
|
||||||
paint.setStrokeWidth(2 * CanvasAdapter.getScale());
|
paint.setStrokeWidth(2 * CanvasAdapter.getScale());
|
||||||
paint.setColor(Color.BLACK);
|
paint.setColor(Color.BLACK);
|
||||||
List<MarkerItem> pts = new ArrayList<>();
|
List<MarkerInterface> pts = new ArrayList<>();
|
||||||
for (double lat = -90; lat <= 90; lat += 10) {
|
for (double lat = -90; lat <= 90; lat += 10) {
|
||||||
for (double lon = -180; lon <= 180; lon += 10) {
|
for (double lon = -180; lon <= 180; lon += 10) {
|
||||||
String title = lat + "/" + lon;
|
String title = lat + "/" + lon;
|
||||||
@@ -85,29 +87,32 @@ public class AtlasMultiTextureActivity extends MarkerOverlayActivity {
|
|||||||
// With iOS we must flip the Y-Axis
|
// With iOS we must flip the Y-Axis
|
||||||
TextureAtlasUtils.createTextureRegions(inputMap, regionsMap, atlasList, true, false);
|
TextureAtlasUtils.createTextureRegions(inputMap, regionsMap, atlasList, true, false);
|
||||||
|
|
||||||
mMarkerLayer = new ItemizedLayer<>(mMap, new ArrayList<MarkerItem>(), (MarkerSymbol) null, this);
|
mMarkerLayer = new ItemizedLayer(mMap, new ArrayList<MarkerInterface>(), (MarkerSymbol) null, this);
|
||||||
mMap.layers().add(mMarkerLayer);
|
mMap.layers().add(mMarkerLayer);
|
||||||
|
|
||||||
mMarkerLayer.addItems(pts);
|
mMarkerLayer.addItems(pts);
|
||||||
|
|
||||||
// set all markers
|
// set all markers
|
||||||
for (MarkerItem item : pts) {
|
for (MarkerInterface item : pts) {
|
||||||
MarkerSymbol markerSymbol = new MarkerSymbol(regionsMap.get(item.getTitle()), HotspotPlace.BOTTOM_CENTER);
|
MarkerItem markerItem = (MarkerItem) item;
|
||||||
item.setMarker(markerSymbol);
|
MarkerSymbol markerSymbol = new MarkerSymbol(regionsMap.get(markerItem.getTitle()), HotspotPlace.BOTTOM_CENTER);
|
||||||
|
markerItem.setMarker(markerSymbol);
|
||||||
}
|
}
|
||||||
|
|
||||||
Toast.makeText(this, "Atlas count: " + atlasList.size(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Atlas count: " + atlasList.size(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemSingleTapUp(int index, MarkerItem item) {
|
public boolean onItemSingleTapUp(int index, MarkerInterface item) {
|
||||||
Toast.makeText(this, "Marker tap\n" + item.getTitle(), Toast.LENGTH_SHORT).show();
|
MarkerItem markerItem = (MarkerItem) item;
|
||||||
|
Toast.makeText(this, "Marker tap\n" + markerItem.getTitle(), Toast.LENGTH_SHORT).show();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemLongPress(int index, MarkerItem item) {
|
public boolean onItemLongPress(int index, MarkerInterface item) {
|
||||||
Toast.makeText(this, "Marker long press\n" + item.getTitle(), Toast.LENGTH_SHORT).show();
|
MarkerItem markerItem = (MarkerItem) item;
|
||||||
|
Toast.makeText(this, "Marker long press\n" + markerItem.getTitle(), Toast.LENGTH_SHORT).show();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2020 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -20,8 +20,8 @@ package org.oscim.android.test;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
import okhttp3.Cache;
|
||||||
import org.oscim.android.cache.TileCache;
|
import okhttp3.OkHttpClient;
|
||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
import org.oscim.layers.TileGridLayer;
|
import org.oscim.layers.TileGridLayer;
|
||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
@@ -29,20 +29,17 @@ import org.oscim.theme.VtmThemes;
|
|||||||
import org.oscim.tiling.TileSource;
|
import org.oscim.tiling.TileSource;
|
||||||
import org.oscim.tiling.source.OkHttpEngine;
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
import java.io.File;
|
||||||
|
|
||||||
public class BaseMapActivity extends MapActivity {
|
public class BaseMapActivity extends MapActivity {
|
||||||
static final Logger log = LoggerFactory.getLogger(BaseMapActivity.class);
|
|
||||||
|
|
||||||
final static boolean USE_CACHE = false;
|
static final boolean USE_CACHE = false;
|
||||||
|
|
||||||
VectorTileLayer mBaseLayer;
|
VectorTileLayer mBaseLayer;
|
||||||
TileSource mTileSource;
|
TileSource mTileSource;
|
||||||
TileGridLayer mGridLayer;
|
TileGridLayer mGridLayer;
|
||||||
|
|
||||||
private TileCache mCache;
|
|
||||||
|
|
||||||
public BaseMapActivity(int contentView) {
|
public BaseMapActivity(int contentView) {
|
||||||
super(contentView);
|
super(contentView);
|
||||||
}
|
}
|
||||||
@@ -54,15 +51,19 @@ public class BaseMapActivity extends MapActivity {
|
|||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||||
|
if (USE_CACHE) {
|
||||||
|
// Cache the tiles into file system
|
||||||
|
File cacheDirectory = new File(getExternalCacheDir(), "tiles");
|
||||||
|
int cacheSize = 10 * 1024 * 1024; // 10 MB
|
||||||
|
Cache cache = new Cache(cacheDirectory, cacheSize);
|
||||||
|
builder.cache(cache);
|
||||||
|
}
|
||||||
|
|
||||||
mTileSource = OSciMap4TileSource.builder()
|
mTileSource = OSciMap4TileSource.builder()
|
||||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
.httpFactory(new OkHttpEngine.OkHttpFactory(builder))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
if (USE_CACHE) {
|
|
||||||
mCache = new TileCache(this, null, "tile.db");
|
|
||||||
mCache.setCacheSize(512 * (1 << 10));
|
|
||||||
mTileSource.setCache(mCache);
|
|
||||||
}
|
|
||||||
mBaseLayer = mMap.setBaseMap(mTileSource);
|
mBaseLayer = mMap.setBaseMap(mTileSource);
|
||||||
|
|
||||||
/* set initial position on first run */
|
/* set initial position on first run */
|
||||||
@@ -72,56 +73,42 @@ public class BaseMapActivity extends MapActivity {
|
|||||||
mMap.setMapPosition(53.08, 8.83, Math.pow(2, 16));
|
mMap.setMapPosition(53.08, 8.83, Math.pow(2, 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
|
|
||||||
if (mCache != null)
|
|
||||||
mCache.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
int itemId = item.getItemId();
|
||||||
switch (item.getItemId()) {
|
if (itemId == R.id.theme_default) {
|
||||||
case R.id.theme_default:
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
item.setChecked(true);
|
||||||
|
return true;
|
||||||
|
} else if (itemId == R.id.theme_osmarender) {
|
||||||
|
mMap.setTheme(VtmThemes.OSMARENDER);
|
||||||
|
item.setChecked(true);
|
||||||
|
return true;
|
||||||
|
} else if (itemId == R.id.theme_osmagray) {
|
||||||
|
mMap.setTheme(VtmThemes.OSMAGRAY);
|
||||||
|
item.setChecked(true);
|
||||||
|
return true;
|
||||||
|
} else if (itemId == R.id.theme_tubes) {
|
||||||
|
mMap.setTheme(VtmThemes.TRONRENDER);
|
||||||
|
item.setChecked(true);
|
||||||
|
return true;
|
||||||
|
} else if (itemId == R.id.theme_newtron) {
|
||||||
|
mMap.setTheme(VtmThemes.NEWTRON);
|
||||||
|
item.setChecked(true);
|
||||||
|
return true;
|
||||||
|
} else if (itemId == R.id.gridlayer) {
|
||||||
|
if (item.isChecked()) {
|
||||||
|
item.setChecked(false);
|
||||||
|
mMap.layers().remove(mGridLayer);
|
||||||
|
} else {
|
||||||
item.setChecked(true);
|
item.setChecked(true);
|
||||||
return true;
|
if (mGridLayer == null)
|
||||||
|
mGridLayer = new TileGridLayer(mMap);
|
||||||
|
|
||||||
case R.id.theme_osmarender:
|
mMap.layers().add(mGridLayer);
|
||||||
mMap.setTheme(VtmThemes.OSMARENDER);
|
}
|
||||||
item.setChecked(true);
|
mMap.updateMap(true);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.theme_osmagray:
|
|
||||||
mMap.setTheme(VtmThemes.OSMAGRAY);
|
|
||||||
item.setChecked(true);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case R.id.theme_tubes:
|
|
||||||
mMap.setTheme(VtmThemes.TRONRENDER);
|
|
||||||
item.setChecked(true);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case R.id.theme_newtron:
|
|
||||||
mMap.setTheme(VtmThemes.NEWTRON);
|
|
||||||
item.setChecked(true);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case R.id.gridlayer:
|
|
||||||
if (item.isChecked()) {
|
|
||||||
item.setChecked(false);
|
|
||||||
mMap.layers().remove(mGridLayer);
|
|
||||||
} else {
|
|
||||||
item.setChecked(true);
|
|
||||||
if (mGridLayer == null)
|
|
||||||
mGridLayer = new TileGridLayer(mMap);
|
|
||||||
|
|
||||||
mMap.layers().add(mGridLayer);
|
|
||||||
}
|
|
||||||
mMap.updateMap(true);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 Hannes Janetzek
|
* Copyright 2014 Hannes Janetzek
|
||||||
* Copyright 2017-2018 devemux86
|
* Copyright 2017-2020 devemux86
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -16,22 +16,22 @@
|
|||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import okhttp3.Cache;
|
||||||
import org.oscim.android.cache.TileCache;
|
import okhttp3.OkHttpClient;
|
||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
import org.oscim.core.MercatorProjection;
|
import org.oscim.core.MercatorProjection;
|
||||||
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
||||||
import org.oscim.renderer.MapRenderer;
|
import org.oscim.renderer.MapRenderer;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.bitmap.BitmapTileSource;
|
import org.oscim.tiling.source.bitmap.BitmapTileSource;
|
||||||
import org.oscim.tiling.source.bitmap.DefaultSources;
|
import org.oscim.tiling.source.bitmap.DefaultSources;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
import java.io.File;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
public class BitmapTileActivity extends MapActivity {
|
public class BitmapTileActivity extends MapActivity {
|
||||||
|
|
||||||
static final Logger log = LoggerFactory.getLogger(BitmapTileActivity.class);
|
private static final boolean USE_CACHE = false;
|
||||||
|
|
||||||
private final static boolean USE_CACHE = false;
|
|
||||||
|
|
||||||
private final BitmapTileSource mTileSource;
|
private final BitmapTileSource mTileSource;
|
||||||
protected BitmapTileLayer mBitmapLayer;
|
protected BitmapTileLayer mBitmapLayer;
|
||||||
@@ -45,8 +45,6 @@ public class BitmapTileActivity extends MapActivity {
|
|||||||
mTileSource = tileSource;
|
mTileSource = tileSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
private TileCache mCache;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -56,31 +54,24 @@ public class BitmapTileActivity extends MapActivity {
|
|||||||
if (mTileSource == null)
|
if (mTileSource == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||||
if (USE_CACHE) {
|
if (USE_CACHE) {
|
||||||
String cacheFile = mTileSource.getUrl()
|
// Cache the tiles into file system
|
||||||
.toString()
|
File cacheDirectory = new File(getExternalCacheDir(), "tiles");
|
||||||
.replaceFirst("https?://", "")
|
int cacheSize = 10 * 1024 * 1024; // 10 MB
|
||||||
.replaceAll("/", "-");
|
Cache cache = new Cache(cacheDirectory, cacheSize);
|
||||||
|
builder.cache(cache);
|
||||||
log.debug("use bitmap cache {}", cacheFile);
|
|
||||||
mCache = new TileCache(this, null, cacheFile);
|
|
||||||
mCache.setCacheSize(512 * (1 << 10));
|
|
||||||
mTileSource.setCache(mCache);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mTileSource.setHttpEngine(new OkHttpEngine.OkHttpFactory(builder));
|
||||||
|
mTileSource.setHttpRequestHeaders(Collections.singletonMap("User-Agent", "vtm-android-example"));
|
||||||
|
|
||||||
mBitmapLayer = new BitmapTileLayer(mMap, mTileSource);
|
mBitmapLayer = new BitmapTileLayer(mMap, mTileSource);
|
||||||
mMap.layers().add(mBitmapLayer);
|
mMap.layers().add(mBitmapLayer);
|
||||||
|
|
||||||
//loooop(1);
|
//loooop(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
if (mCache != null)
|
|
||||||
mCache.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Stress testing
|
// Stress testing
|
||||||
void loooop(final int i) {
|
void loooop(final int i) {
|
||||||
final long time = (long) (500 + Math.random() * 1000);
|
final long time = (long) (500 + Math.random() * 1000);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2018 devemux86
|
* Copyright 2020 Meibes
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -15,22 +15,23 @@
|
|||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import org.oscim.utils.Parameters;
|
@SuppressWarnings("deprecation")
|
||||||
|
public class BlankFragment extends android.app.Fragment {
|
||||||
|
|
||||||
public class MapsforgePolyLabelActivity extends MapsforgeActivity {
|
static BlankFragment newInstance() {
|
||||||
|
BlankFragment instance = new BlankFragment();
|
||||||
|
|
||||||
@Override
|
Bundle args = new Bundle();
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
instance.setArguments(args);
|
||||||
Parameters.POLY_LABEL = true;
|
return instance;
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
super.onDestroy();
|
return inflater.inflate(R.layout.fragment_blank, container, false);
|
||||||
|
|
||||||
Parameters.POLY_LABEL = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2020 devemux86
|
||||||
* Copyright 2017 nebular
|
* Copyright 2017 nebular
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
@@ -15,26 +15,22 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import org.oscim.android.canvas.AndroidBitmap;
|
||||||
|
import org.oscim.android.cluster.ClusterMarkerRenderer;
|
||||||
import org.oscim.backend.canvas.Bitmap;
|
import org.oscim.backend.canvas.Bitmap;
|
||||||
import org.oscim.backend.canvas.Color;
|
import org.oscim.backend.canvas.Color;
|
||||||
import org.oscim.core.GeoPoint;
|
import org.oscim.core.GeoPoint;
|
||||||
import org.oscim.layers.marker.ClusterMarkerRenderer;
|
import org.oscim.layers.marker.*;
|
||||||
import org.oscim.layers.marker.ItemizedLayer;
|
|
||||||
import org.oscim.layers.marker.MarkerItem;
|
|
||||||
import org.oscim.layers.marker.MarkerLayer;
|
|
||||||
import org.oscim.layers.marker.MarkerRenderer;
|
|
||||||
import org.oscim.layers.marker.MarkerRendererFactory;
|
|
||||||
import org.oscim.layers.marker.MarkerSymbol;
|
|
||||||
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
||||||
import org.oscim.tiling.TileSource;
|
|
||||||
import org.oscim.tiling.source.OkHttpEngine;
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
|
import org.oscim.tiling.source.UrlTileSource;
|
||||||
import org.oscim.tiling.source.bitmap.DefaultSources;
|
import org.oscim.tiling.source.bitmap.DefaultSources;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.oscim.android.canvas.AndroidGraphics.drawableToBitmap;
|
|
||||||
|
|
||||||
public class ClusterMarkerOverlayActivity extends MarkerOverlayActivity {
|
public class ClusterMarkerOverlayActivity extends MarkerOverlayActivity {
|
||||||
|
|
||||||
private static final int COUNT = 5;
|
private static final int COUNT = 5;
|
||||||
@@ -45,12 +41,13 @@ public class ClusterMarkerOverlayActivity extends MarkerOverlayActivity {
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
TileSource tileSource = DefaultSources.OPENSTREETMAP
|
UrlTileSource tileSource = DefaultSources.OPENSTREETMAP
|
||||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
.build();
|
.build();
|
||||||
|
tileSource.setHttpRequestHeaders(Collections.singletonMap("User-Agent", "vtm-android-example"));
|
||||||
mMap.layers().add(new BitmapTileLayer(mMap, tileSource));
|
mMap.layers().add(new BitmapTileLayer(mMap, tileSource));
|
||||||
|
|
||||||
Bitmap bitmapPoi = drawableToBitmap(getResources().getDrawable(R.drawable.marker_poi));
|
Bitmap bitmapPoi = new AndroidBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.marker_poi));
|
||||||
final MarkerSymbol symbol;
|
final MarkerSymbol symbol;
|
||||||
if (BILLBOARDS)
|
if (BILLBOARDS)
|
||||||
symbol = new MarkerSymbol(bitmapPoi, MarkerSymbol.HotspotPlace.BOTTOM_CENTER);
|
symbol = new MarkerSymbol(bitmapPoi, MarkerSymbol.HotspotPlace.BOTTOM_CENTER);
|
||||||
@@ -69,15 +66,15 @@ public class ClusterMarkerOverlayActivity extends MarkerOverlayActivity {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
mMarkerLayer = new ItemizedLayer<>(
|
mMarkerLayer = new ItemizedLayer(
|
||||||
mMap,
|
mMap,
|
||||||
new ArrayList<MarkerItem>(),
|
new ArrayList<MarkerInterface>(),
|
||||||
markerRendererFactory,
|
markerRendererFactory,
|
||||||
this);
|
this);
|
||||||
mMap.layers().add(mMarkerLayer);
|
mMap.layers().add(mMarkerLayer);
|
||||||
|
|
||||||
// Create some markers spaced STEP degrees
|
// Create some markers spaced STEP degrees
|
||||||
List<MarkerItem> pts = new ArrayList<>();
|
List<MarkerInterface> pts = new ArrayList<>();
|
||||||
mMap.setMapPosition(53.08, 8.83, 1 << 15);
|
mMap.setMapPosition(53.08, 8.83, 1 << 15);
|
||||||
GeoPoint center = mMap.getMapPosition().getGeoPoint();
|
GeoPoint center = mMap.getMapPosition().getGeoPoint();
|
||||||
for (int x = -COUNT; x < COUNT; x++) {
|
for (int x = -COUNT; x < COUNT; x++) {
|
||||||
|
|||||||
@@ -0,0 +1,105 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2014 Hannes Janetzek
|
||||||
|
* Copyright 2016-2020 devemux86
|
||||||
|
* Copyright 2021 Frank Knoll
|
||||||
|
*
|
||||||
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.oscim.android.test;
|
||||||
|
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import org.oscim.android.canvas.AndroidBitmap;
|
||||||
|
import org.oscim.android.drag.DragAndDropListener;
|
||||||
|
import org.oscim.android.drag.DraggableItemizedLayer;
|
||||||
|
import org.oscim.android.drag.DraggableMarkerItem;
|
||||||
|
import org.oscim.core.GeoPoint;
|
||||||
|
import org.oscim.layers.marker.ItemizedLayer;
|
||||||
|
import org.oscim.layers.marker.MarkerInterface;
|
||||||
|
import org.oscim.layers.marker.MarkerSymbol;
|
||||||
|
import org.oscim.layers.marker.MarkerSymbol.HotspotPlace;
|
||||||
|
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
|
import org.oscim.tiling.source.UrlTileSource;
|
||||||
|
import org.oscim.tiling.source.bitmap.DefaultSources;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DraggableMarkerOverlayActivity extends MapActivity {
|
||||||
|
|
||||||
|
public DraggableMarkerOverlayActivity() {
|
||||||
|
super(R.layout.activity_map_draggable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
createLayers();
|
||||||
|
}
|
||||||
|
|
||||||
|
void createLayers() {
|
||||||
|
UrlTileSource tileSource = DefaultSources.OPENSTREETMAP
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
|
tileSource.setHttpRequestHeaders(Collections.singletonMap("User-Agent", "vtm-android-example"));
|
||||||
|
mMap.layers().add(new BitmapTileLayer(mMap, tileSource));
|
||||||
|
|
||||||
|
ItemizedLayer mMarkerLayer = new DraggableItemizedLayer(
|
||||||
|
mMap,
|
||||||
|
new ArrayList<MarkerInterface>(),
|
||||||
|
new MarkerSymbol(
|
||||||
|
new AndroidBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.marker_poi)),
|
||||||
|
HotspotPlace.BOTTOM_CENTER),
|
||||||
|
null);
|
||||||
|
mMap.layers().add(mMarkerLayer);
|
||||||
|
|
||||||
|
DragAndDropListener dragAndDropListener = new DragAndDropListener() {
|
||||||
|
@Override
|
||||||
|
public void startDragItemAtGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint) {
|
||||||
|
Log.i(DraggableMarkerOverlayActivity.this.getClass().getSimpleName(), "startDragItemAtGeoPoint: " + geoPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ongoingDragItemToGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint) {
|
||||||
|
Log.i(DraggableMarkerOverlayActivity.this.getClass().getSimpleName(), "ongoingDragItemToGeoPoint: " + geoPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dropItemAtGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint) {
|
||||||
|
Log.i(DraggableMarkerOverlayActivity.this.getClass().getSimpleName(), "dropItemAtGeoPoint: " + geoPoint);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
List<MarkerInterface> pts = new ArrayList<>();
|
||||||
|
for (double lat = -90; lat <= 90; lat += 45) {
|
||||||
|
for (double lon = -180; lon <= 180; lon += 45) {
|
||||||
|
pts.add(new DraggableMarkerItem(lat + "/" + lon, "", new GeoPoint(lat, lon), dragAndDropListener));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mMarkerLayer.addItems(pts);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
/* ignore saved position */
|
||||||
|
mMap.setMapPosition(0, 0, 1 << 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2020 Meibes
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.oscim.android.test;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public class FragmentActivity extends Activity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_map_fragment);
|
||||||
|
|
||||||
|
setTitle(getClass().getSimpleName());
|
||||||
|
|
||||||
|
if (savedInstanceState == null) {
|
||||||
|
android.app.Fragment mapFragment = MapFragment.newInstance();
|
||||||
|
android.app.FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||||
|
ft.add(R.id.fragment_container, mapFragment).commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
getMenuInflater().inflate(R.menu.fragment_menu, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == R.id.replace_fragment) {
|
||||||
|
android.app.Fragment blankFragment = BlankFragment.newInstance();
|
||||||
|
android.app.FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||||
|
ft.replace(R.id.fragment_container, blankFragment);
|
||||||
|
ft.addToBackStack(null);
|
||||||
|
ft.commit();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2020 devemux86
|
||||||
* Copyright 2018 Gustl22
|
* Copyright 2018-2019 Gustl22
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -23,16 +23,26 @@ import android.util.DisplayMetrics;
|
|||||||
|
|
||||||
import com.badlogic.gdx.backends.android.AndroidApplication;
|
import com.badlogic.gdx.backends.android.AndroidApplication;
|
||||||
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
|
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
|
||||||
|
import com.badlogic.gdx.graphics.glutils.GLVersion;
|
||||||
import com.badlogic.gdx.utils.SharedLibraryLoader;
|
import com.badlogic.gdx.utils.SharedLibraryLoader;
|
||||||
|
|
||||||
import org.oscim.android.MapPreferences;
|
import org.oscim.android.MapPreferences;
|
||||||
import org.oscim.android.canvas.AndroidGraphics;
|
import org.oscim.android.canvas.AndroidGraphics;
|
||||||
import org.oscim.backend.CanvasAdapter;
|
import org.oscim.backend.CanvasAdapter;
|
||||||
|
import org.oscim.backend.DateTime;
|
||||||
|
import org.oscim.backend.DateTimeAdapter;
|
||||||
import org.oscim.backend.GLAdapter;
|
import org.oscim.backend.GLAdapter;
|
||||||
import org.oscim.core.Tile;
|
import org.oscim.core.Tile;
|
||||||
import org.oscim.gdx.AndroidGL;
|
import org.oscim.gdx.AndroidGL;
|
||||||
|
import org.oscim.gdx.AndroidGL30;
|
||||||
import org.oscim.gdx.GdxAssets;
|
import org.oscim.gdx.GdxAssets;
|
||||||
import org.oscim.gdx.GdxMap;
|
import org.oscim.gdx.GdxMap;
|
||||||
|
import org.oscim.gdx.poi3d.Poi3DLayer;
|
||||||
|
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||||
|
import org.oscim.layers.tile.buildings.S3DBLayer;
|
||||||
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
|
import org.oscim.theme.VtmThemes;
|
||||||
import org.oscim.tiling.TileSource;
|
import org.oscim.tiling.TileSource;
|
||||||
import org.oscim.tiling.source.OkHttpEngine;
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
@@ -40,16 +50,28 @@ import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
|||||||
public class GdxActivity extends AndroidApplication {
|
public class GdxActivity extends AndroidApplication {
|
||||||
MapPreferences mPrefs;
|
MapPreferences mPrefs;
|
||||||
|
|
||||||
|
private boolean mPoi3d;
|
||||||
|
private boolean mS3db;
|
||||||
|
|
||||||
|
public GdxActivity() {
|
||||||
|
this(false, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GdxActivity(boolean s3db, boolean poi3d) {
|
||||||
|
mS3db = s3db;
|
||||||
|
mPoi3d = poi3d;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
AndroidGraphics.init();
|
AndroidGraphics.init();
|
||||||
GdxAssets.init("");
|
GdxAssets.init("");
|
||||||
GLAdapter.init(new AndroidGL());
|
DateTimeAdapter.init(new DateTime());
|
||||||
|
|
||||||
DisplayMetrics metrics = getResources().getDisplayMetrics();
|
DisplayMetrics metrics = getResources().getDisplayMetrics();
|
||||||
CanvasAdapter.dpi = (int) (metrics.scaledDensity * CanvasAdapter.DEFAULT_DPI);
|
CanvasAdapter.dpi = (int) (metrics.density * CanvasAdapter.DEFAULT_DPI);
|
||||||
Tile.SIZE = Tile.calculateTileSize();
|
Tile.SIZE = Tile.calculateTileSize();
|
||||||
|
|
||||||
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
|
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
|
||||||
@@ -63,13 +85,31 @@ public class GdxActivity extends AndroidApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class GdxMapAndroid extends GdxMap {
|
class GdxMapAndroid extends GdxMap {
|
||||||
|
@Override
|
||||||
|
protected void initGLAdapter(GLVersion version) {
|
||||||
|
if (version.getMajorVersion() >= 3)
|
||||||
|
GLAdapter.init(new AndroidGL30());
|
||||||
|
else
|
||||||
|
GLAdapter.init(new AndroidGL());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
TileSource ts = OSciMap4TileSource.builder()
|
TileSource tileSource = OSciMap4TileSource.builder()
|
||||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
.build();
|
.build();
|
||||||
initDefaultLayers(ts, false, true, true);
|
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
||||||
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|
||||||
|
if (mS3db)
|
||||||
|
mMap.layers().add(new S3DBLayer(mMap, l));
|
||||||
|
else
|
||||||
|
mMap.layers().add(new BuildingLayer(mMap, l));
|
||||||
|
|
||||||
|
if (mPoi3d)
|
||||||
|
mMap.layers().add(new Poi3DLayer(mMap, l));
|
||||||
|
|
||||||
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
mPrefs.load(getMap());
|
mPrefs.load(getMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018 devemux86
|
* Copyright 2018 Gustl22
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -14,19 +14,9 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import org.oscim.utils.Parameters;
|
public class GdxPoi3DActivity extends GdxActivity {
|
||||||
|
|
||||||
public class Animator2Activity extends MarkerOverlayActivity {
|
public GdxPoi3DActivity() {
|
||||||
|
super(false, true);
|
||||||
public Animator2Activity() {
|
|
||||||
super();
|
|
||||||
Parameters.ANIMATOR2 = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
|
|
||||||
Parameters.ANIMATOR2 = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018 devemux86
|
* Copyright 2018-2020 devemux86
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -15,9 +15,10 @@
|
|||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
|
||||||
|
|
||||||
import org.oscim.android.MapView;
|
import org.oscim.android.MapView;
|
||||||
import org.oscim.backend.CanvasAdapter;
|
import org.oscim.backend.CanvasAdapter;
|
||||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||||
@@ -27,24 +28,24 @@ import org.oscim.renderer.GLViewport;
|
|||||||
import org.oscim.scalebar.DefaultMapScaleBar;
|
import org.oscim.scalebar.DefaultMapScaleBar;
|
||||||
import org.oscim.scalebar.MapScaleBar;
|
import org.oscim.scalebar.MapScaleBar;
|
||||||
import org.oscim.scalebar.MapScaleBarLayer;
|
import org.oscim.scalebar.MapScaleBarLayer;
|
||||||
|
import org.oscim.theme.IRenderTheme;
|
||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
import org.oscim.tiling.source.mapfile.MapFileTileSource;
|
import org.oscim.tiling.source.mapfile.MapFileTileSource;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.FileInputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A very basic Android app example.
|
* A very basic Android app example.
|
||||||
* <p>
|
* <p>
|
||||||
* You'll need a map with filename germany.map from download.mapsforge.org in device storage.
|
* You'll need a map with filename berlin.map from download.mapsforge.org in device storage.
|
||||||
* Can be berlin.map renamed as germany.map because of smaller size.
|
|
||||||
*/
|
*/
|
||||||
public class GettingStarted extends Activity {
|
public class GettingStarted extends Activity {
|
||||||
|
|
||||||
// Name of the map file in device storage
|
// Request code for selecting a map file
|
||||||
private static final String MAP_FILE = "germany.map";
|
private static final int SELECT_MAP_FILE = 0;
|
||||||
|
|
||||||
private MapView mapView;
|
private MapView mapView;
|
||||||
private MapScaleBar mapScaleBar;
|
private IRenderTheme theme;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -54,10 +55,30 @@ public class GettingStarted extends Activity {
|
|||||||
mapView = new MapView(this);
|
mapView = new MapView(this);
|
||||||
setContentView(mapView);
|
setContentView(mapView);
|
||||||
|
|
||||||
// Tile source
|
// Open map
|
||||||
MapFileTileSource tileSource = new MapFileTileSource();
|
Intent intent = new Intent(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT ? Intent.ACTION_OPEN_DOCUMENT : Intent.ACTION_GET_CONTENT);
|
||||||
String mapPath = new File(Environment.getExternalStorageDirectory(), MAP_FILE).getAbsolutePath();
|
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||||
if (tileSource.setMapFile(mapPath)) {
|
intent.setType("*/*");
|
||||||
|
startActivityForResult(intent, SELECT_MAP_FILE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
if (requestCode == SELECT_MAP_FILE && resultCode == Activity.RESULT_OK) {
|
||||||
|
if (data != null) {
|
||||||
|
Uri uri = data.getData();
|
||||||
|
openMap(uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openMap(Uri uri) {
|
||||||
|
try {
|
||||||
|
// Tile source
|
||||||
|
MapFileTileSource tileSource = new MapFileTileSource();
|
||||||
|
FileInputStream fis = (FileInputStream) getContentResolver().openInputStream(uri);
|
||||||
|
tileSource.setMapFileInputStream(fis);
|
||||||
|
|
||||||
// Vector layer
|
// Vector layer
|
||||||
VectorTileLayer tileLayer = mapView.map().setBaseMap(tileSource);
|
VectorTileLayer tileLayer = mapView.map().setBaseMap(tileSource);
|
||||||
|
|
||||||
@@ -68,10 +89,10 @@ public class GettingStarted extends Activity {
|
|||||||
mapView.map().layers().add(new LabelLayer(mapView.map(), tileLayer));
|
mapView.map().layers().add(new LabelLayer(mapView.map(), tileLayer));
|
||||||
|
|
||||||
// Render theme
|
// Render theme
|
||||||
mapView.map().setTheme(VtmThemes.DEFAULT);
|
theme = mapView.map().setTheme(VtmThemes.DEFAULT);
|
||||||
|
|
||||||
// Scale bar
|
// Scale bar
|
||||||
mapScaleBar = new DefaultMapScaleBar(mapView.map());
|
MapScaleBar mapScaleBar = new DefaultMapScaleBar(mapView.map());
|
||||||
MapScaleBarLayer mapScaleBarLayer = new MapScaleBarLayer(mapView.map(), mapScaleBar);
|
MapScaleBarLayer mapScaleBarLayer = new MapScaleBarLayer(mapView.map(), mapScaleBar);
|
||||||
mapScaleBarLayer.getRenderer().setPosition(GLViewport.Position.BOTTOM_LEFT);
|
mapScaleBarLayer.getRenderer().setPosition(GLViewport.Position.BOTTOM_LEFT);
|
||||||
mapScaleBarLayer.getRenderer().setOffset(5 * CanvasAdapter.getScale(), 0);
|
mapScaleBarLayer.getRenderer().setOffset(5 * CanvasAdapter.getScale(), 0);
|
||||||
@@ -79,6 +100,11 @@ public class GettingStarted extends Activity {
|
|||||||
|
|
||||||
// Note: this map position is specific to Berlin area
|
// Note: this map position is specific to Berlin area
|
||||||
mapView.map().setMapPosition(52.517037, 13.38886, 1 << 12);
|
mapView.map().setMapPosition(52.517037, 13.38886, 1 << 12);
|
||||||
|
} catch (Exception e) {
|
||||||
|
/*
|
||||||
|
* In case of map file errors avoid crash, but developers should handle these cases!
|
||||||
|
*/
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,9 +122,8 @@ public class GettingStarted extends Activity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
if (mapScaleBar != null)
|
|
||||||
mapScaleBar.destroy();
|
|
||||||
mapView.onDestroy();
|
mapView.onDestroy();
|
||||||
|
theme.dispose();
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,172 +15,171 @@
|
|||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package org.oscim.android.test;
|
//package org.oscim.android.test;
|
||||||
|
//
|
||||||
import android.content.Context;
|
//import android.content.Context;
|
||||||
import android.os.Bundle;
|
//import android.os.Bundle;
|
||||||
import android.view.View;
|
//import android.view.View;
|
||||||
import android.widget.Toast;
|
//import android.widget.Toast;
|
||||||
import android.widget.ToggleButton;
|
//import android.widget.ToggleButton;
|
||||||
|
//import io.jeo.map.Style;
|
||||||
import org.jeo.map.Style;
|
//import io.jeo.vector.VectorDataset;
|
||||||
import org.jeo.vector.VectorDataset;
|
//import org.oscim.backend.CanvasAdapter;
|
||||||
import org.oscim.backend.CanvasAdapter;
|
//import org.oscim.backend.canvas.Color;
|
||||||
import org.oscim.backend.canvas.Color;
|
//import org.oscim.layers.OSMIndoorLayer;
|
||||||
import org.oscim.layers.OSMIndoorLayer;
|
//import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
//import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
//import org.oscim.test.JeoTest;
|
||||||
import org.oscim.test.JeoTest;
|
//import org.oscim.theme.VtmThemes;
|
||||||
import org.oscim.theme.VtmThemes;
|
//import org.oscim.theme.styles.TextStyle;
|
||||||
import org.oscim.theme.styles.TextStyle;
|
//import org.oscim.utils.IOUtils;
|
||||||
import org.oscim.utils.IOUtils;
|
//import org.slf4j.Logger;
|
||||||
import org.slf4j.Logger;
|
//import org.slf4j.LoggerFactory;
|
||||||
import org.slf4j.LoggerFactory;
|
//
|
||||||
|
//import java.io.IOException;
|
||||||
import java.io.IOException;
|
//import java.io.InputStream;
|
||||||
import java.io.InputStream;
|
//import java.net.URL;
|
||||||
import java.net.URL;
|
//import java.net.URLConnection;
|
||||||
import java.net.URLConnection;
|
//import java.util.Arrays;
|
||||||
import java.util.Arrays;
|
//
|
||||||
|
//public class JeoIndoorActivity extends BaseMapActivity {
|
||||||
public class JeoIndoorActivity extends BaseMapActivity {
|
// public static final Logger log = LoggerFactory.getLogger(JeoIndoorActivity.class);
|
||||||
public static final Logger log = LoggerFactory.getLogger(JeoIndoorActivity.class);
|
//
|
||||||
|
// // from http://overpass-turbo.eu/s/2vp
|
||||||
// from http://overpass-turbo.eu/s/2vp
|
// String PATH = "https://gist.githubusercontent.com/anonymous/09062103a66844a96048f25626078c8d/raw/1d3af6a5a55e9ea4adc9551fa633a051a44a5a9c/overpass.geojson";
|
||||||
String PATH = "https://gist.githubusercontent.com/anonymous/09062103a66844a96048f25626078c8d/raw/1d3af6a5a55e9ea4adc9551fa633a051a44a5a9c/overpass.geojson";
|
//
|
||||||
|
// private OSMIndoorLayer mIndoorLayer;
|
||||||
private OSMIndoorLayer mIndoorLayer;
|
//
|
||||||
|
// public JeoIndoorActivity() {
|
||||||
public JeoIndoorActivity() {
|
// super(R.layout.jeo_indoor_map);
|
||||||
super(R.layout.jeo_indoor_map);
|
// }
|
||||||
}
|
//
|
||||||
|
// @Override
|
||||||
@Override
|
// public void onCreate(Bundle savedInstanceState) {
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
// super.onCreate(savedInstanceState);
|
||||||
super.onCreate(savedInstanceState);
|
//
|
||||||
|
// mMap.addTask(new Runnable() {
|
||||||
mMap.addTask(new Runnable() {
|
// @Override
|
||||||
@Override
|
// public void run() {
|
||||||
public void run() {
|
// showToast("load data");
|
||||||
showToast("load data");
|
// InputStream is = null;
|
||||||
InputStream is = null;
|
// try {
|
||||||
try {
|
// // File file = new File(Environment.getExternalStorageDirectory()
|
||||||
// File file = new File(Environment.getExternalStorageDirectory()
|
// // .getAbsolutePath(), "osmindoor.json");
|
||||||
// .getAbsolutePath(), "osmindoor.json");
|
// // is = new FileInputStream(file);
|
||||||
// is = new FileInputStream(file);
|
//
|
||||||
|
// URL url = new URL(PATH);
|
||||||
URL url = new URL(PATH);
|
// URLConnection conn = url.openConnection();
|
||||||
URLConnection conn = url.openConnection();
|
// is = conn.getInputStream();
|
||||||
is = conn.getInputStream();
|
// loadJson(is);
|
||||||
loadJson(is);
|
// } catch (IOException e) {
|
||||||
} catch (IOException e) {
|
// e.printStackTrace();
|
||||||
e.printStackTrace();
|
// } finally {
|
||||||
} finally {
|
// IOUtils.closeQuietly(is);
|
||||||
IOUtils.closeQuietly(is);
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// });
|
||||||
});
|
//
|
||||||
|
// mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
//
|
||||||
|
// mMap.layers().add(new BuildingLayer(mMap, mBaseLayer));
|
||||||
mMap.layers().add(new BuildingLayer(mMap, mBaseLayer));
|
// mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
|
||||||
mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
|
//
|
||||||
|
// // String file = Environment.getExternalStorageDirectory().getAbsolutePath();
|
||||||
// String file = Environment.getExternalStorageDirectory().getAbsolutePath();
|
// // VectorDataset data = (VectorDataset) JeoTest.getJsonData(file + "/states.json", true);
|
||||||
// VectorDataset data = (VectorDataset) JeoTest.getJsonData(file + "/states.json", true);
|
// // Style style = JeoTest.getStyle();
|
||||||
// Style style = JeoTest.getStyle();
|
// // mMap.layers().add(new JeoVectorLayer(mMap, data, style));
|
||||||
// mMap.layers().add(new JeoVectorLayer(mMap, data, style));
|
// }
|
||||||
}
|
//
|
||||||
|
// void loadJson(InputStream is) {
|
||||||
void loadJson(InputStream is) {
|
// showToast("got data");
|
||||||
showToast("got data");
|
//
|
||||||
|
// VectorDataset data = JeoTest.readGeoJson(is);
|
||||||
VectorDataset data = JeoTest.readGeoJson(is);
|
// Style style = JeoTest.getStyle();
|
||||||
Style style = JeoTest.getStyle();
|
// TextStyle textStyle = TextStyle.builder()
|
||||||
TextStyle textStyle = TextStyle.builder()
|
// .isCaption(true)
|
||||||
.isCaption(true)
|
// .fontSize(16 * CanvasAdapter.getScale()).color(Color.BLACK)
|
||||||
.fontSize(16 * CanvasAdapter.getScale()).color(Color.BLACK)
|
// .strokeWidth(2.2f * CanvasAdapter.getScale()).strokeColor(Color.WHITE)
|
||||||
.strokeWidth(2.2f * CanvasAdapter.getScale()).strokeColor(Color.WHITE)
|
// .build();
|
||||||
.build();
|
// mIndoorLayer = new OSMIndoorLayer(mMap, data, style, textStyle);
|
||||||
mIndoorLayer = new OSMIndoorLayer(mMap, data, style, textStyle);
|
// mMap.layers().add(mIndoorLayer);
|
||||||
mMap.layers().add(mIndoorLayer);
|
//
|
||||||
|
// showToast("data ready");
|
||||||
showToast("data ready");
|
// mMap.updateMap(true);
|
||||||
mMap.updateMap(true);
|
//
|
||||||
|
// mIndoorLayer.activeLevels[0] = true;
|
||||||
mIndoorLayer.activeLevels[0] = true;
|
// shift();
|
||||||
shift();
|
// }
|
||||||
}
|
//
|
||||||
|
// public void showToast(final String text) {
|
||||||
public void showToast(final String text) {
|
// final Context ctx = this;
|
||||||
final Context ctx = this;
|
// runOnUiThread(new Runnable() {
|
||||||
runOnUiThread(new Runnable() {
|
// @Override
|
||||||
@Override
|
// public void run() {
|
||||||
public void run() {
|
// Toast toast = Toast.makeText(ctx, text, Toast.LENGTH_SHORT);
|
||||||
Toast toast = Toast.makeText(ctx, text, Toast.LENGTH_SHORT);
|
// toast.show();
|
||||||
toast.show();
|
// }
|
||||||
}
|
// });
|
||||||
});
|
// }
|
||||||
}
|
//
|
||||||
|
// boolean mShift = true;
|
||||||
boolean mShift = true;
|
//
|
||||||
|
// public void shift() {
|
||||||
public void shift() {
|
// if (!mShift)
|
||||||
if (!mShift)
|
// return;
|
||||||
return;
|
//
|
||||||
|
// mMap.postDelayed(new Runnable() {
|
||||||
mMap.postDelayed(new Runnable() {
|
//
|
||||||
|
// @Override
|
||||||
@Override
|
// public void run() {
|
||||||
public void run() {
|
// for (int i = 0; i < 10; i++) {
|
||||||
for (int i = 0; i < 10; i++) {
|
// if (mIndoorLayer.activeLevels[i]) {
|
||||||
if (mIndoorLayer.activeLevels[i]) {
|
// mIndoorLayer.activeLevels[i] = false;
|
||||||
mIndoorLayer.activeLevels[i] = false;
|
// mIndoorLayer.activeLevels[(i + 1) % 9] = true;
|
||||||
mIndoorLayer.activeLevels[(i + 1) % 9] = true;
|
// mIndoorLayer.update();
|
||||||
mIndoorLayer.update();
|
// break;
|
||||||
break;
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// shift();
|
||||||
shift();
|
// }
|
||||||
}
|
// }, 200);
|
||||||
}, 200);
|
//
|
||||||
|
// }
|
||||||
}
|
//
|
||||||
|
// public void onClick(View v) {
|
||||||
public void onClick(View v) {
|
// mShift = false;
|
||||||
mShift = false;
|
//
|
||||||
|
// if (mIndoorLayer == null)
|
||||||
if (mIndoorLayer == null)
|
// return;
|
||||||
return;
|
//
|
||||||
|
// int i = 0;
|
||||||
int i = 0;
|
//
|
||||||
|
// if (v instanceof ToggleButton) {
|
||||||
if (v instanceof ToggleButton) {
|
// ToggleButton b = (ToggleButton) v;
|
||||||
ToggleButton b = (ToggleButton) v;
|
// i = (b.getTextOn().charAt(0) - '0') + 1;
|
||||||
i = (b.getTextOn().charAt(0) - '0') + 1;
|
// }
|
||||||
}
|
//
|
||||||
|
// if (i < 0 || i > 9)
|
||||||
if (i < 0 || i > 9)
|
// i = 0;
|
||||||
i = 0;
|
//
|
||||||
|
// mIndoorLayer.activeLevels[i] ^= true;
|
||||||
mIndoorLayer.activeLevels[i] ^= true;
|
// if (v instanceof ToggleButton)
|
||||||
if (v instanceof ToggleButton)
|
// ((ToggleButton) v).setChecked(mIndoorLayer.activeLevels[i]);
|
||||||
((ToggleButton) v).setChecked(mIndoorLayer.activeLevels[i]);
|
// log.debug(Arrays.toString(mIndoorLayer.activeLevels));
|
||||||
log.debug(Arrays.toString(mIndoorLayer.activeLevels));
|
// mIndoorLayer.update();
|
||||||
mIndoorLayer.update();
|
// }
|
||||||
}
|
//
|
||||||
|
// @Override
|
||||||
@Override
|
// protected void onStop() {
|
||||||
protected void onStop() {
|
// super.onStop();
|
||||||
super.onStop();
|
// }
|
||||||
}
|
//
|
||||||
|
// @Override
|
||||||
@Override
|
// protected void onResume() {
|
||||||
protected void onResume() {
|
// super.onResume();
|
||||||
super.onResume();
|
//
|
||||||
|
// /* ignore saved position */
|
||||||
/* ignore saved position */
|
// //mMap.setMapPosition(49.417, 8.673, 1 << 17);
|
||||||
//mMap.setMapPosition(49.417, 8.673, 1 << 17);
|
// mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16);
|
||||||
mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16);
|
// }
|
||||||
}
|
//}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,80 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Hannes Janetzek
|
|
||||||
* Copyright 2016-2018 devemux86
|
|
||||||
* Copyright 2016 Andrey Novikov
|
|
||||||
*
|
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
|
||||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package org.oscim.android.test;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import org.oscim.backend.CanvasAdapter;
|
|
||||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
|
||||||
import org.oscim.map.Layers;
|
|
||||||
import org.oscim.renderer.BitmapRenderer;
|
|
||||||
import org.oscim.renderer.GLViewport;
|
|
||||||
import org.oscim.scalebar.DefaultMapScaleBar;
|
|
||||||
import org.oscim.scalebar.ImperialUnitAdapter;
|
|
||||||
import org.oscim.scalebar.MapScaleBar;
|
|
||||||
import org.oscim.scalebar.MapScaleBarLayer;
|
|
||||||
import org.oscim.scalebar.MetricUnitAdapter;
|
|
||||||
import org.oscim.theme.VtmThemes;
|
|
||||||
|
|
||||||
public class LayerGroupActivity extends BaseMapActivity {
|
|
||||||
|
|
||||||
private static final int GROUP_3D_OBJECTS = 1;
|
|
||||||
private static final int GROUP_LABELS = 2;
|
|
||||||
private static final int GROUP_OVERLAYS = 3;
|
|
||||||
|
|
||||||
private DefaultMapScaleBar mapScaleBar;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
Layers layers = mMap.layers();
|
|
||||||
|
|
||||||
layers.addGroup(GROUP_3D_OBJECTS);
|
|
||||||
layers.add(new BuildingLayer(mMap, mBaseLayer), GROUP_3D_OBJECTS);
|
|
||||||
|
|
||||||
layers.addGroup(GROUP_LABELS);
|
|
||||||
layers.add(new LabelLayer(mMap, mBaseLayer), GROUP_LABELS);
|
|
||||||
|
|
||||||
mapScaleBar = new DefaultMapScaleBar(mMap);
|
|
||||||
mapScaleBar.setScaleBarMode(DefaultMapScaleBar.ScaleBarMode.BOTH);
|
|
||||||
mapScaleBar.setDistanceUnitAdapter(MetricUnitAdapter.INSTANCE);
|
|
||||||
mapScaleBar.setSecondaryDistanceUnitAdapter(ImperialUnitAdapter.INSTANCE);
|
|
||||||
mapScaleBar.setScaleBarPosition(MapScaleBar.ScaleBarPosition.BOTTOM_LEFT);
|
|
||||||
|
|
||||||
MapScaleBarLayer mapScaleBarLayer = new MapScaleBarLayer(mMap, mapScaleBar);
|
|
||||||
BitmapRenderer renderer = mapScaleBarLayer.getRenderer();
|
|
||||||
renderer.setPosition(GLViewport.Position.BOTTOM_LEFT);
|
|
||||||
renderer.setOffset(5 * CanvasAdapter.getScale(), 0);
|
|
||||||
|
|
||||||
layers.addGroup(GROUP_OVERLAYS);
|
|
||||||
layers.add(mapScaleBarLayer, GROUP_OVERLAYS);
|
|
||||||
|
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
if (mapScaleBar != null)
|
|
||||||
mapScaleBar.destroy();
|
|
||||||
|
|
||||||
super.onDestroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 Hannes Janetzek
|
* Copyright 2014 Hannes Janetzek
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2019 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -18,7 +18,6 @@
|
|||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import org.oscim.backend.CanvasAdapter;
|
import org.oscim.backend.CanvasAdapter;
|
||||||
import org.oscim.backend.canvas.Color;
|
import org.oscim.backend.canvas.Color;
|
||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
@@ -38,7 +37,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class LineTexActivity extends BitmapTileActivity {
|
public class LineTexActivity extends BitmapTileActivity {
|
||||||
|
|
||||||
private static final boolean ANIMATION = false;
|
private static final boolean ANIMATION = true;
|
||||||
|
|
||||||
private List<PathLayer> mPathLayers = new ArrayList<>();
|
private List<PathLayer> mPathLayers = new ArrayList<>();
|
||||||
|
|
||||||
@@ -49,7 +48,7 @@ public class LineTexActivity extends BitmapTileActivity {
|
|||||||
TextureItem tex = null;
|
TextureItem tex = null;
|
||||||
try {
|
try {
|
||||||
tex = new TextureItem(CanvasAdapter.getBitmapAsset("", "patterns/pike.png"));
|
tex = new TextureItem(CanvasAdapter.getBitmapAsset("", "patterns/pike.png"));
|
||||||
tex.mipmap = true;
|
//tex.mipmap = true;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2021 devemux86
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -14,16 +14,20 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.location.LocationListener;
|
import android.location.LocationListener;
|
||||||
import android.location.LocationManager;
|
import android.location.LocationManager;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
import org.oscim.layers.LocationLayer;
|
import org.oscim.layers.LocationLayer;
|
||||||
|
import org.oscim.renderer.LocationCallback;
|
||||||
|
|
||||||
public class LocationActivity extends BitmapTileActivity implements LocationListener {
|
public class LocationActivity extends BitmapTileActivity implements LocationListener {
|
||||||
|
private Location location;
|
||||||
private LocationLayer locationLayer;
|
private LocationLayer locationLayer;
|
||||||
private LocationManager locationManager;
|
private LocationManager locationManager;
|
||||||
private final MapPosition mapPosition = new MapPosition();
|
private final MapPosition mapPosition = new MapPosition();
|
||||||
@@ -35,27 +39,46 @@ public class LocationActivity extends BitmapTileActivity implements LocationList
|
|||||||
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
|
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
|
||||||
|
|
||||||
locationLayer = new LocationLayer(mMap);
|
locationLayer = new LocationLayer(mMap);
|
||||||
locationLayer.locationRenderer.setShader("location_1_reverse");
|
locationLayer.locationRenderer.setCallback(new LocationCallback() {
|
||||||
|
@Override
|
||||||
|
public boolean hasRotation() {
|
||||||
|
return location != null && location.hasBearing();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getRotation() {
|
||||||
|
return location != null && location.hasBearing() ? location.getBearing() : 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
locationLayer.setEnabled(false);
|
locationLayer.setEnabled(false);
|
||||||
mMap.layers().add(locationLayer);
|
mMap.layers().add(locationLayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
public void onRequestPermissionsResult(final int requestCode, final String[] permissions, final int[] grantResults) {
|
||||||
super.onResume();
|
if (requestCode == 0) {
|
||||||
|
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED)
|
||||||
|
enableAvailableProviders();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
|
||||||
enableAvailableProviders();
|
enableAvailableProviders();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
public void onStop() {
|
||||||
super.onPause();
|
|
||||||
|
|
||||||
locationManager.removeUpdates(this);
|
locationManager.removeUpdates(this);
|
||||||
|
|
||||||
|
super.onStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLocationChanged(Location location) {
|
public void onLocationChanged(Location location) {
|
||||||
|
this.location = location;
|
||||||
locationLayer.setEnabled(true);
|
locationLayer.setEnabled(true);
|
||||||
locationLayer.setPosition(location.getLatitude(), location.getLongitude(), location.getAccuracy());
|
locationLayer.setPosition(location.getLatitude(), location.getLongitude(), location.getAccuracy());
|
||||||
|
|
||||||
@@ -73,11 +96,19 @@ public class LocationActivity extends BitmapTileActivity implements LocationList
|
|||||||
public void onProviderEnabled(String provider) {
|
public void onProviderEnabled(String provider) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public void onStatusChanged(String provider, int status, Bundle extras) {
|
public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enableAvailableProviders() {
|
private void enableAvailableProviders() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION}, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
locationManager.removeUpdates(this);
|
locationManager.removeUpdates(this);
|
||||||
|
|
||||||
for (String provider : locationManager.getProviders(true)) {
|
for (String provider : locationManager.getProviders(true)) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2021 devemux86
|
||||||
* Copyright 2018 Longri
|
* Copyright 2018 Longri
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
@@ -15,26 +15,26 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.location.LocationListener;
|
import android.location.LocationListener;
|
||||||
import android.location.LocationManager;
|
import android.location.LocationManager;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import org.oscim.backend.CanvasAdapter;
|
import org.oscim.backend.CanvasAdapter;
|
||||||
import org.oscim.backend.canvas.Bitmap;
|
import org.oscim.backend.canvas.Bitmap;
|
||||||
import org.oscim.backend.canvas.Color;
|
|
||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
import org.oscim.layers.LocationTextureLayer;
|
import org.oscim.layers.LocationTextureLayer;
|
||||||
import org.oscim.renderer.atlas.TextureAtlas;
|
import org.oscim.renderer.LocationCallback;
|
||||||
import org.oscim.renderer.atlas.TextureRegion;
|
|
||||||
import org.oscim.renderer.bucket.TextureItem;
|
|
||||||
import org.oscim.utils.IOUtils;
|
import org.oscim.utils.IOUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
public class LocationTextureActivity extends BitmapTileActivity implements LocationListener {
|
public class LocationTextureActivity extends BitmapTileActivity implements LocationListener {
|
||||||
|
private Location location;
|
||||||
private LocationTextureLayer locationLayer;
|
private LocationTextureLayer locationLayer;
|
||||||
private LocationManager locationManager;
|
private LocationManager locationManager;
|
||||||
private final MapPosition mapPosition = new MapPosition();
|
private final MapPosition mapPosition = new MapPosition();
|
||||||
@@ -45,56 +45,72 @@ public class LocationTextureActivity extends BitmapTileActivity implements Locat
|
|||||||
|
|
||||||
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
|
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
|
||||||
|
|
||||||
// load a Bitmap/SVG from resources
|
|
||||||
InputStream is = null;
|
InputStream is = null;
|
||||||
Bitmap bmp = null;
|
Bitmap bitmapArrow = null;
|
||||||
try {
|
try {
|
||||||
is = getResources().openRawResource(R.raw.arrow);
|
is = getResources().openRawResource(R.raw.arrow);
|
||||||
float scale = CanvasAdapter.getScale();
|
bitmapArrow = CanvasAdapter.decodeSvgBitmap(is, (int) (48 * CanvasAdapter.getScale()), (int) (48 * CanvasAdapter.getScale()), 100);
|
||||||
bmp = CanvasAdapter.decodeSvgBitmap(is, (int) (60 * scale), (int) (60 * scale), 100);
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
IOUtils.closeQuietly(is);
|
IOUtils.closeQuietly(is);
|
||||||
}
|
}
|
||||||
|
|
||||||
// create TextureRegion from Bitmap
|
Bitmap bitmapMarker = null;
|
||||||
TextureRegion textureRegion = new TextureRegion(new TextureItem(bmp), new TextureAtlas.Rect(0, 0, bmp.getWidth(), bmp.getHeight()));
|
try {
|
||||||
|
is = getResources().openRawResource(R.raw.marker);
|
||||||
|
bitmapMarker = CanvasAdapter.decodeSvgBitmap(is, (int) (48 * CanvasAdapter.getScale()), (int) (48 * CanvasAdapter.getScale()), 100);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
IOUtils.closeQuietly(is);
|
||||||
|
}
|
||||||
|
|
||||||
// create LocationTextureLayer with created/loaded TextureRegion
|
locationLayer = new LocationTextureLayer(mMap);
|
||||||
locationLayer = new LocationTextureLayer(mMap, textureRegion);
|
locationLayer.locationRenderer.setBitmapArrow(bitmapArrow);
|
||||||
|
locationLayer.locationRenderer.setBitmapMarker(bitmapMarker);
|
||||||
// set color of accuracy circle (Color.BLUE is default)
|
locationLayer.locationRenderer.setCallback(new LocationCallback() {
|
||||||
locationLayer.locationRenderer.setAccuracyColor(Color.get(50, 50, 255));
|
@Override
|
||||||
|
public boolean hasRotation() {
|
||||||
// set color of indicator circle (Color.RED is default)
|
return location != null && location.hasBearing();
|
||||||
locationLayer.locationRenderer.setIndicatorColor(Color.MAGENTA);
|
}
|
||||||
|
|
||||||
// set billboard rendering for TextureRegion (false is default)
|
|
||||||
locationLayer.locationRenderer.setBillboard(false);
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getRotation() {
|
||||||
|
return location != null && location.hasBearing() ? location.getBearing() : 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
locationLayer.setEnabled(false);
|
locationLayer.setEnabled(false);
|
||||||
mMap.layers().add(locationLayer);
|
mMap.layers().add(locationLayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
public void onRequestPermissionsResult(final int requestCode, final String[] permissions, final int[] grantResults) {
|
||||||
super.onResume();
|
if (requestCode == 0) {
|
||||||
|
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED)
|
||||||
|
enableAvailableProviders();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
|
||||||
enableAvailableProviders();
|
enableAvailableProviders();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
public void onStop() {
|
||||||
super.onPause();
|
|
||||||
|
|
||||||
locationManager.removeUpdates(this);
|
locationManager.removeUpdates(this);
|
||||||
|
|
||||||
|
super.onStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLocationChanged(Location location) {
|
public void onLocationChanged(Location location) {
|
||||||
|
this.location = location;
|
||||||
locationLayer.setEnabled(true);
|
locationLayer.setEnabled(true);
|
||||||
locationLayer.setPosition(location.getLatitude(), location.getLongitude(), location.getBearing(), location.getAccuracy());
|
locationLayer.setPosition(location.getLatitude(), location.getLongitude(), location.getAccuracy());
|
||||||
|
|
||||||
// Follow location
|
// Follow location
|
||||||
mMap.getMapPosition(mapPosition);
|
mMap.getMapPosition(mapPosition);
|
||||||
@@ -110,11 +126,19 @@ public class LocationTextureActivity extends BitmapTileActivity implements Locat
|
|||||||
public void onProviderEnabled(String provider) {
|
public void onProviderEnabled(String provider) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public void onStatusChanged(String provider, int status, Bundle extras) {
|
public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enableAvailableProviders() {
|
private void enableAvailableProviders() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION}, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
locationManager.removeUpdates(this);
|
locationManager.removeUpdates(this);
|
||||||
|
|
||||||
for (String provider : locationManager.getProviders(true)) {
|
for (String provider : locationManager.getProviders(true)) {
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 Andrea Antonello
|
||||||
|
* Copyright 2019 devemux86
|
||||||
|
* Copyright 2019 Kostas Tzounopoulos
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.oscim.android.test;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import org.oscim.android.tiling.source.mbtiles.MBTilesBitmapTileSource;
|
||||||
|
import org.oscim.android.tiling.source.mbtiles.MBTilesTileSource;
|
||||||
|
import org.oscim.core.BoundingBox;
|
||||||
|
import org.oscim.core.MapPosition;
|
||||||
|
import org.oscim.core.Tile;
|
||||||
|
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An example activity making use of raster MBTiles.
|
||||||
|
*/
|
||||||
|
public class MBTilesBitmapActivity extends BitmapTileActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
File file = new File(getExternalFilesDir(null), "raster.mbtiles");
|
||||||
|
if (!file.exists()) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(this)
|
||||||
|
.setTitle(R.string.warning)
|
||||||
|
.setMessage(getResources().getString(R.string.startup_message_mbtiles))
|
||||||
|
.setPositiveButton(R.string.exit, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
builder.show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MBTilesTileSource tileSource = new MBTilesBitmapTileSource(file.getAbsolutePath(), 128, null);
|
||||||
|
|
||||||
|
BitmapTileLayer bitmapLayer = new BitmapTileLayer(mMap, tileSource);
|
||||||
|
mMap.layers().add(bitmapLayer);
|
||||||
|
|
||||||
|
/* set initial position on first run */
|
||||||
|
MapPosition pos = new MapPosition();
|
||||||
|
mMap.getMapPosition(pos);
|
||||||
|
if (pos.x == 0.5 && pos.y == 0.5) {
|
||||||
|
BoundingBox bbox = tileSource.getDataSource().getBounds();
|
||||||
|
if (bbox != null) {
|
||||||
|
pos.setByBoundingBox(bbox, Tile.SIZE * 4, Tile.SIZE * 4);
|
||||||
|
mMap.setMapPosition(pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 Andrea Antonello
|
||||||
|
* Copyright 2019 devemux86
|
||||||
|
* Copyright 2019 Kostas Tzounopoulos
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.oscim.android.test;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import org.oscim.android.mvt.tiling.source.mbtiles.MBTilesMvtTileSource;
|
||||||
|
import org.oscim.android.tiling.source.mbtiles.MBTilesTileSource;
|
||||||
|
import org.oscim.android.tiling.source.mbtiles.MBTilesUnsupportedException;
|
||||||
|
import org.oscim.core.BoundingBox;
|
||||||
|
import org.oscim.core.MapPosition;
|
||||||
|
import org.oscim.core.Tile;
|
||||||
|
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||||
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
|
import org.oscim.theme.VtmThemes;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An example activity making use of vector MBTiles.
|
||||||
|
*/
|
||||||
|
public class MBTilesMvtActivity extends MapActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
File file = new File(getExternalFilesDir(null), "vector.mbtiles");
|
||||||
|
if (!file.exists()) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(this)
|
||||||
|
.setTitle(R.string.warning)
|
||||||
|
.setMessage(getResources().getString(R.string.startup_message_mbtiles))
|
||||||
|
.setPositiveButton(R.string.exit, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
builder.show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MBTilesTileSource tileSource;
|
||||||
|
try {
|
||||||
|
tileSource = new MBTilesMvtTileSource(file.getAbsolutePath(), "en");
|
||||||
|
} catch (MBTilesUnsupportedException e) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(this)
|
||||||
|
.setTitle(R.string.warning)
|
||||||
|
.setMessage(e.getMessage())
|
||||||
|
.setPositiveButton(R.string.exit, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
builder.show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
||||||
|
mMap.setTheme(VtmThemes.OPENMAPTILES);
|
||||||
|
|
||||||
|
mMap.layers().add(new BuildingLayer(mMap, l));
|
||||||
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
|
|
||||||
|
/* set initial position on first run */
|
||||||
|
MapPosition pos = new MapPosition();
|
||||||
|
mMap.getMapPosition(pos);
|
||||||
|
if (pos.x == 0.5 && pos.y == 0.5) {
|
||||||
|
BoundingBox bbox = tileSource.getDataSource().getBounds();
|
||||||
|
if (bbox != null) {
|
||||||
|
pos.setByBoundingBox(bbox, Tile.SIZE * 4, Tile.SIZE * 4);
|
||||||
|
mMap.setMapPosition(pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,6 +38,7 @@ public class MapActivity extends Activity {
|
|||||||
this(R.layout.activity_map);
|
this(R.layout.activity_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(mContentView);
|
setContentView(mContentView);
|
||||||
|
|||||||
124
vtm-android-example/src/org/oscim/android/test/MapFragment.java
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2018-2020 devemux86
|
||||||
|
* Copyright 2020 Meibes
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.oscim.android.test;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import org.oscim.android.MapView;
|
||||||
|
import org.oscim.backend.CanvasAdapter;
|
||||||
|
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||||
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
|
import org.oscim.renderer.GLViewport;
|
||||||
|
import org.oscim.scalebar.DefaultMapScaleBar;
|
||||||
|
import org.oscim.scalebar.MapScaleBar;
|
||||||
|
import org.oscim.scalebar.MapScaleBarLayer;
|
||||||
|
import org.oscim.theme.IRenderTheme;
|
||||||
|
import org.oscim.theme.VtmThemes;
|
||||||
|
import org.oscim.tiling.source.mapfile.MapFileTileSource;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* You'll need a map with filename berlin.map from download.mapsforge.org in device storage.
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public class MapFragment extends android.app.Fragment {
|
||||||
|
|
||||||
|
private MapView mapView;
|
||||||
|
private IRenderTheme theme;
|
||||||
|
|
||||||
|
public static MapFragment newInstance() {
|
||||||
|
MapFragment instance = new MapFragment();
|
||||||
|
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
instance.setArguments(args);
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
return inflater.inflate(R.layout.fragment_map, container, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
mapView = new MapView(getActivity());
|
||||||
|
RelativeLayout relativeLayout = view.findViewById(R.id.mapView);
|
||||||
|
relativeLayout.addView(mapView);
|
||||||
|
|
||||||
|
// Tile source
|
||||||
|
MapFileTileSource tileSource = new MapFileTileSource();
|
||||||
|
File file = new File(getActivity().getExternalFilesDir(null), "berlin.map");
|
||||||
|
tileSource.setMapFile(file.getAbsolutePath());
|
||||||
|
|
||||||
|
// Vector layer
|
||||||
|
VectorTileLayer tileLayer = mapView.map().setBaseMap(tileSource);
|
||||||
|
|
||||||
|
// Building layer
|
||||||
|
mapView.map().layers().add(new BuildingLayer(mapView.map(), tileLayer));
|
||||||
|
|
||||||
|
// Label layer
|
||||||
|
mapView.map().layers().add(new LabelLayer(mapView.map(), tileLayer));
|
||||||
|
|
||||||
|
// Render theme
|
||||||
|
theme = mapView.map().setTheme(VtmThemes.DEFAULT);
|
||||||
|
|
||||||
|
// Scale bar
|
||||||
|
MapScaleBar mapScaleBar = new DefaultMapScaleBar(mapView.map());
|
||||||
|
MapScaleBarLayer mapScaleBarLayer = new MapScaleBarLayer(mapView.map(), mapScaleBar);
|
||||||
|
mapScaleBarLayer.getRenderer().setPosition(GLViewport.Position.BOTTOM_LEFT);
|
||||||
|
mapScaleBarLayer.getRenderer().setOffset(5 * CanvasAdapter.getScale(), 0);
|
||||||
|
mapView.map().layers().add(mapScaleBarLayer);
|
||||||
|
|
||||||
|
// Note: this map position is specific to Berlin area
|
||||||
|
mapView.map().setMapPosition(52.517037, 13.38886, 1 << 12);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
if (mapView != null) {
|
||||||
|
mapView.onResume();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
if (mapView != null) {
|
||||||
|
mapView.onPause();
|
||||||
|
}
|
||||||
|
super.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyView() {
|
||||||
|
if (mapView != null) {
|
||||||
|
mapView.onDestroy();
|
||||||
|
mapView = null;
|
||||||
|
}
|
||||||
|
if (theme != null) {
|
||||||
|
theme.dispose();
|
||||||
|
theme = null;
|
||||||
|
}
|
||||||
|
super.onDestroyView();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2018-2020 devemux86
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.oscim.android.test;
|
||||||
|
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import okhttp3.Cache;
|
||||||
|
import okhttp3.CipherSuite;
|
||||||
|
import okhttp3.ConnectionSpec;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
||||||
|
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||||
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
|
import org.oscim.theme.VtmThemes;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
|
import org.oscim.tiling.source.UrlTileSource;
|
||||||
|
import org.oscim.tiling.source.bitmap.DefaultSources;
|
||||||
|
import org.oscim.tiling.source.mvt.MapilionMvtTileSource;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MapilionMvtActivity extends MapActivity {
|
||||||
|
|
||||||
|
// Metered API key for demonstration purposes
|
||||||
|
private static final String API_KEY = "3b3d8353-0fb8-4513-bfe0-d620b2d77c45";
|
||||||
|
|
||||||
|
private static final boolean USE_CACHE = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||||
|
if (USE_CACHE) {
|
||||||
|
// Cache the tiles into file system
|
||||||
|
File cacheDirectory = new File(getExternalCacheDir(), "tiles");
|
||||||
|
int cacheSize = 10 * 1024 * 1024; // 10 MB
|
||||||
|
Cache cache = new Cache(cacheDirectory, cacheSize);
|
||||||
|
builder.cache(cache);
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://github.com/square/okhttp/issues/4053
|
||||||
|
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
|
||||||
|
List<CipherSuite> cipherSuites = new ArrayList<>();
|
||||||
|
List<CipherSuite> modernTlsCipherSuites = ConnectionSpec.MODERN_TLS.cipherSuites();
|
||||||
|
if (modernTlsCipherSuites != null)
|
||||||
|
cipherSuites.addAll(modernTlsCipherSuites);
|
||||||
|
cipherSuites.add(CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA);
|
||||||
|
cipherSuites.add(CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA);
|
||||||
|
ConnectionSpec legacyTls = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
|
||||||
|
.cipherSuites(cipherSuites.toArray(new CipherSuite[0]))
|
||||||
|
.build();
|
||||||
|
builder.connectionSpecs(Arrays.asList(legacyTls, ConnectionSpec.CLEARTEXT));
|
||||||
|
}
|
||||||
|
|
||||||
|
OkHttpEngine.OkHttpFactory factory = new OkHttpEngine.OkHttpFactory(builder);
|
||||||
|
|
||||||
|
UrlTileSource tileSource = MapilionMvtTileSource.builder()
|
||||||
|
.apiKey(API_KEY)
|
||||||
|
.httpFactory(factory)
|
||||||
|
//.locale("en")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
||||||
|
mMap.setTheme(VtmThemes.OPENMAPTILES);
|
||||||
|
|
||||||
|
// Hillshading
|
||||||
|
UrlTileSource shadedTileSource = DefaultSources.MAPILION_HILLSHADE_2
|
||||||
|
.apiKey(API_KEY)
|
||||||
|
.httpFactory(factory)
|
||||||
|
.build();
|
||||||
|
mMap.layers().add(new BitmapTileLayer(mMap, shadedTileSource));
|
||||||
|
|
||||||
|
mMap.layers().add(new BuildingLayer(mMap, l));
|
||||||
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 Hannes Janetzek
|
* Copyright 2014 Hannes Janetzek
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2021 devemux86
|
||||||
* Copyright 2017 Longri
|
* Copyright 2017 Longri
|
||||||
* Copyright 2018 Gustl22
|
* Copyright 2018 Gustl22
|
||||||
|
* Copyright 2021 eddiemuc
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -19,15 +20,18 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.provider.DocumentsContract;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
import org.oscim.android.theme.ContentRenderTheme;
|
||||||
import org.oscim.android.filepicker.FilePicker;
|
import org.oscim.android.theme.ContentResolverResourceProvider;
|
||||||
import org.oscim.android.filepicker.FilterByFileExtension;
|
|
||||||
import org.oscim.android.filepicker.ValidMapFile;
|
|
||||||
import org.oscim.android.filepicker.ValidRenderTheme;
|
|
||||||
import org.oscim.backend.CanvasAdapter;
|
import org.oscim.backend.CanvasAdapter;
|
||||||
import org.oscim.core.MapElement;
|
import org.oscim.core.MapElement;
|
||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
@@ -42,34 +46,40 @@ import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
|||||||
import org.oscim.renderer.BitmapRenderer;
|
import org.oscim.renderer.BitmapRenderer;
|
||||||
import org.oscim.renderer.GLViewport;
|
import org.oscim.renderer.GLViewport;
|
||||||
import org.oscim.renderer.bucket.RenderBuckets;
|
import org.oscim.renderer.bucket.RenderBuckets;
|
||||||
import org.oscim.scalebar.DefaultMapScaleBar;
|
import org.oscim.scalebar.*;
|
||||||
import org.oscim.scalebar.ImperialUnitAdapter;
|
import org.oscim.theme.*;
|
||||||
import org.oscim.scalebar.MapScaleBar;
|
|
||||||
import org.oscim.scalebar.MapScaleBarLayer;
|
|
||||||
import org.oscim.scalebar.MetricUnitAdapter;
|
|
||||||
import org.oscim.theme.ExternalRenderTheme;
|
|
||||||
import org.oscim.theme.ThemeUtils;
|
|
||||||
import org.oscim.theme.VtmThemes;
|
|
||||||
import org.oscim.theme.styles.AreaStyle;
|
import org.oscim.theme.styles.AreaStyle;
|
||||||
import org.oscim.theme.styles.RenderStyle;
|
import org.oscim.theme.styles.RenderStyle;
|
||||||
import org.oscim.tiling.source.mapfile.MapFileTileSource;
|
import org.oscim.tiling.source.mapfile.MapFileTileSource;
|
||||||
import org.oscim.tiling.source.mapfile.MapInfo;
|
import org.oscim.tiling.source.mapfile.MapInfo;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
public class MapsforgeActivity extends MapActivity {
|
public class MapsforgeActivity extends MapActivity {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(MapsforgeActivity.class);
|
||||||
|
|
||||||
static final int SELECT_MAP_FILE = 0;
|
static final int SELECT_MAP_FILE = 0;
|
||||||
static final int SELECT_THEME_FILE = SELECT_MAP_FILE + 1;
|
private static final int SELECT_THEME_ARCHIVE = 1;
|
||||||
|
private static final int SELECT_THEME_DIR = 2;
|
||||||
|
static final int SELECT_THEME_FILE = 3;
|
||||||
|
|
||||||
private static final Tag ISSEA_TAG = new Tag("natural", "issea");
|
private static final Tag ISSEA_TAG = new Tag("natural", "issea");
|
||||||
private static final Tag NOSEA_TAG = new Tag("natural", "nosea");
|
private static final Tag NOSEA_TAG = new Tag("natural", "nosea");
|
||||||
private static final Tag SEA_TAG = new Tag("natural", "sea");
|
private static final Tag SEA_TAG = new Tag("natural", "sea");
|
||||||
|
|
||||||
private TileGridLayer mGridLayer;
|
private TileGridLayer mGridLayer;
|
||||||
private DefaultMapScaleBar mMapScaleBar;
|
|
||||||
private Menu mMenu;
|
private Menu mMenu;
|
||||||
private boolean mS3db;
|
private final boolean mS3db;
|
||||||
private VectorTileLayer mTileLayer;
|
IRenderTheme mTheme;
|
||||||
MapFileTileSource mTileSource;
|
VectorTileLayer mTileLayer;
|
||||||
|
private Uri mThemeDirUri;
|
||||||
|
|
||||||
public MapsforgeActivity() {
|
public MapsforgeActivity() {
|
||||||
this(false);
|
this(false);
|
||||||
@@ -80,34 +90,19 @@ public class MapsforgeActivity extends MapActivity {
|
|||||||
mS3db = s3db;
|
mS3db = s3db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MapsforgeActivity(boolean s3db, int contentView) {
|
||||||
|
super(contentView);
|
||||||
|
mS3db = s3db;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
startActivityForResult(new Intent(this, MapFilePicker.class),
|
Intent intent = new Intent(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT ? Intent.ACTION_OPEN_DOCUMENT : Intent.ACTION_GET_CONTENT);
|
||||||
SELECT_MAP_FILE);
|
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||||
}
|
intent.setType("*/*");
|
||||||
|
startActivityForResult(intent, SELECT_MAP_FILE);
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
if (mMapScaleBar != null)
|
|
||||||
mMapScaleBar.destroy();
|
|
||||||
|
|
||||||
super.onDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class MapFilePicker extends FilePicker {
|
|
||||||
public MapFilePicker() {
|
|
||||||
setFileDisplayFilter(new FilterByFileExtension(".map"));
|
|
||||||
setFileSelectFilter(new ValidMapFile());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class ThemeFilePicker extends FilePicker {
|
|
||||||
public ThemeFilePicker() {
|
|
||||||
setFileDisplayFilter(new FilterByFileExtension(".xml"));
|
|
||||||
setFileSelectFilter(new ValidRenderTheme());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -119,71 +114,87 @@ public class MapsforgeActivity extends MapActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
int itemId = item.getItemId();
|
||||||
switch (item.getItemId()) {
|
if (itemId == R.id.theme_default) {
|
||||||
case R.id.theme_default:
|
if (mTheme != null)
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mTheme.dispose();
|
||||||
|
mTheme = mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
item.setChecked(true);
|
||||||
|
return true;
|
||||||
|
} else if (itemId == R.id.theme_osmarender) {
|
||||||
|
if (mTheme != null)
|
||||||
|
mTheme.dispose();
|
||||||
|
mTheme = mMap.setTheme(VtmThemes.OSMARENDER);
|
||||||
|
item.setChecked(true);
|
||||||
|
return true;
|
||||||
|
} else if (itemId == R.id.theme_osmagray) {
|
||||||
|
if (mTheme != null)
|
||||||
|
mTheme.dispose();
|
||||||
|
mTheme = mMap.setTheme(VtmThemes.OSMAGRAY);
|
||||||
|
item.setChecked(true);
|
||||||
|
return true;
|
||||||
|
} else if (itemId == R.id.theme_tubes) {
|
||||||
|
if (mTheme != null)
|
||||||
|
mTheme.dispose();
|
||||||
|
mTheme = mMap.setTheme(VtmThemes.TRONRENDER);
|
||||||
|
item.setChecked(true);
|
||||||
|
return true;
|
||||||
|
} else if (itemId == R.id.theme_newtron) {
|
||||||
|
if (mTheme != null)
|
||||||
|
mTheme.dispose();
|
||||||
|
mTheme = mMap.setTheme(VtmThemes.NEWTRON);
|
||||||
|
item.setChecked(true);
|
||||||
|
return true;
|
||||||
|
} else if (itemId == R.id.theme_external_archive) {
|
||||||
|
Intent intent = new Intent(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT ? Intent.ACTION_OPEN_DOCUMENT : Intent.ACTION_GET_CONTENT);
|
||||||
|
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||||
|
intent.setType("*/*");
|
||||||
|
startActivityForResult(intent, SELECT_THEME_ARCHIVE);
|
||||||
|
return true;
|
||||||
|
} else if (itemId == R.id.theme_external) {
|
||||||
|
Intent intent;
|
||||||
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
|
||||||
|
return false;
|
||||||
|
intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
|
||||||
|
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
|
startActivityForResult(intent, SELECT_THEME_DIR);
|
||||||
|
return true;
|
||||||
|
} else if (itemId == R.id.gridlayer) {
|
||||||
|
if (item.isChecked()) {
|
||||||
|
item.setChecked(false);
|
||||||
|
mMap.layers().remove(mGridLayer);
|
||||||
|
} else {
|
||||||
item.setChecked(true);
|
item.setChecked(true);
|
||||||
return true;
|
if (mGridLayer == null)
|
||||||
|
mGridLayer = new TileGridLayer(mMap);
|
||||||
|
|
||||||
case R.id.theme_osmarender:
|
mMap.layers().add(mGridLayer);
|
||||||
mMap.setTheme(VtmThemes.OSMARENDER);
|
}
|
||||||
item.setChecked(true);
|
mMap.updateMap(true);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.theme_osmagray:
|
|
||||||
mMap.setTheme(VtmThemes.OSMAGRAY);
|
|
||||||
item.setChecked(true);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case R.id.theme_tubes:
|
|
||||||
mMap.setTheme(VtmThemes.TRONRENDER);
|
|
||||||
item.setChecked(true);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case R.id.theme_newtron:
|
|
||||||
mMap.setTheme(VtmThemes.NEWTRON);
|
|
||||||
item.setChecked(true);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case R.id.theme_external:
|
|
||||||
startActivityForResult(new Intent(this, ThemeFilePicker.class),
|
|
||||||
SELECT_THEME_FILE);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
case R.id.gridlayer:
|
|
||||||
if (item.isChecked()) {
|
|
||||||
item.setChecked(false);
|
|
||||||
mMap.layers().remove(mGridLayer);
|
|
||||||
} else {
|
|
||||||
item.setChecked(true);
|
|
||||||
if (mGridLayer == null)
|
|
||||||
mGridLayer = new TileGridLayer(mMap);
|
|
||||||
|
|
||||||
mMap.layers().add(mGridLayer);
|
|
||||||
}
|
|
||||||
mMap.updateMap(true);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
|
||||||
if (requestCode == SELECT_MAP_FILE) {
|
if (requestCode == SELECT_MAP_FILE) {
|
||||||
if (resultCode != RESULT_OK || intent == null || intent.getStringExtra(FilePicker.SELECTED_FILE) == null) {
|
if (resultCode != Activity.RESULT_OK || data == null) {
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mTileSource = new MapFileTileSource();
|
try {
|
||||||
//mTileSource.setPreferredLanguage("en");
|
Uri uri = data.getData();
|
||||||
String file = intent.getStringExtra(FilePicker.SELECTED_FILE);
|
|
||||||
if (mTileSource.setMapFile(file)) {
|
|
||||||
|
|
||||||
mTileLayer = mMap.setBaseMap(mTileSource);
|
MapFileTileSource tileSource = new MapFileTileSource();
|
||||||
|
//tileSource.setPreferredLanguage("en");
|
||||||
|
FileInputStream fis = (FileInputStream) getContentResolver().openInputStream(uri);
|
||||||
|
tileSource.setMapFileInputStream(fis);
|
||||||
|
|
||||||
|
mTileLayer = mMap.setBaseMap(tileSource);
|
||||||
loadTheme(null);
|
loadTheme(null);
|
||||||
|
|
||||||
if (mS3db)
|
if (mS3db)
|
||||||
@@ -192,58 +203,114 @@ public class MapsforgeActivity extends MapActivity {
|
|||||||
mMap.layers().add(new BuildingLayer(mMap, mTileLayer));
|
mMap.layers().add(new BuildingLayer(mMap, mTileLayer));
|
||||||
mMap.layers().add(new LabelLayer(mMap, mTileLayer));
|
mMap.layers().add(new LabelLayer(mMap, mTileLayer));
|
||||||
|
|
||||||
mMapScaleBar = new DefaultMapScaleBar(mMap);
|
DefaultMapScaleBar mapScaleBar = new DefaultMapScaleBar(mMap);
|
||||||
mMapScaleBar.setScaleBarMode(DefaultMapScaleBar.ScaleBarMode.BOTH);
|
mapScaleBar.setScaleBarMode(DefaultMapScaleBar.ScaleBarMode.BOTH);
|
||||||
mMapScaleBar.setDistanceUnitAdapter(MetricUnitAdapter.INSTANCE);
|
mapScaleBar.setDistanceUnitAdapter(MetricUnitAdapter.INSTANCE);
|
||||||
mMapScaleBar.setSecondaryDistanceUnitAdapter(ImperialUnitAdapter.INSTANCE);
|
mapScaleBar.setSecondaryDistanceUnitAdapter(ImperialUnitAdapter.INSTANCE);
|
||||||
mMapScaleBar.setScaleBarPosition(MapScaleBar.ScaleBarPosition.BOTTOM_LEFT);
|
mapScaleBar.setScaleBarPosition(MapScaleBar.ScaleBarPosition.BOTTOM_LEFT);
|
||||||
|
|
||||||
MapScaleBarLayer mapScaleBarLayer = new MapScaleBarLayer(mMap, mMapScaleBar);
|
MapScaleBarLayer mapScaleBarLayer = new MapScaleBarLayer(mMap, mapScaleBar);
|
||||||
BitmapRenderer renderer = mapScaleBarLayer.getRenderer();
|
BitmapRenderer renderer = mapScaleBarLayer.getRenderer();
|
||||||
renderer.setPosition(GLViewport.Position.BOTTOM_LEFT);
|
renderer.setPosition(GLViewport.Position.BOTTOM_LEFT);
|
||||||
renderer.setOffset(5 * CanvasAdapter.getScale(), 0);
|
renderer.setOffset(5 * CanvasAdapter.getScale(), 0);
|
||||||
mMap.layers().add(mapScaleBarLayer);
|
mMap.layers().add(mapScaleBarLayer);
|
||||||
|
|
||||||
MapInfo info = mTileSource.getMapInfo();
|
MapInfo info = tileSource.getMapInfo();
|
||||||
if (!info.boundingBox.contains(mMap.getMapPosition().getGeoPoint())) {
|
if (!info.boundingBox.contains(mMap.getMapPosition().getGeoPoint())) {
|
||||||
MapPosition pos = new MapPosition();
|
MapPosition pos = new MapPosition();
|
||||||
pos.setByBoundingBox(info.boundingBox, Tile.SIZE * 4, Tile.SIZE * 4);
|
pos.setByBoundingBox(info.boundingBox, Tile.SIZE * 4, Tile.SIZE * 4);
|
||||||
mMap.setMapPosition(pos);
|
mMap.setMapPosition(pos);
|
||||||
mPrefs.clear();
|
mPrefs.clear();
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
} else if (requestCode == SELECT_THEME_FILE) {
|
} else if (requestCode == SELECT_THEME_ARCHIVE) {
|
||||||
if (resultCode != RESULT_OK || intent == null || intent.getStringExtra(FilePicker.SELECTED_FILE) == null) {
|
if (resultCode != Activity.RESULT_OK || data == null)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
String file = intent.getStringExtra(FilePicker.SELECTED_FILE);
|
try {
|
||||||
ExternalRenderTheme externalRenderTheme = new ExternalRenderTheme(file);
|
final Uri uri = data.getData();
|
||||||
|
|
||||||
// Use tessellation with sea and land for Mapsforge themes
|
final List<String> xmlThemes = ZipXmlThemeResourceProvider.scanXmlThemes(new ZipInputStream(new BufferedInputStream(getContentResolver().openInputStream(uri))));
|
||||||
if (ThemeUtils.isMapsforgeTheme(externalRenderTheme)) {
|
if (xmlThemes.isEmpty())
|
||||||
mTileLayer.addHook(new VectorTileLayer.TileLoaderThemeHook() {
|
return;
|
||||||
|
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
|
builder.setTitle(R.string.dialog_theme_title);
|
||||||
|
builder.setSingleChoiceItems(xmlThemes.toArray(new String[0]), -1, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean process(MapTile tile, RenderBuckets buckets, MapElement element, RenderStyle style, int level) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
if (element.tags.contains(ISSEA_TAG) || element.tags.contains(SEA_TAG) || element.tags.contains(NOSEA_TAG)) {
|
try {
|
||||||
if (style instanceof AreaStyle)
|
dialog.dismiss();
|
||||||
((AreaStyle) style).mesh = true;
|
ThemeFile theme = new ZipRenderTheme(xmlThemes.get(which), new ZipXmlThemeResourceProvider(new ZipInputStream(new BufferedInputStream(getContentResolver().openInputStream(uri)))));
|
||||||
|
if (mTheme != null)
|
||||||
|
mTheme.dispose();
|
||||||
|
mTheme = mMap.setTheme(theme);
|
||||||
|
mapsforgeTheme(mTheme);
|
||||||
|
mMenu.findItem(R.id.theme_external_archive).setChecked(true);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void complete(MapTile tile, boolean success) {
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
builder.show();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
} else if (requestCode == SELECT_THEME_DIR) {
|
||||||
|
if (resultCode != Activity.RESULT_OK || data == null)
|
||||||
|
return;
|
||||||
|
|
||||||
mMap.setTheme(externalRenderTheme);
|
mThemeDirUri = data.getData();
|
||||||
|
|
||||||
|
// Now we have the directory for resources, but we need to let the user also select a theme file
|
||||||
|
Intent intent = new Intent(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT ? Intent.ACTION_OPEN_DOCUMENT : Intent.ACTION_GET_CONTENT);
|
||||||
|
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||||
|
intent.setType("*/*");
|
||||||
|
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, mThemeDirUri);
|
||||||
|
startActivityForResult(intent, SELECT_THEME_FILE);
|
||||||
|
} else if (requestCode == SELECT_THEME_FILE) {
|
||||||
|
if (resultCode != Activity.RESULT_OK || data == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Uri uri = data.getData();
|
||||||
|
ThemeFile theme = new ContentRenderTheme(getContentResolver(), uri);
|
||||||
|
theme.setResourceProvider(new ContentResolverResourceProvider(getContentResolver(), mThemeDirUri));
|
||||||
|
|
||||||
|
if (mTheme != null)
|
||||||
|
mTheme.dispose();
|
||||||
|
mTheme = mMap.setTheme(theme);
|
||||||
|
mapsforgeTheme(mTheme);
|
||||||
mMenu.findItem(R.id.theme_external).setChecked(true);
|
mMenu.findItem(R.id.theme_external).setChecked(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void loadTheme(final String styleId) {
|
protected void loadTheme(final String styleId) {
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
if (mTheme != null)
|
||||||
|
mTheme.dispose();
|
||||||
|
mTheme = mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void mapsforgeTheme(IRenderTheme theme) {
|
||||||
|
if (!theme.isMapsforgeTheme())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Use tessellation with sea and land for Mapsforge themes
|
||||||
|
mTileLayer.addHook(new VectorTileLayer.TileLoaderThemeHook() {
|
||||||
|
@Override
|
||||||
|
public boolean process(MapTile tile, RenderBuckets buckets, MapElement element, RenderStyle style, int level) {
|
||||||
|
if (element.tags.contains(ISSEA_TAG) || element.tags.contains(SEA_TAG) || element.tags.contains(NOSEA_TAG)) {
|
||||||
|
if (style instanceof AreaStyle)
|
||||||
|
((AreaStyle) style).mesh = true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void complete(MapTile tile, boolean success) {
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2017 devemux86
|
* Copyright 2016-2020 devemux86
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -17,7 +17,6 @@ package org.oscim.android.test;
|
|||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.oscim.android.theme.AssetsRenderTheme;
|
import org.oscim.android.theme.AssetsRenderTheme;
|
||||||
import org.oscim.theme.XmlRenderThemeMenuCallback;
|
import org.oscim.theme.XmlRenderThemeMenuCallback;
|
||||||
import org.oscim.theme.XmlRenderThemeStyleLayer;
|
import org.oscim.theme.XmlRenderThemeStyleLayer;
|
||||||
@@ -38,27 +37,29 @@ public class MapsforgeStyleActivity extends MapsforgeActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
int itemId = item.getItemId();
|
||||||
case R.id.style_1:
|
if (itemId == R.id.style_1) {
|
||||||
item.setChecked(true);
|
item.setChecked(true);
|
||||||
loadTheme("1");
|
loadTheme("1");
|
||||||
mMap.clearMap();
|
mMap.clearMap();
|
||||||
Toast.makeText(this, "Show nature layers", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Show nature layers", Toast.LENGTH_SHORT).show();
|
||||||
return true;
|
return true;
|
||||||
case R.id.style_2:
|
} else if (itemId == R.id.style_2) {
|
||||||
item.setChecked(true);
|
item.setChecked(true);
|
||||||
loadTheme("2");
|
loadTheme("2");
|
||||||
mMap.clearMap();
|
mMap.clearMap();
|
||||||
Toast.makeText(this, "Hide nature layers", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Hide nature layers", Toast.LENGTH_SHORT).show();
|
||||||
return true;
|
return true;
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void loadTheme(final String styleId) {
|
protected void loadTheme(final String styleId) {
|
||||||
mMap.setTheme(new AssetsRenderTheme(getAssets(), "", "vtm/stylemenu.xml", new XmlRenderThemeMenuCallback() {
|
if (mTheme != null)
|
||||||
|
mTheme.dispose();
|
||||||
|
mTheme = mMap.setTheme(new AssetsRenderTheme(getAssets(), "", "vtm/stylemenu.xml", new XmlRenderThemeMenuCallback() {
|
||||||
@Override
|
@Override
|
||||||
public Set<String> getCategories(XmlRenderThemeStyleMenu renderThemeStyleMenu) {
|
public Set<String> getCategories(XmlRenderThemeStyleMenu renderThemeStyleMenu) {
|
||||||
// Use the selected style or the default
|
// Use the selected style or the default
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2018 devemux86
|
* Copyright 2017-2020 devemux86
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -15,9 +15,8 @@
|
|||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import okhttp3.Cache;
|
||||||
import org.oscim.android.cache.TileCache;
|
import okhttp3.OkHttpClient;
|
||||||
import org.oscim.layers.TileGridLayer;
|
|
||||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
@@ -26,43 +25,35 @@ import org.oscim.tiling.source.OkHttpEngine;
|
|||||||
import org.oscim.tiling.source.UrlTileSource;
|
import org.oscim.tiling.source.UrlTileSource;
|
||||||
import org.oscim.tiling.source.geojson.MapzenGeojsonTileSource;
|
import org.oscim.tiling.source.geojson.MapzenGeojsonTileSource;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class MapzenGeojsonActivity extends MapActivity {
|
public class MapzenGeojsonActivity extends MapActivity {
|
||||||
|
|
||||||
private static final boolean USE_CACHE = false;
|
private static final boolean USE_CACHE = false;
|
||||||
|
|
||||||
private TileCache mCache;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||||
|
if (USE_CACHE) {
|
||||||
|
// Cache the tiles into file system
|
||||||
|
File cacheDirectory = new File(getExternalCacheDir(), "tiles");
|
||||||
|
int cacheSize = 10 * 1024 * 1024; // 10 MB
|
||||||
|
Cache cache = new Cache(cacheDirectory, cacheSize);
|
||||||
|
builder.cache(cache);
|
||||||
|
}
|
||||||
|
|
||||||
UrlTileSource tileSource = MapzenGeojsonTileSource.builder()
|
UrlTileSource tileSource = MapzenGeojsonTileSource.builder()
|
||||||
.apiKey("xxxxxxx") // Put a proper API key
|
.apiKey("xxxxxxx") // Put a proper API key
|
||||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
.httpFactory(new OkHttpEngine.OkHttpFactory(builder))
|
||||||
//.locale("en")
|
//.locale("en")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
if (USE_CACHE) {
|
|
||||||
// Cache the tiles into a local SQLite database
|
|
||||||
mCache = new TileCache(this, null, "tile.db");
|
|
||||||
mCache.setCacheSize(512 * (1 << 10));
|
|
||||||
tileSource.setCache(mCache);
|
|
||||||
}
|
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
||||||
mMap.setTheme(VtmThemes.MAPZEN);
|
mMap.setTheme(VtmThemes.MAPZEN);
|
||||||
|
|
||||||
mMap.layers().add(new BuildingLayer(mMap, l));
|
mMap.layers().add(new BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
|
|
||||||
mMap.layers().add(new TileGridLayer(mMap));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
|
|
||||||
if (mCache != null)
|
|
||||||
mCache.dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2020 devemux86
|
||||||
* Copyright 2017 Mathieu De Brito
|
* Copyright 2017 Mathieu De Brito
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
@@ -16,9 +16,8 @@
|
|||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import okhttp3.Cache;
|
||||||
import org.oscim.android.cache.TileCache;
|
import okhttp3.OkHttpClient;
|
||||||
import org.oscim.layers.TileGridLayer;
|
|
||||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
@@ -27,43 +26,35 @@ import org.oscim.tiling.source.OkHttpEngine;
|
|||||||
import org.oscim.tiling.source.UrlTileSource;
|
import org.oscim.tiling.source.UrlTileSource;
|
||||||
import org.oscim.tiling.source.mvt.MapzenMvtTileSource;
|
import org.oscim.tiling.source.mvt.MapzenMvtTileSource;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class MapzenMvtActivity extends MapActivity {
|
public class MapzenMvtActivity extends MapActivity {
|
||||||
|
|
||||||
private static final boolean USE_CACHE = false;
|
private static final boolean USE_CACHE = false;
|
||||||
|
|
||||||
private TileCache mCache;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||||
|
if (USE_CACHE) {
|
||||||
|
// Cache the tiles into file system
|
||||||
|
File cacheDirectory = new File(getExternalCacheDir(), "tiles");
|
||||||
|
int cacheSize = 10 * 1024 * 1024; // 10 MB
|
||||||
|
Cache cache = new Cache(cacheDirectory, cacheSize);
|
||||||
|
builder.cache(cache);
|
||||||
|
}
|
||||||
|
|
||||||
UrlTileSource tileSource = MapzenMvtTileSource.builder()
|
UrlTileSource tileSource = MapzenMvtTileSource.builder()
|
||||||
.apiKey("xxxxxxx") // Put a proper API key
|
.apiKey("xxxxxxx") // Put a proper API key
|
||||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
.httpFactory(new OkHttpEngine.OkHttpFactory(builder))
|
||||||
//.locale("en")
|
//.locale("en")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
if (USE_CACHE) {
|
|
||||||
// Cache the tiles into a local SQLite database
|
|
||||||
mCache = new TileCache(this, null, "tile.db");
|
|
||||||
mCache.setCacheSize(512 * (1 << 10));
|
|
||||||
tileSource.setCache(mCache);
|
|
||||||
}
|
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
||||||
mMap.setTheme(VtmThemes.MAPZEN);
|
mMap.setTheme(VtmThemes.MAPZEN);
|
||||||
|
|
||||||
mMap.layers().add(new BuildingLayer(mMap, l));
|
mMap.layers().add(new BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
|
|
||||||
mMap.layers().add(new TileGridLayer(mMap));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
|
|
||||||
if (mCache != null)
|
|
||||||
mCache.dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 Hannes Janetzek
|
* Copyright 2014 Hannes Janetzek
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2020 devemux86
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -17,9 +17,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import org.oscim.android.canvas.AndroidBitmap;
|
||||||
import org.oscim.backend.canvas.Bitmap;
|
import org.oscim.backend.canvas.Bitmap;
|
||||||
import org.oscim.core.GeoPoint;
|
import org.oscim.core.GeoPoint;
|
||||||
import org.oscim.event.Gesture;
|
import org.oscim.event.Gesture;
|
||||||
@@ -27,26 +28,25 @@ import org.oscim.event.GestureListener;
|
|||||||
import org.oscim.event.MotionEvent;
|
import org.oscim.event.MotionEvent;
|
||||||
import org.oscim.layers.Layer;
|
import org.oscim.layers.Layer;
|
||||||
import org.oscim.layers.marker.ItemizedLayer;
|
import org.oscim.layers.marker.ItemizedLayer;
|
||||||
|
import org.oscim.layers.marker.MarkerInterface;
|
||||||
import org.oscim.layers.marker.MarkerItem;
|
import org.oscim.layers.marker.MarkerItem;
|
||||||
import org.oscim.layers.marker.MarkerSymbol;
|
import org.oscim.layers.marker.MarkerSymbol;
|
||||||
import org.oscim.layers.marker.MarkerSymbol.HotspotPlace;
|
import org.oscim.layers.marker.MarkerSymbol.HotspotPlace;
|
||||||
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
import org.oscim.tiling.TileSource;
|
|
||||||
import org.oscim.tiling.source.OkHttpEngine;
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
|
import org.oscim.tiling.source.UrlTileSource;
|
||||||
import org.oscim.tiling.source.bitmap.DefaultSources;
|
import org.oscim.tiling.source.bitmap.DefaultSources;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.oscim.android.canvas.AndroidGraphics.drawableToBitmap;
|
public class MarkerOverlayActivity extends MapActivity implements ItemizedLayer.OnItemGestureListener<MarkerInterface> {
|
||||||
|
|
||||||
public class MarkerOverlayActivity extends MapActivity
|
|
||||||
implements ItemizedLayer.OnItemGestureListener<MarkerItem> {
|
|
||||||
|
|
||||||
static final boolean BILLBOARDS = true;
|
static final boolean BILLBOARDS = true;
|
||||||
MarkerSymbol mFocusMarker;
|
MarkerSymbol mFocusMarker;
|
||||||
ItemizedLayer<MarkerItem> mMarkerLayer;
|
ItemizedLayer mMarkerLayer;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -59,28 +59,29 @@ public class MarkerOverlayActivity extends MapActivity
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
TileSource tileSource = DefaultSources.OPENSTREETMAP
|
UrlTileSource tileSource = DefaultSources.OPENSTREETMAP
|
||||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
.build();
|
.build();
|
||||||
|
tileSource.setHttpRequestHeaders(Collections.singletonMap("User-Agent", "vtm-android-example"));
|
||||||
mMap.layers().add(new BitmapTileLayer(mMap, tileSource));
|
mMap.layers().add(new BitmapTileLayer(mMap, tileSource));
|
||||||
|
|
||||||
Bitmap bitmapPoi = drawableToBitmap(getResources().getDrawable(R.drawable.marker_poi));
|
Bitmap bitmapPoi = new AndroidBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.marker_poi));
|
||||||
MarkerSymbol symbol;
|
MarkerSymbol symbol;
|
||||||
if (BILLBOARDS)
|
if (BILLBOARDS)
|
||||||
symbol = new MarkerSymbol(bitmapPoi, HotspotPlace.BOTTOM_CENTER);
|
symbol = new MarkerSymbol(bitmapPoi, HotspotPlace.BOTTOM_CENTER);
|
||||||
else
|
else
|
||||||
symbol = new MarkerSymbol(bitmapPoi, HotspotPlace.CENTER, false);
|
symbol = new MarkerSymbol(bitmapPoi, HotspotPlace.CENTER, false);
|
||||||
|
|
||||||
Bitmap bitmapFocus = drawableToBitmap(getResources().getDrawable(R.drawable.marker_focus));
|
Bitmap bitmapFocus = new AndroidBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.marker_focus));
|
||||||
if (BILLBOARDS)
|
if (BILLBOARDS)
|
||||||
mFocusMarker = new MarkerSymbol(bitmapFocus, HotspotPlace.BOTTOM_CENTER);
|
mFocusMarker = new MarkerSymbol(bitmapFocus, HotspotPlace.BOTTOM_CENTER);
|
||||||
else
|
else
|
||||||
mFocusMarker = new MarkerSymbol(bitmapFocus, HotspotPlace.CENTER, false);
|
mFocusMarker = new MarkerSymbol(bitmapFocus, HotspotPlace.CENTER, false);
|
||||||
|
|
||||||
mMarkerLayer = new ItemizedLayer<>(mMap, new ArrayList<MarkerItem>(), symbol, this);
|
mMarkerLayer = new ItemizedLayer(mMap, new ArrayList<MarkerInterface>(), symbol, this);
|
||||||
mMap.layers().add(mMarkerLayer);
|
mMap.layers().add(mMarkerLayer);
|
||||||
|
|
||||||
List<MarkerItem> pts = new ArrayList<>();
|
List<MarkerInterface> pts = new ArrayList<>();
|
||||||
|
|
||||||
for (double lat = -90; lat <= 90; lat += 5) {
|
for (double lat = -90; lat <= 90; lat += 5) {
|
||||||
for (double lon = -180; lon <= 180; lon += 5)
|
for (double lon = -180; lon <= 180; lon += 5)
|
||||||
@@ -99,24 +100,26 @@ public class MarkerOverlayActivity extends MapActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemSingleTapUp(int index, MarkerItem item) {
|
public boolean onItemSingleTapUp(int index, MarkerInterface item) {
|
||||||
if (item.getMarker() == null)
|
MarkerItem markerItem = (MarkerItem) item;
|
||||||
item.setMarker(mFocusMarker);
|
if (markerItem.getMarker() == null)
|
||||||
|
markerItem.setMarker(mFocusMarker);
|
||||||
else
|
else
|
||||||
item.setMarker(null);
|
markerItem.setMarker(null);
|
||||||
|
|
||||||
Toast.makeText(this, "Marker tap\n" + item.getTitle(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Marker tap\n" + markerItem.getTitle(), Toast.LENGTH_SHORT).show();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemLongPress(int index, MarkerItem item) {
|
public boolean onItemLongPress(int index, MarkerInterface item) {
|
||||||
if (item.getMarker() == null)
|
MarkerItem markerItem = (MarkerItem) item;
|
||||||
item.setMarker(mFocusMarker);
|
if (markerItem.getMarker() == null)
|
||||||
|
markerItem.setMarker(mFocusMarker);
|
||||||
else
|
else
|
||||||
item.setMarker(null);
|
markerItem.setMarker(null);
|
||||||
|
|
||||||
Toast.makeText(this, "Marker long press\n" + item.getTitle(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Marker long press\n" + markerItem.getTitle(), Toast.LENGTH_SHORT).show();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,90 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2016 Marvin W
|
|
||||||
* Copyright 2016-2017 devemux86
|
|
||||||
*
|
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
|
||||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package org.oscim.android.test;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import org.oscim.android.MapPreferences;
|
|
||||||
import org.oscim.android.MapView;
|
|
||||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
|
||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
|
||||||
import org.oscim.map.Map;
|
|
||||||
import org.oscim.theme.VtmThemes;
|
|
||||||
import org.oscim.tiling.TileSource;
|
|
||||||
import org.oscim.tiling.source.OkHttpEngine;
|
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
|
||||||
|
|
||||||
public class MultiMapViewActivity extends Activity {
|
|
||||||
private MapView mMapView1, mMapView2;
|
|
||||||
private MapPreferences mPrefs1, mPrefs2;
|
|
||||||
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_map_multi);
|
|
||||||
|
|
||||||
setTitle(getClass().getSimpleName());
|
|
||||||
|
|
||||||
// 1st map view
|
|
||||||
mMapView1 = (MapView) findViewById(R.id.mapView1);
|
|
||||||
Map map1 = mMapView1.map();
|
|
||||||
mPrefs1 = new MapPreferences(MultiMapViewActivity.class.getName() + "1", this);
|
|
||||||
TileSource tileSource1 = OSciMap4TileSource.builder()
|
|
||||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
|
||||||
.build();
|
|
||||||
VectorTileLayer baseLayer1 = map1.setBaseMap(tileSource1);
|
|
||||||
map1.layers().add(new BuildingLayer(map1, baseLayer1));
|
|
||||||
map1.layers().add(new LabelLayer(map1, baseLayer1));
|
|
||||||
map1.setTheme(VtmThemes.DEFAULT);
|
|
||||||
|
|
||||||
// 2nd map view
|
|
||||||
mMapView2 = (MapView) findViewById(R.id.mapView2);
|
|
||||||
Map map2 = mMapView2.map();
|
|
||||||
mPrefs2 = new MapPreferences(MultiMapViewActivity.class.getName() + "2", this);
|
|
||||||
TileSource tileSource2 = OSciMap4TileSource.builder()
|
|
||||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
|
||||||
.build();
|
|
||||||
VectorTileLayer baseLayer2 = map2.setBaseMap(tileSource2);
|
|
||||||
map2.layers().add(new BuildingLayer(map2, baseLayer2));
|
|
||||||
map2.layers().add(new LabelLayer(map2, baseLayer2));
|
|
||||||
map2.setTheme(VtmThemes.DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
|
|
||||||
mPrefs1.load(mMapView1.map());
|
|
||||||
mMapView1.onResume();
|
|
||||||
|
|
||||||
mPrefs2.load(mMapView2.map());
|
|
||||||
mMapView2.onResume();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPause() {
|
|
||||||
super.onPause();
|
|
||||||
|
|
||||||
mMapView1.onPause();
|
|
||||||
mPrefs1.save(mMapView1.map());
|
|
||||||
|
|
||||||
mMapView2.onPause();
|
|
||||||
mPrefs2.save(mMapView2.map());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018 devemux86
|
* Copyright 2018-2020 devemux86
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -15,9 +15,8 @@
|
|||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import okhttp3.Cache;
|
||||||
import org.oscim.android.cache.TileCache;
|
import okhttp3.OkHttpClient;
|
||||||
import org.oscim.layers.TileGridLayer;
|
|
||||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
@@ -26,43 +25,35 @@ import org.oscim.tiling.source.OkHttpEngine;
|
|||||||
import org.oscim.tiling.source.UrlTileSource;
|
import org.oscim.tiling.source.UrlTileSource;
|
||||||
import org.oscim.tiling.source.geojson.NextzenGeojsonTileSource;
|
import org.oscim.tiling.source.geojson.NextzenGeojsonTileSource;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class NextzenGeojsonActivity extends MapActivity {
|
public class NextzenGeojsonActivity extends MapActivity {
|
||||||
|
|
||||||
private static final boolean USE_CACHE = false;
|
private static final boolean USE_CACHE = false;
|
||||||
|
|
||||||
private TileCache mCache;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||||
|
if (USE_CACHE) {
|
||||||
|
// Cache the tiles into file system
|
||||||
|
File cacheDirectory = new File(getExternalCacheDir(), "tiles");
|
||||||
|
int cacheSize = 10 * 1024 * 1024; // 10 MB
|
||||||
|
Cache cache = new Cache(cacheDirectory, cacheSize);
|
||||||
|
builder.cache(cache);
|
||||||
|
}
|
||||||
|
|
||||||
UrlTileSource tileSource = NextzenGeojsonTileSource.builder()
|
UrlTileSource tileSource = NextzenGeojsonTileSource.builder()
|
||||||
.apiKey("xxxxxxx") // Put a proper API key
|
.apiKey("xxxxxxx") // Put a proper API key
|
||||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
.httpFactory(new OkHttpEngine.OkHttpFactory(builder))
|
||||||
//.locale("en")
|
//.locale("en")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
if (USE_CACHE) {
|
|
||||||
// Cache the tiles into a local SQLite database
|
|
||||||
mCache = new TileCache(this, null, "tile.db");
|
|
||||||
mCache.setCacheSize(512 * (1 << 10));
|
|
||||||
tileSource.setCache(mCache);
|
|
||||||
}
|
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
||||||
mMap.setTheme(VtmThemes.MAPZEN);
|
mMap.setTheme(VtmThemes.MAPZEN);
|
||||||
|
|
||||||
mMap.layers().add(new BuildingLayer(mMap, l));
|
mMap.layers().add(new BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
|
|
||||||
mMap.layers().add(new TileGridLayer(mMap));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
|
|
||||||
if (mCache != null)
|
|
||||||
mCache.dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018 devemux86
|
* Copyright 2018-2020 devemux86
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -15,9 +15,8 @@
|
|||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import okhttp3.Cache;
|
||||||
import org.oscim.android.cache.TileCache;
|
import okhttp3.OkHttpClient;
|
||||||
import org.oscim.layers.TileGridLayer;
|
|
||||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
@@ -26,43 +25,35 @@ import org.oscim.tiling.source.OkHttpEngine;
|
|||||||
import org.oscim.tiling.source.UrlTileSource;
|
import org.oscim.tiling.source.UrlTileSource;
|
||||||
import org.oscim.tiling.source.mvt.NextzenMvtTileSource;
|
import org.oscim.tiling.source.mvt.NextzenMvtTileSource;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class NextzenMvtActivity extends MapActivity {
|
public class NextzenMvtActivity extends MapActivity {
|
||||||
|
|
||||||
private static final boolean USE_CACHE = false;
|
private static final boolean USE_CACHE = false;
|
||||||
|
|
||||||
private TileCache mCache;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||||
|
if (USE_CACHE) {
|
||||||
|
// Cache the tiles into file system
|
||||||
|
File cacheDirectory = new File(getExternalCacheDir(), "tiles");
|
||||||
|
int cacheSize = 10 * 1024 * 1024; // 10 MB
|
||||||
|
Cache cache = new Cache(cacheDirectory, cacheSize);
|
||||||
|
builder.cache(cache);
|
||||||
|
}
|
||||||
|
|
||||||
UrlTileSource tileSource = NextzenMvtTileSource.builder()
|
UrlTileSource tileSource = NextzenMvtTileSource.builder()
|
||||||
.apiKey("xxxxxxx") // Put a proper API key
|
.apiKey("xxxxxxx") // Put a proper API key
|
||||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
.httpFactory(new OkHttpEngine.OkHttpFactory(builder))
|
||||||
//.locale("en")
|
//.locale("en")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
if (USE_CACHE) {
|
|
||||||
// Cache the tiles into a local SQLite database
|
|
||||||
mCache = new TileCache(this, null, "tile.db");
|
|
||||||
mCache.setCacheSize(512 * (1 << 10));
|
|
||||||
tileSource.setCache(mCache);
|
|
||||||
}
|
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
||||||
mMap.setTheme(VtmThemes.MAPZEN);
|
mMap.setTheme(VtmThemes.MAPZEN);
|
||||||
|
|
||||||
mMap.layers().add(new BuildingLayer(mMap, l));
|
mMap.layers().add(new BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
|
|
||||||
mMap.layers().add(new TileGridLayer(mMap));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
|
|
||||||
if (mCache != null)
|
|
||||||
mCache.dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2016-2017 devemux86
|
|
||||||
*
|
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
|
||||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package org.oscim.android.test;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import org.oscim.android.cache.TileCache;
|
|
||||||
import org.oscim.layers.tile.TileLayer;
|
|
||||||
import org.oscim.layers.tile.buildings.S3DBTileLayer;
|
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
|
||||||
import org.oscim.theme.VtmThemes;
|
|
||||||
import org.oscim.tiling.TileSource;
|
|
||||||
import org.oscim.tiling.source.OkHttpEngine;
|
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
|
||||||
|
|
||||||
public class OSciMapS3DBActivity extends BaseMapActivity {
|
|
||||||
|
|
||||||
TileCache mS3dbCache;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
|
||||||
|
|
||||||
TileSource ts = OSciMap4TileSource.builder()
|
|
||||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
|
||||||
.url("http://opensciencemap.org/tiles/s3db")
|
|
||||||
.zoomMin(16)
|
|
||||||
.zoomMax(16)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
if (USE_CACHE) {
|
|
||||||
mS3dbCache = new TileCache(this, null, "s3db.db");
|
|
||||||
mS3dbCache.setCacheSize(512 * (1 << 10));
|
|
||||||
ts.setCache(mS3dbCache);
|
|
||||||
}
|
|
||||||
TileLayer tl = new S3DBTileLayer(mMap, ts, true, false);
|
|
||||||
mMap.layers().add(tl);
|
|
||||||
mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
|
|
||||||
if (mS3dbCache != null)
|
|
||||||
mS3dbCache.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
|
|
||||||
/* ignore saved position */
|
|
||||||
mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2020 devemux86
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -15,9 +15,8 @@
|
|||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import okhttp3.Cache;
|
||||||
import org.oscim.android.cache.TileCache;
|
import okhttp3.OkHttpClient;
|
||||||
import org.oscim.layers.TileGridLayer;
|
|
||||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
@@ -26,43 +25,35 @@ import org.oscim.tiling.source.OkHttpEngine;
|
|||||||
import org.oscim.tiling.source.UrlTileSource;
|
import org.oscim.tiling.source.UrlTileSource;
|
||||||
import org.oscim.tiling.source.mvt.OpenMapTilesMvtTileSource;
|
import org.oscim.tiling.source.mvt.OpenMapTilesMvtTileSource;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class OpenMapTilesMvtActivity extends MapActivity {
|
public class OpenMapTilesMvtActivity extends MapActivity {
|
||||||
|
|
||||||
private static final boolean USE_CACHE = false;
|
private static final boolean USE_CACHE = false;
|
||||||
|
|
||||||
private TileCache mCache;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||||
|
if (USE_CACHE) {
|
||||||
|
// Cache the tiles into file system
|
||||||
|
File cacheDirectory = new File(getExternalCacheDir(), "tiles");
|
||||||
|
int cacheSize = 10 * 1024 * 1024; // 10 MB
|
||||||
|
Cache cache = new Cache(cacheDirectory, cacheSize);
|
||||||
|
builder.cache(cache);
|
||||||
|
}
|
||||||
|
|
||||||
UrlTileSource tileSource = OpenMapTilesMvtTileSource.builder()
|
UrlTileSource tileSource = OpenMapTilesMvtTileSource.builder()
|
||||||
.apiKey("xxxxxxx") // Put a proper API key
|
.apiKey("xxxxxxx") // Put a proper API key
|
||||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
.httpFactory(new OkHttpEngine.OkHttpFactory(builder))
|
||||||
//.locale("en")
|
//.locale("en")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
if (USE_CACHE) {
|
|
||||||
// Cache the tiles into a local SQLite database
|
|
||||||
mCache = new TileCache(this, null, "tile.db");
|
|
||||||
mCache.setCacheSize(512 * (1 << 10));
|
|
||||||
tileSource.setCache(mCache);
|
|
||||||
}
|
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
||||||
mMap.setTheme(VtmThemes.OPENMAPTILES);
|
mMap.setTheme(VtmThemes.OPENMAPTILES);
|
||||||
|
|
||||||
mMap.layers().add(new BuildingLayer(mMap, l));
|
mMap.layers().add(new BuildingLayer(mMap, l));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
|
|
||||||
mMap.layers().add(new TileGridLayer(mMap));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
|
|
||||||
if (mCache != null)
|
|
||||||
mCache.dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 Gustl22
|
||||||
|
* Copyright 2020 devemux86
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.oscim.android.test;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
||||||
|
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||||
|
import org.oscim.layers.tile.buildings.S3DBLayer;
|
||||||
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
|
import org.oscim.map.Viewport;
|
||||||
|
import org.oscim.theme.VtmThemes;
|
||||||
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
|
import org.oscim.tiling.source.UrlTileSource;
|
||||||
|
import org.oscim.tiling.source.bitmap.DefaultSources;
|
||||||
|
import org.oscim.tiling.source.overpass.OverpassTileSource;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use Overpass API data for vector layer.
|
||||||
|
* Only for developing as can be error-prone.
|
||||||
|
* Take care of overpass provider licenses.
|
||||||
|
*/
|
||||||
|
public class OverpassActivity extends MapActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
TileSource tileSource = OverpassTileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.zoomMin(15)
|
||||||
|
.zoomMax(17)
|
||||||
|
.build();
|
||||||
|
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
||||||
|
|
||||||
|
UrlTileSource bitmapTileSource = DefaultSources.OPENSTREETMAP
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.zoomMax(15)
|
||||||
|
.fadeSteps(new BitmapTileLayer.FadeStep[]{
|
||||||
|
new BitmapTileLayer.FadeStep(15, 16, 1f, 0f),
|
||||||
|
new BitmapTileLayer.FadeStep(16, Viewport.MAX_ZOOM_LEVEL, 0f, 0f)
|
||||||
|
})
|
||||||
|
.build();
|
||||||
|
bitmapTileSource.setHttpRequestHeaders(Collections.singletonMap("User-Agent", "vtm-android-example"));
|
||||||
|
mMap.layers().add(new BitmapTileLayer(mMap, bitmapTileSource));
|
||||||
|
|
||||||
|
BuildingLayer.RAW_DATA = true;
|
||||||
|
mMap.layers().add(new S3DBLayer(mMap, l));
|
||||||
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
|
|
||||||
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
|
||||||
|
BuildingLayer.RAW_DATA = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2018 devemux86
|
* Copyright 2017-2020 devemux86
|
||||||
|
* Copyright 2018 Gustl22
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
@@ -14,18 +15,21 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.AsyncTask;
|
import android.graphics.BitmapFactory;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.widget.Toast;
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.*;
|
||||||
|
import org.mapsforge.core.model.Tag;
|
||||||
import org.mapsforge.poi.android.storage.AndroidPoiPersistenceManagerFactory;
|
import org.mapsforge.poi.android.storage.AndroidPoiPersistenceManagerFactory;
|
||||||
import org.mapsforge.poi.storage.ExactMatchPoiCategoryFilter;
|
import org.mapsforge.poi.storage.*;
|
||||||
import org.mapsforge.poi.storage.PoiCategoryFilter;
|
import org.oscim.android.canvas.AndroidBitmap;
|
||||||
import org.mapsforge.poi.storage.PoiCategoryManager;
|
|
||||||
import org.mapsforge.poi.storage.PoiPersistenceManager;
|
|
||||||
import org.mapsforge.poi.storage.PointOfInterest;
|
|
||||||
import org.oscim.android.filepicker.FilePicker;
|
import org.oscim.android.filepicker.FilePicker;
|
||||||
import org.oscim.android.filepicker.FilterByFileExtension;
|
import org.oscim.android.filepicker.FilterByFileExtension;
|
||||||
import org.oscim.backend.canvas.Bitmap;
|
import org.oscim.backend.canvas.Bitmap;
|
||||||
@@ -36,6 +40,7 @@ import org.oscim.event.GestureListener;
|
|||||||
import org.oscim.event.MotionEvent;
|
import org.oscim.event.MotionEvent;
|
||||||
import org.oscim.layers.Layer;
|
import org.oscim.layers.Layer;
|
||||||
import org.oscim.layers.marker.ItemizedLayer;
|
import org.oscim.layers.marker.ItemizedLayer;
|
||||||
|
import org.oscim.layers.marker.MarkerInterface;
|
||||||
import org.oscim.layers.marker.MarkerItem;
|
import org.oscim.layers.marker.MarkerItem;
|
||||||
import org.oscim.layers.marker.MarkerSymbol;
|
import org.oscim.layers.marker.MarkerSymbol;
|
||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
@@ -47,21 +52,20 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.oscim.android.canvas.AndroidGraphics.drawableToBitmap;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POI search.<br/>
|
* POI search.<br/>
|
||||||
* Long press on map to search inside visible bounding box.<br/>
|
* Long press on map to search inside visible bounding box.<br/>
|
||||||
* Tap on POIs to show their name (in default locale).
|
* Tap on POIs to show their name (in default locale).
|
||||||
*/
|
*/
|
||||||
public class PoiSearchActivity extends MapsforgeActivity implements ItemizedLayer.OnItemGestureListener<MarkerItem> {
|
@SuppressWarnings("deprecation")
|
||||||
|
public class PoiSearchActivity extends MapsforgeActivity implements ItemizedLayer.OnItemGestureListener<MarkerInterface> {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(PoiSearchActivity.class);
|
private static final Logger log = LoggerFactory.getLogger(PoiSearchActivity.class);
|
||||||
|
|
||||||
private static final String POI_CATEGORY = "Restaurants";
|
private static final String POI_CATEGORY = "Restaurants";
|
||||||
private static final int SELECT_POI_FILE = MapsforgeActivity.SELECT_THEME_FILE + 1;
|
private static final int SELECT_POI_FILE = MapsforgeActivity.SELECT_THEME_FILE + 1;
|
||||||
|
|
||||||
private ItemizedLayer<MarkerItem> mMarkerLayer;
|
private ItemizedLayer mMarkerLayer;
|
||||||
private PoiPersistenceManager mPersistenceManager;
|
private PoiPersistenceManager mPersistenceManager;
|
||||||
|
|
||||||
public static class PoiFilePicker extends FilePicker {
|
public static class PoiFilePicker extends FilePicker {
|
||||||
@@ -70,10 +74,49 @@ public class PoiSearchActivity extends MapsforgeActivity implements ItemizedLaye
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PoiSearchActivity() {
|
||||||
|
super(false, R.layout.activity_map_poi);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initSearch() {
|
||||||
|
final List<Pattern> searchPatterns = new ArrayList<>();
|
||||||
|
|
||||||
|
final PatternAdapter adapter = new PatternAdapter(this, searchPatterns);
|
||||||
|
ListView searchList = (ListView) findViewById(R.id.search_list);
|
||||||
|
searchList.setAdapter(adapter);
|
||||||
|
|
||||||
|
Button addItem = (Button) findViewById(R.id.add_item);
|
||||||
|
addItem.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
searchPatterns.add(new Pattern("", ""));
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Button startSearch = (Button) findViewById(R.id.start_search);
|
||||||
|
startSearch.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
// Clear overlays
|
||||||
|
mMarkerLayer.removeAllItems();
|
||||||
|
mMap.render();
|
||||||
|
|
||||||
|
// POI search
|
||||||
|
List<Tag> tags = new ArrayList<>();
|
||||||
|
for (Pattern pattern : searchPatterns)
|
||||||
|
tags.add(new Tag(pattern.key, pattern.val));
|
||||||
|
new PoiSearchTask(PoiSearchActivity.this, null, tags).execute(mMap.getBoundingBox(0));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
initSearch();
|
||||||
|
|
||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new PoiSearchActivity.MapEventsReceiver(mMap));
|
mMap.layers().add(new PoiSearchActivity.MapEventsReceiver(mMap));
|
||||||
}
|
}
|
||||||
@@ -96,7 +139,7 @@ public class PoiSearchActivity extends MapsforgeActivity implements ItemizedLaye
|
|||||||
super.onActivityResult(requestCode, resultCode, intent);
|
super.onActivityResult(requestCode, resultCode, intent);
|
||||||
|
|
||||||
if (requestCode == SELECT_MAP_FILE) {
|
if (requestCode == SELECT_MAP_FILE) {
|
||||||
if (mTileSource != null)
|
if (mTileLayer.getTileSource() != null)
|
||||||
startActivityForResult(new Intent(this, PoiFilePicker.class),
|
startActivityForResult(new Intent(this, PoiFilePicker.class),
|
||||||
SELECT_POI_FILE);
|
SELECT_POI_FILE);
|
||||||
else
|
else
|
||||||
@@ -110,24 +153,30 @@ public class PoiSearchActivity extends MapsforgeActivity implements ItemizedLaye
|
|||||||
String file = intent.getStringExtra(FilePicker.SELECTED_FILE);
|
String file = intent.getStringExtra(FilePicker.SELECTED_FILE);
|
||||||
mPersistenceManager = AndroidPoiPersistenceManagerFactory.getPoiPersistenceManager(file);
|
mPersistenceManager = AndroidPoiPersistenceManagerFactory.getPoiPersistenceManager(file);
|
||||||
|
|
||||||
Bitmap bitmap = drawableToBitmap(getResources().getDrawable(R.drawable.marker_green));
|
Bitmap bitmap = new AndroidBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.marker_green));
|
||||||
MarkerSymbol symbol = new MarkerSymbol(bitmap, MarkerSymbol.HotspotPlace.BOTTOM_CENTER);
|
MarkerSymbol symbol = new MarkerSymbol(bitmap, MarkerSymbol.HotspotPlace.BOTTOM_CENTER);
|
||||||
mMarkerLayer = new ItemizedLayer<>(mMap, new ArrayList<MarkerItem>(), symbol, this);
|
mMarkerLayer = new ItemizedLayer(mMap, new ArrayList<MarkerInterface>(), symbol, this);
|
||||||
mMap.layers().add(mMarkerLayer);
|
mMap.layers().add(mMarkerLayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemSingleTapUp(int index, MarkerItem item) {
|
public boolean onItemSingleTapUp(int index, MarkerInterface item) {
|
||||||
Toast.makeText(this, item.getTitle(), Toast.LENGTH_SHORT).show();
|
MarkerItem markerItem = (MarkerItem) item;
|
||||||
|
Toast.makeText(this, markerItem.getTitle(), Toast.LENGTH_SHORT).show();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemLongPress(int index, MarkerItem item) {
|
public boolean onItemLongPress(int index, MarkerInterface item) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onToggleControls(View view) {
|
||||||
|
findViewById(R.id.controls).setVisibility(((ToggleButton) view).isChecked() ?
|
||||||
|
View.VISIBLE : View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
private class MapEventsReceiver extends Layer implements GestureListener {
|
private class MapEventsReceiver extends Layer implements GestureListener {
|
||||||
|
|
||||||
MapEventsReceiver(Map map) {
|
MapEventsReceiver(Map map) {
|
||||||
@@ -141,20 +190,100 @@ public class PoiSearchActivity extends MapsforgeActivity implements ItemizedLaye
|
|||||||
mMarkerLayer.removeAllItems();
|
mMarkerLayer.removeAllItems();
|
||||||
mMap.render();
|
mMap.render();
|
||||||
// POI search
|
// POI search
|
||||||
new PoiSearchTask(PoiSearchActivity.this, POI_CATEGORY).execute(mMap.getBoundingBox(0));
|
new PoiSearchTask(PoiSearchActivity.this, POI_CATEGORY, null).execute(mMap.getBoundingBox(0));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class PoiSearchTask extends AsyncTask<BoundingBox, Void, Collection<PointOfInterest>> {
|
private class Pattern {
|
||||||
|
String key;
|
||||||
|
String val;
|
||||||
|
|
||||||
|
Pattern(String key, String val) {
|
||||||
|
this.key = key;
|
||||||
|
this.val = val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class PatternAdapter extends ArrayAdapter<Pattern> {
|
||||||
|
PatternAdapter(Context context, List<Pattern> patterns) {
|
||||||
|
super(context, 0, patterns);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
Pattern pattern = getItem(position);
|
||||||
|
assert pattern != null;
|
||||||
|
// Check if an existing view is being reused, otherwise inflate the view
|
||||||
|
if (convertView == null)
|
||||||
|
convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_poi_search, parent, false);
|
||||||
|
|
||||||
|
// Populate the data
|
||||||
|
EditText etKey = (EditText) convertView.findViewById(R.id.key);
|
||||||
|
etKey.removeTextChangedListener((PatternTextWatcher) etKey.getTag()); // remove previous listeners
|
||||||
|
etKey.setText(pattern.key); // set text when no listener is attached
|
||||||
|
PatternTextWatcher ptwKey = new PatternTextWatcher(pattern, true);
|
||||||
|
etKey.setTag(ptwKey);
|
||||||
|
etKey.addTextChangedListener(ptwKey);
|
||||||
|
|
||||||
|
EditText etValue = (EditText) convertView.findViewById(R.id.value);
|
||||||
|
etValue.removeTextChangedListener((PatternTextWatcher) etValue.getTag());
|
||||||
|
etValue.setText(pattern.val);
|
||||||
|
PatternTextWatcher ptwVal = new PatternTextWatcher(pattern, false);
|
||||||
|
etValue.setTag(ptwVal);
|
||||||
|
etValue.addTextChangedListener(ptwVal);
|
||||||
|
|
||||||
|
Button remove = (Button) convertView.findViewById(R.id.remove);
|
||||||
|
remove.setTag(pattern);
|
||||||
|
remove.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Pattern pat = (Pattern) v.getTag();
|
||||||
|
remove(pat);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class PatternTextWatcher implements TextWatcher {
|
||||||
|
private Pattern pattern;
|
||||||
|
private boolean isKey;
|
||||||
|
|
||||||
|
PatternTextWatcher(Pattern pattern, boolean isKey) {
|
||||||
|
this.pattern = pattern;
|
||||||
|
this.isKey = isKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
if (isKey)
|
||||||
|
pattern.key = s.toString();
|
||||||
|
else
|
||||||
|
pattern.val = s.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class PoiSearchTask extends android.os.AsyncTask<BoundingBox, Void, Collection<PointOfInterest>> {
|
||||||
private final WeakReference<PoiSearchActivity> weakActivity;
|
private final WeakReference<PoiSearchActivity> weakActivity;
|
||||||
private final String category;
|
private final String category;
|
||||||
|
private final List<Tag> patterns;
|
||||||
|
|
||||||
private PoiSearchTask(PoiSearchActivity activity, String category) {
|
private PoiSearchTask(PoiSearchActivity activity, String category, List<Tag> patterns) {
|
||||||
this.weakActivity = new WeakReference<>(activity);
|
this.weakActivity = new WeakReference<>(activity);
|
||||||
this.category = category;
|
this.category = category;
|
||||||
|
this.patterns = patterns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -163,11 +292,12 @@ public class PoiSearchActivity extends MapsforgeActivity implements ItemizedLaye
|
|||||||
try {
|
try {
|
||||||
PoiCategoryManager categoryManager = mPersistenceManager.getCategoryManager();
|
PoiCategoryManager categoryManager = mPersistenceManager.getCategoryManager();
|
||||||
PoiCategoryFilter categoryFilter = new ExactMatchPoiCategoryFilter();
|
PoiCategoryFilter categoryFilter = new ExactMatchPoiCategoryFilter();
|
||||||
categoryFilter.addCategory(categoryManager.getPoiCategoryByTitle(category));
|
if (category != null)
|
||||||
|
categoryFilter.addCategory(categoryManager.getPoiCategoryByTitle(category));
|
||||||
org.mapsforge.core.model.BoundingBox bb = new org.mapsforge.core.model.BoundingBox(
|
org.mapsforge.core.model.BoundingBox bb = new org.mapsforge.core.model.BoundingBox(
|
||||||
params[0].getMinLatitude(), params[0].getMinLongitude(),
|
params[0].getMinLatitude(), params[0].getMinLongitude(),
|
||||||
params[0].getMaxLatitude(), params[0].getMaxLongitude());
|
params[0].getMaxLatitude(), params[0].getMaxLongitude());
|
||||||
return mPersistenceManager.findInRect(bb, categoryFilter, null, Integer.MAX_VALUE);
|
return mPersistenceManager.findInRect(bb, categoryFilter, patterns, null, Integer.MAX_VALUE);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
log.error(t.getMessage(), t);
|
log.error(t.getMessage(), t);
|
||||||
}
|
}
|
||||||
@@ -180,13 +310,14 @@ public class PoiSearchActivity extends MapsforgeActivity implements ItemizedLaye
|
|||||||
if (activity == null) {
|
if (activity == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Toast.makeText(activity, category + ": " + (pointOfInterests != null ? pointOfInterests.size() : 0), Toast.LENGTH_SHORT).show();
|
Toast.makeText(activity, (category != null ? category : "Results") + ": "
|
||||||
|
+ (pointOfInterests != null ? pointOfInterests.size() : 0), Toast.LENGTH_SHORT).show();
|
||||||
if (pointOfInterests == null) {
|
if (pointOfInterests == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overlay POI
|
// Overlay POI
|
||||||
List<MarkerItem> pts = new ArrayList<>();
|
List<MarkerInterface> pts = new ArrayList<>();
|
||||||
for (PointOfInterest pointOfInterest : pointOfInterests)
|
for (PointOfInterest pointOfInterest : pointOfInterests)
|
||||||
pts.add(new MarkerItem(pointOfInterest.getName(), "", new GeoPoint(pointOfInterest.getLatitude(), pointOfInterest.getLongitude())));
|
pts.add(new MarkerItem(pointOfInterest.getName(), "", new GeoPoint(pointOfInterest.getLatitude(), pointOfInterest.getLongitude())));
|
||||||
mMarkerLayer.addItems(pts);
|
mMarkerLayer.addItems(pts);
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import org.oscim.event.MotionEvent;
|
|||||||
import org.oscim.layers.Layer;
|
import org.oscim.layers.Layer;
|
||||||
import org.oscim.layers.TileGridLayer;
|
import org.oscim.layers.TileGridLayer;
|
||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
|
import org.oscim.tiling.OverzoomTileDataSource;
|
||||||
import org.oscim.tiling.source.mapfile.MapDatabase;
|
import org.oscim.tiling.source.mapfile.MapDatabase;
|
||||||
import org.oscim.tiling.source.mapfile.MapReadResult;
|
import org.oscim.tiling.source.mapfile.MapReadResult;
|
||||||
import org.oscim.tiling.source.mapfile.PointOfInterest;
|
import org.oscim.tiling.source.mapfile.PointOfInterest;
|
||||||
@@ -96,7 +97,7 @@ public class ReverseGeocodeActivity extends MapsforgeActivity {
|
|||||||
int tileYMax = MercatorProjection.pixelYToTileY(pixelY + touchRadius, (byte) mMap.getMapPosition().getZoomLevel());
|
int tileYMax = MercatorProjection.pixelYToTileY(pixelY + touchRadius, (byte) mMap.getMapPosition().getZoomLevel());
|
||||||
Tile upperLeft = new Tile(tileXMin, tileYMin, (byte) mMap.getMapPosition().getZoomLevel());
|
Tile upperLeft = new Tile(tileXMin, tileYMin, (byte) mMap.getMapPosition().getZoomLevel());
|
||||||
Tile lowerRight = new Tile(tileXMax, tileYMax, (byte) mMap.getMapPosition().getZoomLevel());
|
Tile lowerRight = new Tile(tileXMax, tileYMax, (byte) mMap.getMapPosition().getZoomLevel());
|
||||||
MapReadResult mapReadResult = ((MapDatabase) mTileSource.getDataSource()).readLabels(upperLeft, lowerRight);
|
MapReadResult mapReadResult = ((MapDatabase) ((OverzoomTileDataSource) mTileLayer.getTileSource().getDataSource()).getDataSource()).readLabels(upperLeft, lowerRight);
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2014 Hannes Janetzek
|
|
||||||
* Copyright 2016-2017 devemux86
|
|
||||||
* Copyright 2017 Longri
|
|
||||||
*
|
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
|
||||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package org.oscim.android.test;
|
|
||||||
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import org.oscim.layers.marker.MarkerItem;
|
|
||||||
|
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.TimerTask;
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
public class RotateMarkerOverlayActivity extends MarkerOverlayActivity {
|
|
||||||
|
|
||||||
private Timer timer;
|
|
||||||
private int markerCount = 0;
|
|
||||||
|
|
||||||
private void itemEvent(final MarkerItem item) {
|
|
||||||
if (item.getMarker() == null) {
|
|
||||||
item.setMarker(mFocusMarker);
|
|
||||||
markerCount++;
|
|
||||||
final AtomicInteger rotValue = new AtomicInteger(0);
|
|
||||||
if (timer != null)
|
|
||||||
timer.cancel();
|
|
||||||
timer = new Timer();
|
|
||||||
TimerTask timerTask = new TimerTask() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
float value = (float) (rotValue.incrementAndGet() * 10);
|
|
||||||
item.setRotation(value);
|
|
||||||
if (rotValue.get() > 36)
|
|
||||||
rotValue.set(0);
|
|
||||||
mMarkerLayer.update();
|
|
||||||
mMap.updateMap(true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
timer.schedule(timerTask, 1000, 1000);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
item.setMarker(null);
|
|
||||||
markerCount--;
|
|
||||||
if (timer != null && markerCount == 0)
|
|
||||||
timer.cancel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onItemSingleTapUp(int index, MarkerItem item) {
|
|
||||||
itemEvent(item);
|
|
||||||
|
|
||||||
Toast.makeText(this, "Marker tap\n" + item.getTitle(), Toast.LENGTH_SHORT).show();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onItemLongPress(int index, MarkerItem item) {
|
|
||||||
itemEvent(item);
|
|
||||||
|
|
||||||
Toast.makeText(this, "Marker long press\n" + item.getTitle(), Toast.LENGTH_SHORT).show();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,15 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
|
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
|
||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2020 devemux86
|
||||||
|
* Copyright 2016 mar-v-in
|
||||||
|
* Copyright 2016 Mathieu de Brito
|
||||||
* Copyright 2017-2018 Longri
|
* Copyright 2017-2018 Longri
|
||||||
* Copyright 2017 nebular
|
* Copyright 2017 nebular
|
||||||
|
* Copyright 2018 boldtrn
|
||||||
|
* Copyright 2018-2019 Gustl22
|
||||||
|
* Copyright 2019 Andrea Antonello
|
||||||
|
* Copyright 2019 Kostas Tzounopoulos
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -22,7 +28,6 @@ package org.oscim.android.test;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
@@ -81,58 +86,46 @@ public class Samples extends Activity {
|
|||||||
LinearLayout linearLayout = findViewById(R.id.samples);
|
LinearLayout linearLayout = findViewById(R.id.samples);
|
||||||
linearLayout.addView(createButton(GettingStarted.class));
|
linearLayout.addView(createButton(GettingStarted.class));
|
||||||
linearLayout.addView(createLabel(null));
|
linearLayout.addView(createLabel(null));
|
||||||
linearLayout.addView(createButton(SimpleMapActivity.class));
|
|
||||||
linearLayout.addView(createButton(MapsforgeActivity.class));
|
linearLayout.addView(createButton(MapsforgeActivity.class));
|
||||||
|
linearLayout.addView(createButton(SimpleMapActivity.class));
|
||||||
|
linearLayout.addView(createButton(MBTilesMvtActivity.class));
|
||||||
|
linearLayout.addView(createButton(MapilionMvtActivity.class));
|
||||||
/*linearLayout.addView(createButton(MapzenMvtActivity.class));
|
/*linearLayout.addView(createButton(MapzenMvtActivity.class));
|
||||||
linearLayout.addView(createButton(MapzenGeojsonActivity.class));*/
|
linearLayout.addView(createButton(MapzenGeojsonActivity.class));
|
||||||
linearLayout.addView(createButton(NextzenMvtActivity.class));
|
linearLayout.addView(createButton(NextzenMvtActivity.class));
|
||||||
linearLayout.addView(createButton(NextzenGeojsonActivity.class));
|
linearLayout.addView(createButton(NextzenGeojsonActivity.class));
|
||||||
linearLayout.addView(createButton(OpenMapTilesMvtActivity.class));
|
linearLayout.addView(createButton(OpenMapTilesMvtActivity.class));*/
|
||||||
linearLayout.addView(createButton(GdxActivity.class));
|
linearLayout.addView(createButton(GdxActivity.class));
|
||||||
|
|
||||||
linearLayout.addView(createLabel("Features"));
|
linearLayout.addView(createLabel("Features"));
|
||||||
linearLayout.addView(createButton(null, "GraphHopper Routing", new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/graphhopper/graphhopper/tree/master/android")));
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
linearLayout.addView(createButton(LocationActivity.class));
|
linearLayout.addView(createButton(LocationActivity.class));
|
||||||
linearLayout.addView(createButton(LocationTextureActivity.class));
|
linearLayout.addView(createButton(LocationTextureActivity.class));
|
||||||
linearLayout.addView(createButton(PoiSearchActivity.class));
|
linearLayout.addView(createButton(PoiSearchActivity.class));
|
||||||
|
|
||||||
linearLayout.addView(createLabel("Vector Features"));
|
linearLayout.addView(createLabel("Vector Features"));
|
||||||
linearLayout.addView(createButton(MapsforgeStyleActivity.class));
|
linearLayout.addView(createButton(MapsforgeStyleActivity.class));
|
||||||
linearLayout.addView(createButton(MapsforgePolyLabelActivity.class));
|
|
||||||
linearLayout.addView(createButton(MapsforgeS3DBActivity.class));
|
linearLayout.addView(createButton(MapsforgeS3DBActivity.class));
|
||||||
linearLayout.addView(createButton(AtlasThemeActivity.class));
|
linearLayout.addView(createButton(ShadowActivity.class));
|
||||||
linearLayout.addView(createButton(POTTextureActivity.class));
|
|
||||||
|
|
||||||
linearLayout.addView(createLabel("Raster Maps"));
|
linearLayout.addView(createLabel("Raster Maps"));
|
||||||
linearLayout.addView(createButton(BitmapTileActivity.class));
|
linearLayout.addView(createButton(BitmapTileActivity.class));
|
||||||
|
linearLayout.addView(createButton(MBTilesBitmapActivity.class));
|
||||||
|
|
||||||
linearLayout.addView(createLabel("Overlays"));
|
linearLayout.addView(createLabel("Overlays"));
|
||||||
linearLayout.addView(createButton(MarkerOverlayActivity.class));
|
linearLayout.addView(createButton(MarkerOverlayActivity.class));
|
||||||
linearLayout.addView(createButton(RotateMarkerOverlayActivity.class));
|
|
||||||
linearLayout.addView(createButton(AtlasMarkerOverlayActivity.class));
|
|
||||||
linearLayout.addView(createButton(AtlasMultiTextureActivity.class));
|
|
||||||
linearLayout.addView(createButton(ClusterMarkerOverlayActivity.class));
|
|
||||||
linearLayout.addView(createButton(PathOverlayActivity.class));
|
linearLayout.addView(createButton(PathOverlayActivity.class));
|
||||||
linearLayout.addView(createButton(LineTexActivity.class));
|
linearLayout.addView(createButton(LineTexActivity.class));
|
||||||
linearLayout.addView(createButton(VectorLayerActivity.class));
|
linearLayout.addView(createButton(VectorLayerActivity.class));
|
||||||
|
linearLayout.addView(createButton(AtlasMultiTextureActivity.class));
|
||||||
linearLayout.addView(createLabel("User Interaction"));
|
|
||||||
linearLayout.addView(createButton(Animator2Activity.class));
|
|
||||||
linearLayout.addView(createButton(MapEventLayer2Activity.class));
|
|
||||||
linearLayout.addView(createButton(LayerGroupActivity.class));
|
|
||||||
|
|
||||||
linearLayout.addView(createLabel("Dual Map Views"));
|
|
||||||
linearLayout.addView(createButton(MultiMapViewActivity.class));
|
|
||||||
|
|
||||||
linearLayout.addView(createLabel("Experiments"));
|
linearLayout.addView(createLabel("Experiments"));
|
||||||
linearLayout.addView(createButton(ReverseGeocodeActivity.class));
|
linearLayout.addView(createButton(ReverseGeocodeActivity.class));
|
||||||
linearLayout.addView(createButton(OSciMapS3DBActivity.class));
|
|
||||||
linearLayout.addView(createButton(ThemeStylerActivity.class));
|
linearLayout.addView(createButton(ThemeStylerActivity.class));
|
||||||
linearLayout.addView(createButton(JeoIndoorActivity.class));
|
//linearLayout.addView(createButton(JeoIndoorActivity.class));
|
||||||
|
linearLayout.addView(createButton(GdxPoi3DActivity.class));
|
||||||
|
linearLayout.addView(createButton(OverpassActivity.class));
|
||||||
|
linearLayout.addView(createButton(DraggableMarkerOverlayActivity.class));
|
||||||
|
linearLayout.addView(createButton(ClusterMarkerOverlayActivity.class));
|
||||||
|
linearLayout.addView(createButton(FragmentActivity.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 Gustl22
|
||||||
|
* Copyright 2019 devemux86
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.oscim.android.test;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.SeekBar;
|
||||||
|
import android.widget.ToggleButton;
|
||||||
|
|
||||||
|
import org.oscim.renderer.ExtrusionRenderer;
|
||||||
|
import org.oscim.renderer.light.Sun;
|
||||||
|
|
||||||
|
public class ShadowActivity extends SimpleMapActivity implements SeekBar.OnSeekBarChangeListener {
|
||||||
|
|
||||||
|
private SeekBar mSeekBar;
|
||||||
|
|
||||||
|
public ShadowActivity() {
|
||||||
|
super(true, R.layout.activity_shadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
mSeekBar = findViewById(R.id.seekBarShadow);
|
||||||
|
mSeekBar.setOnSeekBarChangeListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||||
|
int id = seekBar.getId();
|
||||||
|
if (id == R.id.seekBarShadow) {
|
||||||
|
Sun sun = mBuildingLayer.getExtrusionRenderer().getSun();
|
||||||
|
sun.setProgress(progress / 1000f);
|
||||||
|
sun.updatePosition();
|
||||||
|
sun.updateColor();
|
||||||
|
|
||||||
|
mMap.updateMap(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onToggleCurrentSun(View view) {
|
||||||
|
boolean isCurrentSun = ((ToggleButton) view).isChecked();
|
||||||
|
mSeekBar.setEnabled(!isCurrentSun);
|
||||||
|
ExtrusionRenderer extrusionRenderer = mBuildingLayer.getExtrusionRenderer();
|
||||||
|
extrusionRenderer.enableCurrentSunPos(isCurrentSun);
|
||||||
|
extrusionRenderer.getSun().update();
|
||||||
|
mSeekBar.setProgress((int) (extrusionRenderer.getSun().getProgress() * 1000));
|
||||||
|
mMap.updateMap(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
* Copyright 2016-2018 devemux86
|
* Copyright 2016-2019 devemux86
|
||||||
|
* Copyright 2019 Gustl22
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -37,7 +38,23 @@ import org.oscim.theme.ThemeLoader;
|
|||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
|
|
||||||
public class SimpleMapActivity extends BaseMapActivity {
|
public class SimpleMapActivity extends BaseMapActivity {
|
||||||
private DefaultMapScaleBar mapScaleBar;
|
|
||||||
|
BuildingLayer mBuildingLayer;
|
||||||
|
private boolean mShadow;
|
||||||
|
|
||||||
|
public SimpleMapActivity() {
|
||||||
|
this(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SimpleMapActivity(boolean shadow) {
|
||||||
|
super();
|
||||||
|
mShadow = shadow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SimpleMapActivity(boolean shadow, int contentView) {
|
||||||
|
super(contentView);
|
||||||
|
mShadow = shadow;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -48,11 +65,12 @@ public class SimpleMapActivity extends BaseMapActivity {
|
|||||||
|
|
||||||
void createLayers() {
|
void createLayers() {
|
||||||
GroupLayer groupLayer = new GroupLayer(mMap);
|
GroupLayer groupLayer = new GroupLayer(mMap);
|
||||||
groupLayer.layers.add(new BuildingLayer(mMap, mBaseLayer));
|
mBuildingLayer = new BuildingLayer(mMap, mBaseLayer, false, mShadow);
|
||||||
|
groupLayer.layers.add(mBuildingLayer);
|
||||||
groupLayer.layers.add(new LabelLayer(mMap, mBaseLayer));
|
groupLayer.layers.add(new LabelLayer(mMap, mBaseLayer));
|
||||||
mMap.layers().add(groupLayer);
|
mMap.layers().add(groupLayer);
|
||||||
|
|
||||||
mapScaleBar = new DefaultMapScaleBar(mMap);
|
DefaultMapScaleBar mapScaleBar = new DefaultMapScaleBar(mMap);
|
||||||
mapScaleBar.setScaleBarMode(DefaultMapScaleBar.ScaleBarMode.BOTH);
|
mapScaleBar.setScaleBarMode(DefaultMapScaleBar.ScaleBarMode.BOTH);
|
||||||
mapScaleBar.setDistanceUnitAdapter(MetricUnitAdapter.INSTANCE);
|
mapScaleBar.setDistanceUnitAdapter(MetricUnitAdapter.INSTANCE);
|
||||||
mapScaleBar.setSecondaryDistanceUnitAdapter(ImperialUnitAdapter.INSTANCE);
|
mapScaleBar.setSecondaryDistanceUnitAdapter(ImperialUnitAdapter.INSTANCE);
|
||||||
@@ -67,14 +85,6 @@ public class SimpleMapActivity extends BaseMapActivity {
|
|||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
if (mapScaleBar != null)
|
|
||||||
mapScaleBar.destroy();
|
|
||||||
|
|
||||||
super.onDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
void runTheMonkey() {
|
void runTheMonkey() {
|
||||||
themes[0] = ThemeLoader.load(VtmThemes.DEFAULT);
|
themes[0] = ThemeLoader.load(VtmThemes.DEFAULT);
|
||||||
themes[1] = ThemeLoader.load(VtmThemes.OSMARENDER);
|
themes[1] = ThemeLoader.load(VtmThemes.OSMARENDER);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import android.widget.SeekBar;
|
|||||||
import android.widget.SeekBar.OnSeekBarChangeListener;
|
import android.widget.SeekBar.OnSeekBarChangeListener;
|
||||||
import android.widget.ToggleButton;
|
import android.widget.ToggleButton;
|
||||||
|
|
||||||
|
import org.oscim.backend.canvas.Color;
|
||||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
@@ -24,9 +25,6 @@ import org.oscim.theme.styles.RenderStyle;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import static org.oscim.utils.ColorUtil.modHsv;
|
|
||||||
import static org.oscim.utils.ColorUtil.shiftHue;
|
|
||||||
|
|
||||||
public class ThemeStylerActivity extends BaseMapActivity implements OnSeekBarChangeListener {
|
public class ThemeStylerActivity extends BaseMapActivity implements OnSeekBarChangeListener {
|
||||||
final Logger log = LoggerFactory.getLogger(ThemeStylerActivity.class);
|
final Logger log = LoggerFactory.getLogger(ThemeStylerActivity.class);
|
||||||
|
|
||||||
@@ -90,13 +88,10 @@ public class ThemeStylerActivity extends BaseMapActivity implements OnSeekBarCha
|
|||||||
}
|
}
|
||||||
|
|
||||||
int modColor(int color, HSV hsv) {
|
int modColor(int color, HSV hsv) {
|
||||||
return modHsv(shiftHue(color, hsv.hue), 1, hsv.sat, hsv.val, true);
|
return hsv.mod(color, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class HSV {
|
public static class HSV extends Color.HSV {
|
||||||
public double hue = 0;
|
|
||||||
public double sat = 1;
|
|
||||||
public double val = 1;
|
|
||||||
public boolean changed;
|
public boolean changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,16 +119,16 @@ public class ThemeStylerActivity extends BaseMapActivity implements OnSeekBarCha
|
|||||||
c = outlineColor;
|
c = outlineColor;
|
||||||
|
|
||||||
if (id == R.id.seekBarS)
|
if (id == R.id.seekBarS)
|
||||||
c.sat = progress / 50f;
|
c.saturation = progress / 50f;
|
||||||
else if (id == R.id.seekBarV)
|
else if (id == R.id.seekBarV)
|
||||||
c.val = progress / 50f;
|
c.value = progress / 50f;
|
||||||
else if (id == R.id.seekBarH)
|
else if (id == R.id.seekBarH)
|
||||||
c.hue = progress / 100f;
|
c.hue = progress / 100f;
|
||||||
|
|
||||||
log.debug((modArea ? "area" : "line")
|
log.debug((modArea ? "area" : "line")
|
||||||
+ " h:" + c.hue
|
+ " h:" + c.hue
|
||||||
+ " s:" + c.sat
|
+ " s:" + c.saturation
|
||||||
+ " v:" + c.val);
|
+ " v:" + c.value);
|
||||||
|
|
||||||
VectorTileLayer l = (VectorTileLayer) mMap.layers().get(1);
|
VectorTileLayer l = (VectorTileLayer) mMap.layers().get(1);
|
||||||
RenderTheme t = (RenderTheme) l.getTheme();
|
RenderTheme t = (RenderTheme) l.getTheme();
|
||||||
@@ -168,21 +163,18 @@ public class ThemeStylerActivity extends BaseMapActivity implements OnSeekBarCha
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
HSV c = null;
|
HSV c = null;
|
||||||
switch (view.getId()) {
|
int id = view.getId();
|
||||||
case R.id.checkBoxArea:
|
if (id == R.id.checkBoxArea) {
|
||||||
c = areaColor;
|
c = areaColor;
|
||||||
break;
|
} else if (id == R.id.checkBoxLine) {
|
||||||
case R.id.checkBoxLine:
|
c = lineColor;
|
||||||
c = lineColor;
|
} else if (id == R.id.checkBoxOutline) {
|
||||||
break;
|
c = outlineColor;
|
||||||
case R.id.checkBoxOutline:
|
|
||||||
c = outlineColor;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if (c == null)
|
if (c == null)
|
||||||
return;
|
return;
|
||||||
((SeekBar) findViewById(R.id.seekBarS)).setProgress((int) (c.sat * 50));
|
((SeekBar) findViewById(R.id.seekBarS)).setProgress((int) (c.saturation * 50));
|
||||||
((SeekBar) findViewById(R.id.seekBarV)).setProgress((int) (c.val * 50));
|
((SeekBar) findViewById(R.id.seekBarV)).setProgress((int) (c.value * 50));
|
||||||
((SeekBar) findViewById(R.id.seekBarH)).setProgress((int) (c.hue * 100));
|
((SeekBar) findViewById(R.id.seekBarH)).setProgress((int) (c.hue * 100));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<manifest package="org.oscim.gdx" />
|
|
||||||
@@ -1,57 +1,31 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'java-library'
|
||||||
apply plugin: 'com.github.dcendents.android-maven'
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
compileOnly files("${System.env.ANDROID_HOME}/platforms/android-${androidCompileSdk()}/android.jar")
|
||||||
api project(':vtm')
|
api project(':vtm')
|
||||||
|
api "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
sourceSets {
|
||||||
compileSdkVersion androidCompileSdk()
|
main.java.srcDirs = ['src']
|
||||||
buildToolsVersion "$androidBuildVersionTools"
|
}
|
||||||
|
|
||||||
compileOptions {
|
file('natives').eachDir() { dir ->
|
||||||
sourceCompatibility JavaVersion.VERSION_1_7
|
task("nativesJar-${dir.name}", type: Jar) {
|
||||||
targetCompatibility JavaVersion.VERSION_1_7
|
archiveClassifier = "natives-${dir.name}"
|
||||||
|
from(dir.path)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defaultConfig {
|
publishing {
|
||||||
versionCode versionCode()
|
publications {
|
||||||
versionName versionName()
|
maven(MavenPublication) {
|
||||||
minSdkVersion androidMinSdk()
|
from components.java
|
||||||
targetSdkVersion androidTargetSdk()
|
file('natives').eachDir() { dir ->
|
||||||
}
|
artifact tasks["nativesJar-${dir.name}"]
|
||||||
|
}
|
||||||
sourceSets {
|
|
||||||
main {
|
|
||||||
manifest.srcFile 'AndroidManifest.xml'
|
|
||||||
java.srcDirs = ['src']
|
|
||||||
resources.srcDirs = ['src']
|
|
||||||
}
|
}
|
||||||
debug.setRoot('build-types/debug')
|
|
||||||
release.setRoot('build-types/release')
|
|
||||||
}
|
|
||||||
|
|
||||||
lintOptions { abortOnError false }
|
|
||||||
}
|
|
||||||
|
|
||||||
android.libraryVariants.all { variant ->
|
|
||||||
def name = variant.buildType.name
|
|
||||||
if (name == "debug")
|
|
||||||
return
|
|
||||||
|
|
||||||
def jar = project.tasks.create "jar${name.capitalize()}", Jar
|
|
||||||
jar.dependsOn variant.javaCompiler
|
|
||||||
jar.exclude '**/BuildConfig.class'
|
|
||||||
jar.exclude '**/R.class'
|
|
||||||
jar.exclude '**/R$*.class'
|
|
||||||
jar.from variant.javaCompiler.destinationDir
|
|
||||||
artifacts.add('archives', jar)
|
|
||||||
|
|
||||||
file('natives').eachDir() { dir ->
|
|
||||||
def nativesJar = project.tasks.create "nativesJar${name.capitalize()}-${dir.name}", Jar
|
|
||||||
nativesJar.classifier = "natives-${dir.name}"
|
|
||||||
nativesJar.from(dir.path)
|
|
||||||
artifacts.add('archives', nativesJar)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,3 +34,7 @@ if (project.hasProperty("SONATYPE_USERNAME")) {
|
|||||||
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (System.getenv('ANDROID_HOME') == null) {
|
||||||
|
throw new GradleException("Environment variable ANDROID_HOME needs to be set to SDK folder")
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013 Hannes Janetzek
|
* Copyright 2013 Hannes Janetzek
|
||||||
|
* Copyright 2019 Gustl22
|
||||||
*
|
*
|
||||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
*
|
*
|
||||||
@@ -19,6 +20,8 @@ package org.oscim.gdx;
|
|||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.opengl.GLES20;
|
import android.opengl.GLES20;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.backends.android.AndroidGL20;
|
||||||
|
|
||||||
import org.oscim.backend.GL;
|
import org.oscim.backend.GL;
|
||||||
|
|
||||||
import java.nio.Buffer;
|
import java.nio.Buffer;
|
||||||
@@ -28,6 +31,8 @@ import java.nio.IntBuffer;
|
|||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
public class AndroidGL implements GL {
|
public class AndroidGL implements GL {
|
||||||
|
|
||||||
|
private static final AndroidGL20 androidGL = new AndroidGL20();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attachShader(int program, int shader) {
|
public void attachShader(int program, int shader) {
|
||||||
GLES20.glAttachShader(program, shader);
|
GLES20.glAttachShader(program, shader);
|
||||||
@@ -103,11 +108,21 @@ public class AndroidGL implements GL {
|
|||||||
return GLES20.glCreateShader(type);
|
return GLES20.glCreateShader(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteBuffer(int buffer) {
|
||||||
|
androidGL.glDeleteBuffer(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteBuffers(int n, IntBuffer buffers) {
|
public void deleteBuffers(int n, IntBuffer buffers) {
|
||||||
GLES20.glDeleteBuffers(n, buffers);
|
GLES20.glDeleteBuffers(n, buffers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteFramebuffer(int framebuffer) {
|
||||||
|
androidGL.glDeleteFramebuffer(framebuffer);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteFramebuffers(int n, IntBuffer framebuffers) {
|
public void deleteFramebuffers(int n, IntBuffer framebuffers) {
|
||||||
GLES20.glDeleteFramebuffers(n, framebuffers);
|
GLES20.glDeleteFramebuffers(n, framebuffers);
|
||||||
@@ -118,6 +133,11 @@ public class AndroidGL implements GL {
|
|||||||
GLES20.glDeleteProgram(program);
|
GLES20.glDeleteProgram(program);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteRenderbuffer(int renderbuffer) {
|
||||||
|
androidGL.glDeleteRenderbuffer(renderbuffer);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteRenderbuffers(int n, IntBuffer renderbuffers) {
|
public void deleteRenderbuffers(int n, IntBuffer renderbuffers) {
|
||||||
GLES20.glDeleteRenderbuffers(n, renderbuffers);
|
GLES20.glDeleteRenderbuffers(n, renderbuffers);
|
||||||
@@ -160,6 +180,11 @@ public class AndroidGL implements GL {
|
|||||||
GLES20.glFramebufferTexture2D(target, attachment, textarget, texture, level);
|
GLES20.glFramebufferTexture2D(target, attachment, textarget, texture, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int genBuffer() {
|
||||||
|
return androidGL.glGenBuffer();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void genBuffers(int n, IntBuffer buffers) {
|
public void genBuffers(int n, IntBuffer buffers) {
|
||||||
GLES20.glGenBuffers(n, buffers);
|
GLES20.glGenBuffers(n, buffers);
|
||||||
@@ -170,11 +195,21 @@ public class AndroidGL implements GL {
|
|||||||
GLES20.glGenerateMipmap(target);
|
GLES20.glGenerateMipmap(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int genFramebuffer() {
|
||||||
|
return androidGL.glGenFramebuffer();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void genFramebuffers(int n, IntBuffer framebuffers) {
|
public void genFramebuffers(int n, IntBuffer framebuffers) {
|
||||||
GLES20.glGenFramebuffers(n, framebuffers);
|
GLES20.glGenFramebuffers(n, framebuffers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int genRenderbuffer() {
|
||||||
|
return androidGL.glGenRenderbuffer();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void genRenderbuffers(int n, IntBuffer renderbuffers) {
|
public void genRenderbuffers(int n, IntBuffer renderbuffers) {
|
||||||
GLES20.glGenRenderbuffers(n, renderbuffers);
|
GLES20.glGenRenderbuffers(n, renderbuffers);
|
||||||
@@ -187,14 +222,12 @@ public class AndroidGL implements GL {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getActiveUniform(int program, int index, IntBuffer size, Buffer type) {
|
public String getActiveUniform(int program, int index, IntBuffer size, Buffer type) {
|
||||||
//return GLES20.glGetActiveUniform(program, index, bufsize, length, size, type, name);
|
return androidGL.glGetActiveUniform(program, index, size, (IntBuffer) type);
|
||||||
throw new UnsupportedOperationException("missing implementation");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getAttachedShaders(int program, int maxcount, Buffer count, IntBuffer shaders) {
|
public void getAttachedShaders(int program, int maxcount, Buffer count, IntBuffer shaders) {
|
||||||
throw new UnsupportedOperationException("missing implementation");
|
androidGL.glGetAttachedShaders(program, maxcount, count, shaders);
|
||||||
//GLES20.glGetAttachedShaders(program, maxcount, count, shaders);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -204,8 +237,7 @@ public class AndroidGL implements GL {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getBooleanv(int pname, Buffer params) {
|
public void getBooleanv(int pname, Buffer params) {
|
||||||
throw new UnsupportedOperationException("missing implementation");
|
androidGL.glGetBooleanv(pname, params);
|
||||||
//GLES20.glGetBooleanv(pname, params);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -260,11 +292,6 @@ public class AndroidGL implements GL {
|
|||||||
GLES20.glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
|
GLES20.glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getShaderSource(int shader, int bufsize, Buffer length, String source) {
|
|
||||||
throw new UnsupportedOperationException("missing implementation");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getTexParameterfv(int target, int pname, FloatBuffer params) {
|
public void getTexParameterfv(int target, int pname, FloatBuffer params) {
|
||||||
GLES20.glGetTexParameterfv(target, pname, params);
|
GLES20.glGetTexParameterfv(target, pname, params);
|
||||||
@@ -308,8 +335,7 @@ public class AndroidGL implements GL {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getVertexAttribPointerv(int index, int pname, Buffer pointer) {
|
public void getVertexAttribPointerv(int index, int pname, Buffer pointer) {
|
||||||
//GLES20.glGetVertexAttribPointerv(index, pname, pointer);
|
androidGL.glGetVertexAttribPointerv(index, pname, pointer);
|
||||||
throw new UnsupportedOperationException("missing implementation");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -431,6 +457,11 @@ public class AndroidGL implements GL {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniform1fv(int location, int count, float[] v, int offset) {
|
||||||
|
GLES20.glUniform1fv(location, count, v, offset);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uniform1i(int location, int x) {
|
public void uniform1i(int location, int x) {
|
||||||
GLES20.glUniform1i(location, x);
|
GLES20.glUniform1i(location, x);
|
||||||
@@ -443,6 +474,11 @@ public class AndroidGL implements GL {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniform1iv(int location, int count, int[] v, int offset) {
|
||||||
|
GLES20.glUniform1iv(location, count, v, offset);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uniform2f(int location, float x, float y) {
|
public void uniform2f(int location, float x, float y) {
|
||||||
GLES20.glUniform2f(location, x, y);
|
GLES20.glUniform2f(location, x, y);
|
||||||
@@ -455,6 +491,11 @@ public class AndroidGL implements GL {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniform2fv(int location, int count, float[] v, int offset) {
|
||||||
|
GLES20.glUniform2fv(location, count, v, offset);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uniform2i(int location, int x, int y) {
|
public void uniform2i(int location, int x, int y) {
|
||||||
GLES20.glUniform2i(location, x, y);
|
GLES20.glUniform2i(location, x, y);
|
||||||
@@ -467,6 +508,11 @@ public class AndroidGL implements GL {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniform2iv(int location, int count, int[] v, int offset) {
|
||||||
|
GLES20.glUniform2iv(location, count, v, offset);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uniform3f(int location, float x, float y, float z) {
|
public void uniform3f(int location, float x, float y, float z) {
|
||||||
GLES20.glUniform3f(location, x, y, z);
|
GLES20.glUniform3f(location, x, y, z);
|
||||||
@@ -479,6 +525,11 @@ public class AndroidGL implements GL {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniform3fv(int location, int count, float[] v, int offset) {
|
||||||
|
GLES20.glUniform3fv(location, count, v, offset);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uniform3i(int location, int x, int y, int z) {
|
public void uniform3i(int location, int x, int y, int z) {
|
||||||
GLES20.glUniform3i(location, x, y, z);
|
GLES20.glUniform3i(location, x, y, z);
|
||||||
@@ -491,6 +542,11 @@ public class AndroidGL implements GL {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniform3iv(int location, int count, int[] v, int offset) {
|
||||||
|
GLES20.glUniform3iv(location, count, v, offset);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uniform4f(int location, float x, float y, float z, float w) {
|
public void uniform4f(int location, float x, float y, float z, float w) {
|
||||||
GLES20.glUniform4f(location, x, y, z, w);
|
GLES20.glUniform4f(location, x, y, z, w);
|
||||||
@@ -501,6 +557,11 @@ public class AndroidGL implements GL {
|
|||||||
GLES20.glUniform4fv(location, count, v);
|
GLES20.glUniform4fv(location, count, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniform4fv(int location, int count, float[] v, int offset) {
|
||||||
|
GLES20.glUniform4fv(location, count, v, offset);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uniform4i(int location, int x, int y, int z, int w) {
|
public void uniform4i(int location, int x, int y, int z, int w) {
|
||||||
GLES20.glUniform4i(location, x, y, z, w);
|
GLES20.glUniform4i(location, x, y, z, w);
|
||||||
@@ -513,24 +574,44 @@ public class AndroidGL implements GL {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniform4iv(int location, int count, int[] v, int offset) {
|
||||||
|
GLES20.glUniform4iv(location, count, v, offset);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uniformMatrix2fv(int location, int count, boolean transpose, FloatBuffer value) {
|
public void uniformMatrix2fv(int location, int count, boolean transpose, FloatBuffer value) {
|
||||||
GLES20.glUniformMatrix2fv(location, count, transpose, value);
|
GLES20.glUniformMatrix2fv(location, count, transpose, value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniformMatrix2fv(int location, int count, boolean transpose, float[] value, int offset) {
|
||||||
|
GLES20.glUniformMatrix2fv(location, count, transpose, value, offset);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uniformMatrix3fv(int location, int count, boolean transpose, FloatBuffer value) {
|
public void uniformMatrix3fv(int location, int count, boolean transpose, FloatBuffer value) {
|
||||||
GLES20.glUniformMatrix3fv(location, count, transpose, value);
|
GLES20.glUniformMatrix3fv(location, count, transpose, value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniformMatrix3fv(int location, int count, boolean transpose, float[] value, int offset) {
|
||||||
|
GLES20.glUniformMatrix3fv(location, count, transpose, value, offset);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uniformMatrix4fv(int location, int count, boolean transpose, FloatBuffer value) {
|
public void uniformMatrix4fv(int location, int count, boolean transpose, FloatBuffer value) {
|
||||||
GLES20.glUniformMatrix4fv(location, count, transpose, value);
|
GLES20.glUniformMatrix4fv(location, count, transpose, value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniformMatrix4fv(int location, int count, boolean transpose, float[] value, int offset) {
|
||||||
|
GLES20.glUniformMatrix4fv(location, count, transpose, value, offset);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void useProgram(int program) {
|
public void useProgram(int program) {
|
||||||
GLES20.glUseProgram(program);
|
GLES20.glUseProgram(program);
|
||||||
@@ -656,15 +737,13 @@ public class AndroidGL implements GL {
|
|||||||
@Override
|
@Override
|
||||||
public void compressedTexImage2D(int target, int level, int internalformat, int width,
|
public void compressedTexImage2D(int target, int level, int internalformat, int width,
|
||||||
int height, int border, int imageSize, Buffer data) {
|
int height, int border, int imageSize, Buffer data) {
|
||||||
throw new UnsupportedOperationException("missing implementation");
|
androidGL.glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void compressedTexSubImage2D(int target, int level, int xoffset, int yoffset,
|
public void compressedTexSubImage2D(int target, int level, int xoffset, int yoffset,
|
||||||
int width, int height, int format, int imageSize, Buffer data) {
|
int width, int height, int format, int imageSize, Buffer data) {
|
||||||
throw new UnsupportedOperationException("missing implementation");
|
androidGL.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -691,6 +770,11 @@ public class AndroidGL implements GL {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteTexture(int texture) {
|
||||||
|
androidGL.glDeleteTexture(texture);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void depthFunc(int func) {
|
public void depthFunc(int func) {
|
||||||
GLES20.glDepthFunc(func);
|
GLES20.glDepthFunc(func);
|
||||||
@@ -757,6 +841,11 @@ public class AndroidGL implements GL {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int genTexture() {
|
||||||
|
return androidGL.glGenTexture();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getError() {
|
public int getError() {
|
||||||
return GLES20.glGetError();
|
return GLES20.glGetError();
|
||||||
@@ -837,8 +926,7 @@ public class AndroidGL implements GL {
|
|||||||
@Override
|
@Override
|
||||||
public void texSubImage2D(int target, int level, int xoffset, int yoffset, int width,
|
public void texSubImage2D(int target, int level, int xoffset, int yoffset, int width,
|
||||||
int height, int format, int type, Buffer pixels) {
|
int height, int format, int type, Buffer pixels) {
|
||||||
GLES20
|
GLES20.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
|
||||||
.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
878
vtm-android-gdx/src/org/oscim/gdx/AndroidGL30.java
Normal file
@@ -0,0 +1,878 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 Gustl22
|
||||||
|
*
|
||||||
|
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
|
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License along with
|
||||||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright 2014 See AUTHORS file.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
package org.oscim.gdx;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.opengl.GLES30;
|
||||||
|
import org.oscim.backend.GL30;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGL30.java
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
@SuppressLint("NewApi")
|
||||||
|
public class AndroidGL30 extends AndroidGL implements GL30 {
|
||||||
|
@Override
|
||||||
|
public void readBuffer(int mode) {
|
||||||
|
GLES30.glReadBuffer(mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawRangeElements(int mode, int start, int end, int count, int type, java.nio.Buffer indices) {
|
||||||
|
GLES30.glDrawRangeElements(mode, start, end, count, type, indices);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawRangeElements(int mode, int start, int end, int count, int type, int offset) {
|
||||||
|
GLES30.glDrawRangeElements(mode, start, end, count, type, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void texImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int format,
|
||||||
|
int type, java.nio.Buffer pixels) {
|
||||||
|
if (pixels == null)
|
||||||
|
GLES30.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, 0);
|
||||||
|
else
|
||||||
|
GLES30.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void texImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int format,
|
||||||
|
int type, int offset) {
|
||||||
|
GLES30.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void texSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth,
|
||||||
|
int format, int type, java.nio.Buffer pixels) {
|
||||||
|
GLES30.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void texSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth,
|
||||||
|
int format, int type, int offset) {
|
||||||
|
GLES30.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void copyTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width,
|
||||||
|
int height) {
|
||||||
|
GLES30.glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void compressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int
|
||||||
|
// imageSize, java.nio.Buffer data) {
|
||||||
|
// GLES30.glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void compressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int
|
||||||
|
// imageSize, int offset) {
|
||||||
|
// GLES30.glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, offset);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void compressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int
|
||||||
|
// depth, int format, int imageSize, java.nio.Buffer data) {
|
||||||
|
// GLES30.glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void compressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int
|
||||||
|
// depth, int format, int imageSize, int offset) {
|
||||||
|
// GLES30.glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void genQueries(int n, int[] ids, int offset) {
|
||||||
|
GLES30.glGenQueries(n, ids, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void genQueries(int n, java.nio.IntBuffer ids) {
|
||||||
|
GLES30.glGenQueries(n, ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteQueries(int n, int[] ids, int offset) {
|
||||||
|
GLES30.glDeleteQueries(n, ids, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteQueries(int n, java.nio.IntBuffer ids) {
|
||||||
|
GLES30.glDeleteQueries(n, ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isQuery(int id) {
|
||||||
|
return GLES30.glIsQuery(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beginQuery(int target, int id) {
|
||||||
|
GLES30.glBeginQuery(target, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void endQuery(int target) {
|
||||||
|
GLES30.glEndQuery(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void getQueryiv(int target, int pname, int[] params, int offset) {
|
||||||
|
// GLES30.glGetQueryiv(target, pname, params, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getQueryiv(int target, int pname, java.nio.IntBuffer params) {
|
||||||
|
GLES30.glGetQueryiv(target, pname, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void getQueryObjectuiv(int id, int pname, int[] params, int offset) {
|
||||||
|
// GLES30.glGetQueryObjectuiv(id, pname, params, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getQueryObjectuiv(int id, int pname, java.nio.IntBuffer params) {
|
||||||
|
GLES30.glGetQueryObjectuiv(id, pname, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean unmapBuffer(int target) {
|
||||||
|
return GLES30.glUnmapBuffer(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public java.nio.Buffer getBufferPointerv(int target, int pname) {
|
||||||
|
return GLES30.glGetBufferPointerv(target, pname);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void drawBuffers(int n, int[] bufs, int offset) {
|
||||||
|
// GLES30.glDrawBuffers(n, bufs, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawBuffers(int n, java.nio.IntBuffer bufs) {
|
||||||
|
GLES30.glDrawBuffers(n, bufs);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void uniformMatrix2x3fv(int location, int count, boolean transpose, float[] value, int offset) {
|
||||||
|
// GLES30.glUniformMatrix2x3fv(location, count, transpose, value, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniformMatrix2x3fv(int location, int count, boolean transpose, java.nio.FloatBuffer value) {
|
||||||
|
GLES30.glUniformMatrix2x3fv(location, count, transpose, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void uniformMatrix3x2fv(int location, int count, boolean transpose, float[] value, int offset) {
|
||||||
|
// GLES30.glUniformMatrix3x2fv(location, count, transpose, value, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniformMatrix3x2fv(int location, int count, boolean transpose, java.nio.FloatBuffer value) {
|
||||||
|
GLES30.glUniformMatrix3x2fv(location, count, transpose, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void uniformMatrix2x4fv(int location, int count, boolean transpose, float[] value, int offset) {
|
||||||
|
// GLES30.glUniformMatrix2x4fv(location, count, transpose, value, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniformMatrix2x4fv(int location, int count, boolean transpose, java.nio.FloatBuffer value) {
|
||||||
|
GLES30.glUniformMatrix2x4fv(location, count, transpose, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void uniformMatrix4x2fv(int location, int count, boolean transpose, float[] value, int offset) {
|
||||||
|
// GLES30.glUniformMatrix4x2fv(location, count, transpose, value, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniformMatrix4x2fv(int location, int count, boolean transpose, java.nio.FloatBuffer value) {
|
||||||
|
GLES30.glUniformMatrix4x2fv(location, count, transpose, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void uniformMatrix3x4fv(int location, int count, boolean transpose, float[] value, int offset) {
|
||||||
|
// GLES30.glUniformMatrix3x4fv(location, count, transpose, value, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniformMatrix3x4fv(int location, int count, boolean transpose, java.nio.FloatBuffer value) {
|
||||||
|
GLES30.glUniformMatrix3x4fv(location, count, transpose, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void uniformMatrix4x3fv(int location, int count, boolean transpose, float[] value, int offset) {
|
||||||
|
// GLES30.glUniformMatrix4x3fv(location, count, transpose, value, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniformMatrix4x3fv(int location, int count, boolean transpose, java.nio.FloatBuffer value) {
|
||||||
|
GLES30.glUniformMatrix4x3fv(location, count, transpose, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void blitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1,
|
||||||
|
int mask, int filter) {
|
||||||
|
GLES30.glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderbufferStorageMultisample(int target, int samples, int internalformat, int width, int height) {
|
||||||
|
GLES30.glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void framebufferTextureLayer(int target, int attachment, int texture, int level, int layer) {
|
||||||
|
GLES30.glFramebufferTextureLayer(target, attachment, texture, level, layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public java.nio.Buffer mapBufferRange(int target, int offset, int length, int access) {
|
||||||
|
// return GLES30.glMapBufferRange(target, offset, length, access);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void flushMappedBufferRange(int target, int offset, int length) {
|
||||||
|
GLES30.glFlushMappedBufferRange(target, offset, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bindVertexArray(int array) {
|
||||||
|
GLES30.glBindVertexArray(array);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteVertexArrays(int n, int[] arrays, int offset) {
|
||||||
|
GLES30.glDeleteVertexArrays(n, arrays, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteVertexArrays(int n, java.nio.IntBuffer arrays) {
|
||||||
|
GLES30.glDeleteVertexArrays(n, arrays);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void genVertexArrays(int n, int[] arrays, int offset) {
|
||||||
|
GLES30.glGenVertexArrays(n, arrays, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void genVertexArrays(int n, java.nio.IntBuffer arrays) {
|
||||||
|
GLES30.glGenVertexArrays(n, arrays);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isVertexArray(int array) {
|
||||||
|
return GLES30.glIsVertexArray(array);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void getIntegeri_v(int target, int index, int[] data, int offset) {
|
||||||
|
// GLES30.glGetIntegeri_v(target, index, data, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void getIntegeri_v(int target, int index, java.nio.IntBuffer data) {
|
||||||
|
// GLES30.glGetIntegeri_v(target, index, data);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beginTransformFeedback(int primitiveMode) {
|
||||||
|
GLES30.glBeginTransformFeedback(primitiveMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void endTransformFeedback() {
|
||||||
|
GLES30.glEndTransformFeedback();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bindBufferRange(int target, int index, int buffer, int offset, int size) {
|
||||||
|
GLES30.glBindBufferRange(target, index, buffer, offset, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bindBufferBase(int target, int index, int buffer) {
|
||||||
|
GLES30.glBindBufferBase(target, index, buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void transformFeedbackVaryings(int program, String[] varyings, int bufferMode) {
|
||||||
|
GLES30.glTransformFeedbackVaryings(program, varyings, bufferMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void getTransformFeedbackVarying(int program, int index, int bufsize, int[] length, int lengthOffset, int[] size, int
|
||||||
|
// sizeOffset, int[] type, int typeOffset, byte[] name, int nameOffset) {
|
||||||
|
// GLES30.glGetTransformFeedbackVarying(program, index, bufsize, length, lengthOffset, size, sizeOffset, type, typeOffset, name,
|
||||||
|
// nameOffset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void getTransformFeedbackVarying(int program, int index, int bufsize, java.nio.IntBuffer length, java.nio.IntBuffer
|
||||||
|
// size, java.nio.IntBuffer type, byte name) {
|
||||||
|
// GLES30.glGetTransformFeedbackVarying(program, index, bufsize, length, size, type, name);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public String getTransformFeedbackVarying(int program, int index, int[] size, int sizeOffset, int[] type, int typeOffset) {
|
||||||
|
// return GLES30.glGetTransformFeedbackVarying(program, index, size, sizeOffset, type, typeOffset);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public String getTransformFeedbackVarying(int program, int index, java.nio.IntBuffer size, java.nio.IntBuffer type) {
|
||||||
|
// return GLES30.glGetTransformFeedbackVarying(program, index, size, type);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void vertexAttribIPointer(int index, int size, int type, int stride, int offset) {
|
||||||
|
GLES30.glVertexAttribIPointer(index, size, type, stride, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void getVertexAttribIiv(int index, int pname, int[] params, int offset) {
|
||||||
|
// GLES30.glGetVertexAttribIiv(index, pname, params, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getVertexAttribIiv(int index, int pname, java.nio.IntBuffer params) {
|
||||||
|
GLES30.glGetVertexAttribIiv(index, pname, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void getVertexAttribIuiv(int index, int pname, int[] params, int offset) {
|
||||||
|
// GLES30.glGetVertexAttribIuiv(index, pname, params, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getVertexAttribIuiv(int index, int pname, java.nio.IntBuffer params) {
|
||||||
|
GLES30.glGetVertexAttribIuiv(index, pname, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void vertexAttribI4i(int index, int x, int y, int z, int w) {
|
||||||
|
GLES30.glVertexAttribI4i(index, x, y, z, w);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void vertexAttribI4ui(int index, int x, int y, int z, int w) {
|
||||||
|
GLES30.glVertexAttribI4ui(index, x, y, z, w);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void vertexAttribI4iv(int index, int[] v, int offset) {
|
||||||
|
// GLES30.glVertexAttribI4iv(index, v, offset);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void vertexAttribI4iv(int index, java.nio.IntBuffer v) {
|
||||||
|
// GLES30.glVertexAttribI4iv(index, v);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void vertexAttribI4uiv(int index, int[] v, int offset) {
|
||||||
|
// GLES30.glVertexAttribI4uiv(index, v, offset);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void vertexAttribI4uiv(int index, java.nio.IntBuffer v) {
|
||||||
|
// GLES30.glVertexAttribI4uiv(index, v);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void getUniformuiv(int program, int location, int[] params, int offset) {
|
||||||
|
// GLES30.glGetUniformuiv(program, location, params, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getUniformuiv(int program, int location, java.nio.IntBuffer params) {
|
||||||
|
GLES30.glGetUniformuiv(program, location, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getFragDataLocation(int program, String name) {
|
||||||
|
return GLES30.glGetFragDataLocation(program, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void uniform1ui(int location, int v0) {
|
||||||
|
// GLES30.glUniform1ui(location, v0);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void uniform2ui(int location, int v0, int v1) {
|
||||||
|
// GLES30.glUniform2ui(location, v0, v1);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void uniform3ui(int location, int v0, int v1, int v2) {
|
||||||
|
// GLES30.glUniform3ui(location, v0, v1, v2);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void uniform4ui(int location, int v0, int v1, int v2, int v3) {
|
||||||
|
// GLES30.glUniform4ui(location, v0, v1, v2, v3);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void uniform1uiv(int location, int count, int[] value, int offset) {
|
||||||
|
// GLES30.glUniform1uiv(location, count, value, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniform1uiv(int location, int count, java.nio.IntBuffer value) {
|
||||||
|
GLES30.glUniform1uiv(location, count, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void uniform2uiv(int location, int count, int[] value, int offset) {
|
||||||
|
// GLES30.glUniform2uiv(location, count, value, offset);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void uniform2uiv(int location, int count, java.nio.IntBuffer value) {
|
||||||
|
// GLES30.glUniform2uiv(location, count, value);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void uniform3uiv(int location, int count, int[] value, int offset) {
|
||||||
|
// GLES30.glUniform3uiv(location, count, value, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniform3uiv(int location, int count, java.nio.IntBuffer value) {
|
||||||
|
GLES30.glUniform3uiv(location, count, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void uniform4uiv(int location, int count, int[] value, int offset) {
|
||||||
|
// GLES30.glUniform4uiv(location, count, value, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniform4uiv(int location, int count, java.nio.IntBuffer value) {
|
||||||
|
GLES30.glUniform4uiv(location, count, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void clearBufferiv(int buffer, int drawbuffer, int[] value, int offset) {
|
||||||
|
// GLES30.glClearBufferiv(buffer, drawbuffer, value, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clearBufferiv(int buffer, int drawbuffer, java.nio.IntBuffer value) {
|
||||||
|
GLES30.glClearBufferiv(buffer, drawbuffer, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void clearBufferuiv(int buffer, int drawbuffer, int[] value, int offset) {
|
||||||
|
// GLES30.glClearBufferuiv(buffer, drawbuffer, value, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clearBufferuiv(int buffer, int drawbuffer, java.nio.IntBuffer value) {
|
||||||
|
GLES30.glClearBufferuiv(buffer, drawbuffer, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void clearBufferfv(int buffer, int drawbuffer, float[] value, int offset) {
|
||||||
|
// GLES30.glClearBufferfv(buffer, drawbuffer, value, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clearBufferfv(int buffer, int drawbuffer, java.nio.FloatBuffer value) {
|
||||||
|
GLES30.glClearBufferfv(buffer, drawbuffer, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clearBufferfi(int buffer, int drawbuffer, float depth, int stencil) {
|
||||||
|
GLES30.glClearBufferfi(buffer, drawbuffer, depth, stencil);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getStringi(int name, int index) {
|
||||||
|
return GLES30.glGetStringi(name, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void copyBufferSubData(int readTarget, int writeTarget, int readOffset, int writeOffset, int size) {
|
||||||
|
GLES30.glCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void getUniformIndices(int program, String[] uniformNames, int[] uniformIndices, int uniformIndicesOffset) {
|
||||||
|
// GLES30.glGetUniformIndices(program, uniformNames, uniformIndices, uniformIndicesOffset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getUniformIndices(int program, String[] uniformNames, java.nio.IntBuffer uniformIndices) {
|
||||||
|
GLES30.glGetUniformIndices(program, uniformNames, uniformIndices);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void getActiveUniformsiv(int program, int uniformCount, int[] uniformIndices, int uniformIndicesOffset, int pname,
|
||||||
|
// int[] params, int paramsOffset) {
|
||||||
|
// GLES30.glGetActiveUniformsiv(program, uniformCount, uniformIndices, uniformIndicesOffset, pname, params, paramsOffset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getActiveUniformsiv(int program, int uniformCount, java.nio.IntBuffer uniformIndices, int pname,
|
||||||
|
java.nio.IntBuffer params) {
|
||||||
|
GLES30.glGetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getUniformBlockIndex(int program, String uniformBlockName) {
|
||||||
|
return GLES30.glGetUniformBlockIndex(program, uniformBlockName);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void getActiveUniformBlockiv(int program, int uniformBlockIndex, int pname, int[] params, int offset) {
|
||||||
|
// GLES30.glGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getActiveUniformBlockiv(int program, int uniformBlockIndex, int pname, java.nio.IntBuffer params) {
|
||||||
|
GLES30.glGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void getActiveUniformBlockName(int program, int uniformBlockIndex, int bufSize, int[] length, int lengthOffset, byte[]
|
||||||
|
// uniformBlockName, int uniformBlockNameOffset) {
|
||||||
|
// GLES30.glGetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, lengthOffset, uniformBlockName,
|
||||||
|
// uniformBlockNameOffset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getActiveUniformBlockName(int program, int uniformBlockIndex, java.nio.Buffer length,
|
||||||
|
java.nio.Buffer uniformBlockName) {
|
||||||
|
GLES30.glGetActiveUniformBlockName(program, uniformBlockIndex, length, uniformBlockName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getActiveUniformBlockName(int program, int uniformBlockIndex) {
|
||||||
|
return GLES30.glGetActiveUniformBlockName(program, uniformBlockIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uniformBlockBinding(int program, int uniformBlockIndex, int uniformBlockBinding) {
|
||||||
|
GLES30.glUniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawArraysInstanced(int mode, int first, int count, int instanceCount) {
|
||||||
|
GLES30.glDrawArraysInstanced(mode, first, count, instanceCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void drawElementsInstanced(int mode, int count, int type, java.nio.Buffer indices, int instanceCount) {
|
||||||
|
// GLES30.glDrawElementsInstanced(mode, count, type, indices, instanceCount);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawElementsInstanced(int mode, int count, int type, int indicesOffset, int instanceCount) {
|
||||||
|
GLES30.glDrawElementsInstanced(mode, count, type, indicesOffset, instanceCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public long fenceSync(int condition, int flags) {
|
||||||
|
// return GLES30.glFenceSync(condition, flags);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public boolean isSync(long sync) {
|
||||||
|
// return GLES30.glIsSync(sync);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void deleteSync(long sync) {
|
||||||
|
// GLES30.glDeleteSync(sync);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public int clientWaitSync(long sync, int flags, long timeout) {
|
||||||
|
// return GLES30.glClientWaitSync(sync, flags, timeout);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void waitSync(long sync, int flags, long timeout) {
|
||||||
|
// GLES30.glWaitSync(sync, flags, timeout);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void getInteger64v(int pname, long[] params, int offset) {
|
||||||
|
// GLES30.glGetInteger64v(pname, params, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getInteger64v(int pname, java.nio.LongBuffer params) {
|
||||||
|
GLES30.glGetInteger64v(pname, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void getSynciv(long sync, int pname, int bufSize, int[] length, int lengthOffset, int[] values, int valuesOffset) {
|
||||||
|
// GLES30.glGetSynciv(sync, pname, bufSize, length, lengthOffset, values, valuesOffset);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void getSynciv(long sync, int pname, int bufSize, java.nio.IntBuffer length, java.nio.IntBuffer values) {
|
||||||
|
// GLES30.glGetSynciv(sync, pname, bufSize, length, values);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void getInteger64i_v(int target, int index, long[] data, int offset) {
|
||||||
|
// GLES30.glGetInteger64i_v(target, index, data, offset);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void getInteger64i_v(int target, int index, java.nio.LongBuffer data) {
|
||||||
|
// GLES30.glGetInteger64i_v(target, index, data);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void getBufferParameteri64v(int target, int pname, long[] params, int offset) {
|
||||||
|
// GLES30.glGetBufferParameteri64v(target, pname, params, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getBufferParameteri64v(int target, int pname, java.nio.LongBuffer params) {
|
||||||
|
GLES30.glGetBufferParameteri64v(target, pname, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void genSamplers(int count, int[] samplers, int offset) {
|
||||||
|
GLES30.glGenSamplers(count, samplers, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void genSamplers(int count, java.nio.IntBuffer samplers) {
|
||||||
|
GLES30.glGenSamplers(count, samplers);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteSamplers(int count, int[] samplers, int offset) {
|
||||||
|
GLES30.glDeleteSamplers(count, samplers, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteSamplers(int count, java.nio.IntBuffer samplers) {
|
||||||
|
GLES30.glDeleteSamplers(count, samplers);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSampler(int sampler) {
|
||||||
|
return GLES30.glIsSampler(sampler);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bindSampler(int unit, int sampler) {
|
||||||
|
GLES30.glBindSampler(unit, sampler);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void samplerParameteri(int sampler, int pname, int param) {
|
||||||
|
GLES30.glSamplerParameteri(sampler, pname, param);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void samplerParameteriv(int sampler, int pname, int[] param, int offset) {
|
||||||
|
// GLES30.glSamplerParameteriv(sampler, pname, param, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void samplerParameteriv(int sampler, int pname, java.nio.IntBuffer param) {
|
||||||
|
GLES30.glSamplerParameteriv(sampler, pname, param);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void samplerParameterf(int sampler, int pname, float param) {
|
||||||
|
GLES30.glSamplerParameterf(sampler, pname, param);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void samplerParameterfv(int sampler, int pname, float[] param, int offset) {
|
||||||
|
// GLES30.glSamplerParameterfv(sampler, pname, param, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void samplerParameterfv(int sampler, int pname, java.nio.FloatBuffer param) {
|
||||||
|
GLES30.glSamplerParameterfv(sampler, pname, param);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void getSamplerParameteriv(int sampler, int pname, int[] params, int offset) {
|
||||||
|
// GLES30.glGetSamplerParameteriv(sampler, pname, params, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getSamplerParameteriv(int sampler, int pname, java.nio.IntBuffer params) {
|
||||||
|
GLES30.glGetSamplerParameteriv(sampler, pname, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void getSamplerParameterfv(int sampler, int pname, float[] params, int offset) {
|
||||||
|
// GLES30.glGetSamplerParameterfv(sampler, pname, params, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getSamplerParameterfv(int sampler, int pname, java.nio.FloatBuffer params) {
|
||||||
|
GLES30.glGetSamplerParameterfv(sampler, pname, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void vertexAttribDivisor(int index, int divisor) {
|
||||||
|
GLES30.glVertexAttribDivisor(index, divisor);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bindTransformFeedback(int target, int id) {
|
||||||
|
GLES30.glBindTransformFeedback(target, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteTransformFeedbacks(int n, int[] ids, int offset) {
|
||||||
|
GLES30.glDeleteTransformFeedbacks(n, ids, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteTransformFeedbacks(int n, java.nio.IntBuffer ids) {
|
||||||
|
GLES30.glDeleteTransformFeedbacks(n, ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void genTransformFeedbacks(int n, int[] ids, int offset) {
|
||||||
|
GLES30.glGenTransformFeedbacks(n, ids, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void genTransformFeedbacks(int n, java.nio.IntBuffer ids) {
|
||||||
|
GLES30.glGenTransformFeedbacks(n, ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isTransformFeedback(int id) {
|
||||||
|
return GLES30.glIsTransformFeedback(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void pauseTransformFeedback() {
|
||||||
|
GLES30.glPauseTransformFeedback();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void resumeTransformFeedback() {
|
||||||
|
GLES30.glResumeTransformFeedback();
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void getProgramBinary(int program, int bufSize, int[] length, int lengthOffset, int[] binaryFormat, int
|
||||||
|
// binaryFormatOffset, java.nio.Buffer binary) {
|
||||||
|
// GLES30.glGetProgramBinary(program, bufSize, length, lengthOffset, binaryFormat, binaryFormatOffset, binary);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void getProgramBinary(int program, int bufSize, java.nio.IntBuffer length, java.nio.IntBuffer binaryFormat,
|
||||||
|
// java.nio.Buffer binary) {
|
||||||
|
// GLES30.glGetProgramBinary(program, bufSize, length, binaryFormat, binary);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void programBinary(int program, int binaryFormat, java.nio.Buffer binary, int length) {
|
||||||
|
// GLES30.glProgramBinary(program, binaryFormat, binary, length);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void programParameteri(int program, int pname, int value) {
|
||||||
|
GLES30.glProgramParameteri(program, pname, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void invalidateFramebuffer(int target, int numAttachments, int[] attachments, int offset) {
|
||||||
|
// GLES30.glInvalidateFramebuffer(target, numAttachments, attachments, offset);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void invalidateFramebuffer(int target, int numAttachments, java.nio.IntBuffer attachments) {
|
||||||
|
GLES30.glInvalidateFramebuffer(target, numAttachments, attachments);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void invalidateSubFramebuffer(int target, int numAttachments, int[] attachments, int offset, int x, int y, int width,
|
||||||
|
// int height) {
|
||||||
|
// GLES30.glInvalidateSubFramebuffer(target, numAttachments, attachments, offset, x, y, width, height);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void invalidateSubFramebuffer(int target, int numAttachments, java.nio.IntBuffer attachments, int x, int y,
|
||||||
|
int width, int height) {
|
||||||
|
GLES30.glInvalidateSubFramebuffer(target, numAttachments, attachments, x, y, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void texStorage2D(int target, int levels, int internalformat, int width, int height) {
|
||||||
|
// GLES30.glTexStorage2D(target, levels, internalformat, width, height);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void texStorage3D(int target, int levels, int internalformat, int width, int height, int depth) {
|
||||||
|
// GLES30.glTexStorage3D(target, levels, internalformat, width, height, depth);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void getInternalformativ(int target, int internalformat, int pname, int bufSize, int[] params, int offset) {
|
||||||
|
// GLES30.glGetInternalformativ(target, internalformat, pname, bufSize, params, offset);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void getInternalformativ(int target, int internalformat, int pname, int bufSize, java.nio.IntBuffer params) {
|
||||||
|
// GLES30.glGetInternalformativ(target, internalformat, pname, bufSize, params);
|
||||||
|
// }
|
||||||
|
}
|
||||||