Compare commits
140 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9de76897bc | ||
|
|
a67b2f2c91 | ||
|
|
791f054f70 | ||
|
|
7e13586463 | ||
|
|
c3639dcb24 | ||
|
|
49ded685b4 | ||
|
|
9b14865bf3 | ||
|
|
abac84e82a | ||
|
|
0367507dae | ||
|
|
9977061680 | ||
|
|
3cae38040c | ||
|
|
97cdfa119d | ||
|
|
641db3ade0 | ||
|
|
bddf2443b6 | ||
|
|
1404d21838 | ||
|
|
95bbc5ea3e | ||
|
|
f8776ffe5f | ||
|
|
bc1dee49a4 | ||
|
|
d81a6309bf | ||
|
|
9a6da018a9 | ||
|
|
8d639499ba | ||
|
|
a5d7a8f6b0 | ||
|
|
577f1520d2 | ||
|
|
c938533943 | ||
|
|
e3b137e3c4 | ||
|
|
72b72b8029 | ||
|
|
ba68b79e86 | ||
|
|
49ef4c8e1b | ||
|
|
535482025e | ||
|
|
e73ac4acfc | ||
|
|
bc20664bc5 | ||
|
|
06936fc4ee | ||
|
|
0829098ebb | ||
|
|
8ad2036ec1 | ||
|
|
4f7675d2a8 | ||
|
|
8f4e9967f0 | ||
|
|
f884c17195 | ||
|
|
490b932eab | ||
|
|
149353119b | ||
|
|
9c3f3b8a4c | ||
|
|
f9e06c80ad | ||
|
|
fe2c067272 | ||
|
|
9c3488e107 | ||
|
|
df784f6f68 | ||
|
|
a178357ca8 | ||
|
|
6627eab8e2 | ||
|
|
0a7638e10d | ||
|
|
f94c665b27 | ||
|
|
d23bca9c7f | ||
|
|
53dbb737fb | ||
|
|
1aa5f24e11 | ||
|
|
1d44057198 | ||
|
|
bcf4cff42b | ||
|
|
cbdeb58c2f | ||
|
|
df5bcd583f | ||
|
|
e2a4ad8a97 | ||
|
|
795359fb44 | ||
|
|
a9a042ea41 | ||
|
|
cd5a62a2ff | ||
|
|
dfd3a7dcf6 | ||
|
|
5615604170 | ||
|
|
b3f6899b1f | ||
|
|
e3f2f19119 | ||
|
|
126b98ae8c | ||
|
|
9104b746ac | ||
|
|
fc6bce20bb | ||
|
|
76582da497 | ||
|
|
a06ea5492e | ||
|
|
1d7ece5a65 | ||
|
|
67b911a7df | ||
|
|
7947e5c027 | ||
|
|
69f7ed7ae0 | ||
|
|
fa658bd1f0 | ||
|
|
233f0c4f7e | ||
|
|
02b29c7584 | ||
|
|
cedf3edc61 | ||
|
|
60aa9600d8 | ||
|
|
3d92807d26 | ||
|
|
67195bbc0c | ||
|
|
7ba5984e5f | ||
|
|
27aee33cb9 | ||
|
|
4a848cc08c | ||
|
|
75c2841a13 | ||
|
|
ed8f03122b | ||
|
|
d80e4fdabc | ||
|
|
c8817f80c8 | ||
|
|
3ee1034f1a | ||
|
|
3b224d21fc | ||
|
|
0d7d75ccb5 | ||
|
|
324a1c309c | ||
|
|
0046f5c159 | ||
|
|
7865867973 | ||
|
|
7c12c2ae9b | ||
|
|
564435a22a | ||
|
|
607cdeb5db | ||
|
|
4903a4b5f4 | ||
|
|
e5043447e3 | ||
|
|
4f78fed094 | ||
|
|
0fbce21140 | ||
|
|
3a19c2f2f5 | ||
|
|
c694fbc63b | ||
|
|
c4b6d019ff | ||
|
|
3603dfef03 | ||
|
|
35f1e7092c | ||
|
|
9283b80594 | ||
|
|
f81dff2365 | ||
|
|
5c2b404b3f | ||
|
|
095ed65eb3 | ||
|
|
3d7a09c457 | ||
|
|
abc1867d7c | ||
|
|
3449bd86e8 | ||
|
|
1861ca4a1b | ||
|
|
a77d89b8b3 | ||
|
|
f63c303293 | ||
|
|
f1634e4976 | ||
|
|
b59f20ef49 | ||
|
|
07138f3240 | ||
|
|
eddfa5a896 | ||
|
|
4532e397c0 | ||
|
|
81a270428c | ||
|
|
76e73368ab | ||
|
|
f4f8eb8d1c | ||
|
|
b695d43fee | ||
|
|
f6d2db4c6f | ||
|
|
e1db67f099 | ||
|
|
7142f3410d | ||
|
|
b110314077 | ||
|
|
1cf4d3a60b | ||
|
|
9c5fd29ff1 | ||
|
|
27a39fbfd7 | ||
|
|
d3aa2af73b | ||
|
|
2555fea5da | ||
|
|
8bb63c875f | ||
|
|
76dcc8b909 | ||
|
|
c38975fcba | ||
|
|
b90d99f82b | ||
|
|
76d55bb1a0 | ||
|
|
d9f7638a25 | ||
|
|
e7a391e640 | ||
|
|
12fe08884e |
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
@@ -6,7 +6,7 @@ Before you start working on an unresolved issue or try to implement a new featur
|
|||||||
|
|
||||||
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.
|
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. 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).
|
||||||
|
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -11,8 +11,10 @@ robovm-build
|
|||||||
/vtm-web/war/
|
/vtm-web/war/
|
||||||
/vtm-web/assets/
|
/vtm-web/assets/
|
||||||
/vtm-web/gwt-unitCache
|
/vtm-web/gwt-unitCache
|
||||||
|
/vtm-web-app/war/WEB-INF/
|
||||||
/vtm-web-app/assets/
|
/vtm-web-app/assets/
|
||||||
/vtm-web-app/src/main/webapp/
|
/vtm-web-app/src/main/webapp/
|
||||||
|
/vtm-web-js/war/WEB-INF/
|
||||||
/vtm-web-js/assets/
|
/vtm-web-js/assets/
|
||||||
/vtm-web-js/src/main/webapp/
|
/vtm-web-js/src/main/webapp/
|
||||||
/vtm-spatialite/
|
/vtm-spatialite/
|
||||||
|
|||||||
40
.travis.yml
40
.travis.yml
@@ -1,22 +1,32 @@
|
|||||||
sudo: false
|
sudo: false
|
||||||
language: android
|
language: android
|
||||||
jdk:
|
jdk:
|
||||||
- oraclejdk8
|
- oraclejdk8
|
||||||
android:
|
|
||||||
components:
|
|
||||||
- platform-tools
|
|
||||||
- tools
|
|
||||||
- build-tools-26.0.0
|
|
||||||
- android-26
|
|
||||||
- extra-android-m2repository
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- GRADLE_OPTS="-Xmx2048m"
|
- ANDROID=27
|
||||||
- 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=
|
- ANDROID_BUILD_TOOLS=27.0.3
|
||||||
- secure: AdKSZKA4gMuKXI4X4dQNJqcMv5OmPIHdN8fpy55Y9yoOQPQHZE3Zwc4QDWBh20q298jyEC854tVTPTysdZ7h+2s2FhsprYv1Bt/QNzKIrLpeIMj2quuVGMbdPuk08y55gost94KwVLJv0sIDpRlB/PEQkA7Mg/UDsT9zR8E1Ms5x+ul2C8e1ag0zzNl1wVnT5jY8WCp74uA/XXCcJl/80qT1stUERazCKwbKNo007hi7rdm4HA7YGevORq8e2r67je+WIBZUAwrHT0Zjuo4ibwUii4LdwvjuN3w0Z6e9Wf4x5bBqGgnih0T31uom2yPjNx+U/c2AWI+Nxfy/SEF2U+9bjBEZ3ZhI7F1B9ofXo2mhvvsVDiUrymMBbG2V64C9kAzeUh7xIBTqIrbdtpAEBV9FlLAtF2swVTwtCgZgcVTOt3RKXCi3X3nk3cuH7PAorFa/QGfT4xxVu2011FVAt2Rm7SD0ZWztZTSTz/4Nt/egtGBOJfrCc7oLEygLzDmLqsqCwCROITVQjWLjrtqDyLteaNiSXeNIQMKun3izApbXnHmXB+FV3R3EZocboqk3v5bmPTahnG6Ghc2zknWyyxSx+O9qIfOpHUL8JMJiT82lUQUeibtCn7DCE8wVQ/gYC5i+a+KO/d3NemSzIFlZ8aoUiEPYq18dYlsDXeLXwF0=
|
- 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:
|
script:
|
||||||
- ./gradlew clean build
|
- ./gradlew clean build
|
||||||
after_success:
|
after_success:
|
||||||
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
||||||
./gradlew uploadArchives -PSONATYPE_USERNAME="${SONATYPE_USERNAME}" -PSONATYPE_PASSWORD="${SONATYPE_PASSWORD}";
|
./gradlew uploadArchives -PSONATYPE_USERNAME="${SONATYPE_USERNAME}" -PSONATYPE_PASSWORD="${SONATYPE_PASSWORD}";
|
||||||
fi
|
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
|
||||||
|
|||||||
15
README.md
15
README.md
@@ -29,15 +29,16 @@ If you have any questions or problems, don't hesitate to ask our public [mailing
|
|||||||
- HTML5/WebGL (using libGDX/GWT, [instructions](docs/web.md))
|
- HTML5/WebGL (using libGDX/GWT, [instructions](docs/web.md))
|
||||||
|
|
||||||
### Projects
|
### Projects
|
||||||
- **vtm** contains the core library
|
- **vtm** core library
|
||||||
- **vtm-android** Android backend
|
- **vtm-android** Android backend
|
||||||
- **vtm-android-example** provides examples using vtm-android
|
- **vtm-android-example** Android examples
|
||||||
- **vtm-gdx** common libGDX backend
|
- **vtm-gdx** common libGDX backend
|
||||||
- **vtm-android-gdx** Android backend (with libGDX)
|
- **vtm-android-gdx** Android libGDX backend
|
||||||
- **vtm-desktop** Desktop backend
|
- **vtm-desktop** Desktop libGDX backend
|
||||||
- **vtm-ios** iOS backend
|
- **vtm-playground** Desktop examples
|
||||||
- **vtm-ios-example** provides examples using vtm-ios
|
- **vtm-ios** iOS libGDX backend
|
||||||
- **vtm-web** HTML5/GWT backend
|
- **vtm-ios-example** iOS examples
|
||||||
|
- **vtm-web** HTML5/GWT libGDX backend
|
||||||
- **vtm-web-app** HTML5/GWT application
|
- **vtm-web-app** HTML5/GWT application
|
||||||
|
|
||||||
## WebGL Demo
|
## WebGL Demo
|
||||||
|
|||||||
20
build.gradle
20
build.gradle
@@ -1,10 +1,11 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
classpath 'com.android.tools.build:gradle:3.0.1'
|
||||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
|
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -13,8 +14,8 @@ allprojects {
|
|||||||
version = 'master-SNAPSHOT'
|
version = 'master-SNAPSHOT'
|
||||||
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
|
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
|
||||||
|
|
||||||
ext.androidBuildVersionTools = "26.0.0"
|
ext.androidBuildVersionTools = "27.0.3"
|
||||||
ext.gdxVersion = "1.9.6"
|
ext.gdxVersion = "1.9.8"
|
||||||
ext.gwtVersion = "2.8.0"
|
ext.gwtVersion = "2.8.0"
|
||||||
ext.slf4jVersion = "1.7.25"
|
ext.slf4jVersion = "1.7.25"
|
||||||
|
|
||||||
@@ -27,18 +28,21 @@ allprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def androidCompileSdk() { return 26 }
|
static def androidCompileSdk() { return 27 }
|
||||||
|
|
||||||
def androidMinSdk() { return 10 }
|
// Minimum API Level by Support Library
|
||||||
|
static def androidMinSdk() { return 14 }
|
||||||
|
|
||||||
def androidTargetSdk() { return 22 }
|
static def androidTargetSdk() { return 22 }
|
||||||
|
|
||||||
def versionCode() { return 50 }
|
static def versionCode() { return 1 }
|
||||||
|
|
||||||
def versionName() { return version }
|
def versionName() { return version }
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
repositories {
|
repositories {
|
||||||
|
google()
|
||||||
|
maven { url 'https://repo.boundlessgeo.com/main' }
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,11 @@ if (project.hasProperty("android")) {
|
|||||||
task sourcesJar(type: Jar) {
|
task sourcesJar(type: Jar) {
|
||||||
classifier = 'sources'
|
classifier = 'sources'
|
||||||
from android.sourceSets.main.java.srcDirs
|
from android.sourceSets.main.java.srcDirs
|
||||||
exclude 'android-logger.properties'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task javadoc(type: Javadoc) {
|
task javadoc(type: Javadoc) {
|
||||||
source = android.sourceSets.main.java.srcDirs
|
source = android.sourceSets.main.java.srcDirs
|
||||||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
|
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
|
||||||
exclude 'android-logger.properties'
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
task sourcesJar(type: Jar) {
|
task sourcesJar(type: Jar) {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
| [MapTrek](http://maptrek.mobi) | Application for outdoor activities | GPL3/Free and Commercial | Android | Open |
|
| [MapTrek](http://maptrek.mobi) | Application for outdoor activities | GPL3/Free and Commercial | Android | Open |
|
||||||
| [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 |
|
||||||
|
| 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 |
|
||||||
| [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 |
|
||||||
|
|||||||
@@ -1,5 +1,46 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## Version 0.9.2 (2018-01-04)
|
||||||
|
|
||||||
|
- Gradle fix transitive dependencies [#433](https://github.com/mapsforge/vtm/issues/433)
|
||||||
|
- libGDX 1.9.8 [#464](https://github.com/mapsforge/vtm/issues/464)
|
||||||
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.9.2)
|
||||||
|
|
||||||
|
## Version 0.9.1 (2017-12-29)
|
||||||
|
|
||||||
|
- 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)
|
||||||
|
- Many other minor improvements and bug fixes
|
||||||
|
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.9.1)
|
||||||
|
|
||||||
|
## Version 0.9.0 (2017-12-03)
|
||||||
|
|
||||||
|
- Mapsforge maps **v5 beta** support [#429](https://github.com/mapsforge/vtm/issues/429)
|
||||||
|
- Mapsforge themes compatibility [#100](https://github.com/mapsforge/vtm/issues/100)
|
||||||
|
- Render themes: line symbol [#124](https://github.com/mapsforge/vtm/issues/124)
|
||||||
|
- Render themes: stroke dash array [#131](https://github.com/mapsforge/vtm/issues/131)
|
||||||
|
- PathLayer overlay touch events [#316](https://github.com/mapsforge/vtm/issues/316)
|
||||||
|
- VectorLayer (polygon) overlay touch events [#424](https://github.com/mapsforge/vtm/issues/424)
|
||||||
|
- Two finger tap zoom out gesture [#423](https://github.com/mapsforge/vtm/issues/423)
|
||||||
|
- POI Search example [#394](https://github.com/mapsforge/vtm/issues/394)
|
||||||
|
- Mapsforge Reverse Geocoding [#383](https://github.com/mapsforge/vtm/issues/383)
|
||||||
|
- Core utilities [#396](https://github.com/mapsforge/vtm/issues/396)
|
||||||
|
- MercatorProjection.groundResolution renamed to groundResolutionWithScale
|
||||||
|
- Map scaling improvements [#401](https://github.com/mapsforge/vtm/issues/401)
|
||||||
|
- Mapsforge fix artifacts zoom >17 [#231](https://github.com/mapsforge/vtm/issues/231)
|
||||||
|
- Mapzen building extrusions [#419](https://github.com/mapsforge/vtm/issues/419)
|
||||||
|
- BuildingLayer expects height tags in meters
|
||||||
|
- Polygon symbol positioning [#405](https://github.com/mapsforge/vtm/issues/405)
|
||||||
|
- PolyLabel default disabled [#402](https://github.com/mapsforge/vtm/issues/402)
|
||||||
|
- vtm-theme-comparator module [#387](https://github.com/mapsforge/vtm/issues/387)
|
||||||
|
- Feature parameters [#403](https://github.com/mapsforge/vtm/issues/403)
|
||||||
|
- 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)
|
||||||
|
- 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)
|
||||||
|
- Many other minor improvements and bug fixes
|
||||||
|
- [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)
|
||||||
@@ -19,7 +60,8 @@
|
|||||||
- Improve canvas DPI setting [#349](https://github.com/mapsforge/vtm/issues/349)
|
- Improve canvas DPI setting [#349](https://github.com/mapsforge/vtm/issues/349)
|
||||||
- OSM indoor layer enhancements [#366](https://github.com/mapsforge/vtm/issues/366)
|
- OSM indoor layer enhancements [#366](https://github.com/mapsforge/vtm/issues/366)
|
||||||
- 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)
|
||||||
- Disable vtm-jeo module until update [#375](https://github.com/mapsforge/vtm/issues/375)
|
- 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)
|
||||||
- Many other minor improvements and bug fixes
|
- Many other 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)
|
||||||
|
|
||||||
@@ -45,14 +87,15 @@
|
|||||||
- Tile grid layer scaling [#238](https://github.com/mapsforge/vtm/issues/238)
|
- Tile grid layer scaling [#238](https://github.com/mapsforge/vtm/issues/238)
|
||||||
- Internal render themes new SVG resources [#251](https://github.com/mapsforge/vtm/issues/251)
|
- Internal render themes new SVG resources [#251](https://github.com/mapsforge/vtm/issues/251)
|
||||||
- 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)
|
||||||
- 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
|
- Many other 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 revive
|
||||||
|
|
||||||
|
- 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)
|
||||||
- Mapsforge multilingual maps [#34](https://github.com/mapsforge/vtm/issues/34)
|
|
||||||
- Render theme styles [#93](https://github.com/mapsforge/vtm/issues/93)
|
- Render theme styles [#93](https://github.com/mapsforge/vtm/issues/93)
|
||||||
- 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)
|
||||||
@@ -67,9 +110,10 @@
|
|||||||
- 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)
|
||||||
- vtm-http module [#140](https://github.com/mapsforge/vtm/issues/140)
|
- vtm-http module [#140](https://github.com/mapsforge/vtm/issues/140)
|
||||||
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
|
|
||||||
- LWJGL desktop libGDX backend [#129](https://github.com/mapsforge/vtm/issues/129)
|
- LWJGL desktop libGDX backend [#129](https://github.com/mapsforge/vtm/issues/129)
|
||||||
- SNAPSHOT builds publish to Sonatype OSSRH [#165](https://github.com/mapsforge/vtm/issues/165)
|
|
||||||
- Available on [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.mapsforge%22)
|
- Available on [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.mapsforge%22)
|
||||||
|
- 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)
|
||||||
|
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
|
||||||
- Many other minor improvements and bug fixes
|
- Many other 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)
|
||||||
|
|||||||
@@ -8,42 +8,42 @@ Current version is [
|
### Android (with libGDX)
|
||||||
```groovy
|
```groovy
|
||||||
compile 'org.mapsforge:vtm-android:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]'
|
||||||
compile 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-arm64-v8a'
|
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-arm64-v8a'
|
||||||
compile 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-armeabi'
|
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-armeabi'
|
||||||
compile 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-armeabi-v7a'
|
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-armeabi-v7a'
|
||||||
compile 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86'
|
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86'
|
||||||
compile 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86_64'
|
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86_64'
|
||||||
compile 'org.mapsforge:vtm-gdx:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-gdx:[CURRENT-VERSION]'
|
||||||
compile 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]'
|
||||||
compile 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-arm64-v8a'
|
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-arm64-v8a'
|
||||||
compile 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-armeabi'
|
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-armeabi'
|
||||||
compile 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-armeabi-v7a'
|
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-armeabi-v7a'
|
||||||
compile 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86'
|
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86'
|
||||||
compile 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86_64'
|
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86_64'
|
||||||
compile 'com.badlogicgames.gdx:gdx:1.9.6'
|
implementation 'com.badlogicgames.gdx:gdx:1.9.8'
|
||||||
compile 'com.badlogicgames.gdx:gdx-backend-android:1.9.6'
|
implementation 'com.badlogicgames.gdx:gdx-backend-android:1.9.8'
|
||||||
compile 'com.caverock:androidsvg:1.2.2-beta-1'
|
implementation 'com.caverock:androidsvg:1.2.2-beta-1'
|
||||||
```
|
```
|
||||||
|
|
||||||
### iOS
|
### iOS
|
||||||
@@ -52,19 +52,45 @@ Detailed iOS instructions can be found [here](ios.md).
|
|||||||
|
|
||||||
### Desktop
|
### Desktop
|
||||||
```groovy
|
```groovy
|
||||||
compile 'org.mapsforge:vtm-gdx:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-gdx:[CURRENT-VERSION]'
|
||||||
compile 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]'
|
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]'
|
||||||
compile 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-linux'
|
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-linux'
|
||||||
compile 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-osx'
|
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-osx'
|
||||||
compile 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-windows'
|
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-windows'
|
||||||
compile 'com.badlogicgames.gdx:gdx:1.9.6'
|
implementation 'com.badlogicgames.gdx:gdx:1.9.8'
|
||||||
compile 'com.badlogicgames.gdx:gdx-platform:1.9.6:natives-desktop'
|
implementation 'com.badlogicgames.gdx:gdx-platform:1.9.8:natives-desktop'
|
||||||
compile 'com.badlogicgames.gdx:gdx-backend-lwjgl:1.9.6'
|
implementation 'com.badlogicgames.gdx:gdx-backend-lwjgl:1.9.8'
|
||||||
compile 'org.lwjgl.lwjgl:lwjgl:2.9.3'
|
implementation 'org.lwjgl.lwjgl:lwjgl:2.9.3'
|
||||||
compile 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-linux'
|
implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-linux'
|
||||||
compile 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-osx'
|
implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-osx'
|
||||||
compile 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-windows'
|
implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-windows'
|
||||||
compile 'com.metsci.ext.com.kitfox.svg:svg-salamander:0.1.19'
|
implementation 'com.metsci.ext.com.kitfox.svg:svg-salamander:0.1.19'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Optional
|
||||||
|
|
||||||
|
- JTS geometries
|
||||||
|
|
||||||
|
```groovy
|
||||||
|
implementation 'org.mapsforge:vtm-jts:[CURRENT-VERSION]'
|
||||||
|
implementation 'com.vividsolutions:jts:1.13'
|
||||||
|
```
|
||||||
|
|
||||||
|
- Online tiles
|
||||||
|
|
||||||
|
```groovy
|
||||||
|
implementation 'org.mapsforge:vtm-http:[CURRENT-VERSION]'
|
||||||
|
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
|
||||||
|
implementation 'com.squareup.okio:okio:1.13.0'
|
||||||
|
```
|
||||||
|
|
||||||
|
- GeoJSON tiles
|
||||||
|
|
||||||
|
```groovy
|
||||||
|
implementation 'org.mapsforge:vtm-json:[CURRENT-VERSION]'
|
||||||
|
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.8.4'
|
||||||
|
implementation 'com.fasterxml.jackson.core:jackson-core:2.8.4'
|
||||||
|
implementation 'com.fasterxml.jackson.core:jackson-databind:2.8.4'
|
||||||
```
|
```
|
||||||
|
|
||||||
## Snapshots
|
## Snapshots
|
||||||
@@ -80,7 +106,7 @@ repositories {
|
|||||||
|
|
||||||
And declare the dependencies like:
|
And declare the dependencies like:
|
||||||
```groovy
|
```groovy
|
||||||
compile 'org.mapsforge:vtm:master-SNAPSHOT'
|
implementation 'org.mapsforge:vtm:master-SNAPSHOT'
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
- [AndroidMaps](http://www.androidmaps.co.uk/)
|
- [AndroidMaps](http://www.androidmaps.co.uk/)
|
||||||
- [Freizeitkarte](http://www.freizeitkarte-osm.de/android/en/index.html)
|
- [Freizeitkarte](http://www.freizeitkarte-osm.de/android/en/index.html)
|
||||||
|
- [Kurviger](https://offline-maps.kurviger.de/)
|
||||||
- [Locusvectormaps](http://www.locusvectormaps.com)
|
- [Locusvectormaps](http://www.locusvectormaps.com)
|
||||||
- [Mapsforge](http://download.mapsforge.org/)
|
- [Mapsforge](http://download.mapsforge.org/)
|
||||||
- [OpenAndroMaps](http://www.openandromaps.org/en/)
|
- [OpenAndroMaps](http://www.openandromaps.org/en/)
|
||||||
|
|||||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
#Fri Mar 03 12:50:23 EET 2017
|
#Thu Oct 26 11:57:58 EEST 2017
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java-library'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "com.badlogicgames.gdx:gdx-jnigen:$gdxVersion"
|
api "com.badlogicgames.gdx:gdx-jnigen:$gdxVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
|||||||
@@ -190,6 +190,8 @@
|
|||||||
<xs:attribute name="fade" default="-1" type="xs:integer" use="optional" />
|
<xs:attribute name="fade" default="-1" type="xs:integer" use="optional" />
|
||||||
<xs:attribute name="blur" default="-1" type="xs:float" use="optional" />
|
<xs:attribute name="blur" default="-1" type="xs:float" use="optional" />
|
||||||
<xs:attribute name="fix" default="false" type="xs:boolean" use="optional" />
|
<xs:attribute name="fix" default="false" type="xs:boolean" 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" />
|
||||||
|
|
||||||
<!-- stipple repeat in 'pixel' -->
|
<!-- stipple repeat in 'pixel' -->
|
||||||
<xs:attribute name="stipple" default="0" type="xs:integer" use="optional" />
|
<xs:attribute name="stipple" default="0" type="xs:integer" use="optional" />
|
||||||
@@ -200,27 +202,6 @@
|
|||||||
|
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|
||||||
<!--<xs:complexType name="outline">
|
|
||||||
<xs:attribute name="cat" type="xs:string" use="optional" />
|
|
||||||
<xs:attribute name="name" 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-height" type="xs:positiveInteger" use="optional" />
|
|
||||||
<xs:attribute name="symbol-percent" type="xs:positiveInteger" 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:complexType>-->
|
|
||||||
|
|
||||||
<xs:complexType name="lineSymbol">
|
|
||||||
<xs:attribute name="cat" type="xs:string" use="optional" />
|
|
||||||
<xs:attribute name="src" type="tns:src" use="required" />
|
|
||||||
<xs:attribute name="symbol-width" 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="align-center" default="false" type="xs:boolean" use="optional" />
|
|
||||||
<xs:attribute name="repeat" default="false" type="xs:boolean" use="optional" />
|
|
||||||
</xs:complexType>
|
|
||||||
|
|
||||||
<xs:complexType name="text">
|
<xs:complexType name="text">
|
||||||
<xs:attribute name="cat" type="xs:string" use="optional" />
|
<xs:attribute name="cat" type="xs:string" use="optional" />
|
||||||
|
|
||||||
@@ -255,6 +236,8 @@
|
|||||||
<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" />
|
||||||
|
<!-- 12m default -->
|
||||||
|
<xs:attribute name="default-height" default="12" type="xs:positiveInteger" use="optional" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|
||||||
<!-- match elements -->
|
<!-- match elements -->
|
||||||
@@ -268,7 +251,7 @@
|
|||||||
<xs:element name="circle" type="tns:circle" />
|
<xs:element name="circle" type="tns:circle" />
|
||||||
<xs:element name="line" type="tns:line" />
|
<xs:element name="line" type="tns:line" />
|
||||||
<xs:element name="outline" type="tns:line" />
|
<xs:element name="outline" type="tns:line" />
|
||||||
<xs:element name="lineSymbol" type="tns:lineSymbol" />
|
<xs:element name="lineSymbol" type="tns:line" />
|
||||||
<xs:element name="text" type="tns:text" />
|
<xs:element name="text" type="tns:text" />
|
||||||
<xs:element name="extrusion" type="tns:extrusion" />
|
<xs:element name="extrusion" type="tns:extrusion" />
|
||||||
<xs:element name="symbol" type="tns:symbol" />
|
<xs:element name="symbol" type="tns:symbol" />
|
||||||
|
|||||||
@@ -10,11 +10,12 @@ include ':vtm-gdx'
|
|||||||
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-playground'
|
include ':vtm-playground'
|
||||||
include ':vtm-tests'
|
include ':vtm-tests'
|
||||||
|
include ':vtm-theme-comparator'
|
||||||
include ':vtm-themes'
|
include ':vtm-themes'
|
||||||
include ':vtm-web'
|
include ':vtm-web'
|
||||||
include ':vtm-web-app'
|
include ':vtm-web-app'
|
||||||
|
|||||||
@@ -10,10 +10,6 @@
|
|||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
<uses-sdk
|
|
||||||
android:minSdkVersion="10"
|
|
||||||
android:targetSdkVersion="22" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
@@ -41,9 +37,12 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".ClusterMarkerOverlayActivity"
|
android:name=".ClusterMarkerOverlayActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<!--<activity
|
<activity
|
||||||
|
android:name=".GdxMapActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<activity
|
||||||
android:name=".JeoIndoorMapActivity"
|
android:name=".JeoIndoorMapActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />-->
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".LayerGroupActivity"
|
android:name=".LayerGroupActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
@@ -53,18 +52,18 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".LocationActivity"
|
android:name=".LocationActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
|
||||||
android:name=".MapFragmentActivity"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
|
||||||
<activity
|
|
||||||
android:name=".MapPositionActivity"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MapsforgeMapActivity"
|
android:name=".MapsforgeMapActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MapsforgeMapActivity$MapFilePicker"
|
android:name=".MapsforgeMapActivity$MapFilePicker"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<activity
|
||||||
|
android:name=".MapsforgeMapActivity$ThemeFilePicker"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<activity
|
||||||
|
android:name=".MapsforgePolyLabelActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MapsforgeStyleActivity"
|
android:name=".MapsforgeStyleActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
@@ -83,17 +82,29 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".NewGesturesActivity"
|
android:name=".NewGesturesActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<activity
|
||||||
|
android:name=".OpenMapTilesGeojsonMapActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<activity
|
||||||
|
android:name=".OSciMapS3DBMapActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".PathOverlayActivity"
|
android:name=".PathOverlayActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<activity
|
||||||
|
android:name=".PoiSearchActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
|
<activity
|
||||||
|
android:name=".PoiSearchActivity$PoiFilePicker"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".POTTextureActivity"
|
android:name=".POTTextureActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".RotateMarkerOverlayActivity"
|
android:name=".ReverseGeocodeActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".S3DBMapActivity"
|
android:name=".RotateMarkerOverlayActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".SimpleMapActivity"
|
android:name=".SimpleMapActivity"
|
||||||
|
|||||||
@@ -1,17 +1,26 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':vtm-android')
|
implementation project(':vtm-android')
|
||||||
compile project(':vtm-extras')
|
implementation project(':vtm-http')
|
||||||
compile project(':vtm-http')
|
implementation project(':vtm-jeo')
|
||||||
/*compile(project(':vtm-jeo')) {
|
implementation project(':vtm-json')
|
||||||
exclude group: 'com.vividsolutions', module: 'jts'
|
implementation project(':vtm-jts')
|
||||||
}*/
|
implementation project(':vtm-themes')
|
||||||
compile project(':vtm-json')
|
implementation "org.slf4j:slf4j-android:$slf4jVersion"
|
||||||
compile project(':vtm-jts')
|
|
||||||
compile project(':vtm-themes')
|
implementation project(':vtm-android-gdx')
|
||||||
compile 'com.noveogroup.android:android-logger:1.3.6'
|
implementation project(':vtm-gdx')
|
||||||
compile 'com.android.support:support-v4:25.3.1'
|
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
|
||||||
|
|
||||||
|
implementation 'org.mapsforge:mapsforge-poi-android:master-SNAPSHOT'
|
||||||
|
implementation 'org.mapsforge:spatialite-android:master-SNAPSHOT:natives-armeabi'
|
||||||
|
implementation 'org.mapsforge:spatialite-android:master-SNAPSHOT:natives-armeabi-v7a'
|
||||||
|
implementation 'org.mapsforge:spatialite-android:master-SNAPSHOT:natives-x86'
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
@@ -27,6 +36,7 @@ android {
|
|||||||
versionCode versionCode()
|
versionCode versionCode()
|
||||||
versionName versionName()
|
versionName versionName()
|
||||||
minSdkVersion androidMinSdk()
|
minSdkVersion androidMinSdk()
|
||||||
|
targetSdkVersion androidTargetSdk()
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -39,6 +49,9 @@ android {
|
|||||||
file("${rootDir}/vtm-android/natives").eachDir() { dir ->
|
file("${rootDir}/vtm-android/natives").eachDir() { dir ->
|
||||||
jniLibs.srcDirs += "${dir.path}/lib"
|
jniLibs.srcDirs += "${dir.path}/lib"
|
||||||
}
|
}
|
||||||
|
file("${rootDir}/vtm-android-gdx/natives").eachDir() { dir ->
|
||||||
|
jniLibs.srcDirs += "${dir.path}/lib"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
debug.setRoot('build-types/debug')
|
debug.setRoot('build-types/debug')
|
||||||
release.setRoot('build-types/release')
|
release.setRoot('build-types/release')
|
||||||
|
|||||||
BIN
vtm-android-example/res/drawable-hdpi/marker_green.png
Normal file
BIN
vtm-android-example/res/drawable-hdpi/marker_green.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
BIN
vtm-android-example/res/drawable-hdpi/marker_red.png
Normal file
BIN
vtm-android-example/res/drawable-hdpi/marker_red.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
BIN
vtm-android-example/res/drawable-mdpi/marker_green.png
Normal file
BIN
vtm-android-example/res/drawable-mdpi/marker_green.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
BIN
vtm-android-example/res/drawable-mdpi/marker_red.png
Normal file
BIN
vtm-android-example/res/drawable-mdpi/marker_red.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
@@ -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"
|
||||||
|
android:title="@string/theme_external" />
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<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="ok">OK</string>
|
<string name="ok">OK</string>
|
||||||
<string name="cancel">Cancel</string>
|
<string name="cancel">Cancel</string>
|
||||||
<string name="error">Error</string>
|
<string name="error">Error</string>
|
||||||
@@ -17,5 +18,6 @@
|
|||||||
<string name="style_1">Show nature</string>
|
<string name="style_1">Show nature</string>
|
||||||
<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>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
root=DEBUG:%logger
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, 2011, 2012 mapsforge.org
|
* Copyright 2010, 2011, 2012 mapsforge.org
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
|
* 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
|
||||||
* 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,10 +18,13 @@ package org.oscim.android.filepicker;
|
|||||||
|
|
||||||
import org.oscim.theme.ExternalRenderTheme;
|
import org.oscim.theme.ExternalRenderTheme;
|
||||||
import org.oscim.theme.ThemeFile;
|
import org.oscim.theme.ThemeFile;
|
||||||
|
import org.oscim.theme.ThemeUtils;
|
||||||
|
import org.oscim.theme.XmlMapsforgeThemeBuilder;
|
||||||
import org.oscim.theme.XmlThemeBuilder;
|
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.InputSource;
|
||||||
import org.xml.sax.XMLReader;
|
import org.xml.sax.XMLReader;
|
||||||
|
import org.xml.sax.helpers.DefaultHandler;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
@@ -34,9 +38,14 @@ 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());
|
ThemeFile theme = new ExternalRenderTheme(file.getAbsolutePath());
|
||||||
XmlThemeBuilder renderThemeHandler = new XmlThemeBuilder(theme);
|
DefaultHandler renderThemeHandler;
|
||||||
|
if (ThemeUtils.isMapsforgeTheme(theme))
|
||||||
|
renderThemeHandler = new XmlMapsforgeThemeBuilder(theme);
|
||||||
|
else
|
||||||
|
renderThemeHandler = new XmlThemeBuilder(theme);
|
||||||
XMLReader xmlReader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
|
XMLReader xmlReader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
|
||||||
xmlReader.setContentHandler(renderThemeHandler);
|
xmlReader.setContentHandler(renderThemeHandler);
|
||||||
xmlReader.parse(new InputSource(theme.getRenderThemeAsStream()));
|
xmlReader.parse(new InputSource(theme.getRenderThemeAsStream()));
|
||||||
|
|||||||
@@ -18,8 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
|
|
||||||
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.layers.marker.ItemizedLayer;
|
import org.oscim.layers.marker.ItemizedLayer;
|
||||||
@@ -32,6 +30,8 @@ import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
|||||||
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.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
import org.oscim.utils.TextureAtlasUtils;
|
import org.oscim.utils.TextureAtlasUtils;
|
||||||
|
|
||||||
@@ -48,17 +48,16 @@ public class AtlasMarkerOverlayActivity extends MarkerOverlayActivity {
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
TileSource tileSource = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
|
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
||||||
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.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|
||||||
/* directly load bitmap from resources */
|
Bitmap bitmapPoi = drawableToBitmap(getResources().getDrawable(R.drawable.marker_poi));
|
||||||
Bitmap bitmapPoi = drawableToBitmap(getResources(), R.drawable.marker_poi);
|
Bitmap bitmapFocus = drawableToBitmap(getResources().getDrawable(R.drawable.marker_focus));
|
||||||
|
|
||||||
/* another option: use some bitmap drawable */
|
|
||||||
Drawable d = getResources().getDrawable(R.drawable.marker_focus);
|
|
||||||
Bitmap bitmapFocus = drawableToBitmap(d);
|
|
||||||
|
|
||||||
// Create Atlas from Bitmaps
|
// Create Atlas from Bitmaps
|
||||||
java.util.Map<Object, Bitmap> inputMap = new LinkedHashMap<>();
|
java.util.Map<Object, Bitmap> inputMap = new LinkedHashMap<>();
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
|||||||
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.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
import org.oscim.utils.TextureAtlasUtils;
|
import org.oscim.utils.TextureAtlasUtils;
|
||||||
|
|
||||||
@@ -50,7 +52,10 @@ public class AtlasMultiTextureActivity extends MarkerOverlayActivity {
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
TileSource tileSource = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
|
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
||||||
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.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -17,13 +17,13 @@ package org.oscim.android.test;
|
|||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import org.oscim.theme.ThemeLoader;
|
import org.oscim.utils.Parameters;
|
||||||
|
|
||||||
public class AtlasThemeActivity extends SimpleMapActivity {
|
public class AtlasThemeActivity extends SimpleMapActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
ThemeLoader.USE_ATLAS = true;
|
Parameters.TEXTURE_ATLAS = true;
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import org.oscim.layers.TileGridLayer;
|
|||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -53,7 +54,9 @@ public class BaseMapActivity extends MapActivity {
|
|||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
mTileSource = new OSciMap4TileSource();
|
mTileSource = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
|
|
||||||
if (USE_CACHE) {
|
if (USE_CACHE) {
|
||||||
mCache = new TileCache(this, null, "tile.db");
|
mCache = new TileCache(this, null, "tile.db");
|
||||||
|
|||||||
@@ -21,11 +21,16 @@ import org.oscim.core.GeoPoint;
|
|||||||
import org.oscim.layers.marker.ClusterMarkerRenderer;
|
import org.oscim.layers.marker.ClusterMarkerRenderer;
|
||||||
import org.oscim.layers.marker.ItemizedLayer;
|
import org.oscim.layers.marker.ItemizedLayer;
|
||||||
import org.oscim.layers.marker.MarkerItem;
|
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.marker.MarkerSymbol;
|
||||||
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;
|
||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -43,22 +48,37 @@ public class ClusterMarkerOverlayActivity extends MarkerOverlayActivity {
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
TileSource tileSource = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
|
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
||||||
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.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|
||||||
Bitmap bitmapPoi = drawableToBitmap(getResources(), R.drawable.marker_poi);
|
Bitmap bitmapPoi = drawableToBitmap(getResources().getDrawable(R.drawable.marker_poi));
|
||||||
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);
|
||||||
else
|
else
|
||||||
symbol = new MarkerSymbol(bitmapPoi, MarkerSymbol.HotspotPlace.CENTER, false);
|
symbol = new MarkerSymbol(bitmapPoi, MarkerSymbol.HotspotPlace.CENTER, false);
|
||||||
|
|
||||||
|
MarkerRendererFactory markerRendererFactory = new MarkerRendererFactory() {
|
||||||
|
@Override
|
||||||
|
public MarkerRenderer create(MarkerLayer markerLayer) {
|
||||||
|
return new ClusterMarkerRenderer(markerLayer, symbol, new ClusterMarkerRenderer.ClusterStyle(Color.WHITE, Color.BLUE)) {
|
||||||
|
@Override
|
||||||
|
protected Bitmap getClusterBitmap(int size) {
|
||||||
|
// Can customize cluster bitmap here
|
||||||
|
return super.getClusterBitmap(size);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
mMarkerLayer = new ItemizedLayer<>(
|
mMarkerLayer = new ItemizedLayer<>(
|
||||||
mMap,
|
mMap,
|
||||||
new ArrayList<MarkerItem>(),
|
new ArrayList<MarkerItem>(),
|
||||||
ClusterMarkerRenderer.factory(symbol, new ClusterMarkerRenderer.ClusterStyle(Color.WHITE, Color.BLUE)),
|
markerRendererFactory,
|
||||||
this);
|
this);
|
||||||
mMap.layers().add(mMarkerLayer);
|
mMap.layers().add(mMarkerLayer);
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,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.gdx;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
@@ -28,10 +28,14 @@ import org.oscim.android.canvas.AndroidGraphics;
|
|||||||
import org.oscim.backend.CanvasAdapter;
|
import org.oscim.backend.CanvasAdapter;
|
||||||
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.GdxAssets;
|
||||||
|
import org.oscim.gdx.GdxMap;
|
||||||
import org.oscim.tiling.TileSource;
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
public class MainActivity extends AndroidApplication {
|
public class GdxMapActivity extends AndroidApplication {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -43,7 +47,7 @@ public class MainActivity extends AndroidApplication {
|
|||||||
|
|
||||||
DisplayMetrics metrics = getResources().getDisplayMetrics();
|
DisplayMetrics metrics = getResources().getDisplayMetrics();
|
||||||
CanvasAdapter.dpi = (int) (metrics.scaledDensity * CanvasAdapter.DEFAULT_DPI);
|
CanvasAdapter.dpi = (int) (metrics.scaledDensity * CanvasAdapter.DEFAULT_DPI);
|
||||||
Tile.SIZE = Tile.calculateTileSize(metrics.scaledDensity);
|
Tile.SIZE = Tile.calculateTileSize();
|
||||||
|
|
||||||
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
|
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
|
||||||
cfg.stencil = 8;
|
cfg.stencil = 8;
|
||||||
@@ -57,7 +61,9 @@ public class MainActivity extends AndroidApplication {
|
|||||||
class GdxMapAndroid extends GdxMap {
|
class GdxMapAndroid extends GdxMap {
|
||||||
@Override
|
@Override
|
||||||
public void createLayers() {
|
public void createLayers() {
|
||||||
TileSource ts = new OSciMap4TileSource();
|
TileSource ts = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
initDefaultLayers(ts, true, true, true, getResources().getDisplayMetrics().density);
|
initDefaultLayers(ts, true, true, true, getResources().getDisplayMetrics().density);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,186 +1,186 @@
|
|||||||
///*
|
/*
|
||||||
// * Copyright 2014 Hannes Janetzek
|
* Copyright 2014 Hannes Janetzek
|
||||||
// * Copyright 2016-2017 devemux86
|
* Copyright 2016-2017 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).
|
||||||
// *
|
*
|
||||||
// * 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.
|
||||||
// *
|
*
|
||||||
// * This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
* 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
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
// * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
* 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
|
* 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 org.jeo.map.Style;
|
import org.jeo.map.Style;
|
||||||
//import org.jeo.vector.VectorDataset;
|
import org.jeo.vector.VectorDataset;
|
||||||
//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 JeoIndoorMapActivity extends BaseMapActivity {
|
public class JeoIndoorMapActivity extends BaseMapActivity {
|
||||||
// public static final Logger log = LoggerFactory.getLogger(JeoIndoorMapActivity.class);
|
public static final Logger log = LoggerFactory.getLogger(JeoIndoorMapActivity.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 JeoIndoorMapActivity() {
|
public JeoIndoorMapActivity() {
|
||||||
// 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();
|
||||||
// float scale = getResources().getDisplayMetrics().density;
|
float scale = getResources().getDisplayMetrics().density;
|
||||||
// TextStyle textStyle = TextStyle.builder()
|
TextStyle textStyle = TextStyle.builder()
|
||||||
// .isCaption(true)
|
.isCaption(true)
|
||||||
// .fontSize(16 * scale).color(Color.BLACK)
|
.fontSize(16 * scale).color(Color.BLACK)
|
||||||
// .strokeWidth(2.2f * scale).strokeColor(Color.WHITE)
|
.strokeWidth(2.2f * scale).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);
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import org.oscim.layers.vector.geometries.Style;
|
|||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
import org.oscim.renderer.bucket.TextureItem;
|
import org.oscim.renderer.bucket.TextureItem;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -45,8 +46,13 @@ public class LineTexActivity extends SimpleMapActivity {
|
|||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
TextureItem tex = new TextureItem(CanvasAdapter.getBitmapAsset("", "patterns/pike.png"));
|
TextureItem tex = null;
|
||||||
tex.mipmap = true;
|
try {
|
||||||
|
tex = new TextureItem(CanvasAdapter.getBitmapAsset("", "patterns/pike.png"));
|
||||||
|
tex.mipmap = true;
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
for (double lat = -90; lat <= 90; lat += 5) {
|
for (double lat = -90; lat <= 90; lat += 5) {
|
||||||
int c = Color.fade(Color.rainbow((float) (lat + 90) / 180), 0.5f);
|
int c = Color.fade(Color.rainbow((float) (lat + 90) / 180), 0.5f);
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import android.os.Bundle;
|
|||||||
|
|
||||||
import org.oscim.android.MapPreferences;
|
import org.oscim.android.MapPreferences;
|
||||||
import org.oscim.android.MapView;
|
import org.oscim.android.MapView;
|
||||||
import org.oscim.core.Tile;
|
|
||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
|
|
||||||
public class MapActivity extends Activity {
|
public class MapActivity extends Activity {
|
||||||
@@ -41,7 +40,6 @@ public class MapActivity extends Activity {
|
|||||||
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
Tile.SIZE = Tile.calculateTileSize(getResources().getDisplayMetrics().scaledDensity);
|
|
||||||
setContentView(mContentView);
|
setContentView(mContentView);
|
||||||
|
|
||||||
setTitle(getClass().getSimpleName());
|
setTitle(getClass().getSimpleName());
|
||||||
|
|||||||
@@ -1,107 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2016 Mathieu De Brito
|
|
||||||
* 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.test;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.support.v4.app.Fragment;
|
|
||||||
import android.support.v4.app.FragmentActivity;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import org.oscim.android.MapPreferences;
|
|
||||||
import org.oscim.android.MapView;
|
|
||||||
import org.oscim.core.MapPosition;
|
|
||||||
import org.oscim.core.Tile;
|
|
||||||
import org.oscim.layers.GroupLayer;
|
|
||||||
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.oscimap4.OSciMap4TileSource;
|
|
||||||
|
|
||||||
public class MapFragmentActivity extends FragmentActivity {
|
|
||||||
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
Tile.SIZE = Tile.calculateTileSize(getResources().getDisplayMetrics().scaledDensity);
|
|
||||||
setContentView(R.layout.activity_map_fragment);
|
|
||||||
|
|
||||||
setTitle(getClass().getSimpleName());
|
|
||||||
|
|
||||||
MapFragment newFragment = new MapFragment();
|
|
||||||
getSupportFragmentManager()
|
|
||||||
.beginTransaction()
|
|
||||||
.add(R.id.fragment_container, newFragment)
|
|
||||||
.commit();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class MapFragment extends Fragment {
|
|
||||||
|
|
||||||
private MapView mMapView;
|
|
||||||
private MapPreferences mPrefs;
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
||||||
View contentView = super.onCreateView(inflater, container, savedInstanceState);
|
|
||||||
if (contentView == null) {
|
|
||||||
contentView = inflater.inflate(R.layout.fragment_map, container, false);
|
|
||||||
}
|
|
||||||
return contentView;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
|
|
||||||
super.onViewCreated(view, savedInstanceState);
|
|
||||||
|
|
||||||
mMapView = (MapView) view.findViewById(R.id.mapView);
|
|
||||||
mPrefs = new MapPreferences(MapFragment.class.getName(), getContext());
|
|
||||||
|
|
||||||
VectorTileLayer l = mMapView.map().setBaseMap(new OSciMap4TileSource());
|
|
||||||
|
|
||||||
GroupLayer groupLayer = new GroupLayer(mMapView.map());
|
|
||||||
groupLayer.layers.add(new BuildingLayer(mMapView.map(), l));
|
|
||||||
groupLayer.layers.add(new LabelLayer(mMapView.map(), l));
|
|
||||||
mMapView.map().layers().add(groupLayer);
|
|
||||||
|
|
||||||
mMapView.map().setTheme(VtmThemes.DEFAULT);
|
|
||||||
|
|
||||||
// set initial position on first run
|
|
||||||
MapPosition pos = new MapPosition();
|
|
||||||
mMapView.map().getMapPosition(pos);
|
|
||||||
if (pos.x == 0.5 && pos.y == 0.5)
|
|
||||||
mMapView.map().setMapPosition(53.08, 8.83, Math.pow(2, 16));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
|
|
||||||
mPrefs.load(mMapView.map());
|
|
||||||
mMapView.onResume();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPause() {
|
|
||||||
super.onPause();
|
|
||||||
|
|
||||||
mMapView.onPause();
|
|
||||||
mPrefs.save(mMapView.map());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2016 Mathieu De Brito
|
|
||||||
* Copyright 2016 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.widget.Toast;
|
|
||||||
|
|
||||||
import org.oscim.core.MapPosition;
|
|
||||||
import org.oscim.core.MercatorProjection;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test consecutive map position animations.
|
|
||||||
*/
|
|
||||||
public class MapPositionActivity extends SimpleMapActivity {
|
|
||||||
|
|
||||||
// Reuse MapPosition instance
|
|
||||||
private final MapPosition mapPosition = new MapPosition();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
runTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
|
|
||||||
/* ignore saved position */
|
|
||||||
mMap.setMapPosition(0, 0, 1 << 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void animateToBearing(final float bearing) {
|
|
||||||
mMap.postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
mMap.getMapPosition(mapPosition);
|
|
||||||
mapPosition.setBearing(bearing);
|
|
||||||
mMap.animator().animateTo(1000, mapPosition);
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void animateToLocation(final double latitude, final double longitude) {
|
|
||||||
mMap.postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
mMap.getMapPosition(true, mapPosition);
|
|
||||||
mapPosition.setPosition(latitude, longitude);
|
|
||||||
mMap.animator().animateTo(1000, mapPosition);
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void runTest() {
|
|
||||||
// 1 - ask for a bearing
|
|
||||||
final float bearing = 180;
|
|
||||||
animateToBearing(bearing);
|
|
||||||
|
|
||||||
// 2 - ask for a new location
|
|
||||||
double latitude = Math.random() * MercatorProjection.LATITUDE_MAX;
|
|
||||||
double longitude = Math.random() * MercatorProjection.LONGITUDE_MAX;
|
|
||||||
animateToLocation(latitude, longitude);
|
|
||||||
|
|
||||||
// If animations were merged, final bearing should be 180°
|
|
||||||
mMap.postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
mMap.getMapPosition(mapPosition);
|
|
||||||
Toast.makeText(MapPositionActivity.this, "Bearing expected: " + bearing + ", got: " + mapPosition.getBearing(), Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
}, 3000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 Hannes Janetzek
|
* Copyright 2014 Hannes Janetzek
|
||||||
* Copyright 2016-2017 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
|
* 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).
|
||||||
*
|
*
|
||||||
@@ -25,28 +26,46 @@ import android.view.MenuItem;
|
|||||||
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.android.filepicker.ValidMapFile;
|
import org.oscim.android.filepicker.ValidMapFile;
|
||||||
|
import org.oscim.android.filepicker.ValidRenderTheme;
|
||||||
|
import org.oscim.core.MapElement;
|
||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
|
import org.oscim.core.Tag;
|
||||||
import org.oscim.core.Tile;
|
import org.oscim.core.Tile;
|
||||||
import org.oscim.layers.TileGridLayer;
|
import org.oscim.layers.TileGridLayer;
|
||||||
|
import org.oscim.layers.tile.MapTile;
|
||||||
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;
|
||||||
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.scalebar.DefaultMapScaleBar;
|
import org.oscim.scalebar.DefaultMapScaleBar;
|
||||||
import org.oscim.scalebar.ImperialUnitAdapter;
|
import org.oscim.scalebar.ImperialUnitAdapter;
|
||||||
import org.oscim.scalebar.MapScaleBar;
|
import org.oscim.scalebar.MapScaleBar;
|
||||||
import org.oscim.scalebar.MapScaleBarLayer;
|
import org.oscim.scalebar.MapScaleBarLayer;
|
||||||
import org.oscim.scalebar.MetricUnitAdapter;
|
import org.oscim.scalebar.MetricUnitAdapter;
|
||||||
|
import org.oscim.theme.ExternalRenderTheme;
|
||||||
|
import org.oscim.theme.ThemeUtils;
|
||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
|
import org.oscim.theme.styles.AreaStyle;
|
||||||
|
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;
|
||||||
|
|
||||||
public class MapsforgeMapActivity extends MapActivity {
|
public class MapsforgeMapActivity extends MapActivity {
|
||||||
private 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 Tag ISSEA_TAG = new Tag("natural", "issea");
|
||||||
|
private static final Tag NOSEA_TAG = new Tag("natural", "nosea");
|
||||||
|
private static final Tag SEA_TAG = new Tag("natural", "sea");
|
||||||
|
|
||||||
private TileGridLayer mGridLayer;
|
private TileGridLayer mGridLayer;
|
||||||
private DefaultMapScaleBar mMapScaleBar;
|
private DefaultMapScaleBar mMapScaleBar;
|
||||||
|
private Menu mMenu;
|
||||||
|
private VectorTileLayer mTileLayer;
|
||||||
|
MapFileTileSource mTileSource;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -71,9 +90,17 @@ public class MapsforgeMapActivity extends MapActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class ThemeFilePicker extends FilePicker {
|
||||||
|
public ThemeFilePicker() {
|
||||||
|
setFileDisplayFilter(new FilterByFileExtension(".xml"));
|
||||||
|
setFileSelectFilter(new ValidRenderTheme());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
getMenuInflater().inflate(R.menu.theme_menu, menu);
|
getMenuInflater().inflate(R.menu.theme_menu, menu);
|
||||||
|
mMenu = menu;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,6 +133,11 @@ public class MapsforgeMapActivity extends MapActivity {
|
|||||||
item.setChecked(true);
|
item.setChecked(true);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case R.id.theme_external:
|
||||||
|
startActivityForResult(new Intent(this, ThemeFilePicker.class),
|
||||||
|
SELECT_THEME_FILE);
|
||||||
|
return true;
|
||||||
|
|
||||||
case R.id.gridlayer:
|
case R.id.gridlayer:
|
||||||
if (item.isChecked()) {
|
if (item.isChecked()) {
|
||||||
item.setChecked(false);
|
item.setChecked(false);
|
||||||
@@ -133,16 +165,16 @@ public class MapsforgeMapActivity extends MapActivity {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapFileTileSource tileSource = new MapFileTileSource();
|
mTileSource = new MapFileTileSource();
|
||||||
tileSource.setPreferredLanguage("en");
|
//mTileSource.setPreferredLanguage("en");
|
||||||
String file = intent.getStringExtra(FilePicker.SELECTED_FILE);
|
String file = intent.getStringExtra(FilePicker.SELECTED_FILE);
|
||||||
if (tileSource.setMapFile(file)) {
|
if (mTileSource.setMapFile(file)) {
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
mTileLayer = mMap.setBaseMap(mTileSource);
|
||||||
loadTheme(null);
|
loadTheme(null);
|
||||||
|
|
||||||
mMap.layers().add(new BuildingLayer(mMap, l));
|
mMap.layers().add(new BuildingLayer(mMap, mTileLayer));
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
mMap.layers().add(new LabelLayer(mMap, mTileLayer));
|
||||||
|
|
||||||
mMapScaleBar = new DefaultMapScaleBar(mMap);
|
mMapScaleBar = new DefaultMapScaleBar(mMap);
|
||||||
mMapScaleBar.setScaleBarMode(DefaultMapScaleBar.ScaleBarMode.BOTH);
|
mMapScaleBar.setScaleBarMode(DefaultMapScaleBar.ScaleBarMode.BOTH);
|
||||||
@@ -156,13 +188,41 @@ public class MapsforgeMapActivity extends MapActivity {
|
|||||||
renderer.setOffset(5 * getResources().getDisplayMetrics().density, 0);
|
renderer.setOffset(5 * getResources().getDisplayMetrics().density, 0);
|
||||||
mMap.layers().add(mapScaleBarLayer);
|
mMap.layers().add(mapScaleBarLayer);
|
||||||
|
|
||||||
MapInfo info = tileSource.getMapInfo();
|
MapInfo info = mTileSource.getMapInfo();
|
||||||
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();
|
||||||
}
|
}
|
||||||
|
} else if (requestCode == SELECT_THEME_FILE) {
|
||||||
|
if (resultCode != RESULT_OK || intent == null || intent.getStringExtra(FilePicker.SELECTED_FILE) == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String file = intent.getStringExtra(FilePicker.SELECTED_FILE);
|
||||||
|
ExternalRenderTheme externalRenderTheme = new ExternalRenderTheme(file);
|
||||||
|
|
||||||
|
// Use tessellation with sea and land for Mapsforge themes
|
||||||
|
if (ThemeUtils.isMapsforgeTheme(externalRenderTheme)) {
|
||||||
|
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) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
mMap.setTheme(externalRenderTheme);
|
||||||
|
mMenu.findItem(R.id.theme_external).setChecked(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* 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.test;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import org.oscim.utils.Parameters;
|
||||||
|
|
||||||
|
public class MapsforgePolyLabelActivity extends MapsforgeMapActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
Parameters.POLY_LABEL = true;
|
||||||
|
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-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
|
||||||
@@ -58,7 +58,7 @@ public class MapsforgeStyleActivity extends MapsforgeMapActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void loadTheme(final String styleId) {
|
protected void loadTheme(final String styleId) {
|
||||||
mMap.setTheme(new AssetsRenderTheme(this, "", "vtm/stylemenu.xml", new XmlRenderThemeMenuCallback() {
|
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
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.oscim.backend.canvas.Bitmap;
|
import org.oscim.backend.canvas.Bitmap;
|
||||||
@@ -35,6 +34,8 @@ import org.oscim.layers.tile.vector.VectorTileLayer;
|
|||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -54,26 +55,26 @@ public class MarkerOverlayActivity extends SimpleMapActivity
|
|||||||
// Map events receiver
|
// Map events receiver
|
||||||
mMap.layers().add(new MapEventsReceiver(mMap));
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
|
||||||
VectorTileLayer l = mMap.setBaseMap(new OSciMap4TileSource());
|
TileSource tileSource = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
.build();
|
||||||
|
VectorTileLayer l = mMap.setBaseMap(tileSource);
|
||||||
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.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|
||||||
/* directly load bitmap from resources */
|
Bitmap bitmapPoi = drawableToBitmap(getResources().getDrawable(R.drawable.marker_poi));
|
||||||
Bitmap bitmap = drawableToBitmap(getResources(), R.drawable.marker_poi);
|
|
||||||
|
|
||||||
MarkerSymbol symbol;
|
MarkerSymbol symbol;
|
||||||
if (BILLBOARDS)
|
if (BILLBOARDS)
|
||||||
symbol = new MarkerSymbol(bitmap, HotspotPlace.BOTTOM_CENTER);
|
symbol = new MarkerSymbol(bitmapPoi, HotspotPlace.BOTTOM_CENTER);
|
||||||
else
|
else
|
||||||
symbol = new MarkerSymbol(bitmap, HotspotPlace.CENTER, false);
|
symbol = new MarkerSymbol(bitmapPoi, HotspotPlace.CENTER, false);
|
||||||
|
|
||||||
/* another option: use some bitmap drawable */
|
Bitmap bitmapFocus = drawableToBitmap(getResources().getDrawable(R.drawable.marker_focus));
|
||||||
Drawable d = getResources().getDrawable(R.drawable.marker_focus);
|
|
||||||
if (BILLBOARDS)
|
if (BILLBOARDS)
|
||||||
mFocusMarker = new MarkerSymbol(drawableToBitmap(d), HotspotPlace.BOTTOM_CENTER);
|
mFocusMarker = new MarkerSymbol(bitmapFocus, HotspotPlace.BOTTOM_CENTER);
|
||||||
else
|
else
|
||||||
mFocusMarker = new MarkerSymbol(drawableToBitmap(d), 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<MarkerItem>(), symbol, this);
|
||||||
mMap.layers().add(mMarkerLayer);
|
mMap.layers().add(mMarkerLayer);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016 Marvin W
|
* Copyright 2016 Marvin W
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-2017 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).
|
||||||
*
|
*
|
||||||
@@ -22,12 +22,13 @@ import android.os.Bundle;
|
|||||||
|
|
||||||
import org.oscim.android.MapPreferences;
|
import org.oscim.android.MapPreferences;
|
||||||
import org.oscim.android.MapView;
|
import org.oscim.android.MapView;
|
||||||
import org.oscim.core.Tile;
|
|
||||||
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;
|
||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.tiling.source.OkHttpEngine;
|
||||||
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
public class MultiMapActivity extends Activity {
|
public class MultiMapActivity extends Activity {
|
||||||
@@ -36,7 +37,6 @@ public class MultiMapActivity extends Activity {
|
|||||||
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
Tile.SIZE = Tile.calculateTileSize(getResources().getDisplayMetrics().scaledDensity);
|
|
||||||
setContentView(R.layout.activity_map_multi);
|
setContentView(R.layout.activity_map_multi);
|
||||||
|
|
||||||
setTitle(getClass().getSimpleName());
|
setTitle(getClass().getSimpleName());
|
||||||
@@ -45,7 +45,10 @@ public class MultiMapActivity extends Activity {
|
|||||||
mMapView1 = (MapView) findViewById(R.id.mapView1);
|
mMapView1 = (MapView) findViewById(R.id.mapView1);
|
||||||
Map map1 = mMapView1.map();
|
Map map1 = mMapView1.map();
|
||||||
mPrefs1 = new MapPreferences(MultiMapActivity.class.getName() + "1", this);
|
mPrefs1 = new MapPreferences(MultiMapActivity.class.getName() + "1", this);
|
||||||
VectorTileLayer baseLayer1 = map1.setBaseMap(new OSciMap4TileSource());
|
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 BuildingLayer(map1, baseLayer1));
|
||||||
map1.layers().add(new LabelLayer(map1, baseLayer1));
|
map1.layers().add(new LabelLayer(map1, baseLayer1));
|
||||||
map1.setTheme(VtmThemes.DEFAULT);
|
map1.setTheme(VtmThemes.DEFAULT);
|
||||||
@@ -54,7 +57,10 @@ public class MultiMapActivity extends Activity {
|
|||||||
mMapView2 = (MapView) findViewById(R.id.mapView2);
|
mMapView2 = (MapView) findViewById(R.id.mapView2);
|
||||||
Map map2 = mMapView2.map();
|
Map map2 = mMapView2.map();
|
||||||
mPrefs2 = new MapPreferences(MultiMapActivity.class.getName() + "2", this);
|
mPrefs2 = new MapPreferences(MultiMapActivity.class.getName() + "2", this);
|
||||||
VectorTileLayer baseLayer2 = map2.setBaseMap(new OSciMap4TileSource());
|
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 BuildingLayer(map2, baseLayer2));
|
||||||
map2.layers().add(new LabelLayer(map2, baseLayer2));
|
map2.layers().add(new LabelLayer(map2, baseLayer2));
|
||||||
map2.setTheme(VtmThemes.DEFAULT);
|
map2.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-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
|
||||||
@@ -14,13 +14,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import org.oscim.map.Map;
|
import org.oscim.utils.Parameters;
|
||||||
|
|
||||||
public class NewGesturesActivity extends MarkerOverlayActivity {
|
public class NewGesturesActivity extends MarkerOverlayActivity {
|
||||||
|
|
||||||
public NewGesturesActivity() {
|
public NewGesturesActivity() {
|
||||||
super();
|
super();
|
||||||
Map.NEW_GESTURES = true;
|
Parameters.MAP_EVENT_LAYER2 = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -28,6 +28,6 @@ public class NewGesturesActivity extends MarkerOverlayActivity {
|
|||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
|
||||||
// Revert gestures for other activities
|
// Revert gestures for other activities
|
||||||
Map.NEW_GESTURES = false;
|
Parameters.MAP_EVENT_LAYER2 = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-2017 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,13 +20,14 @@ import android.os.Bundle;
|
|||||||
|
|
||||||
import org.oscim.android.cache.TileCache;
|
import org.oscim.android.cache.TileCache;
|
||||||
import org.oscim.layers.tile.TileLayer;
|
import org.oscim.layers.tile.TileLayer;
|
||||||
import org.oscim.layers.tile.buildings.S3DBLayer;
|
import org.oscim.layers.tile.buildings.S3DBTileLayer;
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||||
import org.oscim.theme.VtmThemes;
|
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.oscimap4.OSciMap4TileSource;
|
import org.oscim.tiling.source.oscimap4.OSciMap4TileSource;
|
||||||
|
|
||||||
public class S3DBMapActivity extends BaseMapActivity {
|
public class OSciMapS3DBMapActivity extends BaseMapActivity {
|
||||||
|
|
||||||
TileCache mS3dbCache;
|
TileCache mS3dbCache;
|
||||||
|
|
||||||
@@ -37,6 +38,7 @@ public class S3DBMapActivity extends BaseMapActivity {
|
|||||||
mMap.setTheme(VtmThemes.DEFAULT);
|
mMap.setTheme(VtmThemes.DEFAULT);
|
||||||
|
|
||||||
TileSource ts = OSciMap4TileSource.builder()
|
TileSource ts = OSciMap4TileSource.builder()
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
.url("http://opensciencemap.org/tiles/s3db")
|
.url("http://opensciencemap.org/tiles/s3db")
|
||||||
.zoomMin(16)
|
.zoomMin(16)
|
||||||
.zoomMax(16)
|
.zoomMax(16)
|
||||||
@@ -47,7 +49,7 @@ public class S3DBMapActivity extends BaseMapActivity {
|
|||||||
mS3dbCache.setCacheSize(512 * (1 << 10));
|
mS3dbCache.setCacheSize(512 * (1 << 10));
|
||||||
ts.setCache(mS3dbCache);
|
ts.setCache(mS3dbCache);
|
||||||
}
|
}
|
||||||
TileLayer tl = new S3DBLayer(mMap, ts, true, false);
|
TileLayer tl = new S3DBTileLayer(mMap, ts, true, false);
|
||||||
mMap.layers().add(tl);
|
mMap.layers().add(tl);
|
||||||
mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
|
mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* 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.test;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import org.oscim.android.cache.TileCache;
|
||||||
|
import org.oscim.layers.TileGridLayer;
|
||||||
|
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.geojson.OpenMapTilesGeojsonTileSource;
|
||||||
|
|
||||||
|
public class OpenMapTilesGeojsonMapActivity extends MapActivity {
|
||||||
|
|
||||||
|
private static final boolean USE_CACHE = false;
|
||||||
|
|
||||||
|
private TileCache mCache;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
UrlTileSource tileSource = OpenMapTilesGeojsonTileSource.builder()
|
||||||
|
.apiKey("xxxxxxx") // Put a proper API key
|
||||||
|
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||||
|
//.locale("en")
|
||||||
|
.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);
|
||||||
|
mMap.setTheme(VtmThemes.OPENMAPTILES);
|
||||||
|
|
||||||
|
mMap.layers().add(new BuildingLayer(mMap, l));
|
||||||
|
mMap.layers().add(new LabelLayer(mMap, l));
|
||||||
|
|
||||||
|
mMap.layers().add(new TileGridLayer(mMap, getResources().getDisplayMetrics().density));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
|
||||||
|
if (mCache != null)
|
||||||
|
mCache.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2014 Hannes Janetzek
|
|
||||||
* 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.layers.tile.buildings.BuildingLayer;
|
|
||||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
|
||||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
|
||||||
import org.oscim.theme.IRenderTheme;
|
|
||||||
import org.oscim.theme.ThemeLoader;
|
|
||||||
import org.oscim.theme.VtmThemes;
|
|
||||||
import org.oscim.tiling.source.geojson.OsmBuildingJsonTileSource;
|
|
||||||
import org.oscim.tiling.source.geojson.OsmLanduseJsonTileSource;
|
|
||||||
import org.oscim.tiling.source.geojson.OsmRoadLabelJsonTileSource;
|
|
||||||
import org.oscim.tiling.source.geojson.OsmRoadLineJsonTileSource;
|
|
||||||
import org.oscim.tiling.source.geojson.OsmWaterJsonTileSource;
|
|
||||||
|
|
||||||
public class OsmJsonMapActivity extends MapActivity {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
IRenderTheme theme = ThemeLoader.load(VtmThemes.DEFAULT);
|
|
||||||
|
|
||||||
mMap.setBaseMap(new VectorTileLayer(mMap, new OsmLanduseJsonTileSource()));
|
|
||||||
mMap.setTheme(theme);
|
|
||||||
|
|
||||||
VectorTileLayer l = new VectorTileLayer(mMap, new OsmWaterJsonTileSource());
|
|
||||||
l.setRenderTheme(theme);
|
|
||||||
l.tileRenderer().setOverdrawColor(0);
|
|
||||||
mMap.layers().add(l);
|
|
||||||
|
|
||||||
l = new VectorTileLayer(mMap, new OsmRoadLineJsonTileSource());
|
|
||||||
l.setRenderTheme(theme);
|
|
||||||
l.tileRenderer().setOverdrawColor(0);
|
|
||||||
mMap.layers().add(l);
|
|
||||||
|
|
||||||
l = new VectorTileLayer(mMap, new OsmBuildingJsonTileSource());
|
|
||||||
l.setRenderTheme(theme);
|
|
||||||
l.tileRenderer().setOverdrawColor(0);
|
|
||||||
mMap.layers().add(l);
|
|
||||||
mMap.layers().add(new BuildingLayer(mMap, l));
|
|
||||||
|
|
||||||
l = new VectorTileLayer(mMap, new OsmRoadLabelJsonTileSource());
|
|
||||||
l.setRenderTheme(theme);
|
|
||||||
l.tileRenderer().setOverdrawColor(0);
|
|
||||||
mMap.layers().add(l);
|
|
||||||
mMap.layers().add(new LabelLayer(mMap, l));
|
|
||||||
|
|
||||||
mMap.setMapPosition(53.08, 8.83, Math.pow(2, 16));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -16,13 +16,13 @@ package org.oscim.android.test;
|
|||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import org.oscim.theme.ThemeLoader;
|
import org.oscim.utils.Parameters;
|
||||||
|
|
||||||
public class POTTextureActivity extends SimpleMapActivity {
|
public class POTTextureActivity extends SimpleMapActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
ThemeLoader.POT_TEXTURES = true;
|
Parameters.POT_TEXTURES = true;
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,14 @@
|
|||||||
package org.oscim.android.test;
|
package org.oscim.android.test;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
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;
|
||||||
import org.oscim.event.Event;
|
import org.oscim.event.Event;
|
||||||
|
import org.oscim.event.Gesture;
|
||||||
|
import org.oscim.event.MotionEvent;
|
||||||
import org.oscim.layers.vector.PathLayer;
|
import org.oscim.layers.vector.PathLayer;
|
||||||
import org.oscim.map.Map.UpdateListener;
|
import org.oscim.map.Map.UpdateListener;
|
||||||
|
|
||||||
@@ -44,7 +48,18 @@ public class PathOverlayActivity extends SimpleMapActivity {
|
|||||||
|
|
||||||
for (double lat = -90; lat <= 90; lat += 5) {
|
for (double lat = -90; lat <= 90; lat += 5) {
|
||||||
int c = Color.fade(Color.rainbow((float) (lat + 90) / 180), 0.5f);
|
int c = Color.fade(Color.rainbow((float) (lat + 90) / 180), 0.5f);
|
||||||
PathLayer pathLayer = new PathLayer(mMap, c, 6);
|
PathLayer pathLayer = new PathLayer(mMap, c, 6 * CanvasAdapter.getScale()) {
|
||||||
|
@Override
|
||||||
|
public boolean onGesture(Gesture g, MotionEvent e) {
|
||||||
|
if (g instanceof Gesture.Tap) {
|
||||||
|
if (contains(e.getX(), e.getY())) {
|
||||||
|
Toast.makeText(PathOverlayActivity.this, "PathLayer tap\n" + mMap.viewport().fromScreenPoint(e.getX(), e.getY()), Toast.LENGTH_SHORT).show();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
mMap.layers().add(pathLayer);
|
mMap.layers().add(pathLayer);
|
||||||
mPathLayers.add(pathLayer);
|
mPathLayers.add(pathLayer);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,193 @@
|
|||||||
|
/*
|
||||||
|
* 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.test;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import org.mapsforge.poi.android.storage.AndroidPoiPersistenceManagerFactory;
|
||||||
|
import org.mapsforge.poi.storage.ExactMatchPoiCategoryFilter;
|
||||||
|
import org.mapsforge.poi.storage.PoiCategoryFilter;
|
||||||
|
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.FilterByFileExtension;
|
||||||
|
import org.oscim.backend.canvas.Bitmap;
|
||||||
|
import org.oscim.core.BoundingBox;
|
||||||
|
import org.oscim.core.GeoPoint;
|
||||||
|
import org.oscim.event.Gesture;
|
||||||
|
import org.oscim.event.GestureListener;
|
||||||
|
import org.oscim.event.MotionEvent;
|
||||||
|
import org.oscim.layers.Layer;
|
||||||
|
import org.oscim.layers.marker.ItemizedLayer;
|
||||||
|
import org.oscim.layers.marker.MarkerItem;
|
||||||
|
import org.oscim.layers.marker.MarkerSymbol;
|
||||||
|
import org.oscim.map.Map;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static org.oscim.android.canvas.AndroidGraphics.drawableToBitmap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POI search.<br/>
|
||||||
|
* Long press on map to search inside visible bounding box.<br/>
|
||||||
|
* Tap on POIs to show their name (in default locale).
|
||||||
|
*/
|
||||||
|
public class PoiSearchActivity extends MapsforgeMapActivity implements ItemizedLayer.OnItemGestureListener<MarkerItem> {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(PoiSearchActivity.class);
|
||||||
|
|
||||||
|
private static String POI_FILE;
|
||||||
|
private static final String POI_CATEGORY = "Restaurants";
|
||||||
|
private static final int SELECT_POI_FILE = MapsforgeMapActivity.SELECT_THEME_FILE + 1;
|
||||||
|
|
||||||
|
private ItemizedLayer<MarkerItem> mMarkerLayer;
|
||||||
|
|
||||||
|
public static class PoiFilePicker extends FilePicker {
|
||||||
|
public PoiFilePicker() {
|
||||||
|
setFileDisplayFilter(new FilterByFileExtension(".poi"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
// Map events receiver
|
||||||
|
mMap.layers().add(new PoiSearchActivity.MapEventsReceiver(mMap));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, intent);
|
||||||
|
|
||||||
|
if (requestCode == SELECT_MAP_FILE) {
|
||||||
|
if (mTileSource != null)
|
||||||
|
startActivityForResult(new Intent(this, PoiFilePicker.class),
|
||||||
|
SELECT_POI_FILE);
|
||||||
|
else
|
||||||
|
finish();
|
||||||
|
} else if (requestCode == SELECT_POI_FILE) {
|
||||||
|
if (resultCode != RESULT_OK || intent == null || intent.getStringExtra(FilePicker.SELECTED_FILE) == null) {
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
POI_FILE = intent.getStringExtra(FilePicker.SELECTED_FILE);
|
||||||
|
|
||||||
|
Bitmap bitmap = drawableToBitmap(getResources().getDrawable(R.drawable.marker_green));
|
||||||
|
MarkerSymbol symbol = new MarkerSymbol(bitmap, MarkerSymbol.HotspotPlace.BOTTOM_CENTER);
|
||||||
|
mMarkerLayer = new ItemizedLayer<>(mMap, new ArrayList<MarkerItem>(), symbol, this);
|
||||||
|
mMap.layers().add(mMarkerLayer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onItemSingleTapUp(int index, MarkerItem item) {
|
||||||
|
Toast.makeText(this, item.getTitle(), Toast.LENGTH_SHORT).show();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onItemLongPress(int index, MarkerItem item) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private class MapEventsReceiver extends Layer implements GestureListener {
|
||||||
|
|
||||||
|
MapEventsReceiver(Map map) {
|
||||||
|
super(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onGesture(Gesture g, MotionEvent e) {
|
||||||
|
if (g instanceof Gesture.LongPress) {
|
||||||
|
// Clear overlays
|
||||||
|
mMarkerLayer.removeAllItems();
|
||||||
|
mMap.render();
|
||||||
|
// POI search
|
||||||
|
new PoiSearchTask(PoiSearchActivity.this, POI_CATEGORY).execute(mMap.getBoundingBox(0));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class PoiSearchTask extends AsyncTask<BoundingBox, Void, Collection<PointOfInterest>> {
|
||||||
|
private final WeakReference<PoiSearchActivity> weakActivity;
|
||||||
|
private final String category;
|
||||||
|
|
||||||
|
private PoiSearchTask(PoiSearchActivity activity, String category) {
|
||||||
|
this.weakActivity = new WeakReference<>(activity);
|
||||||
|
this.category = category;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Collection<PointOfInterest> doInBackground(BoundingBox... params) {
|
||||||
|
// Search POI
|
||||||
|
PoiPersistenceManager persistenceManager = null;
|
||||||
|
try {
|
||||||
|
persistenceManager = AndroidPoiPersistenceManagerFactory.getPoiPersistenceManager(POI_FILE);
|
||||||
|
PoiCategoryManager categoryManager = persistenceManager.getCategoryManager();
|
||||||
|
PoiCategoryFilter categoryFilter = new ExactMatchPoiCategoryFilter();
|
||||||
|
categoryFilter.addCategory(categoryManager.getPoiCategoryByTitle(category));
|
||||||
|
org.mapsforge.core.model.BoundingBox bb = new org.mapsforge.core.model.BoundingBox(
|
||||||
|
params[0].getMinLatitude(), params[0].getMinLongitude(),
|
||||||
|
params[0].getMaxLatitude(), params[0].getMaxLongitude());
|
||||||
|
return persistenceManager.findInRect(bb, categoryFilter, null, Integer.MAX_VALUE);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
log.error(t.getMessage(), t);
|
||||||
|
} finally {
|
||||||
|
if (persistenceManager != null) {
|
||||||
|
persistenceManager.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPostExecute(Collection<PointOfInterest> pointOfInterests) {
|
||||||
|
PoiSearchActivity activity = weakActivity.get();
|
||||||
|
if (activity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Toast.makeText(activity, category + ": " + (pointOfInterests != null ? pointOfInterests.size() : 0), Toast.LENGTH_SHORT).show();
|
||||||
|
if (pointOfInterests == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Overlay POI
|
||||||
|
List<MarkerItem> pts = new ArrayList<>();
|
||||||
|
for (PointOfInterest pointOfInterest : pointOfInterests)
|
||||||
|
pts.add(new MarkerItem(pointOfInterest.getName(), "", new GeoPoint(pointOfInterest.getLatitude(), pointOfInterest.getLongitude())));
|
||||||
|
mMarkerLayer.addItems(pts);
|
||||||
|
mMap.render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
/*
|
||||||
|
* 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.test;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.Menu;
|
||||||
|
|
||||||
|
import org.oscim.backend.CanvasAdapter;
|
||||||
|
import org.oscim.core.GeoPoint;
|
||||||
|
import org.oscim.core.GeometryBuffer;
|
||||||
|
import org.oscim.core.MercatorProjection;
|
||||||
|
import org.oscim.core.Point;
|
||||||
|
import org.oscim.core.Tag;
|
||||||
|
import org.oscim.core.Tile;
|
||||||
|
import org.oscim.event.Gesture;
|
||||||
|
import org.oscim.event.GestureListener;
|
||||||
|
import org.oscim.event.MotionEvent;
|
||||||
|
import org.oscim.layers.Layer;
|
||||||
|
import org.oscim.layers.TileGridLayer;
|
||||||
|
import org.oscim.map.Map;
|
||||||
|
import org.oscim.tiling.source.mapfile.MapDatabase;
|
||||||
|
import org.oscim.tiling.source.mapfile.MapReadResult;
|
||||||
|
import org.oscim.tiling.source.mapfile.PointOfInterest;
|
||||||
|
import org.oscim.tiling.source.mapfile.Way;
|
||||||
|
import org.oscim.utils.GeoPointUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse Geocoding with long press.
|
||||||
|
* <p/>
|
||||||
|
* - POI in specified radius.<br/>
|
||||||
|
* - Ways containing touch point.
|
||||||
|
*/
|
||||||
|
public class ReverseGeocodeActivity extends MapsforgeMapActivity {
|
||||||
|
|
||||||
|
private static final int TOUCH_RADIUS = 32 / 2;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
// Map events receiver
|
||||||
|
mMap.layers().add(new MapEventsReceiver(mMap));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, intent);
|
||||||
|
|
||||||
|
if (requestCode == SELECT_MAP_FILE) {
|
||||||
|
// For debug
|
||||||
|
TileGridLayer gridLayer = new TileGridLayer(mMap, getResources().getDisplayMetrics().density);
|
||||||
|
mMap.layers().add(gridLayer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class MapEventsReceiver extends Layer implements GestureListener {
|
||||||
|
|
||||||
|
MapEventsReceiver(Map map) {
|
||||||
|
super(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onGesture(Gesture g, MotionEvent e) {
|
||||||
|
if (g instanceof Gesture.LongPress) {
|
||||||
|
GeoPoint p = mMap.viewport().fromScreenPoint(e.getX(), e.getY());
|
||||||
|
|
||||||
|
// Read all labeled POI and ways for the area covered by the tiles under touch
|
||||||
|
float touchRadius = TOUCH_RADIUS * CanvasAdapter.getScale();
|
||||||
|
long mapSize = MercatorProjection.getMapSize((byte) mMap.getMapPosition().getZoomLevel());
|
||||||
|
double pixelX = MercatorProjection.longitudeToPixelX(p.getLongitude(), mapSize);
|
||||||
|
double pixelY = MercatorProjection.latitudeToPixelY(p.getLatitude(), mapSize);
|
||||||
|
int tileXMin = MercatorProjection.pixelXToTileX(pixelX - touchRadius, (byte) mMap.getMapPosition().getZoomLevel());
|
||||||
|
int tileXMax = MercatorProjection.pixelXToTileX(pixelX + touchRadius, (byte) mMap.getMapPosition().getZoomLevel());
|
||||||
|
int tileYMin = 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 lowerRight = new Tile(tileXMax, tileYMax, (byte) mMap.getMapPosition().getZoomLevel());
|
||||||
|
MapReadResult mapReadResult = ((MapDatabase) mTileSource.getDataSource()).readLabels(upperLeft, lowerRight);
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
// Filter POI
|
||||||
|
sb.append("*** POI ***");
|
||||||
|
for (PointOfInterest pointOfInterest : mapReadResult.pointOfInterests) {
|
||||||
|
Point layerXY = new Point();
|
||||||
|
mMap.viewport().toScreenPoint(pointOfInterest.position, false, layerXY);
|
||||||
|
Point tapXY = new Point(e.getX(), e.getY());
|
||||||
|
if (layerXY.distance(tapXY) > touchRadius) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
sb.append("\n");
|
||||||
|
List<Tag> tags = pointOfInterest.tags;
|
||||||
|
for (Tag tag : tags) {
|
||||||
|
sb.append("\n").append(tag.key).append("=").append(tag.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter ways
|
||||||
|
sb.append("\n\n").append("*** WAYS ***");
|
||||||
|
for (Way way : mapReadResult.ways) {
|
||||||
|
if (way.geometryType != GeometryBuffer.GeometryType.POLY
|
||||||
|
|| !GeoPointUtils.contains(way.geoPoints[0], p)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
sb.append("\n");
|
||||||
|
List<Tag> tags = way.tags;
|
||||||
|
for (Tag tag : tags) {
|
||||||
|
sb.append("\n").append(tag.key).append("=").append(tag.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(ReverseGeocodeActivity.this);
|
||||||
|
builder.setIcon(android.R.drawable.ic_menu_search);
|
||||||
|
builder.setTitle(R.string.dialog_reverse_geocoding_title);
|
||||||
|
builder.setMessage(sb);
|
||||||
|
builder.setPositiveButton(R.string.ok, null);
|
||||||
|
builder.show();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,19 +22,57 @@ 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.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple start screen for the sample activities.
|
* Start screen for the sample activities.
|
||||||
*/
|
*/
|
||||||
public class Samples extends Activity {
|
public class Samples extends Activity {
|
||||||
|
|
||||||
|
private Button createButton(Class<?> clazz) {
|
||||||
|
return this.createButton(clazz, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Button createButton(final Class<?> clazz, String text, View.OnClickListener customListener) {
|
||||||
|
Button button = new Button(this);
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
|
||||||
|
button.setAllCaps(false);
|
||||||
|
if (text == null) {
|
||||||
|
button.setText(clazz.getSimpleName());
|
||||||
|
} else {
|
||||||
|
button.setText(text);
|
||||||
|
}
|
||||||
|
if (customListener == null) {
|
||||||
|
button.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
startActivity(new Intent(Samples.this, clazz));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
button.setOnClickListener(customListener);
|
||||||
|
}
|
||||||
|
return button;
|
||||||
|
}
|
||||||
|
|
||||||
|
private TextView createLabel(String text) {
|
||||||
|
TextView textView = new TextView(this);
|
||||||
|
textView.setGravity(Gravity.CENTER);
|
||||||
|
if (text == null) {
|
||||||
|
textView.setText("----------");
|
||||||
|
} else {
|
||||||
|
textView.setText(text);
|
||||||
|
}
|
||||||
|
return textView;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -45,9 +83,21 @@ public class Samples extends Activity {
|
|||||||
linearLayout.addView(createButton(MapsforgeMapActivity.class));
|
linearLayout.addView(createButton(MapsforgeMapActivity.class));
|
||||||
linearLayout.addView(createButton(MapzenMvtMapActivity.class));
|
linearLayout.addView(createButton(MapzenMvtMapActivity.class));
|
||||||
linearLayout.addView(createButton(MapzenGeojsonMapActivity.class));
|
linearLayout.addView(createButton(MapzenGeojsonMapActivity.class));
|
||||||
|
linearLayout.addView(createButton(OpenMapTilesGeojsonMapActivity.class));
|
||||||
|
linearLayout.addView(createButton(GdxMapActivity.class));
|
||||||
|
|
||||||
|
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(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(AtlasThemeActivity.class));
|
linearLayout.addView(createButton(AtlasThemeActivity.class));
|
||||||
linearLayout.addView(createButton(POTTextureActivity.class));
|
linearLayout.addView(createButton(POTTextureActivity.class));
|
||||||
|
|
||||||
@@ -68,46 +118,14 @@ public class Samples extends Activity {
|
|||||||
linearLayout.addView(createLabel("User Interaction"));
|
linearLayout.addView(createLabel("User Interaction"));
|
||||||
linearLayout.addView(createButton(NewGesturesActivity.class));
|
linearLayout.addView(createButton(NewGesturesActivity.class));
|
||||||
linearLayout.addView(createButton(LayerGroupActivity.class));
|
linearLayout.addView(createButton(LayerGroupActivity.class));
|
||||||
linearLayout.addView(createButton(MapFragmentActivity.class));
|
|
||||||
|
|
||||||
linearLayout.addView(createLabel("Dual Map Views"));
|
linearLayout.addView(createLabel("Dual Map Views"));
|
||||||
linearLayout.addView(createButton(MultiMapActivity.class));
|
linearLayout.addView(createButton(MultiMapActivity.class));
|
||||||
|
|
||||||
linearLayout.addView(createLabel("Experiments"));
|
linearLayout.addView(createLabel("Experiments"));
|
||||||
linearLayout.addView(createButton(MapPositionActivity.class));
|
linearLayout.addView(createButton(ReverseGeocodeActivity.class));
|
||||||
linearLayout.addView(createButton(S3DBMapActivity.class));
|
linearLayout.addView(createButton(OSciMapS3DBMapActivity.class));
|
||||||
linearLayout.addView(createButton(ThemeStylerActivity.class));
|
linearLayout.addView(createButton(ThemeStylerActivity.class));
|
||||||
//linearLayout.addView(createButton(JeoIndoorMapActivity.class));
|
linearLayout.addView(createButton(JeoIndoorMapActivity.class));
|
||||||
}
|
|
||||||
|
|
||||||
private Button createButton(final Class<?> clazz) {
|
|
||||||
return this.createButton(clazz, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Button createButton(final Class<?> clazz, String text) {
|
|
||||||
Button button = new Button(this);
|
|
||||||
if (text == null) {
|
|
||||||
button.setText(clazz.getSimpleName());
|
|
||||||
} else {
|
|
||||||
button.setText(text);
|
|
||||||
}
|
|
||||||
button.setOnClickListener(new OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
startActivity(new Intent(Samples.this, clazz));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return button;
|
|
||||||
}
|
|
||||||
|
|
||||||
private TextView createLabel(String text) {
|
|
||||||
TextView textView = new TextView(this);
|
|
||||||
textView.setGravity(Gravity.CENTER);
|
|
||||||
if (text == null) {
|
|
||||||
textView.setText("---------------");
|
|
||||||
} else {
|
|
||||||
textView.setText(text);
|
|
||||||
}
|
|
||||||
return textView;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +1,2 @@
|
|||||||
<?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 package="org.oscim.gdx" />
|
||||||
package="org.oscim.gdx"
|
|
||||||
android:installLocation="auto"
|
|
||||||
android:versionCode="1"
|
|
||||||
android:versionName="1.0">
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
||||||
|
|
||||||
<uses-sdk
|
|
||||||
android:minSdkVersion="10"
|
|
||||||
android:targetSdkVersion="22" />
|
|
||||||
|
|
||||||
<application
|
|
||||||
android:allowBackup="true"
|
|
||||||
android:icon="@drawable/ic_launcher"
|
|
||||||
android:label="@string/app_name">
|
|
||||||
<activity
|
|
||||||
android:name=".MainActivity"
|
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
</application>
|
|
||||||
|
|
||||||
</manifest>
|
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.library'
|
||||||
apply plugin: 'com.github.dcendents.android-maven'
|
apply plugin: 'com.github.dcendents.android-maven'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':vtm-android')
|
api project(':vtm')
|
||||||
compile project(':vtm-gdx')
|
|
||||||
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
|
|
||||||
compile 'com.noveogroup.android:android-logger:1.3.6'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
@@ -21,6 +18,7 @@ android {
|
|||||||
versionCode versionCode()
|
versionCode versionCode()
|
||||||
versionName versionName()
|
versionName versionName()
|
||||||
minSdkVersion androidMinSdk()
|
minSdkVersion androidMinSdk()
|
||||||
|
targetSdkVersion androidTargetSdk()
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -28,14 +26,6 @@ android {
|
|||||||
manifest.srcFile 'AndroidManifest.xml'
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
java.srcDirs = ['src']
|
java.srcDirs = ['src']
|
||||||
resources.srcDirs = ['src']
|
resources.srcDirs = ['src']
|
||||||
aidl.srcDirs = ['src', 'assets']
|
|
||||||
renderscript.srcDirs = ['src', 'assets']
|
|
||||||
res.srcDirs = ['res']
|
|
||||||
assets.srcDirs = ['assets']
|
|
||||||
file('natives').eachDir() { dir ->
|
|
||||||
jniLibs.srcDirs += "${dir.path}/lib"
|
|
||||||
jniLibs.srcDirs += "${rootDir}/vtm-android/natives/${dir.name}/lib"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
debug.setRoot('build-types/debug')
|
debug.setRoot('build-types/debug')
|
||||||
release.setRoot('build-types/release')
|
release.setRoot('build-types/release')
|
||||||
@@ -44,52 +34,21 @@ android {
|
|||||||
lintOptions { abortOnError false }
|
lintOptions { abortOnError false }
|
||||||
}
|
}
|
||||||
|
|
||||||
android.applicationVariants.all { variant ->
|
android.libraryVariants.all { variant ->
|
||||||
def name = variant.buildType.name
|
def name = variant.buildType.name
|
||||||
if (name.equals("debug")) {
|
if (name == "debug")
|
||||||
print "Skipping debug jar"
|
return
|
||||||
return; // Skip debug builds.
|
|
||||||
}
|
|
||||||
|
|
||||||
def jar = project.tasks.create "jar${name.capitalize()}", Jar
|
def jar = project.tasks.create "jar${name.capitalize()}", Jar
|
||||||
jar.dependsOn variant.javaCompile
|
jar.dependsOn variant.javaCompiler
|
||||||
jar.from variant.javaCompile.destinationDir
|
jar.from variant.javaCompiler.destinationDir
|
||||||
jar.exclude 'android-logger.properties'
|
artifacts.add('archives', jar)
|
||||||
artifacts.add('archives', jar);
|
|
||||||
|
|
||||||
file('natives').eachDir() { dir ->
|
file('natives').eachDir() { dir ->
|
||||||
def nativesJar = project.tasks.create "nativesJar${name.capitalize()}-${dir.name}", Jar
|
def nativesJar = project.tasks.create "nativesJar${name.capitalize()}-${dir.name}", Jar
|
||||||
nativesJar.classifier = "natives-${dir.name}"
|
nativesJar.classifier = "natives-${dir.name}"
|
||||||
nativesJar.from(dir.path)
|
nativesJar.from(dir.path)
|
||||||
artifacts.add('archives', nativesJar);
|
artifacts.add('archives', nativesJar)
|
||||||
}
|
|
||||||
|
|
||||||
def fatJar = project.tasks.create "fatJar${name.capitalize()}", Jar
|
|
||||||
fatJar.classifier = 'jar-with-dependencies'
|
|
||||||
fatJar.dependsOn variant.javaCompile
|
|
||||||
fatJar.from variant.javaCompile.destinationDir
|
|
||||||
fatJar.from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
|
|
||||||
file('natives').eachDir() { dir ->
|
|
||||||
fatJar.from(dir.path)
|
|
||||||
fatJar.from("${rootProject.projectDir}/vtm-android/natives/${dir.name}")
|
|
||||||
}
|
|
||||||
fatJar.exclude 'android-logger.properties'
|
|
||||||
artifacts.add('archives', fatJar);
|
|
||||||
}
|
|
||||||
|
|
||||||
afterEvaluate {
|
|
||||||
configurations.archives.artifacts.removeAll { it.file =~ 'apk' }
|
|
||||||
}
|
|
||||||
|
|
||||||
task run(dependsOn: 'installDebug') {
|
|
||||||
doFirst {
|
|
||||||
println(">> adb run...")
|
|
||||||
String adb = System.getenv()['ANDROID_HOME'] + '/platform-tools/adb'
|
|
||||||
String cmd = "${adb} shell am start -n org.oscim.gdx/.MainActivity"
|
|
||||||
def proc = cmd.execute()
|
|
||||||
proc.in.eachLine { line -> println line }
|
|
||||||
proc.err.eachLine { line -> System.err.println('ERROR: ' + line) }
|
|
||||||
proc.waitFor()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 41 KiB |
@@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<string name="app_name">VTM GDX</string>
|
|
||||||
</resources>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
root=DEBUG:%logger
|
|
||||||
@@ -2,13 +2,13 @@ apply plugin: 'com.android.library'
|
|||||||
apply plugin: 'com.github.dcendents.android-maven'
|
apply plugin: 'com.github.dcendents.android-maven'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':vtm')
|
api project(':vtm')
|
||||||
compile 'com.caverock:androidsvg:1.2.2-beta-1'
|
api 'com.caverock:androidsvg:1.2.2-beta-1'
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion androidCompileSdk()
|
compileSdkVersion androidCompileSdk()
|
||||||
buildToolsVersion = "$androidBuildVersionTools"
|
buildToolsVersion "$androidBuildVersionTools"
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_7
|
sourceCompatibility JavaVersion.VERSION_1_7
|
||||||
@@ -19,6 +19,7 @@ android {
|
|||||||
versionCode versionCode()
|
versionCode versionCode()
|
||||||
versionName versionName()
|
versionName versionName()
|
||||||
minSdkVersion androidMinSdk()
|
minSdkVersion androidMinSdk()
|
||||||
|
targetSdkVersion androidTargetSdk()
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -26,8 +27,6 @@ android {
|
|||||||
manifest.srcFile 'AndroidManifest.xml'
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
java.srcDirs = ['src']
|
java.srcDirs = ['src']
|
||||||
resources.srcDirs = ['src']
|
resources.srcDirs = ['src']
|
||||||
res.srcDirs = ['res']
|
|
||||||
assets.srcDirs = ['assets']
|
|
||||||
}
|
}
|
||||||
debug.setRoot('build-types/debug')
|
debug.setRoot('build-types/debug')
|
||||||
release.setRoot('build-types/release')
|
release.setRoot('build-types/release')
|
||||||
@@ -38,32 +37,20 @@ android {
|
|||||||
|
|
||||||
android.libraryVariants.all { variant ->
|
android.libraryVariants.all { variant ->
|
||||||
def name = variant.buildType.name
|
def name = variant.buildType.name
|
||||||
if (name.equals("debug")) {
|
if (name == "debug")
|
||||||
print "Skipping debug jar"
|
return
|
||||||
return; // Skip debug builds.
|
|
||||||
}
|
|
||||||
|
|
||||||
def jar = project.tasks.create "jar${name.capitalize()}", Jar
|
def jar = project.tasks.create "jar${name.capitalize()}", Jar
|
||||||
jar.dependsOn variant.javaCompile
|
jar.dependsOn variant.javaCompiler
|
||||||
jar.from variant.javaCompile.destinationDir
|
jar.from variant.javaCompiler.destinationDir
|
||||||
artifacts.add('archives', jar);
|
artifacts.add('archives', jar)
|
||||||
|
|
||||||
file('natives').eachDir() { dir ->
|
file('natives').eachDir() { dir ->
|
||||||
def nativesJar = project.tasks.create "nativesJar${name.capitalize()}-${dir.name}", Jar
|
def nativesJar = project.tasks.create "nativesJar${name.capitalize()}-${dir.name}", Jar
|
||||||
nativesJar.classifier = "natives-${dir.name}"
|
nativesJar.classifier = "natives-${dir.name}"
|
||||||
nativesJar.from(dir.path)
|
nativesJar.from(dir.path)
|
||||||
artifacts.add('archives', nativesJar);
|
artifacts.add('archives', nativesJar)
|
||||||
}
|
}
|
||||||
|
|
||||||
def fatJar = project.tasks.create "fatJar${name.capitalize()}", Jar
|
|
||||||
fatJar.classifier = 'jar-with-dependencies'
|
|
||||||
fatJar.dependsOn variant.javaCompile
|
|
||||||
fatJar.from variant.javaCompile.destinationDir
|
|
||||||
fatJar.from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
|
|
||||||
file('natives').eachDir() { dir ->
|
|
||||||
fatJar.from(dir.path)
|
|
||||||
}
|
|
||||||
artifacts.add('archives', fatJar);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (project.hasProperty("SONATYPE_USERNAME")) {
|
if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ import org.oscim.android.input.AndroidMotionEvent;
|
|||||||
import org.oscim.android.input.GestureHandler;
|
import org.oscim.android.input.GestureHandler;
|
||||||
import org.oscim.backend.CanvasAdapter;
|
import org.oscim.backend.CanvasAdapter;
|
||||||
import org.oscim.backend.GLAdapter;
|
import org.oscim.backend.GLAdapter;
|
||||||
|
import org.oscim.core.Tile;
|
||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
|
import org.oscim.utils.Parameters;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -82,6 +84,8 @@ public class MapView extends GLSurfaceView {
|
|||||||
|
|
||||||
DisplayMetrics metrics = getResources().getDisplayMetrics();
|
DisplayMetrics metrics = getResources().getDisplayMetrics();
|
||||||
CanvasAdapter.dpi = (int) (metrics.scaledDensity * CanvasAdapter.DEFAULT_DPI);
|
CanvasAdapter.dpi = (int) (metrics.scaledDensity * CanvasAdapter.DEFAULT_DPI);
|
||||||
|
if (!Parameters.CUSTOM_TILE_SIZE)
|
||||||
|
Tile.SIZE = Tile.calculateTileSize();
|
||||||
|
|
||||||
/* Initialize the Map */
|
/* Initialize the Map */
|
||||||
mMap = new AndroidMap(this);
|
mMap = new AndroidMap(this);
|
||||||
@@ -100,7 +104,7 @@ public class MapView extends GLSurfaceView {
|
|||||||
mMap.clearMap();
|
mMap.clearMap();
|
||||||
mMap.updateMap(false);
|
mMap.updateMap(false);
|
||||||
|
|
||||||
if (!Map.NEW_GESTURES) {
|
if (!Parameters.MAP_EVENT_LAYER2) {
|
||||||
GestureHandler gestureHandler = new GestureHandler(mMap);
|
GestureHandler gestureHandler = new GestureHandler(mMap);
|
||||||
mGestureDetector = new GestureDetector(context, gestureHandler);
|
mGestureDetector = new GestureDetector(context, gestureHandler);
|
||||||
mGestureDetector.setOnDoubleTapListener(gestureHandler);
|
mGestureDetector.setOnDoubleTapListener(gestureHandler);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ package org.oscim.android.canvas;
|
|||||||
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.RectF;
|
||||||
|
|
||||||
import org.oscim.backend.canvas.Bitmap;
|
import org.oscim.backend.canvas.Bitmap;
|
||||||
import org.oscim.backend.canvas.Canvas;
|
import org.oscim.backend.canvas.Canvas;
|
||||||
@@ -87,6 +88,14 @@ public class AndroidCanvas implements Canvas {
|
|||||||
canvas.drawColor(color, color == Color.TRANSPARENT ? PorterDuff.Mode.CLEAR : PorterDuff.Mode.SRC_OVER);
|
canvas.drawColor(color, color == Color.TRANSPARENT ? PorterDuff.Mode.CLEAR : PorterDuff.Mode.SRC_OVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fillRectangle(float x, float y, float width, float height, int color) {
|
||||||
|
RectF rect = new RectF(x, y, x + width, y + height);
|
||||||
|
android.graphics.Paint paint = new android.graphics.Paint();
|
||||||
|
paint.setColor(color);
|
||||||
|
canvas.drawRect(rect, paint);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getHeight() {
|
public int getHeight() {
|
||||||
return canvas.getHeight();
|
return canvas.getHeight();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, 2011, 2012 mapsforge.org
|
* Copyright 2010, 2011, 2012 mapsforge.org
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-2017 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).
|
||||||
@@ -59,23 +59,13 @@ public final class AndroidGraphics extends CanvasAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Bitmap decodeSvgBitmapImpl(InputStream inputStream, int width, int height, int percent) {
|
public Bitmap decodeSvgBitmapImpl(InputStream inputStream, int width, int height, int percent) throws IOException {
|
||||||
try {
|
return new AndroidSvgBitmap(inputStream, width, height, percent);
|
||||||
return new AndroidSvgBitmap(inputStream, width, height, percent);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Bitmap loadBitmapAssetImpl(String relativePathPrefix, String src, int width, int height, int percent) {
|
public Bitmap loadBitmapAssetImpl(String relativePathPrefix, String src, int width, int height, int percent) throws IOException {
|
||||||
try {
|
return createBitmap(relativePathPrefix, src, width, height, percent);
|
||||||
return createBitmap(relativePathPrefix, src, width, height, percent);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -112,7 +102,7 @@ public final class AndroidGraphics extends CanvasAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Bitmap drawableToBitmap(Resources res, int resId) {
|
public static Bitmap drawableToBitmap(Resources res, int resId) {
|
||||||
return new AndroidBitmap(res.openRawResource(resId));
|
return drawableToBitmap(res.getDrawable(resId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, 2011, 2012 mapsforge.org
|
* Copyright 2010, 2011, 2012 mapsforge.org
|
||||||
* Copyright 2013-2014 Ludwig M Brinckmann
|
* Copyright 2013-2014 Ludwig M Brinckmann
|
||||||
* Copyright 2014-2016 devemux86
|
* Copyright 2014-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
|
||||||
@@ -78,7 +78,7 @@ public class AndroidSvgBitmap extends AndroidBitmap {
|
|||||||
|
|
||||||
private static android.graphics.Bitmap getResourceBitmapImpl(InputStream inputStream, int width, int height, int percent) throws IOException {
|
private static android.graphics.Bitmap getResourceBitmapImpl(InputStream inputStream, int width, int height, int percent) throws IOException {
|
||||||
synchronized (SVG.getVersion()) {
|
synchronized (SVG.getVersion()) {
|
||||||
return getResourceBitmap(inputStream, CanvasAdapter.dpi / CanvasAdapter.DEFAULT_DPI, DEFAULT_SIZE, width, height, percent);
|
return getResourceBitmap(inputStream, CanvasAdapter.getScale(), DEFAULT_SIZE, width, height, percent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010, 2011, 2012 mapsforge.org
|
* Copyright 2010, 2011, 2012 mapsforge.org
|
||||||
* Copyright 2016-2017 devemux86
|
* Copyright 2016-2017 devemux86
|
||||||
|
* Copyright 2017 Andrey Novikov
|
||||||
*
|
*
|
||||||
* 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,11 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.android.theme;
|
package org.oscim.android.theme;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.res.AssetManager;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import org.oscim.theme.IRenderTheme.ThemeException;
|
import org.oscim.theme.IRenderTheme.ThemeException;
|
||||||
import org.oscim.theme.ThemeFile;
|
import org.oscim.theme.ThemeFile;
|
||||||
|
import org.oscim.theme.ThemeUtils;
|
||||||
import org.oscim.theme.XmlRenderThemeMenuCallback;
|
import org.oscim.theme.XmlRenderThemeMenuCallback;
|
||||||
import org.oscim.utils.Utils;
|
import org.oscim.utils.Utils;
|
||||||
|
|
||||||
@@ -33,36 +35,33 @@ import java.io.InputStream;
|
|||||||
public class AssetsRenderTheme implements ThemeFile {
|
public class AssetsRenderTheme implements ThemeFile {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private final InputStream mInputStream;
|
private final AssetManager mAssetManager;
|
||||||
|
private final String mFileName;
|
||||||
private XmlRenderThemeMenuCallback mMenuCallback;
|
private XmlRenderThemeMenuCallback mMenuCallback;
|
||||||
private final String mRelativePathPrefix;
|
private final String mRelativePathPrefix;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param context the Android context.
|
* @param assetManager the Android asset manager.
|
||||||
* @param relativePathPrefix the prefix for all relative resource paths.
|
* @param relativePathPrefix the prefix for all relative resource paths.
|
||||||
* @param fileName the path to the XML render theme file.
|
* @param fileName the path to the XML render theme file.
|
||||||
* @throws ThemeException if an error occurs while reading the render theme XML.
|
* @throws ThemeException if an error occurs while reading the render theme XML.
|
||||||
*/
|
*/
|
||||||
public AssetsRenderTheme(Context context, String relativePathPrefix, String fileName) throws ThemeException {
|
public AssetsRenderTheme(AssetManager assetManager, String relativePathPrefix, String fileName) throws ThemeException {
|
||||||
this(context, relativePathPrefix, fileName, null);
|
this(assetManager, relativePathPrefix, fileName, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param context the Android context.
|
* @param assetManager the Android asset manager.
|
||||||
* @param relativePathPrefix the prefix for all relative resource paths.
|
* @param relativePathPrefix the prefix for all relative resource paths.
|
||||||
* @param fileName the path to the XML render theme file.
|
* @param fileName the path to the XML render theme file.
|
||||||
* @param menuCallback the interface callback to create a settings menu on the fly.
|
* @param menuCallback the interface callback to create a settings menu on the fly.
|
||||||
* @throws ThemeException if an error occurs while reading the render theme XML.
|
* @throws ThemeException if an error occurs while reading the render theme XML.
|
||||||
*/
|
*/
|
||||||
public AssetsRenderTheme(Context context, String relativePathPrefix, String fileName, XmlRenderThemeMenuCallback menuCallback) throws ThemeException {
|
public AssetsRenderTheme(AssetManager assetManager, String relativePathPrefix, String fileName, XmlRenderThemeMenuCallback menuCallback) throws ThemeException {
|
||||||
|
mAssetManager = assetManager;
|
||||||
mRelativePathPrefix = relativePathPrefix;
|
mRelativePathPrefix = relativePathPrefix;
|
||||||
|
mFileName = fileName;
|
||||||
mMenuCallback = menuCallback;
|
mMenuCallback = menuCallback;
|
||||||
|
|
||||||
try {
|
|
||||||
mInputStream = context.getAssets().open((TextUtils.isEmpty(mRelativePathPrefix) ? "" : mRelativePathPrefix) + fileName);
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new ThemeException(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -73,7 +72,7 @@ public class AssetsRenderTheme implements ThemeFile {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
AssetsRenderTheme other = (AssetsRenderTheme) obj;
|
AssetsRenderTheme other = (AssetsRenderTheme) obj;
|
||||||
if (mInputStream != other.mInputStream) {
|
if (getRenderThemeAsStream() != other.getRenderThemeAsStream()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!Utils.equals(mRelativePathPrefix, other.mRelativePathPrefix)) {
|
if (!Utils.equals(mRelativePathPrefix, other.mRelativePathPrefix)) {
|
||||||
@@ -94,7 +93,16 @@ public class AssetsRenderTheme implements ThemeFile {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InputStream getRenderThemeAsStream() throws ThemeException {
|
public InputStream getRenderThemeAsStream() throws ThemeException {
|
||||||
return mInputStream;
|
try {
|
||||||
|
return mAssetManager.open((TextUtils.isEmpty(mRelativePathPrefix) ? "" : mRelativePathPrefix) + mFileName);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new ThemeException(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isMapsforgeTheme() {
|
||||||
|
return ThemeUtils.isMapsforgeTheme(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -13,10 +13,6 @@
|
|||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
<uses-sdk
|
|
||||||
android:minSdkVersion="10"
|
|
||||||
android:targetSdkVersion="22" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".App"
|
android:name=".App"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':vtm-android')
|
implementation project(':vtm-android')
|
||||||
compile project(':vtm-themes')
|
implementation project(':vtm-extras')
|
||||||
compile project(':vtm-extras')
|
implementation project(':vtm-themes')
|
||||||
compile 'com.noveogroup.android:android-logger:1.3.6'
|
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
|
||||||
compile 'com.squareup.okhttp3:okhttp:3.8.0'
|
implementation "org.slf4j:slf4j-android:$slf4jVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
@@ -21,6 +21,7 @@ android {
|
|||||||
versionCode versionCode()
|
versionCode versionCode()
|
||||||
versionName versionName()
|
versionName versionName()
|
||||||
minSdkVersion androidMinSdk()
|
minSdkVersion androidMinSdk()
|
||||||
|
targetSdkVersion androidTargetSdk()
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
root=DEBUG:%logger
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Copyright 2010, 2011, 2012 mapsforge.org
|
/* Copyright 2010, 2011, 2012 mapsforge.org
|
||||||
* Copyright 2012 Hannes Janetzek
|
* Copyright 2012 Hannes Janetzek
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-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
|
||||||
@@ -40,7 +40,6 @@ import org.oscim.app.location.LocationDialog;
|
|||||||
import org.oscim.app.location.LocationHandler;
|
import org.oscim.app.location.LocationHandler;
|
||||||
import org.oscim.app.preferences.EditPreferences;
|
import org.oscim.app.preferences.EditPreferences;
|
||||||
import org.oscim.core.GeoPoint;
|
import org.oscim.core.GeoPoint;
|
||||||
import org.oscim.core.Tile;
|
|
||||||
import org.oscim.overlay.DistanceTouchOverlay;
|
import org.oscim.overlay.DistanceTouchOverlay;
|
||||||
import org.osmdroid.location.POI;
|
import org.osmdroid.location.POI;
|
||||||
import org.osmdroid.overlays.MapEventsReceiver;
|
import org.osmdroid.overlays.MapEventsReceiver;
|
||||||
@@ -74,7 +73,6 @@ public class TileMap extends MapActivity implements MapEventsReceiver {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
Tile.SIZE = Tile.calculateTileSize(getResources().getDisplayMetrics().scaledDensity);
|
|
||||||
setContentView(R.layout.activity_tilemap);
|
setContentView(R.layout.activity_tilemap);
|
||||||
App.view = (MapView) findViewById(R.id.mapView);
|
App.view = (MapView) findViewById(R.id.mapView);
|
||||||
registerMapView(App.view);
|
registerMapView(App.view);
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java-library'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':vtm-gdx')
|
api project(':vtm-gdx')
|
||||||
file('natives').eachDir() { dir ->
|
api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
|
||||||
compile files(dir.path)
|
api 'com.metsci.ext.com.kitfox.svg:svg-salamander:0.1.19'
|
||||||
}
|
|
||||||
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
|
||||||
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
|
|
||||||
compile 'com.metsci.ext.com.kitfox.svg:svg-salamander:0.1.19'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -28,21 +24,6 @@ file('natives').eachDir() { dir ->
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task fatJar(type: Jar, dependsOn: classes) {
|
|
||||||
classifier = 'jar-with-dependencies'
|
|
||||||
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
|
|
||||||
// Natives come from compile configuration
|
|
||||||
/*file('natives').eachDir() { dir ->
|
|
||||||
fatJar.from(dir.path)
|
|
||||||
}*/
|
|
||||||
exclude 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.SF'
|
|
||||||
with jar
|
|
||||||
}
|
|
||||||
|
|
||||||
artifacts {
|
|
||||||
archives fatJar
|
|
||||||
}
|
|
||||||
|
|
||||||
if (project.hasProperty("SONATYPE_USERNAME")) {
|
if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
||||||
|
|||||||
@@ -183,11 +183,16 @@ public class AwtCanvas implements Canvas {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fillColor(int color) {
|
public void fillColor(int color) {
|
||||||
|
fillRectangle(0, 0, getWidth(), getHeight(), color);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fillRectangle(float x, float y, float width, float height, int color) {
|
||||||
java.awt.Color awtColor = color == Color.TRANSPARENT ? TRANSPARENT : new java.awt.Color(color);
|
java.awt.Color awtColor = color == Color.TRANSPARENT ? TRANSPARENT : new java.awt.Color(color);
|
||||||
Composite originalComposite = this.canvas.getComposite();
|
Composite originalComposite = this.canvas.getComposite();
|
||||||
this.canvas.setComposite(AlphaComposite.getInstance(color == Color.TRANSPARENT ? AlphaComposite.CLEAR : AlphaComposite.SRC_OVER));
|
this.canvas.setComposite(AlphaComposite.getInstance(color == Color.TRANSPARENT ? AlphaComposite.CLEAR : AlphaComposite.SRC_OVER));
|
||||||
this.canvas.setColor(awtColor);
|
this.canvas.setColor(awtColor);
|
||||||
this.canvas.fillRect(0, 0, getWidth(), getHeight());
|
this.canvas.fillRect((int) x, (int) y, (int) width, (int) height);
|
||||||
this.canvas.setComposite(originalComposite);
|
this.canvas.setComposite(originalComposite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,32 +104,17 @@ public class AwtGraphics extends CanvasAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Bitmap decodeBitmapImpl(InputStream inputStream) {
|
public Bitmap decodeBitmapImpl(InputStream inputStream) throws IOException {
|
||||||
try {
|
return new AwtBitmap(inputStream);
|
||||||
return new AwtBitmap(inputStream);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Bitmap decodeSvgBitmapImpl(InputStream inputStream, int width, int height, int percent) {
|
public Bitmap decodeSvgBitmapImpl(InputStream inputStream, int width, int height, int percent) throws IOException {
|
||||||
try {
|
return new AwtSvgBitmap(inputStream, width, height, percent);
|
||||||
return new AwtSvgBitmap(inputStream, width, height, percent);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Bitmap loadBitmapAssetImpl(String relativePathPrefix, String src, int width, int height, int percent) {
|
public Bitmap loadBitmapAssetImpl(String relativePathPrefix, String src, int width, int height, int percent) throws IOException {
|
||||||
try {
|
return createBitmap(relativePathPrefix, src, width, height, percent);
|
||||||
return createBitmap(relativePathPrefix, src, width, height, percent);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2016 devemux86
|
* Copyright 2015-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
|
||||||
@@ -79,7 +79,7 @@ public class AwtSvgBitmap extends AwtBitmap {
|
|||||||
|
|
||||||
private static BufferedImage getResourceBitmapImpl(InputStream inputStream, int width, int height, int percent) throws IOException {
|
private static BufferedImage getResourceBitmapImpl(InputStream inputStream, int width, int height, int percent) throws IOException {
|
||||||
synchronized (SVGCache.getSVGUniverse()) {
|
synchronized (SVGCache.getSVGUniverse()) {
|
||||||
return getResourceBitmap(inputStream, CanvasAdapter.dpi / CanvasAdapter.DEFAULT_DPI, DEFAULT_SIZE, width, height, percent);
|
return getResourceBitmap(inputStream, CanvasAdapter.getScale(), DEFAULT_SIZE, width, height, percent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public class GdxMapApp extends GdxMap {
|
|||||||
cfg.samples = 2;
|
cfg.samples = 2;
|
||||||
cfg.foregroundFPS = 30;
|
cfg.foregroundFPS = 30;
|
||||||
cfg.backgroundFPS = 10;
|
cfg.backgroundFPS = 10;
|
||||||
|
cfg.forceExit = false;
|
||||||
return cfg;
|
return cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,4 +80,9 @@ public class GdxMapApp extends GdxMap {
|
|||||||
|
|
||||||
mMap.setMapPosition(0, 0, 1 << 2);
|
mMap.setMapPosition(0, 0, 1 << 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dispose() {
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
22
vtm-desktop/src/org/oscim/gdx/GdxMapImpl.java
Normal file
22
vtm-desktop/src/org/oscim/gdx/GdxMapImpl.java
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* 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.gdx;
|
||||||
|
|
||||||
|
public class GdxMapImpl extends GdxMap {
|
||||||
|
@Override
|
||||||
|
public void dispose() {
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java-library'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':vtm')
|
api project(':vtm')
|
||||||
compile 'com.fasterxml.jackson.core:jackson-core:2.8.4'
|
api 'com.fasterxml.jackson.core:jackson-core:2.8.4'
|
||||||
compile 'com.google.protobuf:protobuf-java:2.6.1'
|
api 'com.google.protobuf:protobuf-java:2.6.1'
|
||||||
compile 'com.vividsolutions:jts-core:1.14.0'
|
api 'com.vividsolutions:jts:1.13'
|
||||||
compile 'org.openstreetmap.osmosis:osmosis-osm-binary:0.45'
|
api 'org.openstreetmap.osmosis:osmosis-osm-binary:0.45'
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ public class GeoJsonTileDecoder implements ITileDecoder {
|
|||||||
|
|
||||||
//add tag information
|
//add tag information
|
||||||
mTileSource.decodeTags(mMapElement, mTagMap);
|
mTileSource.decodeTags(mMapElement, mTagMap);
|
||||||
if (mMapElement.tags.numTags == 0)
|
if (mMapElement.tags.size() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mTileSource.postGeomHook(mMapElement);
|
mTileSource.postGeomHook(mMapElement);
|
||||||
@@ -269,8 +269,8 @@ public class GeoJsonTileDecoder implements ITileDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void removeLastPoint() {
|
private void removeLastPoint() {
|
||||||
mMapElement.pointPos -= 2;
|
mMapElement.pointNextPos -= 2;
|
||||||
mMapElement.index[mMapElement.indexPos] -= 2;
|
mMapElement.index[mMapElement.indexCurrentPos] -= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseLineString(JsonParser jp)
|
private void parseLineString(JsonParser jp)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class OsmBuildingJsonTileSource extends GeoJsonTileSource {
|
|||||||
super("http://tile.openstreetmap.us/vectiles-buildings");
|
super("http://tile.openstreetmap.us/vectiles-buildings");
|
||||||
}
|
}
|
||||||
|
|
||||||
Tag mTagBuilding = new Tag("building", "yes");
|
Tag mTagBuilding = new Tag(Tag.KEY_BUILDING, Tag.VALUE_YES);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void decodeTags(MapElement mapElement, Map<String, Object> properties) {
|
public void decodeTags(MapElement mapElement, Map<String, Object> properties) {
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ public class OsmRoadLineJsonTileSource extends GeoJsonTileSource {
|
|||||||
|
|
||||||
static final Logger log = LoggerFactory.getLogger(OsmRoadLineJsonTileSource.class);
|
static final Logger log = LoggerFactory.getLogger(OsmRoadLineJsonTileSource.class);
|
||||||
|
|
||||||
Tag mTagTunnel = new Tag("tunnel", "yes");
|
Tag mTagTunnel = new Tag("tunnel", Tag.VALUE_YES);
|
||||||
Tag mTagBridge = new Tag("bridge", "yes");
|
Tag mTagBridge = new Tag("bridge", Tag.VALUE_YES);
|
||||||
|
|
||||||
public OsmRoadLineJsonTileSource() {
|
public OsmRoadLineJsonTileSource() {
|
||||||
super("http://tile.openstreetmap.us/vectiles-highroad");
|
super("http://tile.openstreetmap.us/vectiles-highroad");
|
||||||
|
|||||||
@@ -484,8 +484,8 @@ public class TileDecoder extends PbfDecoder {
|
|||||||
|
|
||||||
// only add last point if it is di
|
// only add last point if it is di
|
||||||
int ppos = cnt * 2;
|
int ppos = cnt * 2;
|
||||||
if (elem.points[elem.pointPos - ppos] != curX
|
if (elem.points[elem.pointNextPos - ppos] != curX
|
||||||
|| elem.points[elem.pointPos - ppos + 1] != curY)
|
|| elem.points[elem.pointNextPos - ppos + 1] != curY)
|
||||||
elem.addPoint(curX / mScale, curY / mScale);
|
elem.addPoint(curX / mScale, curY / mScale);
|
||||||
|
|
||||||
lastClip = false;
|
lastClip = false;
|
||||||
@@ -525,10 +525,10 @@ public class TileDecoder extends PbfDecoder {
|
|||||||
if (isPoly && isOuter && simplify && !testBBox(xmax - xmin, ymax - ymin)) {
|
if (isPoly && isOuter && simplify && !testBBox(xmax - xmin, ymax - ymin)) {
|
||||||
//log.debug("skip small poly "+ elem.indexPos + " > "
|
//log.debug("skip small poly "+ elem.indexPos + " > "
|
||||||
// + (xmax - xmin) * (ymax - ymin));
|
// + (xmax - xmin) * (ymax - ymin));
|
||||||
elem.pointPos -= elem.index[elem.indexPos];
|
elem.pointNextPos -= elem.index[elem.indexCurrentPos];
|
||||||
if (elem.indexPos > 0) {
|
if (elem.indexCurrentPos > 0) {
|
||||||
elem.indexPos -= 2;
|
elem.indexCurrentPos -= 2;
|
||||||
elem.index[elem.indexPos + 1] = -1;
|
elem.index[elem.indexCurrentPos + 1] = -1;
|
||||||
} else {
|
} else {
|
||||||
elem.type = GeometryType.NONE;
|
elem.type = GeometryType.NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -631,7 +631,7 @@
|
|||||||
<!--
|
<!--
|
||||||
<m k="historic"> <circle r="3" fill="#4040ff" stroke="#606060"
|
<m k="historic"> <circle r="3" fill="#4040ff" stroke="#606060"
|
||||||
width="1.5" /> <m zoom-min="17"> <caption
|
width="1.5" /> <m zoom-min="17"> <caption
|
||||||
k="name" dy="-10" font-style="bold" font-size="10" fill="#4040ff" stroke="#ffffff"
|
k="name" dy="10" font-style="bold" font-size="10" fill="#4040ff" stroke="#ffffff"
|
||||||
width="2.0" /> </m> </m>
|
width="2.0" /> </m> </m>
|
||||||
-->
|
-->
|
||||||
<!-- house numbers -->
|
<!-- house numbers -->
|
||||||
@@ -674,14 +674,14 @@
|
|||||||
<m v="station" zoom-min="14">
|
<m v="station" zoom-min="14">
|
||||||
<circle fill="#ec2d2d" r="6" stroke="#606060" stroke-width="1.5" />
|
<circle fill="#ec2d2d" r="6" stroke="#606060" stroke-width="1.5" />
|
||||||
<!--
|
<!--
|
||||||
<caption k="name" dy="-10" font-style="bold" font-size="13" fill="#ec2d2d"
|
<caption k="name" dy="15" font-style="bold" font-size="13" fill="#ec2d2d"
|
||||||
stroke="#ffffff" stroke-width="2.0" />
|
stroke="#ffffff" stroke-width="2.0" />
|
||||||
-->
|
-->
|
||||||
</m>
|
</m>
|
||||||
<m v="halt|tram_stop" zoom-min="17">
|
<m v="halt|tram_stop" zoom-min="17">
|
||||||
<circle fill="#ec2d2d" r="4" stroke="#606060" stroke-width="1.5" />
|
<circle fill="#ec2d2d" r="4" stroke="#606060" stroke-width="1.5" />
|
||||||
<!--
|
<!--
|
||||||
<caption k="name" dy="-15" font-style="bold" font-size="11" fill="#ec2d2d"
|
<caption k="name" dy="10" font-style="bold" font-size="11" fill="#ec2d2d"
|
||||||
stroke="#ffffff" stroke-width="2.0" />
|
stroke="#ffffff" stroke-width="2.0" />
|
||||||
-->
|
-->
|
||||||
</m>
|
</m>
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ public class OSciMap2TileSource extends UrlTileSource {
|
|||||||
private boolean decodeTileTags() throws IOException {
|
private boolean decodeTileTags() throws IOException {
|
||||||
String tagString = decodeString();
|
String tagString = decodeString();
|
||||||
|
|
||||||
int curTag = mTileTags.numTags;
|
int curTag = mTileTags.size();
|
||||||
|
|
||||||
String key = Tags.keys[mSArray[curTag]];
|
String key = Tags.keys[mSArray[curTag]];
|
||||||
Tag tag;
|
Tag tag;
|
||||||
@@ -261,7 +261,7 @@ public class OSciMap2TileSource extends UrlTileSource {
|
|||||||
if (fail || indexCnt == 0) {
|
if (fail || indexCnt == 0) {
|
||||||
log.debug(mTile + " failed reading way: bytes:" + bytes + " index:"
|
log.debug(mTile + " failed reading way: bytes:" + bytes + " index:"
|
||||||
+ (Arrays.toString(index)) + " tag:"
|
+ (Arrays.toString(index)) + " tag:"
|
||||||
+ (mElem.tags.numTags > 0 ? Arrays.deepToString(mElem.tags.tags) : "null")
|
+ (mElem.tags.size() > 0 ? Arrays.deepToString(mElem.tags.getTags()) : "null")
|
||||||
+ " " + indexCnt + " " + coordCnt);
|
+ " " + indexCnt + " " + coordCnt);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -290,7 +290,7 @@ public class OSciMap2TileSource extends UrlTileSource {
|
|||||||
|
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
int end = position() + bytes;
|
int end = position() + bytes;
|
||||||
int max = mTileTags.numTags - 1;
|
int max = mTileTags.size() - 1;
|
||||||
|
|
||||||
for (; position() < end; cnt++) {
|
for (; position() < end; cnt++) {
|
||||||
int tagNum = decodeVarint32();
|
int tagNum = decodeVarint32();
|
||||||
@@ -315,7 +315,7 @@ public class OSciMap2TileSource extends UrlTileSource {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mElem.tags.add(mTileTags.tags[tagNum]);
|
mElem.tags.add(mTileTags.get(tagNum));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cnt == 0) {
|
if (cnt == 0) {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java-library'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':vtm')
|
api project(':vtm')
|
||||||
compile project(':vtm-themes')
|
api project(':vtm-themes')
|
||||||
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
api "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import org.oscim.map.Map;
|
|||||||
import org.oscim.renderer.MapRenderer;
|
import org.oscim.renderer.MapRenderer;
|
||||||
import org.oscim.theme.VtmThemes;
|
import org.oscim.theme.VtmThemes;
|
||||||
import org.oscim.tiling.TileSource;
|
import org.oscim.tiling.TileSource;
|
||||||
|
import org.oscim.utils.Parameters;
|
||||||
|
|
||||||
public abstract class GdxMap implements ApplicationListener {
|
public abstract class GdxMap implements ApplicationListener {
|
||||||
|
|
||||||
@@ -85,7 +86,7 @@ public abstract class GdxMap implements ApplicationListener {
|
|||||||
mMapRenderer.onSurfaceChanged(w, h);
|
mMapRenderer.onSurfaceChanged(w, h);
|
||||||
|
|
||||||
InputMultiplexer mux = new InputMultiplexer();
|
InputMultiplexer mux = new InputMultiplexer();
|
||||||
if (!Map.NEW_GESTURES) {
|
if (!Parameters.MAP_EVENT_LAYER2) {
|
||||||
mGestureDetector = new GestureDetector(new GestureHandlerImpl(mMap));
|
mGestureDetector = new GestureDetector(new GestureHandlerImpl(mMap));
|
||||||
mux.addProcessor(mGestureDetector);
|
mux.addProcessor(mGestureDetector);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java-library'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':vtm')
|
api project(':vtm')
|
||||||
compile 'com.squareup.okhttp3:okhttp:3.8.0'
|
api 'com.squareup.okhttp3:okhttp:3.8.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ buildscript {
|
|||||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.1'
|
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.3'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ sourceSets.main.java.srcDirs = ["src/"]
|
|||||||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
roboVMVersion = "2.3.1"
|
roboVMVersion = "2.3.3"
|
||||||
}
|
}
|
||||||
|
|
||||||
launchIPhoneSimulator.dependsOn build
|
launchIPhoneSimulator.dependsOn build
|
||||||
@@ -25,15 +25,9 @@ launchIOSDevice.dependsOn build
|
|||||||
createIPA.dependsOn build
|
createIPA.dependsOn build
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':vtm')
|
implementation project(':vtm-ios')
|
||||||
compile project(':vtm-gdx')
|
implementation project(':vtm-jts')
|
||||||
compile project(':vtm-jts')
|
implementation "org.slf4j:slf4j-simple:$slf4jVersion"
|
||||||
compile project(':vtm-ios')
|
|
||||||
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
|
|
||||||
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
|
|
||||||
compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
|
|
||||||
compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
|
|
||||||
compile "org.slf4j:slf4j-simple:$slf4jVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task copyVtmResources(type: Copy) {
|
task copyVtmResources(type: Copy) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2017 Longri
|
* Copyright 2016-2017 Longri
|
||||||
* Copyright 2016 devemux86
|
* Copyright 2016-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
|
||||||
@@ -19,7 +19,7 @@ import com.badlogic.gdx.backends.iosrobovm.IOSApplication;
|
|||||||
import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration;
|
import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration;
|
||||||
|
|
||||||
import org.oscim.backend.CanvasAdapter;
|
import org.oscim.backend.CanvasAdapter;
|
||||||
import org.oscim.theme.ThemeLoader;
|
import org.oscim.utils.Parameters;
|
||||||
import org.robovm.apple.foundation.NSAutoreleasePool;
|
import org.robovm.apple.foundation.NSAutoreleasePool;
|
||||||
import org.robovm.apple.glkit.GLKViewDrawableStencilFormat;
|
import org.robovm.apple.glkit.GLKViewDrawableStencilFormat;
|
||||||
import org.robovm.apple.uikit.UIApplication;
|
import org.robovm.apple.uikit.UIApplication;
|
||||||
@@ -38,12 +38,13 @@ public class ExampleLauncher extends IOSApplication.Delegate {
|
|||||||
float scale = (float) (getIosVersion() >= 8 ? UIScreen.getMainScreen().getNativeScale() : UIScreen.getMainScreen().getScale());
|
float scale = (float) (getIosVersion() >= 8 ? UIScreen.getMainScreen().getNativeScale() : UIScreen.getMainScreen().getScale());
|
||||||
CanvasAdapter.dpi *= scale;
|
CanvasAdapter.dpi *= scale;
|
||||||
|
|
||||||
IOSMapApp iosMapApp = new IOSMapApp();
|
// IOSMapApp iosMapApp = new IOSMapApp();
|
||||||
// IOSLineTexTest iosMapApp = new IOSLineTexTest();
|
// IOSPathLayerTest iosMapApp = new IOSPathLayerTest();
|
||||||
// IOSMapAppCluster iosMapApp = new IOSMapAppCluster();
|
IOSLineTexBucketTest iosMapApp = new IOSLineTexBucketTest();
|
||||||
|
|
||||||
|
|
||||||
ThemeLoader.POT_TEXTURES = true;
|
// iOS needs POT textures for drawing lines with texture
|
||||||
|
Parameters.POT_TEXTURES = true;
|
||||||
iosMapApp.init();
|
iosMapApp.init();
|
||||||
|
|
||||||
return new IOSApplication(iosMapApp, config);
|
return new IOSApplication(iosMapApp, config);
|
||||||
|
|||||||
118
vtm-ios-example/src/org/oscim/ios/test/IOSLineTexBucketTest.java
Normal file
118
vtm-ios-example/src/org/oscim/ios/test/IOSLineTexBucketTest.java
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
/*
|
||||||
|
* 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.ios.test;
|
||||||
|
|
||||||
|
import org.oscim.backend.CanvasAdapter;
|
||||||
|
import org.oscim.backend.GLAdapter;
|
||||||
|
import org.oscim.core.GeometryBuffer;
|
||||||
|
import org.oscim.core.Tag;
|
||||||
|
import org.oscim.core.TagSet;
|
||||||
|
import org.oscim.gdx.GdxAssets;
|
||||||
|
import org.oscim.gdx.GdxMap;
|
||||||
|
import org.oscim.ios.backend.IosGL;
|
||||||
|
import org.oscim.ios.backend.IosGraphics;
|
||||||
|
import org.oscim.layers.GenericLayer;
|
||||||
|
import org.oscim.renderer.BucketRenderer;
|
||||||
|
import org.oscim.renderer.GLViewport;
|
||||||
|
import org.oscim.renderer.MapRenderer;
|
||||||
|
import org.oscim.renderer.bucket.LineTexBucket;
|
||||||
|
import org.oscim.renderer.bucket.TextureItem;
|
||||||
|
import org.oscim.theme.IRenderTheme;
|
||||||
|
import org.oscim.theme.ThemeLoader;
|
||||||
|
import org.oscim.theme.VtmThemes;
|
||||||
|
import org.oscim.theme.styles.LineStyle;
|
||||||
|
import org.oscim.theme.styles.RenderStyle;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class IOSLineTexBucketTest extends GdxMap {
|
||||||
|
|
||||||
|
public static void init() {
|
||||||
|
// init globals
|
||||||
|
IosGraphics.init();
|
||||||
|
GdxAssets.init("assets/");
|
||||||
|
GLAdapter.init(new IosGL());
|
||||||
|
}
|
||||||
|
|
||||||
|
GeometryBuffer mLine = new GeometryBuffer(2, 1);
|
||||||
|
|
||||||
|
LineTest l = new LineTest();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createLayers() {
|
||||||
|
MapRenderer.setBackgroundColor(0xffffffff);
|
||||||
|
|
||||||
|
mMap.setMapPosition(0, 0, 1 << 4);
|
||||||
|
|
||||||
|
GeometryBuffer g = mLine;
|
||||||
|
g.startLine();
|
||||||
|
g.addPoint(-100, 0);
|
||||||
|
g.addPoint(100, 0);
|
||||||
|
|
||||||
|
addLines(l);
|
||||||
|
|
||||||
|
mMap.layers().add(new GenericLayer(mMap, l));
|
||||||
|
}
|
||||||
|
|
||||||
|
void addLines(LineTest l) {
|
||||||
|
|
||||||
|
GeometryBuffer g = mLine;
|
||||||
|
LineStyle lineStyle;
|
||||||
|
TextureItem tex = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
tex = new TextureItem(CanvasAdapter.getBitmapAsset("", "patterns/pike.png"));
|
||||||
|
tex.mipmap = true;
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
IRenderTheme t = ThemeLoader.load(VtmThemes.DEFAULT);
|
||||||
|
|
||||||
|
TagSet tags = new TagSet();
|
||||||
|
tags.add(new Tag("highway", null));
|
||||||
|
tags.add(new Tag("oneway", "yes"));
|
||||||
|
|
||||||
|
RenderStyle[] ri = t.matchElement(GeometryBuffer.GeometryType.LINE, tags, 16);
|
||||||
|
|
||||||
|
lineStyle = (LineStyle) ri[0];
|
||||||
|
|
||||||
|
LineTexBucket lt = l.buckets.getLineTexBucket(20);
|
||||||
|
lt.line = lineStyle;
|
||||||
|
lt.addLine(g.translate(0, 10.5f));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class LineTest extends BucketRenderer {
|
||||||
|
|
||||||
|
public LineTest() {
|
||||||
|
mMapPosition.scale = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void update(GLViewport v) {
|
||||||
|
if (mMapPosition.scale == 0)
|
||||||
|
mMapPosition.copy(v.pos);
|
||||||
|
|
||||||
|
if (!isReady()) {
|
||||||
|
compile();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -40,7 +40,7 @@ import org.oscim.utils.Utils;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class IOSLineTexTest extends GdxMap {
|
public class IOSPathLayerTest extends GdxMap {
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
// init globals
|
// init globals
|
||||||
@@ -91,12 +91,6 @@ public class IOSLineTexTest extends GdxMap {
|
|||||||
List<GeoPoint> pts = new ArrayList<>();
|
List<GeoPoint> pts = new ArrayList<>();
|
||||||
|
|
||||||
for (double lon = -180; lon <= 180; lon += 2) {
|
for (double lon = -180; lon <= 180; lon += 2) {
|
||||||
//pts.add(new GeoPoint(lat, lon));
|
|
||||||
// double longitude = lon + (pos * 180);
|
|
||||||
// if (longitude < -180)
|
|
||||||
// longitude += 360;
|
|
||||||
// if (longitude > 180)
|
|
||||||
// longitude -= 360;
|
|
||||||
double longitude = lon;
|
double longitude = lon;
|
||||||
|
|
||||||
double latitude = lat + (pos * 90);
|
double latitude = lat + (pos * 90);
|
||||||
@@ -4,11 +4,11 @@ buildscript {
|
|||||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.1'
|
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.3'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'java'
|
apply plugin: 'java-library'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
apply plugin: 'robovm'
|
apply plugin: 'robovm'
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ sourceSets.main.java.srcDirs = ["src/"]
|
|||||||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
roboVMVersion = "2.3.1"
|
roboVMVersion = "2.3.3"
|
||||||
}
|
}
|
||||||
|
|
||||||
launchIPhoneSimulator.dependsOn build
|
launchIPhoneSimulator.dependsOn build
|
||||||
@@ -26,11 +26,11 @@ launchIOSDevice.dependsOn build
|
|||||||
createIPA.dependsOn build
|
createIPA.dependsOn build
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':vtm-gdx')
|
api project(':vtm-gdx')
|
||||||
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
|
api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
|
||||||
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
|
api "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
|
||||||
compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
|
api "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
|
||||||
compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
|
api "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
task copyVtmResources(type: Copy) {
|
task copyVtmResources(type: Copy) {
|
||||||
@@ -57,17 +57,8 @@ task nativesJar(type: Jar) {
|
|||||||
from('natives')
|
from('natives')
|
||||||
}
|
}
|
||||||
|
|
||||||
task fatJar(type: Jar, dependsOn: classes) {
|
|
||||||
classifier = 'jar-with-dependencies'
|
|
||||||
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
|
|
||||||
from('natives')
|
|
||||||
exclude 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.SF'
|
|
||||||
with jar
|
|
||||||
}
|
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives nativesJar
|
archives nativesJar
|
||||||
//archives fatJar
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (project.hasProperty("SONATYPE_USERNAME")) {
|
if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||||
|
|||||||
Binary file not shown.
@@ -81,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
-(CGFloat) opacity;
|
-(CGFloat) opacity;
|
||||||
|
|
||||||
/*! @brief opacity is dependent (via inheritence) as you descend an SVG Document. This opacity is the place to keep track of updated opacity.
|
/*! @brief opacity is dependent (via inheritence) as you descend an SVG Document. This opacity is the place to keep track of updated opacity.
|
||||||
* @param the current opacity (defaults to 1.0)
|
* @param opacity the current opacity (defaults to 1.0)
|
||||||
*/
|
*/
|
||||||
-(void) setOpacity:(CGFloat)opacity;
|
-(void) setOpacity:(CGFloat)opacity;
|
||||||
|
|
||||||
|
|||||||
@@ -49,4 +49,4 @@
|
|||||||
|
|
||||||
/*! \brief Because views and buttons are dynamically instantiated from Storyboards and Nibs, code for their classes might not link in from a static library. Thus this method to make sure the class gets called at least once from code.
|
/*! \brief Because views and buttons are dynamically instantiated from Storyboards and Nibs, code for their classes might not link in from a static library. Thus this method to make sure the class gets called at least once from code.
|
||||||
*/
|
*/
|
||||||
void MakeSureSVGghLinks();
|
void MakeSureSVGghLinks(void);
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -34,7 +34,7 @@
|
|||||||
</data>
|
</data>
|
||||||
<key>Headers/SVGContext.h</key>
|
<key>Headers/SVGContext.h</key>
|
||||||
<data>
|
<data>
|
||||||
fYKblLtFBEOZBWKITmzeqxkB3wA=
|
nipDZcSdfdoY/A8ur+tBBZ0/+6w=
|
||||||
</data>
|
</data>
|
||||||
<key>Headers/SVGDocumentView.h</key>
|
<key>Headers/SVGDocumentView.h</key>
|
||||||
<data>
|
<data>
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
</data>
|
</data>
|
||||||
<key>Headers/SVGgh.h</key>
|
<key>Headers/SVGgh.h</key>
|
||||||
<data>
|
<data>
|
||||||
FhA5aS1gL+U2oztDy+ZAYAMbsQY=
|
cvRfO1GOHm6DU0yYwNOiyIVoduk=
|
||||||
</data>
|
</data>
|
||||||
<key>Headers/SVGghLoader.h</key>
|
<key>Headers/SVGghLoader.h</key>
|
||||||
<data>
|
<data>
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
</data>
|
</data>
|
||||||
<key>Info.plist</key>
|
<key>Info.plist</key>
|
||||||
<data>
|
<data>
|
||||||
Ekf8hDNYwrf/YAzxlZyyfB58pCE=
|
mQCRU5XiOhj4nuJmB5nqUsBIgCw=
|
||||||
</data>
|
</data>
|
||||||
<key>Modules/module.modulemap</key>
|
<key>Modules/module.modulemap</key>
|
||||||
<data>
|
<data>
|
||||||
@@ -168,11 +168,11 @@
|
|||||||
<dict>
|
<dict>
|
||||||
<key>hash</key>
|
<key>hash</key>
|
||||||
<data>
|
<data>
|
||||||
fYKblLtFBEOZBWKITmzeqxkB3wA=
|
nipDZcSdfdoY/A8ur+tBBZ0/+6w=
|
||||||
</data>
|
</data>
|
||||||
<key>hash2</key>
|
<key>hash2</key>
|
||||||
<data>
|
<data>
|
||||||
7BISlxYEV6x9kQFS15ufHja8Q+26HD5NjXYaTDJyIEI=
|
vBXhqJbZ8dvTNO4WmhY8Fa+mEQ1CXgCeY2t8BK9GdEM=
|
||||||
</data>
|
</data>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Headers/SVGDocumentView.h</key>
|
<key>Headers/SVGDocumentView.h</key>
|
||||||
@@ -256,11 +256,11 @@
|
|||||||
<dict>
|
<dict>
|
||||||
<key>hash</key>
|
<key>hash</key>
|
||||||
<data>
|
<data>
|
||||||
FhA5aS1gL+U2oztDy+ZAYAMbsQY=
|
cvRfO1GOHm6DU0yYwNOiyIVoduk=
|
||||||
</data>
|
</data>
|
||||||
<key>hash2</key>
|
<key>hash2</key>
|
||||||
<data>
|
<data>
|
||||||
K7FvEVgrwXFf8fYXUC1Z28mYShSPC2GIrNE0Q4jvPMs=
|
XU2bmBHIVDePmIgujoxVNix2qbEhCI7bmzLLm2UoioA=
|
||||||
</data>
|
</data>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Headers/SVGghLoader.h</key>
|
<key>Headers/SVGghLoader.h</key>
|
||||||
|
|||||||
@@ -76,8 +76,6 @@ public class IosCanvas implements Canvas {
|
|||||||
IosPaint iosFill = (IosPaint) fill;
|
IosPaint iosFill = (IosPaint) fill;
|
||||||
if (stroke != null) {
|
if (stroke != null) {
|
||||||
IosPaint iosStroke = (IosPaint) stroke;
|
IosPaint iosStroke = (IosPaint) stroke;
|
||||||
iosFill.setStrokeWidth(iosStroke.strokeWidth);
|
|
||||||
iosFill.setStrokeColor(iosStroke.getColor());
|
|
||||||
iosStroke.drawLine(this.cgBitmapContext, string, x, y);
|
iosStroke.drawLine(this.cgBitmapContext, string, x, y);
|
||||||
}
|
}
|
||||||
iosFill.drawLine(this.cgBitmapContext, string, x, y);
|
iosFill.drawLine(this.cgBitmapContext, string, x, y);
|
||||||
@@ -150,6 +148,14 @@ public class IosCanvas implements Canvas {
|
|||||||
this.cgBitmapContext.fillRect(rect);
|
this.cgBitmapContext.fillRect(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fillRectangle(float x, float y, float width, float height, int color) {
|
||||||
|
CGRect rect = new CGRect(x, y, width, height);
|
||||||
|
setFillColor(this.cgBitmapContext, (color));
|
||||||
|
this.cgBitmapContext.setBlendMode(CGBlendMode.Normal);
|
||||||
|
this.cgBitmapContext.fillRect(rect);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getHeight() {
|
public int getHeight() {
|
||||||
return this.cgBitmapContext != null ? (int) this.cgBitmapContext.getHeight() : 0;
|
return this.cgBitmapContext != null ? (int) this.cgBitmapContext.getHeight() : 0;
|
||||||
|
|||||||
@@ -55,32 +55,17 @@ public class IosGraphics extends CanvasAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Bitmap decodeBitmapImpl(InputStream inputStream) {
|
protected Bitmap decodeBitmapImpl(InputStream inputStream) throws IOException {
|
||||||
try {
|
return new IosBitmap(inputStream);
|
||||||
return new IosBitmap(inputStream);
|
|
||||||
} catch (IOException e) {
|
|
||||||
log.error("decodeBitmapImpl", e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Bitmap decodeSvgBitmapImpl(InputStream inputStream, int width, int height, int percent) {
|
protected Bitmap decodeSvgBitmapImpl(InputStream inputStream, int width, int height, int percent) throws IOException {
|
||||||
try {
|
return new IosSvgBitmap(inputStream, width, height, percent);
|
||||||
return new IosSvgBitmap(inputStream, width, height, percent);
|
|
||||||
} catch (IOException e) {
|
|
||||||
log.error("decodeSvgBitmapImpl", e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Bitmap loadBitmapAssetImpl(String relativePathPrefix, String src, int width, int height, int percent) {
|
protected Bitmap loadBitmapAssetImpl(String relativePathPrefix, String src, int width, int height, int percent) throws IOException {
|
||||||
try {
|
return createBitmap(relativePathPrefix, src, width, height, percent);
|
||||||
return createBitmap(relativePathPrefix, src, width, height, percent);
|
|
||||||
} catch (IOException e) {
|
|
||||||
log.error("loadBitmapAssetImpl", e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ public class IosPaint implements Paint {
|
|||||||
!!!!!
|
!!!!!
|
||||||
NOTE: The value of NSStrokeWidthAttributeName is interpreted as a percentage of the font point size.
|
NOTE: The value of NSStrokeWidthAttributeName is interpreted as a percentage of the font point size.
|
||||||
*/
|
*/
|
||||||
float strokeWidthPercent = -(this.strokeWidth / this.textSize * 50);
|
float strokeWidthPercent = (this.strokeWidth / this.textSize * 150);
|
||||||
attribs.setStrokeWidth(strokeWidthPercent);
|
attribs.setStrokeWidth(strokeWidthPercent);
|
||||||
|
|
||||||
NSAttributedString attributedString = new NSAttributedString(text, attribs);
|
NSAttributedString attributedString = new NSAttributedString(text, attribs);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user