Compare commits
110 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d96dfb7f1 | ||
| fb0b88e916 | |||
|
|
1ee201a41f | ||
|
|
72a93a0cc0 | ||
|
|
290b8ec1dd | ||
|
|
ff9246168b | ||
|
|
eef8ee3934 | ||
|
|
6342756105 | ||
|
|
25d28ad9e2 | ||
|
|
5613a96cc2 | ||
|
|
42d251e8cb | ||
|
|
151bed799f | ||
|
|
3436302abf | ||
|
|
b0baf72462 | ||
|
|
79916df991 | ||
|
|
015d173d9b | ||
|
|
5d37b53c02 | ||
|
|
fd092aa4dd | ||
|
|
c36d62e0d1 | ||
|
|
88d8a7ed8a | ||
|
|
6b98cb7d89 | ||
|
|
eef08827e5 | ||
|
|
1207262c72 | ||
|
|
5c5c08f5c4 | ||
|
|
c24a9c1631 | ||
|
|
4c2be99dc9 | ||
|
|
b2efa815f6 | ||
|
|
92727cc75d | ||
|
|
707e1c4069 | ||
|
|
b4520369be | ||
|
|
6bd2239e95 | ||
|
|
b4014eec64 | ||
|
|
3b01288c46 | ||
|
|
7032428f09 | ||
|
|
c7219da70e | ||
|
|
69ad616a5f | ||
|
|
b18f42a5a8 | ||
|
|
272ead2518 | ||
|
|
f7bdc420bf | ||
|
|
43b52de5d8 | ||
|
|
14d67da9fa | ||
|
|
a20fc2ef11 | ||
|
|
d29fd500e5 | ||
|
|
e1191f68ae | ||
|
|
36e4116d39 | ||
|
|
43cfcd4a81 | ||
|
|
332a694d65 | ||
|
|
76fa6bdfc6 | ||
|
|
efd85ea3d9 | ||
|
|
e09af9502a | ||
|
|
fce9791cd6 | ||
|
|
575c2c2b34 | ||
|
|
7b0a5249b7 | ||
|
|
002877ff5f | ||
|
|
4f69560cf3 | ||
|
|
e86bf54d8a | ||
|
|
d89a402375 | ||
|
|
f570105920 | ||
|
|
3011e6acda | ||
|
|
59e8dea217 | ||
|
|
ae7c7b1910 | ||
|
|
cf234cd7ca | ||
|
|
4fb99aaf28 | ||
|
|
7e09e4f2e8 | ||
|
|
d428b689ba | ||
|
|
3c0ca26b67 | ||
|
|
84ccf9d1bc | ||
|
|
5442e67518 | ||
|
|
6fb02ec055 | ||
|
|
825cd05150 | ||
|
|
9357cf380b | ||
|
|
670883701d | ||
|
|
86794c8838 | ||
|
|
c4003bab33 | ||
|
|
f5f77157c9 | ||
|
|
8e0d467ceb | ||
|
|
044c8ce74f | ||
|
|
87dc04251d | ||
|
|
0a2f47ee57 | ||
|
|
172664c55b | ||
|
|
cd90e95a4a | ||
|
|
b3f18a92d2 | ||
|
|
774ceced8b | ||
|
|
2ea8e006a3 | ||
|
|
f04b8d36f8 | ||
|
|
37363b31da | ||
|
|
44a1756229 | ||
|
|
a184e25348 | ||
|
|
6f64e97faf | ||
|
|
30ad6f1cef | ||
|
|
bd965750a9 | ||
|
|
f076544993 | ||
|
|
bb03b40075 | ||
|
|
634a2e5c0d | ||
|
|
c3203b3cb4 | ||
|
|
a82275315c | ||
|
|
12a58e5827 | ||
|
|
9895921a5c | ||
|
|
ba8b800ee0 | ||
|
|
8be9211ed6 | ||
|
|
b8983007d2 | ||
|
|
bd24ba12d5 | ||
|
|
5de7070f15 | ||
|
|
e2c901d1e5 | ||
|
|
156fda15cd | ||
|
|
425e5dac61 | ||
|
|
8f15859f9b | ||
|
|
6d29d11499 | ||
|
|
6da37d481d | ||
|
|
62015eee0b |
32
.github/workflows/android.yml
vendored
Normal file
32
.github/workflows/android.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: Android CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: set up JDK 11
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'temurin'
|
||||
cache: gradle
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
- name: Publish
|
||||
if: github.event_name != 'pull_request'
|
||||
env:
|
||||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
|
||||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
|
||||
run: ./gradlew -PSONATYPE_USERNAME="$SONATYPE_USERNAME" -PSONATYPE_PASSWORD="$SONATYPE_PASSWORD" publish
|
||||
32
.travis.yml
32
.travis.yml
@@ -1,32 +0,0 @@
|
||||
sudo: false
|
||||
language: android
|
||||
jdk:
|
||||
- openjdk8
|
||||
env:
|
||||
global:
|
||||
- ANDROID=30
|
||||
- ANDROID_BUILD_TOOLS=30.0.3
|
||||
- GRADLE_OPTS="-Xmx2048m"
|
||||
- secure: sW674wuFZOuoX7jHQHDbX3j8NxL8JxR07cyq+CrrqJ537dU9lxWQmMBRUpOb+p/q7sQ74PUtiKJkmFgKCSJSAKY+nr6GJ8P/q6u5TUKbmUWODSn8znehX2zualfvFwpF4PILok/wUzXBQE62jn4lUua7cMdsHRMNHbLmKqBoVL0meObDDjsaJ/RCbOPuruy3FmgvXPp0+Y4zl1GsklDSyjFzg4LBzjAk9Ryvh1O4zvJBkkyfCgurLKCnOKIPy3v5fPMS9oDfO1aarAVGoZZe416pvTW4hb8cdB6kn9XWYDob4NDFX/sP5k7XIhd/NAIn9LrKFg0sLtATaKLX+BcasF1CgDR/u6+SEeQd5QaRF7Go2Nq5Ltuu4OIFONI2qhEeVDDK6Otf2WSWj9KPno2GHuumBfbg4ypWoJgmZrMXk8JeVV/OP/0jIQz3p/7yfF21X1XBEqYaVHPAMKdEYYkCSa46KfACyOt6LfnkuCHtoTOpFo7sq0omIA2HOtpIx1u3vMBUyAbQqT6cokkKB1b6gNTFwhHc+8ybfLFPljJB8cWshI+V/b06S6fekRmvTNxvDykWNsdlkENBYqc9hMfjcT4hO4K+76SWN62mimQYODvFyfTVMC7WkQ3k/XEnmqUPV5XkbaILbS1d/tA57N148FiJ5/QXtI6Y94imubYyVqU=
|
||||
- secure: AdKSZKA4gMuKXI4X4dQNJqcMv5OmPIHdN8fpy55Y9yoOQPQHZE3Zwc4QDWBh20q298jyEC854tVTPTysdZ7h+2s2FhsprYv1Bt/QNzKIrLpeIMj2quuVGMbdPuk08y55gost94KwVLJv0sIDpRlB/PEQkA7Mg/UDsT9zR8E1Ms5x+ul2C8e1ag0zzNl1wVnT5jY8WCp74uA/XXCcJl/80qT1stUERazCKwbKNo007hi7rdm4HA7YGevORq8e2r67je+WIBZUAwrHT0Zjuo4ibwUii4LdwvjuN3w0Z6e9Wf4x5bBqGgnih0T31uom2yPjNx+U/c2AWI+Nxfy/SEF2U+9bjBEZ3ZhI7F1B9ofXo2mhvvsVDiUrymMBbG2V64C9kAzeUh7xIBTqIrbdtpAEBV9FlLAtF2swVTwtCgZgcVTOt3RKXCi3X3nk3cuH7PAorFa/QGfT4xxVu2011FVAt2Rm7SD0ZWztZTSTz/4Nt/egtGBOJfrCc7oLEygLzDmLqsqCwCROITVQjWLjrtqDyLteaNiSXeNIQMKun3izApbXnHmXB+FV3R3EZocboqk3v5bmPTahnG6Ghc2zknWyyxSx+O9qIfOpHUL8JMJiT82lUQUeibtCn7DCE8wVQ/gYC5i+a+KO/d3NemSzIFlZ8aoUiEPYq18dYlsDXeLXwF0=
|
||||
android:
|
||||
components:
|
||||
- tools
|
||||
- platform-tools
|
||||
- tools
|
||||
- build-tools-$ANDROID_BUILD_TOOLS
|
||||
- android-$ANDROID
|
||||
before_install:
|
||||
- yes | sdkmanager "platforms;android-$ANDROID"
|
||||
script:
|
||||
- ./gradlew clean build
|
||||
after_success:
|
||||
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
||||
./gradlew uploadArchives -PSONATYPE_USERNAME="${SONATYPE_USERNAME}" -PSONATYPE_PASSWORD="${SONATYPE_PASSWORD}";
|
||||
fi
|
||||
notifications:
|
||||
email:
|
||||
recipients:
|
||||
- secure: fOInp4SGBqiIMgnsGceQTa0SuFLaAoxAF15W0crhuljGlqSgnbnBjh0xFEF4P5+q3VT3DgDZs53GVVo6S9gEl8AWJy84KGuUX1M/CQKUQC4bwNXJdHfY3MIy6D50da6UfwWeNS4ienKh2Rj6w2TapN9M8C9nJJZk9aJFc9NWZmWTVboHZd4oUDeeRBJ6KSk1Ay7L/mmxv4cMCXaW7pPJixvUFESKNYgK4KAN3zYpym2UijrQ8zf7OVcYnTorcAuXUZDk8EvwdHl3rIAdlbVqvyZ8rmoQ2Da/Q2VlWUL/HrHUVJtCPZ+T+dNUag4a8joIDqWKwcyk76PElmgft3azb7GERb+bkZz1ToQc2IvuOeUk2SsuXWZugoEQImKWl/yWeirWBLrwzieaVh4j04dMSn/Npc1yL5kjX9EuiM6MFHdYPianMpvhFiaYKihjzW0GPV6sfuY7xS8cA9L9DjAsXoHIXIxc/+hRA+bpPUl+qMaQdGjJmNJJ2VPFnOY0XCsDDQDIVa3nZOA6aXMUG2c4H26RJZPe7uvfRiuL86n3KAmkoXSwne9t8WYMgl89LMsU5XxjBvwz2Qa1HqG09tVs6nhB23easrhEYEf/ZsGg0DIIL1FImUHj+wUUfZXeyFmbiE6lD/i2+3a5DqzZGHbXUDCoUIagObMf8fe2z5+0K/Q=
|
||||
on_success: always
|
||||
on_failure: always
|
||||
@@ -1,5 +1,4 @@
|
||||
[](https://search.maven.org/search?q=g:org.mapsforge)
|
||||
[](https://travis-ci.org/mapsforge/vtm)
|
||||
[](http://www.gnu.org/licenses/lgpl-3.0)
|
||||
|
||||
# V™
|
||||
@@ -30,6 +29,7 @@ If you have any questions or problems, don't hesitate to ask the Discussions for
|
||||
- iOS (libGDX/RoboVM, [instructions](docs/ios.md))
|
||||
- Desktop (libGDX/LWJGL, [instructions](docs/desktop.md))
|
||||
- HTML5/WebGL (libGDX/GWT, [instructions](docs/web.md))
|
||||
- Building VTM: set `ANDROID_HOME` environment variable with the Android SDK installation directory
|
||||
|
||||
### Projects
|
||||
- **vtm** core library
|
||||
@@ -47,8 +47,7 @@ If you have any questions or problems, don't hesitate to ask the Discussions for
|
||||
- **vtm-web-app** HTML5/GWT application
|
||||
|
||||
## WebGL Demo
|
||||
[OpenScienceMap](http://opensciencemap.org/s3db/#scale=17,rot=61,tilt=51,lat=53.075,lon=8.807) view of Bremen.
|
||||
- Hold right mouse button to change view direction.
|
||||
[OpenScienceMap](https://oscim.ogiqvo.com/vtm/#scale=17,rot=61,tilt=51,lat=53.075,lon=8.807) view of Bremen. Running [nextzen2oscimv4](https://github.com/schedul-xor/nextzen2oscimv4) server which contains OSM data in Germany. Notice: nextzen2oscimv4 server is still unstable.
|
||||
|
||||
## Applications
|
||||
- VTM is used by many [applications](docs/Applications.md).
|
||||
|
||||
33
build.gradle
33
build.gradle
@@ -1,21 +1,12 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.1.3'
|
||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
|
||||
}
|
||||
plugins {
|
||||
id 'com.android.application' version '7.4.2' apply false
|
||||
}
|
||||
|
||||
allprojects {
|
||||
group = 'org.mapsforge'
|
||||
version = 'master-SNAPSHOT'
|
||||
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
|
||||
|
||||
ext.androidBuildVersionTools = "30.0.3"
|
||||
ext.gdxVersion = "1.9.10"
|
||||
ext.gdxVersion = "1.11.0"
|
||||
ext.gwtVersion = "2.8.2"
|
||||
ext.slf4jVersion = "1.7.28"
|
||||
|
||||
@@ -28,31 +19,27 @@ allprojects {
|
||||
}
|
||||
}
|
||||
|
||||
static def androidCompileSdk() { return 30 }
|
||||
static def androidCompileSdk() { return 33 }
|
||||
|
||||
// 14 for Support Library, 16 for sqlite-android
|
||||
static def androidMinSdk() { return 16 }
|
||||
// 14 for Support Library
|
||||
static def androidMinSdk() { return 21 }
|
||||
|
||||
static def androidTargetSdk() { return 30 }
|
||||
static def androidTargetSdk() { return 33 }
|
||||
|
||||
static def versionCode() { return 1 }
|
||||
|
||||
def versionName() { return version }
|
||||
|
||||
subprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven { url "https://plugins.gradle.org/m2/" }
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_7
|
||||
targetCompatibility = JavaVersion.VERSION_1_7
|
||||
options.encoding = 'UTF-8'
|
||||
if (JavaVersion.current().isJava9Compatible()) {
|
||||
if (!project.properties.containsKey('android')) {
|
||||
if (project.name == 'vtm-desktop-lwjgl3' || project.name == 'vtm-playground' || project.name == 'vtm-theme-comparator')
|
||||
options.compilerArgs.addAll(['--release', '8'])
|
||||
else
|
||||
options.compilerArgs.addAll(['--release', '7'])
|
||||
}
|
||||
}
|
||||
|
||||
125
deploy.gradle
125
deploy.gradle
@@ -1,84 +1,63 @@
|
||||
apply plugin: 'signing'
|
||||
|
||||
if (project.hasProperty("android")) {
|
||||
task sourcesJar(type: Jar) {
|
||||
classifier = 'sources'
|
||||
from android.sourceSets.main.java.srcDirs
|
||||
}
|
||||
|
||||
task javadoc(type: Javadoc) {
|
||||
source = android.sourceSets.main.java.srcDirs
|
||||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
|
||||
classpath += project.android.libraryVariants.toList().first().javaCompileProvider.get().classpath
|
||||
}
|
||||
} else {
|
||||
task sourcesJar(type: Jar) {
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
java {
|
||||
withJavadocJar()
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
||||
classifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives javadocJar
|
||||
archives sourcesJar
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
pom {
|
||||
name = 'VTM'
|
||||
description = 'OpenGL vector map library - running on Android, iOS, Desktop and browser.'
|
||||
url = 'https://github.com/mapsforge/vtm'
|
||||
licenses {
|
||||
license {
|
||||
name = 'GNU Lesser GPL'
|
||||
url = 'https://www.gnu.org/licenses/lgpl.html'
|
||||
}
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id = 'hannes.janetzek'
|
||||
name = 'Hannes Janetzek'
|
||||
email = 'hannes.janetzek@gmail.com'
|
||||
}
|
||||
developer {
|
||||
id = 'devemux86'
|
||||
name = 'Emux'
|
||||
email = 'devemux86@gmail.com'
|
||||
}
|
||||
}
|
||||
scm {
|
||||
connection = 'scm:git:https://github.com/mapsforge/vtm'
|
||||
developerConnection = 'scm:git:https://github.com/mapsforge/vtm'
|
||||
url = 'https://github.com/mapsforge/vtm'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
|
||||
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
|
||||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
||||
credentials {
|
||||
username = SONATYPE_USERNAME
|
||||
password = SONATYPE_PASSWORD
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
signing {
|
||||
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
|
||||
sign configurations.archives
|
||||
required { !version.endsWith('SNAPSHOT') }
|
||||
sign publishing.publications.maven
|
||||
}
|
||||
|
||||
uploadArchives {
|
||||
repositories {
|
||||
mavenDeployer {
|
||||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
||||
|
||||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
|
||||
authentication(userName: SONATYPE_USERNAME, password: SONATYPE_PASSWORD)
|
||||
}
|
||||
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
|
||||
authentication(userName: SONATYPE_USERNAME, password: SONATYPE_PASSWORD)
|
||||
}
|
||||
|
||||
pom.project {
|
||||
packaging 'jar'
|
||||
|
||||
name 'vtm'
|
||||
description 'OpenGL vector map library written in Java - running on Android, iOS, Desktop and within the browser.'
|
||||
url 'https://github.com/mapsforge/vtm'
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name 'GNU Lesser GPL'
|
||||
url 'http://www.gnu.org/licenses/lgpl.html'
|
||||
distribution 'repo'
|
||||
}
|
||||
}
|
||||
|
||||
scm {
|
||||
connection 'scm:git:https://github.com/mapsforge/vtm'
|
||||
developerConnection 'scm:git:https://github.com/mapsforge/vtm'
|
||||
url 'https://github.com/mapsforge/vtm'
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id 'hannes.janetzek'
|
||||
name 'Hannes Janetzek'
|
||||
email 'hannes.janetzek@gmail.com'
|
||||
}
|
||||
developer {
|
||||
id 'devemux86'
|
||||
name 'Emux'
|
||||
email 'devemux86@gmail.com'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
javadoc {
|
||||
if (JavaVersion.current().isJava9Compatible()) {
|
||||
options.addBooleanOption('html5', true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,20 +3,21 @@
|
||||
|**Name**|**Type**|**License/Cost**|**Platforms**|**Sources**|
|
||||
|--------|--------|----------------|-------------|-----------|
|
||||
| [AdvRider WD](https://play.google.com/store/apps/details?id=com.abware.watchdog_client) | Tool-set for the adventure rider | Proprietary/Free | Android | Closed |
|
||||
| [Cachebox 3.0](https://github.com/Longri/cachebox3.0) | Geocaching application | Apache 2.0/Free | Android, Desktop, iOS | Open |
|
||||
| [Cruiser](http://wiki.openstreetmap.org/wiki/Cruiser) | Map and navigation application | Proprietary/Free | Android, Desktop | Closed |
|
||||
| [Cachebox 3.0](https://github.com/Longri/cachebox3.0) | Geocaching application | Apache 2.0/Free | Android, iOS, Desktop | Open |
|
||||
| [Cartograph Maps 3](https://www.cartograph.eu) | Map viewing and track recording | Proprietary/Free (in-app purchases) | Android, iOS, Desktop | Closed |
|
||||
| [Cruiser](https://wiki.openstreetmap.org/wiki/Cruiser) | Map and navigation platform | Proprietary/Free | Android, Desktop | Closed |
|
||||
| [GCDroid](https://play.google.com/store/apps/details?id=com.gcdroid) | Geocaching App | Proprietary/Free and Commercial | Android | Closed |
|
||||
| [GPSLogger II](https://play.google.com/store/apps/details?id=com.emacberry.gpslogger) | Map and navigation, Fitness & Cycling application | Proprietary/Free | Android | Closed |
|
||||
| [HabanaTrans](https://play.google.com/store/apps/details?id=cu.pabloapk.habanatrans&hl=es_419) | Public transport, map offline, gps, routing | Proprietary/Free | Android | Closed |
|
||||
| [Hunt Cyprus](https://play.google.com/store/apps/developer?id=Talent+S.A.) | Map and navigation application for hunters | Proprietary/Free and Commercial | Android | Closed |
|
||||
| [Kurviger](https://kurviger.de/en) | Route planner specialized on motorcyclists | Proprietary/Free (in-app purchases) | Android | Closed |
|
||||
| [MapTrek](http://maptrek.mobi) | Application for outdoor activities | GPL3/Free and Commercial | Android | Open |
|
||||
| [Kurviger](https://play.google.com/store/apps/details?id=gr.talent.kurviger) | Route planner specialized on motorcyclists | Proprietary/Free (in-app purchases) | Android | Closed |
|
||||
| [MyRunningApp](https://play.google.com/store/apps/details?id=it.nimarsolutions.rungpstracker) | Fitness app | Proprietary/Free | Android | Closed |
|
||||
| [MyTourbook](http://mytourbook.sourceforge.net/mytourbook/) | Visualize and analyze tours | GPL2/Free | Desktop | Open |
|
||||
| [Navi Cyprus](https://play.google.com/store/apps/developer?id=Talent+S.A.) | Map and navigation application | Proprietary/Free and Commercial | Android | Closed |
|
||||
| [Pocket Maps](https://github.com/junjunguo/PocketMaps) | Offline maps, routing & tracking functions | MIT/Free | Android | Open |
|
||||
| Tokyo Ogiqvo | Visualize App | Commercial | [Android](https://play.google.com/store/apps/details?id=com.ogiqvo.view.tokyo&hl=ja), [iOS](https://itunes.apple.com/us/app/tokyo-ogiqvo/id1097100677?mt=8) | Closed |
|
||||
| [topoGuide](http://www.topoguide.gr/index-en.php) | Digital guides for the outdoor | Proprietary/Free and Commercial | Android | Closed |
|
||||
| [Trekarta](https://github.com/andreynovikov/trekarta) | Application for outdoor activities | GPL3/Free and Commercial | Android | Open |
|
||||
| [Ubitrek](https://play.google.com/store/apps/details?id=ubicarta.ubitrek) | Hiking with IGN maps | Proprietary/Free | Android | Closed |
|
||||
| [VTM with Eclipse RCP](https://github.com/wolfgang-ch/vtm-with-rcp) | VTM with an Eclipse RCP application | GPL3/Free | Desktop | Open |
|
||||
| [Walkaholic](https://play.google.com/store/apps/details?id=com.walkaholic.hikeapp) | Hiking app with official routes and online/offline maps | Proprietary/Free (in-app purchases) | Android | Closed |
|
||||
|
||||
@@ -1,8 +1,39 @@
|
||||
# Changelog
|
||||
|
||||
## New since 0.16.0
|
||||
## New since 0.19.0
|
||||
|
||||
- Many other minor improvements and bug fixes
|
||||
- Motorider map theme [#1045](https://github.com/mapsforge/vtm/pull/1045)
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.20.0)
|
||||
|
||||
## Version 0.19.0 (2023-04-26)
|
||||
|
||||
- Render themes: line texture improvements [#1008](https://github.com/mapsforge/vtm/pull/1008)
|
||||
- Biker map theme [#995](https://github.com/mapsforge/vtm/pull/995)
|
||||
- MVT simplification [#956](https://github.com/mapsforge/vtm/pull/956)
|
||||
- `Parameters.SIMPLIFICATION_TOLERANCE`, `Parameters.SIMPLIFICATION_EXCEPTIONS`
|
||||
- libGDX 1.11.0 [#972](https://github.com/mapsforge/vtm/pull/972) [#977](https://github.com/mapsforge/vtm/pull/977)
|
||||
- Disable `vtm-jeo` [#997](https://github.com/mapsforge/vtm/pull/997)
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.19.0)
|
||||
|
||||
## Version 0.18.0 (2022-06-18)
|
||||
|
||||
- Mapsforge: deduplicate maps [#903](https://github.com/mapsforge/vtm/pull/903)
|
||||
- Fix overlapping map regions [#903](https://github.com/mapsforge/vtm/pull/903) [#905](https://github.com/mapsforge/vtm/pull/905)
|
||||
- Fix `vtm-jni64.dll` [#911](https://github.com/mapsforge/vtm/pull/911)
|
||||
- Mapsforge: simplification exceptions [#906](https://github.com/mapsforge/vtm/pull/906)
|
||||
- `Parameters.SIMPLIFICATION_EXCEPTIONS`
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.18.0)
|
||||
|
||||
## Version 0.17.0 (2022-01-03)
|
||||
|
||||
- Drawable style point reduction option [#862](https://github.com/mapsforge/vtm/pull/862)
|
||||
- Drawable style texture repeat option [#862](https://github.com/mapsforge/vtm/pull/862)
|
||||
- Draggable marker Android sample [#869](https://github.com/mapsforge/vtm/pull/869)
|
||||
- Move cluster experiment in samples [#858](https://github.com/mapsforge/vtm/pull/858)
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.17.0)
|
||||
|
||||
## Version 0.16.0 (2021-05-27)
|
||||
@@ -13,7 +44,7 @@
|
||||
- Nautical unit adapter with feet [#803](https://github.com/mapsforge/vtm/pull/803)
|
||||
- Distant labels rendering option [#844](https://github.com/mapsforge/vtm/pull/844)
|
||||
- `Parameters.DISTANT_LABELS`
|
||||
- Many other minor improvements and bug fixes
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.16.0)
|
||||
|
||||
## Version 0.15.0 (2021-01-01)
|
||||
@@ -24,7 +55,7 @@
|
||||
- Render theme xml pull parser [#786](https://github.com/mapsforge/vtm/pull/786)
|
||||
- Symbol scale option [#790](https://github.com/mapsforge/vtm/pull/790)
|
||||
- `Parameters.SYMBOL_SCALING`
|
||||
- Many other minor improvements and bug fixes
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.15.0)
|
||||
|
||||
## Version 0.14.0 (2020-08-25)
|
||||
@@ -34,7 +65,7 @@
|
||||
- Marker renderer sort option
|
||||
- `Parameters.MARKER_SORT`
|
||||
- Update vtm-jeo module [#770](https://github.com/mapsforge/vtm/pull/770)
|
||||
- Many other minor improvements and bug fixes
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.14.0)
|
||||
|
||||
## Version 0.13.0 (2020-01-12)
|
||||
@@ -49,7 +80,7 @@
|
||||
- `MapView.OPENGL_VERSION`
|
||||
- Android: threaded system initialization
|
||||
- `Parameters.THREADED_INIT`
|
||||
- Many other minor improvements and bug fixes
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.13.0)
|
||||
|
||||
## Version 0.12.0 (2019-09-17)
|
||||
@@ -66,14 +97,14 @@
|
||||
- `Parameters.POLY_LABEL`
|
||||
- Android 10 compatibility [#728](https://github.com/mapsforge/vtm/issues/728)
|
||||
- libGDX 1.9.10 [#731](https://github.com/mapsforge/vtm/issues/731)
|
||||
- Many other minor improvements and bug fixes
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.12.0)
|
||||
|
||||
## Version 0.11.1 (2019-04-12)
|
||||
|
||||
- MBTiles raster tile source (Android) [#708](https://github.com/mapsforge/vtm/pull/708)
|
||||
- Fix Android 4.2 crash [#713](https://github.com/mapsforge/vtm/issues/713)
|
||||
- Many other minor improvements and bug fixes
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.11.1)
|
||||
|
||||
## Version 0.11.0 (2019-03-25)
|
||||
@@ -99,7 +130,7 @@
|
||||
- OpenGL ES 3.0 support [#646](https://github.com/mapsforge/vtm/issues/646)
|
||||
- OpenGL ES 2.0 complete [#642](https://github.com/mapsforge/vtm/pull/642)
|
||||
- libGDX 1.9.9 [#635](https://github.com/mapsforge/vtm/issues/635)
|
||||
- Many other minor improvements and bug fixes
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.11.0)
|
||||
|
||||
## Version 0.10.0 (2018-08-28)
|
||||
@@ -135,7 +166,7 @@
|
||||
- Android 9 compatibility [#550](https://github.com/mapsforge/vtm/issues/550)
|
||||
- JTS (LocationTech) [#484](https://github.com/mapsforge/vtm/issues/484)
|
||||
- SVG Salamander (JitPack) [#560](https://github.com/mapsforge/vtm/issues/560)
|
||||
- Many other minor improvements and bug fixes
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.10.0)
|
||||
|
||||
## Version 0.9.2 (2018-01-04)
|
||||
@@ -148,7 +179,7 @@
|
||||
|
||||
- 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
|
||||
- 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)
|
||||
@@ -177,7 +208,7 @@
|
||||
- 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
|
||||
- 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)
|
||||
@@ -203,7 +234,7 @@
|
||||
- Gretty plugin at web modules [#338](https://github.com/mapsforge/vtm/issues/338)
|
||||
- libGDX 1.9.6 [#333](https://github.com/mapsforge/vtm/issues/333)
|
||||
- Internal render themes various improvements [#41](https://github.com/mapsforge/vtm/issues/41)
|
||||
- Many other minor improvements and bug fixes
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.8.0)
|
||||
|
||||
## Version 0.7.0 (2017-02-26)
|
||||
@@ -231,7 +262,7 @@
|
||||
- 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)
|
||||
- Many other minor improvements and bug fixes
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.7.0)
|
||||
|
||||
## Version 0.6.0 (2016-10-28) - VTM revival
|
||||
@@ -262,5 +293,5 @@
|
||||
- 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
|
||||
- Minor improvements and bug fixes
|
||||
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.6.0)
|
||||
|
||||
@@ -10,35 +10,34 @@ Current version is [
|
||||
```groovy
|
||||
runtimeOnly 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-armeabi-v7a'
|
||||
runtimeOnly 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-arm64-v8a'
|
||||
runtimeOnly 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86'
|
||||
runtimeOnly 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86_64'
|
||||
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]'
|
||||
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-armeabi-v7a'
|
||||
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-arm64-v8a'
|
||||
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86'
|
||||
implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86_64'
|
||||
implementation 'org.mapsforge:vtm-gdx:[CURRENT-VERSION]'
|
||||
runtimeOnly 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-armeabi-v7a'
|
||||
runtimeOnly 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-arm64-v8a'
|
||||
runtimeOnly 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86'
|
||||
runtimeOnly 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86_64'
|
||||
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]'
|
||||
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-armeabi-v7a'
|
||||
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-arm64-v8a'
|
||||
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86'
|
||||
implementation 'org.mapsforge:vtm-android-gdx:[CURRENT-VERSION]:natives-x86_64'
|
||||
implementation 'com.badlogicgames.gdx:gdx:1.9.10'
|
||||
implementation 'com.badlogicgames.gdx:gdx-backend-android:1.9.10'
|
||||
implementation 'com.badlogicgames.gdx:gdx:1.11.0'
|
||||
implementation 'com.badlogicgames.gdx:gdx-backend-android:1.11.0'
|
||||
implementation 'com.caverock:androidsvg:1.4'
|
||||
```
|
||||
|
||||
@@ -50,32 +49,33 @@ Detailed iOS instructions can be found [here](ios.md).
|
||||
```groovy
|
||||
implementation 'org.mapsforge:vtm-gdx:[CURRENT-VERSION]'
|
||||
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]'
|
||||
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-linux'
|
||||
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-osx'
|
||||
implementation 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-windows'
|
||||
implementation 'com.badlogicgames.gdx:gdx:1.9.10'
|
||||
implementation 'com.badlogicgames.gdx:gdx-platform:1.9.10:natives-desktop'
|
||||
implementation 'com.formdev:svgSalamander:1.1.2.4'
|
||||
runtimeOnly 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-linux'
|
||||
runtimeOnly 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-osx'
|
||||
runtimeOnly 'org.mapsforge:vtm-desktop:[CURRENT-VERSION]:natives-windows'
|
||||
implementation 'com.badlogicgames.gdx:gdx:1.11.0'
|
||||
runtimeOnly 'com.badlogicgames.gdx:gdx-platform:1.11.0:natives-desktop'
|
||||
implementation 'guru.nidi.com.kitfox:svgSalamander:1.1.3'
|
||||
implementation 'net.sf.kxml:kxml2:2.3.0'
|
||||
```
|
||||
|
||||
### Desktop (LWJGL)
|
||||
```groovy
|
||||
implementation 'org.mapsforge:vtm-desktop-lwjgl:[CURRENT-VERSION]'
|
||||
implementation 'com.badlogicgames.gdx:gdx-backend-lwjgl:1.9.10'
|
||||
implementation 'com.badlogicgames.gdx:gdx-backend-lwjgl:1.11.0'
|
||||
implementation 'org.lwjgl.lwjgl:lwjgl:2.9.3'
|
||||
implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-linux'
|
||||
implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-osx'
|
||||
implementation 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-windows'
|
||||
runtimeOnly 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-linux'
|
||||
runtimeOnly 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-osx'
|
||||
runtimeOnly 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3:natives-windows'
|
||||
```
|
||||
|
||||
### Desktop (LWJGL 3)
|
||||
```groovy
|
||||
implementation 'org.mapsforge:vtm-desktop-lwjgl3:[CURRENT-VERSION]'
|
||||
implementation 'com.badlogicgames.gdx:gdx-backend-lwjgl3:1.9.10'
|
||||
implementation 'org.lwjgl:lwjgl:3.2.3'
|
||||
implementation 'org.lwjgl:lwjgl:3.2.3:natives-linux'
|
||||
implementation 'org.lwjgl:lwjgl:3.2.3:natives-macos'
|
||||
implementation 'org.lwjgl:lwjgl:3.2.3:natives-windows'
|
||||
implementation 'com.badlogicgames.gdx:gdx-backend-lwjgl3:1.11.0'
|
||||
implementation 'org.lwjgl:lwjgl:3.3.1'
|
||||
runtimeOnly 'org.lwjgl:lwjgl:3.3.1:natives-linux'
|
||||
runtimeOnly 'org.lwjgl:lwjgl:3.3.1:natives-macos'
|
||||
runtimeOnly 'org.lwjgl:lwjgl:3.3.1:natives-windows'
|
||||
```
|
||||
|
||||
### JTS geometries
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
- [BBBike](https://extract.bbbike.org/?format=mapsforge-osm.zip)
|
||||
- [Freizeitkarte](https://www.freizeitkarte-osm.de/android/en/index.html)
|
||||
- [Kurviger](https://download.kurviger.de/)
|
||||
- [Mapsforge](https://download.mapsforge.org/)
|
||||
- [Mapsforge](https://download.mapsforge.org/) | [Mirror (fast)](http://ftp-stud.hs-esslingen.de/pub/Mirrors/download.mapsforge.org/)
|
||||
- [OpenAndroMaps](https://www.openandromaps.org/en/)
|
||||
- [OpenMaps](https://openmaps.eu/)
|
||||
- [paws.cz](https://osm.paws.cz/)
|
||||
- [vector.city](https://vector.city/)
|
||||
|
||||
@@ -12,6 +12,10 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app"s APK
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
# Enables namespacing of each library's R class so that its R class includes only the
|
||||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
53
gradlew
vendored
53
gradlew
vendored
@@ -1,5 +1,21 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
@@ -66,6 +82,7 @@ esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
@@ -109,10 +126,11 @@ if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
@@ -138,19 +156,19 @@ if $cygwin ; then
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@@ -159,14 +177,9 @@ save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
||||
43
gradlew.bat
vendored
43
gradlew.bat
vendored
@@ -1,3 +1,19 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@@ -13,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
@@ -35,7 +54,7 @@ goto fail
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
@@ -45,28 +64,14 @@ echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'java'
|
||||
|
||||
dependencies {
|
||||
api "com.badlogicgames.gdx:gdx-jnigen:$gdxVersion"
|
||||
implementation "com.badlogicgames.gdx:gdx-jnigen:$gdxVersion"
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
203
jni/jni/build-windows64.xml
Normal file
203
jni/jni/build-windows64.xml
Normal file
@@ -0,0 +1,203 @@
|
||||
<project name="vtm-jni-Windows-64" basedir="." default="postcompile">
|
||||
|
||||
<!-- include the environment -->
|
||||
<property environment="env"/>
|
||||
|
||||
<!-- output directory for temporary object files -->
|
||||
<property name="buildDir" value="target/windows64" />
|
||||
|
||||
<!-- output directory for the shared library -->
|
||||
<property name="libsDir" value="../libs/windows64" />
|
||||
|
||||
<!-- the name of the shared library -->
|
||||
<property name="libName" value="vtm-jni64.dll"/>
|
||||
|
||||
<!-- the jni header jniPlatform to use -->
|
||||
<property name="jniPlatform" value="win32"/>
|
||||
|
||||
<!-- the compiler to use when compiling c files -->
|
||||
<property name="cCompiler" value="gcc"/>
|
||||
|
||||
<!-- the compiler to use when compiling c++ files -->
|
||||
<property name="cppCompiler" value="g++"/>
|
||||
|
||||
<!-- the command to use when archiving files -->
|
||||
<property name="archiver" value="ar"/>
|
||||
|
||||
<!-- the compilerPrefix for the C & C++ compilers -->
|
||||
<property name="compilerPrefix" value="x86_64-w64-mingw32-"/>
|
||||
|
||||
<!-- the compilerSuffix for the C & C++ compilers -->
|
||||
<property name="compilerSuffix" value=".exe" />
|
||||
|
||||
<!-- define gcc compiler, options and files to compile -->
|
||||
<property name="gcc" value="${compilerPrefix}${cCompiler}${compilerSuffix}"/>
|
||||
<property name="gcc-opts" value="-c -Wall -O2 -mfpmath=sse -msse2 -fmessage-length=0 -m64 -Wall -std=c99 -O2 -ffast-math -DNDEBUG"/>
|
||||
<fileset id="gcc-files" dir="./">
|
||||
<exclude name="target/"/>
|
||||
<include name="memcpy_wrap.c"/>
|
||||
<include name="gl/utils.c"/>
|
||||
<include name="libtess2/Source/bucketalloc.c"/>
|
||||
<include name="libtess2/Source/dict.c"/>
|
||||
<include name="libtess2/Source/geom.c"/>
|
||||
<include name="libtess2/Source/mesh.c"/>
|
||||
<include name="libtess2/Source/priorityq.c"/>
|
||||
<include name="libtess2/Source/sweep.c"/>
|
||||
<include name="libtess2/Source/tess.c"/>
|
||||
</fileset>
|
||||
|
||||
<!-- define g++ compiler, options and files to compile -->
|
||||
<property name="g++" value="${compilerPrefix}${cppCompiler}${compilerSuffix}"/>
|
||||
<property name="g++-opts" value="-c -Wall -O2 -mfpmath=sse -msse2 -fmessage-length=0 -m64 -Wall -std=c99 -O2 -ffast-math -DNDEBUG -fpermissive"/>
|
||||
<fileset id="g++-files" dir="./">
|
||||
<exclude name="target/"/>
|
||||
<include name="**/*.cpp"/>
|
||||
</fileset>
|
||||
|
||||
<!-- define linker and options -->
|
||||
<property name="linker" value="${compilerPrefix}${cppCompiler}${compilerSuffix}"/>
|
||||
<property name="linker-opts" value="-Wl,--kill-at -shared -static -static-libgcc -static-libstdc++ -m64"/>
|
||||
<property name="libraries" value=""/>
|
||||
|
||||
<!-- define stripper -->
|
||||
<property name="stripper" value="${compilerPrefix}strip${compilerSuffix}"/>
|
||||
|
||||
<!-- cleans the build directory, removes all object files and shared libs -->
|
||||
<target name="clean">
|
||||
<delete includeemptydirs="true" quiet="true">
|
||||
<fileset dir="${buildDir}"/>
|
||||
<fileset dir="${libsDir}" includes="**/*"/>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="precompile" depends="clean">
|
||||
<condition property="compiler-found">
|
||||
<and>
|
||||
<or>
|
||||
<!-- Include both b/c Windows might be either -->
|
||||
<available file="${g++}" filepath="${env.PATH}"/>
|
||||
<available file="${g++}" filepath="${env.Path}"/>
|
||||
</or>
|
||||
<or>
|
||||
<!-- Include both b/c Windows might be either -->
|
||||
<available file="${gcc}" filepath="${env.PATH}"/>
|
||||
<available file="${gcc}" filepath="${env.Path}"/>
|
||||
</or>
|
||||
</and>
|
||||
</condition>
|
||||
<condition property="has-compiler">
|
||||
<equals arg1="${compiler-found}" arg2="true"/>
|
||||
</condition>
|
||||
<condition property="stripper-found">
|
||||
<or>
|
||||
<!-- Include both b/c Windows might be either -->
|
||||
<available file="${stripper}" filepath="${env.PATH}"/>
|
||||
<available file="${stripper}" filepath="${env.Path}"/>
|
||||
</or>
|
||||
</condition>
|
||||
<condition property="should-strip">
|
||||
<and>
|
||||
<equals arg1="${stripper-found}" arg2="true"/>
|
||||
<equals arg1="${release}" arg2="true"/>
|
||||
<!-- Don't strip mac osx libs -->
|
||||
<not>
|
||||
<contains string="${libName}" substring="dylib"/>
|
||||
</not>
|
||||
</and>
|
||||
</condition>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="create-build-dir" depends="precompile" if="has-compiler">
|
||||
<!-- FIXME this is pretty nasty :/ -->
|
||||
<copy todir="${buildDir}">
|
||||
<fileset refid="g++-files"/>
|
||||
<fileset refid="gcc-files"/>
|
||||
</copy>
|
||||
<delete>
|
||||
<fileset dir="${buildDir}">
|
||||
<include name="*"/>
|
||||
<exclude name="*.o"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<!-- compiles all C and C++ files to object files in the build directory -->
|
||||
<target name="compile" depends="create-build-dir" if="has-compiler">
|
||||
<mkdir dir="${buildDir}"/>
|
||||
<apply failonerror="true" executable="${g++}" dest="${buildDir}" verbose="true">
|
||||
<arg line="${g++-opts}"/>
|
||||
<arg value="-Ijni-headers"/>
|
||||
<arg value="-Ijni-headers/${jniPlatform}"/>
|
||||
<arg value="-I."/>
|
||||
<arg value="-I."/>
|
||||
<arg value="-Ilibtess2/Include"/>
|
||||
|
||||
<srcfile/>
|
||||
<arg value="-o"/>
|
||||
<targetfile/>
|
||||
<fileset refid="g++-files"/>
|
||||
<compositemapper>
|
||||
<mapper type="glob" from="*.cpp" to="*.o"/>
|
||||
<mapper type="glob" from="*.mm" to="*.o"/>
|
||||
</compositemapper>
|
||||
</apply>
|
||||
<apply failonerror="true" executable="${gcc}" dest="${buildDir}" verbose="true">
|
||||
<arg line="${gcc-opts}"/>
|
||||
<arg value="-Ijni-headers"/>
|
||||
<arg value="-Ijni-headers/${jniPlatform}"/>
|
||||
<arg value="-I."/>
|
||||
<arg value="-I."/>
|
||||
<arg value="-Ilibtess2/Include"/>
|
||||
<arg value="-Ilibtess2/Source"/>
|
||||
|
||||
<srcfile/>
|
||||
<arg value="-o"/>
|
||||
<targetfile/>
|
||||
<fileset refid="gcc-files"/>
|
||||
<compositemapper>
|
||||
<mapper type="glob" from="*.c" to="*.o"/>
|
||||
<mapper type="glob" from="*.m" to="*.o"/>
|
||||
</compositemapper>
|
||||
</apply>
|
||||
</target>
|
||||
|
||||
<!-- links the shared library based on the previously compiled object files -->
|
||||
<target name="link" depends="compile" if="has-compiler">
|
||||
<fileset dir="${buildDir}" id="objFileSet">
|
||||
<patternset>
|
||||
<include name="**/*.o" />
|
||||
</patternset>
|
||||
</fileset>
|
||||
<pathconvert pathsep=" " property="objFiles" refid="objFileSet" />
|
||||
<mkdir dir="${libsDir}" />
|
||||
<exec executable="${linker}" failonerror="true" dir="${buildDir}">
|
||||
<arg line="${linker-opts}" />
|
||||
<arg value="-o" />
|
||||
<arg path="${libsDir}/${libName}" />
|
||||
<arg line="${objFiles}"/>
|
||||
<arg line="${libraries}" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<!-- strips the shared library of debug symbols -->
|
||||
<target name="strip" depends="link" if="should-strip">
|
||||
<exec executable="${stripper}" failonerror="true" dir="${buildDir}">
|
||||
<arg value="--strip-unneeded"/>
|
||||
<arg path="${libsDir}/${libName}" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<!-- copy dll into dev environment
|
||||
<target name="copyDLL" depends="link">
|
||||
<copy
|
||||
file ="${libsDir}/${libName}"
|
||||
todir ="C:/DAT/MT/mytourbook/bundles/net.tourbook.ext.vtm.windows/natives"
|
||||
/>
|
||||
</target>
|
||||
-->
|
||||
|
||||
<target name="postcompile" depends="strip">
|
||||
|
||||
</target>
|
||||
</project>
|
||||
@@ -102,7 +102,7 @@ matrix4_proj2D(float* mat, float* vec, float *out);
|
||||
|
||||
jlong JNI(alloc)(JNIEnv *env, jclass* clazz)
|
||||
{
|
||||
return (long) calloc(16, sizeof(float));
|
||||
return (jlong) calloc(16, sizeof(float));
|
||||
}
|
||||
|
||||
jobject JNI(getBuffer)(JNIEnv *env, jclass* clazz,jlong ptr){
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
//@line:131
|
||||
{
|
||||
if (size <= 0)
|
||||
return (long)tessNewTess(0);
|
||||
return (jlong)tessNewTess(0);
|
||||
if (size > 10)
|
||||
size = 10;
|
||||
TESSalloc ma;
|
||||
@@ -39,7 +39,7 @@
|
||||
ma.regionBucketSize = 1 << size; // 256
|
||||
ma.extraVertices = 8;
|
||||
//ma.extraVertices = 256;
|
||||
return (long)tessNewTess(&ma);
|
||||
return (jlong)tessNewTess(&ma);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
}
|
||||
rootProject.name = 'vtm-parent'
|
||||
include ':vtm'
|
||||
include ':vtm-android'
|
||||
@@ -14,7 +30,7 @@ include ':vtm-gdx-poi3d'
|
||||
include ':vtm-http'
|
||||
include ':vtm-ios'
|
||||
include ':vtm-ios-example'
|
||||
include ':vtm-jeo'
|
||||
//include ':vtm-jeo'
|
||||
include ':vtm-json'
|
||||
include ':vtm-jts'
|
||||
include ':vtm-models'
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.oscim.android.test"
|
||||
android:installLocation="auto"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission
|
||||
@@ -19,7 +19,8 @@
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity
|
||||
android:name=".Samples"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize">
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
@@ -34,6 +35,9 @@
|
||||
<activity
|
||||
android:name=".ClusterMarkerOverlayActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
android:name=".DraggableMarkerOverlayActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
android:name=".FragmentActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
@@ -46,9 +50,9 @@
|
||||
<activity
|
||||
android:name=".GdxPoi3DActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
<activity
|
||||
<!--<activity
|
||||
android:name=".JeoIndoorActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />-->
|
||||
<activity
|
||||
android:name=".LineTexActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||
|
||||
@@ -5,7 +5,7 @@ dependencies {
|
||||
implementation project(':vtm-android-mvt')
|
||||
implementation project(':vtm-extras')
|
||||
implementation project(':vtm-http')
|
||||
implementation project(':vtm-jeo')
|
||||
//implementation project(':vtm-jeo')
|
||||
implementation project(':vtm-json')
|
||||
implementation project(':vtm-jts')
|
||||
implementation project(':vtm-mvt')
|
||||
@@ -16,27 +16,23 @@ dependencies {
|
||||
implementation project(':vtm-gdx')
|
||||
implementation project(':vtm-gdx-poi3d')
|
||||
|
||||
implementation 'org.mapsforge:mapsforge-poi-android:0.16.0'
|
||||
implementation 'org.mapsforge:sqlite-android:0.16.0:natives-armeabi-v7a'
|
||||
implementation 'org.mapsforge:sqlite-android:0.16.0:natives-arm64-v8a'
|
||||
implementation 'org.mapsforge:sqlite-android:0.16.0:natives-x86'
|
||||
implementation 'org.mapsforge:sqlite-android:0.16.0:natives-x86_64'
|
||||
implementation 'org.mapsforge:mapsforge-poi-android:master-SNAPSHOT'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion androidCompileSdk()
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
namespace 'org.oscim.android.test'
|
||||
compileSdk androidCompileSdk()
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_7
|
||||
targetCompatibility JavaVersion.VERSION_1_7
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
versionCode project.versionCode()
|
||||
versionName project.versionName()
|
||||
minSdkVersion androidMinSdk()
|
||||
targetSdkVersion androidTargetSdk()
|
||||
minSdk androidMinSdk()
|
||||
targetSdk androidTargetSdk()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
@@ -56,12 +52,14 @@ android {
|
||||
release.setRoot('build-types/release')
|
||||
}
|
||||
|
||||
lintOptions { abortOnError false }
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
exclude 'META-INF/services/org.jeo.data.Driver'
|
||||
exclude 'META-INF/LICENSE'
|
||||
exclude 'META-INF/NOTICE'
|
||||
resources {
|
||||
excludes += ['META-INF/services/io.jeo.data.Driver', 'META-INF/LICENSE', 'META-INF/NOTICE']
|
||||
}
|
||||
}
|
||||
|
||||
/*buildTypes {
|
||||
@@ -84,3 +82,7 @@ task run(dependsOn: 'installDebug') {
|
||||
proc.waitFor()
|
||||
}
|
||||
}
|
||||
|
||||
if (System.getenv('ANDROID_HOME') == null) {
|
||||
throw new GradleException("Environment variable ANDROID_HOME needs to be set to SDK folder")
|
||||
}
|
||||
|
||||
10
vtm-android-example/res/layout/activity_map_draggable.xml
Normal file
10
vtm-android-example/res/layout/activity_map_draggable.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<org.oscim.android.drag.DragMapView
|
||||
android:id="@+id/mapView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -28,7 +28,7 @@
|
||||
<string name="search_value">void or value</string>
|
||||
<string name="now">Now</string>
|
||||
<string name="warning">Warning</string>
|
||||
<string name="startup_message_mbtiles">To run this sample activity, you need an MBTiles database installed on storage.\n\nadb push %s %s</string>
|
||||
<string name="startup_message_mbtiles">To run this sample activity, you need an MBTiles database installed on storage.</string>
|
||||
<string name="exit">Exit</string>
|
||||
<string name="replace_fragment">Replace fragment</string>
|
||||
<string name="empty_fragment_text">This is a fragment to test the back stack behaviour of the map fragment.</string>
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
* 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.layers.marker;
|
||||
package org.oscim.android.cluster;
|
||||
|
||||
import org.oscim.backend.canvas.Bitmap;
|
||||
import org.oscim.core.MercatorProjection;
|
||||
import org.oscim.core.PointF;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.layers.marker.utils.ScreenUtils;
|
||||
import org.oscim.layers.marker.*;
|
||||
import org.oscim.layers.marker.utils.SparseIntArray;
|
||||
import org.oscim.renderer.GLViewport;
|
||||
import org.oscim.renderer.bucket.SymbolItem;
|
||||
@@ -45,7 +45,7 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
||||
/**
|
||||
* default color of number inside the icon. Would be super-cool to cook this into the map theme
|
||||
*/
|
||||
private static int CLUSTER_COLORTEXT = 0xff8000c0;
|
||||
private static final int CLUSTER_COLORTEXT = 0xff8000c0;
|
||||
|
||||
/**
|
||||
* default color of circle background
|
||||
@@ -84,12 +84,12 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
||||
* We use a flat Sparse array to calculate the clusters. The sparse array models a 2D map where every (x,y) denotes
|
||||
* a grid slot, ie. 64x64dp. For efficiency I use a linear sparsearray with ARRindex = SLOTypos * max_x + SLOTxpos"
|
||||
*/
|
||||
private SparseIntArray mGridMap = new SparseIntArray(200); // initial space for 200 markers, that's not a lot of memory, and in most cases will avoid resizing the array
|
||||
private final SparseIntArray mGridMap = new SparseIntArray(200); // initial space for 200 markers, that's not a lot of memory, and in most cases will avoid resizing the array
|
||||
|
||||
/**
|
||||
* Whether to enable clustering or disable the functionality
|
||||
*/
|
||||
private boolean mClusteringEnabled = false;
|
||||
private final boolean mClusteringEnabled;
|
||||
|
||||
/**
|
||||
* Constructs a clustered marker renderer
|
||||
@@ -139,18 +139,18 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
||||
*/
|
||||
private void repopulateCluster(int size, double scale) {
|
||||
/* the grid slot size in px. increase to group more aggressively. currently set to marker size */
|
||||
final int GRIDSIZE = ScreenUtils.getPixels(MAP_GRID_SIZE_DP);
|
||||
final int GRIDSIZE = ClusterUtils.getPixels(MAP_GRID_SIZE_DP);
|
||||
|
||||
/* the factor to map into Grid Coordinates (discrete squares of GRIDSIZE x GRIDSIZE) */
|
||||
final double factor = (scale / GRIDSIZE);
|
||||
|
||||
InternalItem.Clustered[] tmp = new InternalItem.Clustered[size];
|
||||
Clustered[] tmp = new Clustered[size];
|
||||
|
||||
// clear grid map to count items that share the same "grid slot"
|
||||
mGridMap.clear();
|
||||
|
||||
for (int i = 0; i < size; i++) {
|
||||
InternalItem.Clustered it = tmp[i] = new InternalItem.Clustered();
|
||||
Clustered it = tmp[i] = new Clustered();
|
||||
|
||||
it.item = mMarkerLayer.createItem(i);
|
||||
|
||||
@@ -160,7 +160,7 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
||||
it.py = mMapPoint.y;
|
||||
|
||||
// items can be declared non-clusterable
|
||||
if (!(it.item instanceof MarkerItem.NonClusterable)) {
|
||||
if (!(it.item instanceof NonClusterable)) {
|
||||
|
||||
final int
|
||||
absposx = (int) (it.px * factor), // absolute item X position in the grid
|
||||
@@ -244,7 +244,7 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
||||
int numVisible = 0;
|
||||
|
||||
// Increase view to show items that are partially visible
|
||||
mMarkerLayer.map().viewport().getMapExtents(mBox, Tile.SIZE / 2);
|
||||
mMarkerLayer.map().viewport().getMapExtents(mBox, Tile.SIZE >> 1);
|
||||
|
||||
long flip = (long) (Tile.SIZE * v.pos.scale) >> 1;
|
||||
|
||||
@@ -262,7 +262,7 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
||||
|
||||
/* check visibility */
|
||||
for (InternalItem itm : mItems) {
|
||||
InternalItem.Clustered it = (InternalItem.Clustered) itm;
|
||||
Clustered it = (Clustered) itm;
|
||||
|
||||
it.changes = false;
|
||||
it.x = (float) ((it.px - mx) * scale);
|
||||
@@ -318,7 +318,7 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
||||
//log.debug(Arrays.toString(mItems));
|
||||
|
||||
for (InternalItem itm : mItems) {
|
||||
InternalItem.Clustered it = (InternalItem.Clustered) itm;
|
||||
Clustered it = (Clustered) itm;
|
||||
|
||||
// skip invisible AND clustered-out
|
||||
if ((!it.visible) || (it.clusteredOut))
|
||||
@@ -387,7 +387,7 @@ public class ClusterMarkerRenderer extends MarkerRenderer {
|
||||
// create and cache bitmap. This is unacceptable inside the GL thread,
|
||||
// so we'll call this routine at the beginning to pre-cache all bitmaps
|
||||
|
||||
ScreenUtils.ClusterDrawable drawable = new ScreenUtils.ClusterDrawable(
|
||||
ClusterUtils.ClusterDrawable drawable = new ClusterUtils.ClusterDrawable(
|
||||
MAP_MARKER_CLUSTER_SIZE_DP - CLUSTER_MAXSIZE + size, // make size dependent on cluster size
|
||||
mStyleForeground,
|
||||
mStyleBackground,
|
||||
@@ -14,7 +14,7 @@
|
||||
* 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.layers.marker.utils;
|
||||
package org.oscim.android.cluster;
|
||||
|
||||
import org.oscim.backend.CanvasAdapter;
|
||||
import org.oscim.backend.canvas.Bitmap;
|
||||
@@ -25,7 +25,7 @@ import org.oscim.backend.canvas.Paint;
|
||||
* A simple utility class to make clustered markers functionality self-contained.
|
||||
* Includes a method to translate between DPs and PXs and a circular icon generator.
|
||||
*/
|
||||
public class ScreenUtils {
|
||||
public class ClusterUtils {
|
||||
|
||||
/**
|
||||
* Get pixels from DPs
|
||||
@@ -38,8 +38,9 @@ public class ScreenUtils {
|
||||
}
|
||||
|
||||
public static class ClusterDrawable {
|
||||
private Paint mPaintText = CanvasAdapter.newPaint();
|
||||
private Paint mPaintCircle = CanvasAdapter.newPaint(), mPaintBorder = CanvasAdapter.newPaint();
|
||||
private final Paint mPaintText = CanvasAdapter.newPaint();
|
||||
private final Paint mPaintCircle = CanvasAdapter.newPaint();
|
||||
private final Paint mPaintBorder = CanvasAdapter.newPaint();
|
||||
private int mSize;
|
||||
private String mText;
|
||||
|
||||
@@ -57,8 +58,8 @@ public class ScreenUtils {
|
||||
}
|
||||
|
||||
private void setup(int sizedp, int foregroundColor, int backgroundColor) {
|
||||
mSize = ScreenUtils.getPixels(sizedp);
|
||||
mPaintText.setTextSize(ScreenUtils.getPixels((int) (sizedp * 0.6666666)));
|
||||
mSize = ClusterUtils.getPixels(sizedp);
|
||||
mPaintText.setTextSize(ClusterUtils.getPixels((int) (sizedp * 0.6666666)));
|
||||
mPaintText.setColor(foregroundColor);
|
||||
|
||||
mPaintCircle.setColor(backgroundColor);
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2017 nebular
|
||||
* Copyright 2017 devemux86
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.oscim.android.cluster;
|
||||
|
||||
import org.oscim.layers.marker.InternalItem;
|
||||
|
||||
/**
|
||||
* Extension for clustered items.
|
||||
*/
|
||||
public class Clustered extends InternalItem {
|
||||
/**
|
||||
* If this is >0, this item will be displayed as a cluster circle, with size clusterSize+1.
|
||||
*/
|
||||
public int clusterSize;
|
||||
|
||||
/**
|
||||
* If this is true, this item is hidden (because it's represented by another InternalItem acting as cluster.
|
||||
*/
|
||||
public boolean clusteredOut;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2017 nebular
|
||||
* Copyright 2017 devemux86
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.oscim.android.cluster;
|
||||
|
||||
import org.oscim.core.GeoPoint;
|
||||
import org.oscim.layers.marker.MarkerItem;
|
||||
|
||||
/**
|
||||
* If a MarkerItem is created using this convenience class instead of MarkerItem,
|
||||
* this specific item will not be clusterable.
|
||||
*/
|
||||
public class NonClusterable extends MarkerItem {
|
||||
public NonClusterable(String title, String description, GeoPoint geoPoint) {
|
||||
super(null, title, description, geoPoint);
|
||||
}
|
||||
|
||||
public NonClusterable(Object uid, String title, String description, GeoPoint geoPoint) {
|
||||
super(uid, title, description, geoPoint);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2021 Frank Knoll
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.oscim.android.drag;
|
||||
|
||||
import org.oscim.core.GeoPoint;
|
||||
|
||||
public interface DragAndDropListener {
|
||||
|
||||
void startDragItemAtGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint);
|
||||
|
||||
void ongoingDragItemToGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint);
|
||||
|
||||
void dropItemAtGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright 2013 Hannes Janetzek
|
||||
* Copyright 2016 devemux86
|
||||
* Copyright 2021 Frank Knoll
|
||||
*
|
||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.oscim.android.drag;
|
||||
|
||||
import android.view.MotionEvent;
|
||||
import org.oscim.android.input.AndroidMotionEvent;
|
||||
import org.oscim.android.input.GestureHandler;
|
||||
import org.oscim.event.Gesture;
|
||||
import org.oscim.map.Map;
|
||||
|
||||
class DragGestureHandler extends GestureHandler {
|
||||
|
||||
public static final Gesture START_DRAG = new Gesture() {
|
||||
};
|
||||
public static final Gesture ONGOING_DRAG = new Gesture() {
|
||||
};
|
||||
public static final Gesture END_DRAG = new Gesture() {
|
||||
};
|
||||
|
||||
private final AndroidMotionEvent mMotionEvent;
|
||||
private final Map mMap;
|
||||
private boolean scrolling = false;
|
||||
|
||||
public DragGestureHandler(Map map) {
|
||||
super(map);
|
||||
mMotionEvent = new AndroidMotionEvent();
|
||||
mMap = map;
|
||||
}
|
||||
|
||||
public boolean isScrolling() {
|
||||
return scrolling;
|
||||
}
|
||||
|
||||
public void setScrolling(boolean scrolling) {
|
||||
this.scrolling = scrolling;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowPress(MotionEvent e) {
|
||||
scrolling = true;
|
||||
mMap.handleGesture(START_DRAG, mMotionEvent.wrap(e));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
|
||||
scrolling = true;
|
||||
return mMap.handleGesture(ONGOING_DRAG, mMotionEvent.wrap(e2));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2012 Hannes Janetzek
|
||||
* Copyright 2016-2020 devemux86
|
||||
* Copyright 2018-2019 Gustl22
|
||||
* Copyright 2021 Frank Knoll
|
||||
*
|
||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.oscim.android.drag;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.GestureDetector;
|
||||
import org.oscim.android.MapView;
|
||||
import org.oscim.map.Map;
|
||||
import org.oscim.utils.Parameters;
|
||||
|
||||
public class DragMapView extends MapView {
|
||||
|
||||
private DragGestureHandler gestureHandler;
|
||||
|
||||
public DragMapView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public DragMapView(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
|
||||
if (!Parameters.MAP_EVENT_LAYER2) {
|
||||
gestureHandler = new DragGestureHandler(mMap);
|
||||
mGestureDetector = new GestureDetector(context, gestureHandler);
|
||||
mGestureDetector.setOnDoubleTapListener(gestureHandler);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(android.view.MotionEvent motionEvent) {
|
||||
if (!isClickable()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (motionEvent.getAction() == android.view.MotionEvent.ACTION_UP) {
|
||||
if (gestureHandler.isScrolling()) {
|
||||
gestureHandler.setScrolling(false);
|
||||
return ((Map) mMap).handleGesture(DragGestureHandler.END_DRAG, mMotionEvent.wrap(motionEvent));
|
||||
}
|
||||
}
|
||||
|
||||
return super.onTouchEvent(motionEvent);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright 2012 osmdroid authors: Nicolas Gramlich, Theodore Hong, Fred Eisele
|
||||
*
|
||||
* Copyright 2013 Hannes Janetzek
|
||||
* Copyright 2016-2021 devemux86
|
||||
* Copyright 2016 Stephan Leuschner
|
||||
* Copyright 2016 Pedinel
|
||||
* Copyright 2019 Carlos Alberto Martínez Gadea
|
||||
* Copyright 2021 Frank Knoll
|
||||
*
|
||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.oscim.android.drag;
|
||||
|
||||
import org.oscim.core.GeoPoint;
|
||||
import org.oscim.event.Gesture;
|
||||
import org.oscim.event.GestureListener;
|
||||
import org.oscim.event.MotionEvent;
|
||||
import org.oscim.layers.marker.ItemizedLayer;
|
||||
import org.oscim.layers.marker.MarkerInterface;
|
||||
import org.oscim.layers.marker.MarkerSymbol;
|
||||
import org.oscim.map.Map;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.oscim.android.drag.DragGestureHandler.*;
|
||||
|
||||
public class DraggableItemizedLayer extends ItemizedLayer implements GestureListener {
|
||||
|
||||
private final ItemDragger itemDragger;
|
||||
|
||||
public DraggableItemizedLayer(Map map,
|
||||
List<MarkerInterface> markerItems,
|
||||
MarkerSymbol defaultMarker,
|
||||
OnItemGestureListener<MarkerInterface> listener) {
|
||||
super(map, markerItems, defaultMarker, listener);
|
||||
itemDragger = new ItemDragger(this, map);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean activateSelectedItems(MotionEvent event, ActiveItem task) {
|
||||
return super.activateSelectedItems(event, task);
|
||||
}
|
||||
|
||||
protected List<MarkerInterface> getMarkerItems() {
|
||||
return mItemList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onGesture(Gesture gesture, MotionEvent event) {
|
||||
if (!isEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (gesture == START_DRAG) {
|
||||
return itemDragger.startDragItem(event, getGeoPoint(event));
|
||||
} else if (gesture == ONGOING_DRAG) {
|
||||
return itemDragger.ongoingDragItemTo(getGeoPoint(event));
|
||||
} else if (gesture == END_DRAG) {
|
||||
return itemDragger.dropItemAt(getGeoPoint(event));
|
||||
} else {
|
||||
itemDragger.noDrag();
|
||||
}
|
||||
|
||||
return super.onGesture(gesture, event);
|
||||
}
|
||||
|
||||
private GeoPoint getGeoPoint(MotionEvent event) {
|
||||
return map().viewport().fromScreenPoint(event.getX(), event.getY());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright 2012 osmdroid authors:
|
||||
* Copyright 2012 Nicolas Gramlich
|
||||
* Copyright 2012 Theodore Hong
|
||||
* Copyright 2012 Fred Eisele
|
||||
*
|
||||
* Copyright 2014 Hannes Janetzek
|
||||
* Copyright 2016 devemux86
|
||||
* Copyright 2016 Erik Duisters
|
||||
* Copyright 2017 Longri
|
||||
* Copyright 2021 Frank Knoll
|
||||
*
|
||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.oscim.android.drag;
|
||||
|
||||
import org.oscim.core.GeoPoint;
|
||||
import org.oscim.layers.marker.MarkerItem;
|
||||
|
||||
public class DraggableMarkerItem extends MarkerItem {
|
||||
|
||||
private final DragAndDropListener dragAndDropListener;
|
||||
|
||||
public DraggableMarkerItem(String title, String description, GeoPoint geoPoint, DragAndDropListener dragAndDropListener) {
|
||||
super(title, description, geoPoint);
|
||||
this.dragAndDropListener = dragAndDropListener;
|
||||
}
|
||||
|
||||
public DragAndDropListener getDragAndDropListener() {
|
||||
return dragAndDropListener;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright 2021 Frank Knoll
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.oscim.android.drag;
|
||||
|
||||
import org.oscim.core.GeoPoint;
|
||||
import org.oscim.event.MotionEvent;
|
||||
import org.oscim.layers.marker.ItemizedLayer;
|
||||
import org.oscim.layers.marker.MarkerItem;
|
||||
import org.oscim.layers.marker.MarkerLayer;
|
||||
import org.oscim.map.Map;
|
||||
|
||||
class ItemDragger {
|
||||
|
||||
private final DraggableItemizedLayer draggableItemizedLayer;
|
||||
private final DragAndDropListener dragItemAndRedrawListener;
|
||||
private DraggableMarkerItem dragItem;
|
||||
|
||||
public ItemDragger(DraggableItemizedLayer draggableItemizedLayer, Map map) {
|
||||
this.draggableItemizedLayer = draggableItemizedLayer;
|
||||
this.dragItemAndRedrawListener = createDragItemAndRedrawListener(draggableItemizedLayer, map);
|
||||
}
|
||||
|
||||
public boolean startDragItem(MotionEvent event, final GeoPoint geoPoint) {
|
||||
dragItem = null;
|
||||
return draggableItemizedLayer.activateSelectedItems(
|
||||
event,
|
||||
new ItemizedLayer.ActiveItem() {
|
||||
@Override
|
||||
public boolean run(int index) {
|
||||
dragItem = (DraggableMarkerItem) draggableItemizedLayer.getMarkerItems().get(index);
|
||||
dragItemAndRedrawListener.startDragItemAtGeoPoint(dragItem, geoPoint);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public boolean ongoingDragItemTo(GeoPoint geoPoint) {
|
||||
if (dragItem == null) {
|
||||
return false;
|
||||
}
|
||||
dragItemAndRedrawListener.ongoingDragItemToGeoPoint(dragItem, geoPoint);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean dropItemAt(GeoPoint geoPoint) {
|
||||
if (dragItem == null) {
|
||||
return false;
|
||||
}
|
||||
dragItemAndRedrawListener.dropItemAtGeoPoint(dragItem, geoPoint);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void noDrag() {
|
||||
dragItem = null;
|
||||
}
|
||||
|
||||
private DragAndDropListener createDragItemAndRedrawListener(final MarkerLayer markerLayer, final Map map) {
|
||||
return new DragAndDropListener() {
|
||||
@Override
|
||||
public void startDragItemAtGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint) {
|
||||
item.getDragAndDropListener().startDragItemAtGeoPoint(item, geoPoint);
|
||||
updateLocationOfMarkerItemAndRedraw(item, geoPoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ongoingDragItemToGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint) {
|
||||
item.getDragAndDropListener().ongoingDragItemToGeoPoint(item, geoPoint);
|
||||
updateLocationOfMarkerItemAndRedraw(item, geoPoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropItemAtGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint) {
|
||||
item.getDragAndDropListener().dropItemAtGeoPoint(item, geoPoint);
|
||||
updateLocationOfMarkerItemAndRedraw(item, geoPoint);
|
||||
}
|
||||
|
||||
private void updateLocationOfMarkerItemAndRedraw(MarkerItem markerItem, GeoPoint location) {
|
||||
markerItem.geoPoint = location;
|
||||
markerLayer.populate();
|
||||
map.render();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -192,6 +192,7 @@ public class FilePicker extends Activity implements AdapterView.OnItemClickListe
|
||||
// }
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected Dialog onCreateDialog(int id) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
|
||||
@@ -75,34 +75,28 @@ public class BaseMapActivity extends MapActivity {
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.theme_default:
|
||||
int itemId = item.getItemId();
|
||||
if (itemId == R.id.theme_default) {
|
||||
mMap.setTheme(VtmThemes.DEFAULT);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_osmarender:
|
||||
} else if (itemId == R.id.theme_osmarender) {
|
||||
mMap.setTheme(VtmThemes.OSMARENDER);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_osmagray:
|
||||
} else if (itemId == R.id.theme_osmagray) {
|
||||
mMap.setTheme(VtmThemes.OSMAGRAY);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_tubes:
|
||||
} else if (itemId == R.id.theme_tubes) {
|
||||
mMap.setTheme(VtmThemes.TRONRENDER);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_newtron:
|
||||
} else if (itemId == R.id.theme_newtron) {
|
||||
mMap.setTheme(VtmThemes.NEWTRON);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.gridlayer:
|
||||
} else if (itemId == R.id.gridlayer) {
|
||||
if (item.isChecked()) {
|
||||
item.setChecked(false);
|
||||
mMap.layers().remove(mGridLayer);
|
||||
|
||||
@@ -14,14 +14,13 @@
|
||||
*/
|
||||
package org.oscim.android.test;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class BlankFragment extends Fragment {
|
||||
public class BlankFragment extends android.app.Fragment {
|
||||
|
||||
static BlankFragment newInstance() {
|
||||
BlankFragment instance = new BlankFragment();
|
||||
|
||||
@@ -17,6 +17,7 @@ package org.oscim.android.test;
|
||||
|
||||
import android.graphics.BitmapFactory;
|
||||
import org.oscim.android.canvas.AndroidBitmap;
|
||||
import org.oscim.android.cluster.ClusterMarkerRenderer;
|
||||
import org.oscim.backend.canvas.Bitmap;
|
||||
import org.oscim.backend.canvas.Color;
|
||||
import org.oscim.core.GeoPoint;
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright 2014 Hannes Janetzek
|
||||
* Copyright 2016-2020 devemux86
|
||||
* Copyright 2021 Frank Knoll
|
||||
*
|
||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.oscim.android.test;
|
||||
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import org.oscim.android.canvas.AndroidBitmap;
|
||||
import org.oscim.android.drag.DragAndDropListener;
|
||||
import org.oscim.android.drag.DraggableItemizedLayer;
|
||||
import org.oscim.android.drag.DraggableMarkerItem;
|
||||
import org.oscim.core.GeoPoint;
|
||||
import org.oscim.layers.marker.ItemizedLayer;
|
||||
import org.oscim.layers.marker.MarkerInterface;
|
||||
import org.oscim.layers.marker.MarkerSymbol;
|
||||
import org.oscim.layers.marker.MarkerSymbol.HotspotPlace;
|
||||
import org.oscim.layers.tile.bitmap.BitmapTileLayer;
|
||||
import org.oscim.tiling.source.OkHttpEngine;
|
||||
import org.oscim.tiling.source.UrlTileSource;
|
||||
import org.oscim.tiling.source.bitmap.DefaultSources;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class DraggableMarkerOverlayActivity extends MapActivity {
|
||||
|
||||
public DraggableMarkerOverlayActivity() {
|
||||
super(R.layout.activity_map_draggable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
createLayers();
|
||||
}
|
||||
|
||||
void createLayers() {
|
||||
UrlTileSource tileSource = DefaultSources.OPENSTREETMAP
|
||||
.httpFactory(new OkHttpEngine.OkHttpFactory())
|
||||
.build();
|
||||
tileSource.setHttpRequestHeaders(Collections.singletonMap("User-Agent", "vtm-android-example"));
|
||||
mMap.layers().add(new BitmapTileLayer(mMap, tileSource));
|
||||
|
||||
ItemizedLayer mMarkerLayer = new DraggableItemizedLayer(
|
||||
mMap,
|
||||
new ArrayList<MarkerInterface>(),
|
||||
new MarkerSymbol(
|
||||
new AndroidBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.marker_poi)),
|
||||
HotspotPlace.BOTTOM_CENTER),
|
||||
null);
|
||||
mMap.layers().add(mMarkerLayer);
|
||||
|
||||
DragAndDropListener dragAndDropListener = new DragAndDropListener() {
|
||||
@Override
|
||||
public void startDragItemAtGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint) {
|
||||
Log.i(DraggableMarkerOverlayActivity.this.getClass().getSimpleName(), "startDragItemAtGeoPoint: " + geoPoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ongoingDragItemToGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint) {
|
||||
Log.i(DraggableMarkerOverlayActivity.this.getClass().getSimpleName(), "ongoingDragItemToGeoPoint: " + geoPoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropItemAtGeoPoint(DraggableMarkerItem item, GeoPoint geoPoint) {
|
||||
Log.i(DraggableMarkerOverlayActivity.this.getClass().getSimpleName(), "dropItemAtGeoPoint: " + geoPoint);
|
||||
}
|
||||
};
|
||||
|
||||
List<MarkerInterface> pts = new ArrayList<>();
|
||||
for (double lat = -90; lat <= 90; lat += 45) {
|
||||
for (double lon = -180; lon <= 180; lon += 45) {
|
||||
pts.add(new DraggableMarkerItem(lat + "/" + lon, "", new GeoPoint(lat, lon), dragAndDropListener));
|
||||
}
|
||||
}
|
||||
|
||||
mMarkerLayer.addItems(pts);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
/* ignore saved position */
|
||||
mMap.setMapPosition(0, 0, 1 << 2);
|
||||
}
|
||||
}
|
||||
@@ -15,15 +15,13 @@
|
||||
package org.oscim.android.test;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class FragmentActivity extends Activity {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -32,8 +30,8 @@ public class FragmentActivity extends Activity {
|
||||
setTitle(getClass().getSimpleName());
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
Fragment mapFragment = MapFragment.newInstance();
|
||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
android.app.Fragment mapFragment = MapFragment.newInstance();
|
||||
android.app.FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
ft.add(R.id.fragment_container, mapFragment).commit();
|
||||
}
|
||||
}
|
||||
@@ -44,12 +42,11 @@ public class FragmentActivity extends Activity {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.replace_fragment) {
|
||||
Fragment blankFragment = BlankFragment.newInstance();
|
||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
android.app.Fragment blankFragment = BlankFragment.newInstance();
|
||||
android.app.FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
ft.replace(R.id.fragment_container, blankFragment);
|
||||
ft.addToBackStack(null);
|
||||
ft.commit();
|
||||
|
||||
@@ -15,171 +15,171 @@
|
||||
* 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.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
import android.widget.ToggleButton;
|
||||
import io.jeo.map.Style;
|
||||
import io.jeo.vector.VectorDataset;
|
||||
import org.oscim.backend.CanvasAdapter;
|
||||
import org.oscim.backend.canvas.Color;
|
||||
import org.oscim.layers.OSMIndoorLayer;
|
||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||
import org.oscim.test.JeoTest;
|
||||
import org.oscim.theme.VtmThemes;
|
||||
import org.oscim.theme.styles.TextStyle;
|
||||
import org.oscim.utils.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class JeoIndoorActivity extends BaseMapActivity {
|
||||
public static final Logger log = LoggerFactory.getLogger(JeoIndoorActivity.class);
|
||||
|
||||
// from http://overpass-turbo.eu/s/2vp
|
||||
String PATH = "https://gist.githubusercontent.com/anonymous/09062103a66844a96048f25626078c8d/raw/1d3af6a5a55e9ea4adc9551fa633a051a44a5a9c/overpass.geojson";
|
||||
|
||||
private OSMIndoorLayer mIndoorLayer;
|
||||
|
||||
public JeoIndoorActivity() {
|
||||
super(R.layout.jeo_indoor_map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
mMap.addTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showToast("load data");
|
||||
InputStream is = null;
|
||||
try {
|
||||
// File file = new File(Environment.getExternalStorageDirectory()
|
||||
// .getAbsolutePath(), "osmindoor.json");
|
||||
// is = new FileInputStream(file);
|
||||
|
||||
URL url = new URL(PATH);
|
||||
URLConnection conn = url.openConnection();
|
||||
is = conn.getInputStream();
|
||||
loadJson(is);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
IOUtils.closeQuietly(is);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mMap.setTheme(VtmThemes.DEFAULT);
|
||||
|
||||
mMap.layers().add(new BuildingLayer(mMap, mBaseLayer));
|
||||
mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
|
||||
|
||||
// String file = Environment.getExternalStorageDirectory().getAbsolutePath();
|
||||
// VectorDataset data = (VectorDataset) JeoTest.getJsonData(file + "/states.json", true);
|
||||
// Style style = JeoTest.getStyle();
|
||||
// mMap.layers().add(new JeoVectorLayer(mMap, data, style));
|
||||
}
|
||||
|
||||
void loadJson(InputStream is) {
|
||||
showToast("got data");
|
||||
|
||||
VectorDataset data = JeoTest.readGeoJson(is);
|
||||
Style style = JeoTest.getStyle();
|
||||
TextStyle textStyle = TextStyle.builder()
|
||||
.isCaption(true)
|
||||
.fontSize(16 * CanvasAdapter.getScale()).color(Color.BLACK)
|
||||
.strokeWidth(2.2f * CanvasAdapter.getScale()).strokeColor(Color.WHITE)
|
||||
.build();
|
||||
mIndoorLayer = new OSMIndoorLayer(mMap, data, style, textStyle);
|
||||
mMap.layers().add(mIndoorLayer);
|
||||
|
||||
showToast("data ready");
|
||||
mMap.updateMap(true);
|
||||
|
||||
mIndoorLayer.activeLevels[0] = true;
|
||||
shift();
|
||||
}
|
||||
|
||||
public void showToast(final String text) {
|
||||
final Context ctx = this;
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast toast = Toast.makeText(ctx, text, Toast.LENGTH_SHORT);
|
||||
toast.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
boolean mShift = true;
|
||||
|
||||
public void shift() {
|
||||
if (!mShift)
|
||||
return;
|
||||
|
||||
mMap.postDelayed(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
if (mIndoorLayer.activeLevels[i]) {
|
||||
mIndoorLayer.activeLevels[i] = false;
|
||||
mIndoorLayer.activeLevels[(i + 1) % 9] = true;
|
||||
mIndoorLayer.update();
|
||||
break;
|
||||
}
|
||||
}
|
||||
shift();
|
||||
}
|
||||
}, 200);
|
||||
|
||||
}
|
||||
|
||||
public void onClick(View v) {
|
||||
mShift = false;
|
||||
|
||||
if (mIndoorLayer == null)
|
||||
return;
|
||||
|
||||
int i = 0;
|
||||
|
||||
if (v instanceof ToggleButton) {
|
||||
ToggleButton b = (ToggleButton) v;
|
||||
i = (b.getTextOn().charAt(0) - '0') + 1;
|
||||
}
|
||||
|
||||
if (i < 0 || i > 9)
|
||||
i = 0;
|
||||
|
||||
mIndoorLayer.activeLevels[i] ^= true;
|
||||
if (v instanceof ToggleButton)
|
||||
((ToggleButton) v).setChecked(mIndoorLayer.activeLevels[i]);
|
||||
log.debug(Arrays.toString(mIndoorLayer.activeLevels));
|
||||
mIndoorLayer.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
/* ignore saved position */
|
||||
//mMap.setMapPosition(49.417, 8.673, 1 << 17);
|
||||
mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16);
|
||||
}
|
||||
}
|
||||
//package org.oscim.android.test;
|
||||
//
|
||||
//import android.content.Context;
|
||||
//import android.os.Bundle;
|
||||
//import android.view.View;
|
||||
//import android.widget.Toast;
|
||||
//import android.widget.ToggleButton;
|
||||
//import io.jeo.map.Style;
|
||||
//import io.jeo.vector.VectorDataset;
|
||||
//import org.oscim.backend.CanvasAdapter;
|
||||
//import org.oscim.backend.canvas.Color;
|
||||
//import org.oscim.layers.OSMIndoorLayer;
|
||||
//import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||
//import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||
//import org.oscim.test.JeoTest;
|
||||
//import org.oscim.theme.VtmThemes;
|
||||
//import org.oscim.theme.styles.TextStyle;
|
||||
//import org.oscim.utils.IOUtils;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//
|
||||
//import java.io.IOException;
|
||||
//import java.io.InputStream;
|
||||
//import java.net.URL;
|
||||
//import java.net.URLConnection;
|
||||
//import java.util.Arrays;
|
||||
//
|
||||
//public class JeoIndoorActivity extends BaseMapActivity {
|
||||
// public static final Logger log = LoggerFactory.getLogger(JeoIndoorActivity.class);
|
||||
//
|
||||
// // from http://overpass-turbo.eu/s/2vp
|
||||
// String PATH = "https://gist.githubusercontent.com/anonymous/09062103a66844a96048f25626078c8d/raw/1d3af6a5a55e9ea4adc9551fa633a051a44a5a9c/overpass.geojson";
|
||||
//
|
||||
// private OSMIndoorLayer mIndoorLayer;
|
||||
//
|
||||
// public JeoIndoorActivity() {
|
||||
// super(R.layout.jeo_indoor_map);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onCreate(Bundle savedInstanceState) {
|
||||
// super.onCreate(savedInstanceState);
|
||||
//
|
||||
// mMap.addTask(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// showToast("load data");
|
||||
// InputStream is = null;
|
||||
// try {
|
||||
// // File file = new File(Environment.getExternalStorageDirectory()
|
||||
// // .getAbsolutePath(), "osmindoor.json");
|
||||
// // is = new FileInputStream(file);
|
||||
//
|
||||
// URL url = new URL(PATH);
|
||||
// URLConnection conn = url.openConnection();
|
||||
// is = conn.getInputStream();
|
||||
// loadJson(is);
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// } finally {
|
||||
// IOUtils.closeQuietly(is);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// mMap.setTheme(VtmThemes.DEFAULT);
|
||||
//
|
||||
// mMap.layers().add(new BuildingLayer(mMap, mBaseLayer));
|
||||
// mMap.layers().add(new LabelLayer(mMap, mBaseLayer));
|
||||
//
|
||||
// // String file = Environment.getExternalStorageDirectory().getAbsolutePath();
|
||||
// // VectorDataset data = (VectorDataset) JeoTest.getJsonData(file + "/states.json", true);
|
||||
// // Style style = JeoTest.getStyle();
|
||||
// // mMap.layers().add(new JeoVectorLayer(mMap, data, style));
|
||||
// }
|
||||
//
|
||||
// void loadJson(InputStream is) {
|
||||
// showToast("got data");
|
||||
//
|
||||
// VectorDataset data = JeoTest.readGeoJson(is);
|
||||
// Style style = JeoTest.getStyle();
|
||||
// TextStyle textStyle = TextStyle.builder()
|
||||
// .isCaption(true)
|
||||
// .fontSize(16 * CanvasAdapter.getScale()).color(Color.BLACK)
|
||||
// .strokeWidth(2.2f * CanvasAdapter.getScale()).strokeColor(Color.WHITE)
|
||||
// .build();
|
||||
// mIndoorLayer = new OSMIndoorLayer(mMap, data, style, textStyle);
|
||||
// mMap.layers().add(mIndoorLayer);
|
||||
//
|
||||
// showToast("data ready");
|
||||
// mMap.updateMap(true);
|
||||
//
|
||||
// mIndoorLayer.activeLevels[0] = true;
|
||||
// shift();
|
||||
// }
|
||||
//
|
||||
// public void showToast(final String text) {
|
||||
// final Context ctx = this;
|
||||
// runOnUiThread(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// Toast toast = Toast.makeText(ctx, text, Toast.LENGTH_SHORT);
|
||||
// toast.show();
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// boolean mShift = true;
|
||||
//
|
||||
// public void shift() {
|
||||
// if (!mShift)
|
||||
// return;
|
||||
//
|
||||
// mMap.postDelayed(new Runnable() {
|
||||
//
|
||||
// @Override
|
||||
// public void run() {
|
||||
// for (int i = 0; i < 10; i++) {
|
||||
// if (mIndoorLayer.activeLevels[i]) {
|
||||
// mIndoorLayer.activeLevels[i] = false;
|
||||
// mIndoorLayer.activeLevels[(i + 1) % 9] = true;
|
||||
// mIndoorLayer.update();
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// shift();
|
||||
// }
|
||||
// }, 200);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public void onClick(View v) {
|
||||
// mShift = false;
|
||||
//
|
||||
// if (mIndoorLayer == null)
|
||||
// return;
|
||||
//
|
||||
// int i = 0;
|
||||
//
|
||||
// if (v instanceof ToggleButton) {
|
||||
// ToggleButton b = (ToggleButton) v;
|
||||
// i = (b.getTextOn().charAt(0) - '0') + 1;
|
||||
// }
|
||||
//
|
||||
// if (i < 0 || i > 9)
|
||||
// i = 0;
|
||||
//
|
||||
// mIndoorLayer.activeLevels[i] ^= true;
|
||||
// if (v instanceof ToggleButton)
|
||||
// ((ToggleButton) v).setChecked(mIndoorLayer.activeLevels[i]);
|
||||
// log.debug(Arrays.toString(mIndoorLayer.activeLevels));
|
||||
// mIndoorLayer.update();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void onStop() {
|
||||
// super.onStop();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void onResume() {
|
||||
// super.onResume();
|
||||
//
|
||||
// /* ignore saved position */
|
||||
// //mMap.setMapPosition(49.417, 8.673, 1 << 17);
|
||||
// mMap.setMapPosition(53.5620092, 9.9866457, 1 << 16);
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2019 devemux86
|
||||
* Copyright 2016-2021 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
|
||||
@@ -96,6 +96,7 @@ public class LocationActivity extends BitmapTileActivity implements LocationList
|
||||
public void onProviderEnabled(String provider) {
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||
}
|
||||
@@ -103,7 +104,7 @@ public class LocationActivity extends BitmapTileActivity implements LocationList
|
||||
private void enableAvailableProviders() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||
requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 0);
|
||||
requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION}, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2019 devemux86
|
||||
* Copyright 2016-2021 devemux86
|
||||
* Copyright 2018 Longri
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
@@ -126,6 +126,7 @@ public class LocationTextureActivity extends BitmapTileActivity implements Locat
|
||||
public void onProviderEnabled(String provider) {
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||
}
|
||||
@@ -133,7 +134,7 @@ public class LocationTextureActivity extends BitmapTileActivity implements Locat
|
||||
private void enableAvailableProviders() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||
requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 0);
|
||||
requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION}, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class MBTilesBitmapActivity extends BitmapTileActivity {
|
||||
if (!file.exists()) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this)
|
||||
.setTitle(R.string.warning)
|
||||
.setMessage(getResources().getString(R.string.startup_message_mbtiles, file.getName(), file.getAbsolutePath()))
|
||||
.setMessage(getResources().getString(R.string.startup_message_mbtiles))
|
||||
.setPositiveButton(R.string.exit, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
@@ -45,7 +45,7 @@ public class MBTilesMvtActivity extends MapActivity {
|
||||
if (!file.exists()) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this)
|
||||
.setTitle(R.string.warning)
|
||||
.setMessage(getResources().getString(R.string.startup_message_mbtiles, file.getName(), file.getAbsolutePath()))
|
||||
.setMessage(getResources().getString(R.string.startup_message_mbtiles))
|
||||
.setPositiveButton(R.string.exit, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package org.oscim.android.test;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -40,7 +39,7 @@ import java.io.File;
|
||||
* You'll need a map with filename berlin.map from download.mapsforge.org in device storage.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class MapFragment extends Fragment {
|
||||
public class MapFragment extends android.app.Fragment {
|
||||
|
||||
private MapView mapView;
|
||||
private IRenderTheme theme;
|
||||
|
||||
@@ -114,59 +114,52 @@ public class MapsforgeActivity extends MapActivity {
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.theme_default:
|
||||
int itemId = item.getItemId();
|
||||
if (itemId == R.id.theme_default) {
|
||||
if (mTheme != null)
|
||||
mTheme.dispose();
|
||||
mTheme = mMap.setTheme(VtmThemes.DEFAULT);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_osmarender:
|
||||
} else if (itemId == R.id.theme_osmarender) {
|
||||
if (mTheme != null)
|
||||
mTheme.dispose();
|
||||
mTheme = mMap.setTheme(VtmThemes.OSMARENDER);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_osmagray:
|
||||
} else if (itemId == R.id.theme_osmagray) {
|
||||
if (mTheme != null)
|
||||
mTheme.dispose();
|
||||
mTheme = mMap.setTheme(VtmThemes.OSMAGRAY);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_tubes:
|
||||
} else if (itemId == R.id.theme_tubes) {
|
||||
if (mTheme != null)
|
||||
mTheme.dispose();
|
||||
mTheme = mMap.setTheme(VtmThemes.TRONRENDER);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_newtron:
|
||||
} else if (itemId == R.id.theme_newtron) {
|
||||
if (mTheme != null)
|
||||
mTheme.dispose();
|
||||
mTheme = mMap.setTheme(VtmThemes.NEWTRON);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_external_archive:
|
||||
} else if (itemId == R.id.theme_external_archive) {
|
||||
Intent intent = new Intent(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT ? Intent.ACTION_OPEN_DOCUMENT : Intent.ACTION_GET_CONTENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("*/*");
|
||||
startActivityForResult(intent, SELECT_THEME_ARCHIVE);
|
||||
return true;
|
||||
|
||||
case R.id.theme_external:
|
||||
} else if (itemId == R.id.theme_external) {
|
||||
Intent intent;
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
|
||||
return false;
|
||||
intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
startActivityForResult(intent, SELECT_THEME_DIR);
|
||||
return true;
|
||||
|
||||
case R.id.gridlayer:
|
||||
} else if (itemId == R.id.gridlayer) {
|
||||
if (item.isChecked()) {
|
||||
item.setChecked(false);
|
||||
mMap.layers().remove(mGridLayer);
|
||||
|
||||
@@ -37,22 +37,22 @@ public class MapsforgeStyleActivity extends MapsforgeActivity {
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.style_1:
|
||||
int itemId = item.getItemId();
|
||||
if (itemId == R.id.style_1) {
|
||||
item.setChecked(true);
|
||||
loadTheme("1");
|
||||
mMap.clearMap();
|
||||
Toast.makeText(this, "Show nature layers", Toast.LENGTH_SHORT).show();
|
||||
return true;
|
||||
case R.id.style_2:
|
||||
} else if (itemId == R.id.style_2) {
|
||||
item.setChecked(true);
|
||||
loadTheme("2");
|
||||
mMap.clearMap();
|
||||
Toast.makeText(this, "Hide nature layers", Toast.LENGTH_SHORT).show();
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.oscim.android.test;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
@@ -58,6 +57,7 @@ import java.util.List;
|
||||
* Long press on map to search inside visible bounding box.<br/>
|
||||
* Tap on POIs to show their name (in default locale).
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PoiSearchActivity extends MapsforgeActivity implements ItemizedLayer.OnItemGestureListener<MarkerInterface> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PoiSearchActivity.class);
|
||||
@@ -275,7 +275,7 @@ public class PoiSearchActivity extends MapsforgeActivity implements ItemizedLaye
|
||||
}
|
||||
}
|
||||
|
||||
private class PoiSearchTask extends AsyncTask<BoundingBox, Void, Collection<PointOfInterest>> {
|
||||
private class PoiSearchTask extends android.os.AsyncTask<BoundingBox, Void, Collection<PointOfInterest>> {
|
||||
private final WeakReference<PoiSearchActivity> weakActivity;
|
||||
private final String category;
|
||||
private final List<Tag> patterns;
|
||||
@@ -297,7 +297,7 @@ public class PoiSearchActivity extends MapsforgeActivity implements ItemizedLaye
|
||||
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 mPersistenceManager.findInRect(bb, categoryFilter, patterns, Integer.MAX_VALUE);
|
||||
return mPersistenceManager.findInRect(bb, categoryFilter, patterns, null, Integer.MAX_VALUE);
|
||||
} catch (Throwable t) {
|
||||
log.error(t.getMessage(), t);
|
||||
}
|
||||
|
||||
@@ -121,9 +121,10 @@ public class Samples extends Activity {
|
||||
linearLayout.addView(createLabel("Experiments"));
|
||||
linearLayout.addView(createButton(ReverseGeocodeActivity.class));
|
||||
linearLayout.addView(createButton(ThemeStylerActivity.class));
|
||||
linearLayout.addView(createButton(JeoIndoorActivity.class));
|
||||
//linearLayout.addView(createButton(JeoIndoorActivity.class));
|
||||
linearLayout.addView(createButton(GdxPoi3DActivity.class));
|
||||
linearLayout.addView(createButton(OverpassActivity.class));
|
||||
linearLayout.addView(createButton(DraggableMarkerOverlayActivity.class));
|
||||
linearLayout.addView(createButton(ClusterMarkerOverlayActivity.class));
|
||||
linearLayout.addView(createButton(FragmentActivity.class));
|
||||
}
|
||||
|
||||
@@ -163,16 +163,13 @@ public class ThemeStylerActivity extends BaseMapActivity implements OnSeekBarCha
|
||||
return;
|
||||
|
||||
HSV c = null;
|
||||
switch (view.getId()) {
|
||||
case R.id.checkBoxArea:
|
||||
int id = view.getId();
|
||||
if (id == R.id.checkBoxArea) {
|
||||
c = areaColor;
|
||||
break;
|
||||
case R.id.checkBoxLine:
|
||||
} else if (id == R.id.checkBoxLine) {
|
||||
c = lineColor;
|
||||
break;
|
||||
case R.id.checkBoxOutline:
|
||||
} else if (id == R.id.checkBoxOutline) {
|
||||
c = outlineColor;
|
||||
break;
|
||||
}
|
||||
if (c == null)
|
||||
return;
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<manifest package="org.oscim.gdx" />
|
||||
@@ -1,57 +1,31 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.github.dcendents.android-maven'
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
dependencies {
|
||||
compileOnly files("${System.env.ANDROID_HOME}/platforms/android-${androidCompileSdk()}/android.jar")
|
||||
api project(':vtm')
|
||||
api "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion androidCompileSdk()
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_7
|
||||
targetCompatibility JavaVersion.VERSION_1_7
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
versionCode project.versionCode()
|
||||
versionName project.versionName()
|
||||
minSdkVersion androidMinSdk()
|
||||
targetSdkVersion androidTargetSdk()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile 'AndroidManifest.xml'
|
||||
java.srcDirs = ['src']
|
||||
}
|
||||
debug.setRoot('build-types/debug')
|
||||
release.setRoot('build-types/release')
|
||||
}
|
||||
|
||||
lintOptions { abortOnError false }
|
||||
sourceSets {
|
||||
main.java.srcDirs = ['src']
|
||||
}
|
||||
|
||||
android.libraryVariants.all { variant ->
|
||||
def name = variant.buildType.name
|
||||
if (name == "debug")
|
||||
return
|
||||
|
||||
def jar = project.tasks.create "jar${name.capitalize()}", Jar
|
||||
jar.dependsOn variant.javaCompileProvider
|
||||
jar.exclude '**/BuildConfig.class'
|
||||
jar.exclude '**/R.class'
|
||||
jar.exclude '**/R$*.class'
|
||||
jar.from variant.javaCompileProvider.get().destinationDir
|
||||
artifacts.add('archives', jar)
|
||||
file('natives').eachDir() { dir ->
|
||||
task("nativesJar-${dir.name}", type: Jar) {
|
||||
archiveClassifier = "natives-${dir.name}"
|
||||
from(dir.path)
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
file('natives').eachDir() { dir ->
|
||||
def nativesJar = project.tasks.create "nativesJar${name.capitalize()}-${dir.name}", Jar
|
||||
nativesJar.classifier = "natives-${dir.name}"
|
||||
nativesJar.from(dir.path)
|
||||
artifacts.add('archives', nativesJar)
|
||||
artifact tasks["nativesJar-${dir.name}"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,3 +34,7 @@ if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
||||
}
|
||||
}
|
||||
|
||||
if (System.getenv('ANDROID_HOME') == null) {
|
||||
throw new GradleException("Environment variable ANDROID_HOME needs to be set to SDK folder")
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -222,7 +222,7 @@ public class AndroidGL implements GL {
|
||||
|
||||
@Override
|
||||
public String getActiveUniform(int program, int index, IntBuffer size, Buffer type) {
|
||||
return androidGL.glGetActiveUniform(program, index, size, type);
|
||||
return androidGL.glGetActiveUniform(program, index, size, (IntBuffer) type);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,12 +35,12 @@ package org.oscim.gdx;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.opengl.GLES30;
|
||||
|
||||
import org.oscim.backend.GL30;
|
||||
|
||||
/**
|
||||
* See https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGL30.java
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressLint("NewApi")
|
||||
public class AndroidGL30 extends AndroidGL implements GL30 {
|
||||
@Override
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<manifest package="org.oscim.android.mvt" />
|
||||
@@ -1,51 +1,22 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.github.dcendents.android-maven'
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
dependencies {
|
||||
compileOnly files("${System.env.ANDROID_HOME}/platforms/android-${androidCompileSdk()}/android.jar")
|
||||
api project(':vtm-android')
|
||||
api project(':vtm-mvt')
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion androidCompileSdk()
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_7
|
||||
targetCompatibility JavaVersion.VERSION_1_7
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
versionCode project.versionCode()
|
||||
versionName project.versionName()
|
||||
minSdkVersion androidMinSdk()
|
||||
targetSdkVersion androidTargetSdk()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile 'AndroidManifest.xml'
|
||||
java.srcDirs = ['src']
|
||||
}
|
||||
debug.setRoot('build-types/debug')
|
||||
release.setRoot('build-types/release')
|
||||
}
|
||||
|
||||
lintOptions { abortOnError false }
|
||||
sourceSets {
|
||||
main.java.srcDirs = ['src']
|
||||
}
|
||||
|
||||
android.libraryVariants.all { variant ->
|
||||
def name = variant.buildType.name
|
||||
if (name == "debug")
|
||||
return
|
||||
|
||||
def jar = project.tasks.create "jar${name.capitalize()}", Jar
|
||||
jar.dependsOn variant.javaCompileProvider
|
||||
jar.exclude '**/BuildConfig.class'
|
||||
jar.exclude '**/R.class'
|
||||
jar.exclude '**/R$*.class'
|
||||
jar.from variant.javaCompileProvider.get().destinationDir
|
||||
artifacts.add('archives', jar)
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||
@@ -53,3 +24,7 @@ if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
||||
}
|
||||
}
|
||||
|
||||
if (System.getenv('ANDROID_HOME') == null) {
|
||||
throw new GradleException("Environment variable ANDROID_HOME needs to be set to SDK folder")
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2019 Kostas Tzounopoulos
|
||||
* Copyright 2022 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
|
||||
@@ -27,7 +28,6 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@@ -134,7 +134,8 @@ public class MBTilesMvtTileDataSource extends MBTilesTileDataSource {
|
||||
responseDataSink.completed(success ? QueryResult.SUCCESS : QueryResult.FAILED);
|
||||
} else
|
||||
responseDataSink.completed(QueryResult.TILE_NOT_FOUND);
|
||||
} catch (IOException e) {
|
||||
} catch (Throwable t) {
|
||||
log.error(t.getMessage(), t);
|
||||
responseDataSink.completed(QueryResult.FAILED);
|
||||
} finally {
|
||||
if (cursor != null)
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<manifest package="org.oscim.android" />
|
||||
@@ -1,57 +1,31 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.github.dcendents.android-maven'
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
dependencies {
|
||||
compileOnly files("${System.env.ANDROID_HOME}/platforms/android-${androidCompileSdk()}/android.jar")
|
||||
api project(':vtm')
|
||||
api 'com.caverock:androidsvg:1.4'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion androidCompileSdk()
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_7
|
||||
targetCompatibility JavaVersion.VERSION_1_7
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
versionCode project.versionCode()
|
||||
versionName project.versionName()
|
||||
minSdkVersion androidMinSdk()
|
||||
targetSdkVersion androidTargetSdk()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
manifest.srcFile 'AndroidManifest.xml'
|
||||
java.srcDirs = ['src']
|
||||
}
|
||||
debug.setRoot('build-types/debug')
|
||||
release.setRoot('build-types/release')
|
||||
}
|
||||
|
||||
lintOptions { abortOnError false }
|
||||
sourceSets {
|
||||
main.java.srcDirs = ['src']
|
||||
}
|
||||
|
||||
android.libraryVariants.all { variant ->
|
||||
def name = variant.buildType.name
|
||||
if (name == "debug")
|
||||
return
|
||||
|
||||
def jar = project.tasks.create "jar${name.capitalize()}", Jar
|
||||
jar.dependsOn variant.javaCompileProvider
|
||||
jar.exclude '**/BuildConfig.class'
|
||||
jar.exclude '**/R.class'
|
||||
jar.exclude '**/R$*.class'
|
||||
jar.from variant.javaCompileProvider.get().destinationDir
|
||||
artifacts.add('archives', jar)
|
||||
file('natives').eachDir() { dir ->
|
||||
task("nativesJar-${dir.name}", type: Jar) {
|
||||
archiveClassifier = "natives-${dir.name}"
|
||||
from(dir.path)
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
file('natives').eachDir() { dir ->
|
||||
def nativesJar = project.tasks.create "nativesJar${name.capitalize()}-${dir.name}", Jar
|
||||
nativesJar.classifier = "natives-${dir.name}"
|
||||
nativesJar.from(dir.path)
|
||||
artifacts.add('archives', nativesJar)
|
||||
artifact tasks["nativesJar-${dir.name}"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,3 +34,7 @@ if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
||||
}
|
||||
}
|
||||
|
||||
if (System.getenv('ANDROID_HOME') == null) {
|
||||
throw new GradleException("Environment variable ANDROID_HOME needs to be set to SDK folder")
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -92,6 +92,7 @@ public class MapView extends GLSurfaceView {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public MapView(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
|
||||
|
||||
@@ -107,6 +107,9 @@ public final class AndroidGraphics extends CanvasAdapter {
|
||||
return new AndroidBitmap(bitmap);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public static Bitmap drawableToBitmap(Resources res, int resId) {
|
||||
return drawableToBitmap(res.getDrawable(resId));
|
||||
}
|
||||
|
||||
@@ -35,12 +35,12 @@ package org.oscim.android.gl;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.opengl.GLES30;
|
||||
|
||||
import org.oscim.backend.GL30;
|
||||
|
||||
/**
|
||||
* See https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGL30.java
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressLint("NewApi")
|
||||
public class AndroidGL30 extends AndroidGL implements GL30 {
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2019 Andrea Antonello
|
||||
* Copyright 2019 devemux86
|
||||
* Copyright 2019-2022 devemux86
|
||||
* Copyright 2019 Kostas Tzounopoulos
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
@@ -124,8 +124,8 @@ public class MBTilesBitmapTileDataSource extends MBTilesTileDataSource {
|
||||
Bitmap bitmap = CanvasAdapter.decodeBitmap(new ByteArrayInputStream(bytes));
|
||||
sink.setTileImage(bitmap);
|
||||
res = QueryResult.SUCCESS;
|
||||
} catch (Exception e) {
|
||||
log.debug("{} invalid bitmap", tile);
|
||||
} catch (Throwable t) {
|
||||
log.error(t.getMessage(), t);
|
||||
} finally {
|
||||
sink.completed(res);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.oscim.app"
|
||||
android:installLocation="auto"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
@@ -22,6 +22,7 @@
|
||||
<activity
|
||||
android:name=".TileMap"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -10,19 +10,19 @@ dependencies {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion androidCompileSdk()
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
namespace 'org.oscim.app'
|
||||
compileSdk androidCompileSdk()
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_7
|
||||
targetCompatibility JavaVersion.VERSION_1_7
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
versionCode project.versionCode()
|
||||
versionName project.versionName()
|
||||
minSdkVersion androidMinSdk()
|
||||
targetSdkVersion androidTargetSdk()
|
||||
minSdk androidMinSdk()
|
||||
targetSdk androidTargetSdk()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
@@ -39,10 +39,13 @@ android {
|
||||
release.setRoot('build-types/release')
|
||||
}
|
||||
|
||||
lintOptions { abortOnError false }
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
exclude 'META-INF/LICENSE'
|
||||
exclude 'META-INF/NOTICE'
|
||||
resources {
|
||||
excludes += ['META-INF/LICENSE', 'META-INF/NOTICE']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,17 +182,13 @@ public class MapLayers {
|
||||
App.map.layers().remove(mBackgroundLayer);
|
||||
mBackgroundLayer = null;
|
||||
|
||||
switch (id) {
|
||||
case R.id.menu_layer_openstreetmap:
|
||||
if (id == R.id.menu_layer_openstreetmap) {
|
||||
UrlTileSource tileSource = DefaultSources.OPENSTREETMAP.build();
|
||||
tileSource.setHttpRequestHeaders(Collections.singletonMap("User-Agent", "vtm-playground"));
|
||||
mBackgroundLayer = new BitmapTileLayer(App.map, tileSource);
|
||||
break;
|
||||
|
||||
case R.id.menu_layer_naturalearth:
|
||||
} else if (id == R.id.menu_layer_naturalearth) {
|
||||
mBackgroundLayer = new BitmapTileLayer(App.map, DefaultSources.NE_LANDCOVER.build());
|
||||
break;
|
||||
default:
|
||||
} else {
|
||||
mBackgroundLayer = mBackroundPlaceholder;
|
||||
id = -1;
|
||||
}
|
||||
|
||||
@@ -293,23 +293,20 @@ public class POISearch {
|
||||
}
|
||||
|
||||
public boolean onContextItemSelected(MenuItem item, GeoPoint geoPoint) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.menu_poi_nearby:
|
||||
int itemId = item.getItemId();
|
||||
if (itemId == R.id.menu_poi_nearby) {
|
||||
Intent intent = new Intent(App.activity, POIActivity.class);
|
||||
intent.putExtra("ID", poiMarkers.getBubbledItemId());
|
||||
App.activity.startActivityForResult(intent, TileMap.POIS_REQUEST);
|
||||
return true;
|
||||
|
||||
case R.id.menu_poi_clear:
|
||||
} else if (itemId == R.id.menu_poi_clear) {
|
||||
poiMarkers.removeAllItems();
|
||||
mPOIs.clear();
|
||||
App.map.updateMap(true);
|
||||
|
||||
return true;
|
||||
default:
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -321,8 +321,8 @@ public class RouteSearch {
|
||||
}
|
||||
|
||||
boolean onContextItemSelected(MenuItem item, GeoPoint geoPoint) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.menu_route_departure:
|
||||
int itemId = item.getItemId();
|
||||
if (itemId == R.id.menu_route_departure) {
|
||||
mStartPoint = geoPoint;
|
||||
|
||||
markerStart = putMarkerItem(markerStart, mStartPoint, START_INDEX,
|
||||
@@ -330,8 +330,7 @@ public class RouteSearch {
|
||||
|
||||
getRouteAsync();
|
||||
return true;
|
||||
|
||||
case R.id.menu_route_destination:
|
||||
} else if (itemId == R.id.menu_route_destination) {
|
||||
mDestinationPoint = geoPoint;
|
||||
|
||||
markerDestination = putMarkerItem(markerDestination, mDestinationPoint, DEST_INDEX,
|
||||
@@ -340,20 +339,17 @@ public class RouteSearch {
|
||||
|
||||
getRouteAsync();
|
||||
return true;
|
||||
|
||||
case R.id.menu_route_viapoint:
|
||||
} else if (itemId == R.id.menu_route_viapoint) {
|
||||
GeoPoint viaPoint = geoPoint;
|
||||
addViaPoint(viaPoint);
|
||||
|
||||
getRouteAsync();
|
||||
return true;
|
||||
|
||||
case R.id.menu_route_clear:
|
||||
} else if (itemId == R.id.menu_route_clear) {
|
||||
clearOverlays();
|
||||
return true;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Copyright 2010, 2011, 2012 mapsforge.org
|
||||
* Copyright 2012 Hannes Janetzek
|
||||
* Copyright 2016-2019 devemux86
|
||||
* Copyright 2016-2021 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
|
||||
@@ -77,7 +77,7 @@ public class TileMap extends MapActivity implements MapEventsReceiver {
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED)
|
||||
requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 0);
|
||||
requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION}, 0);
|
||||
}
|
||||
|
||||
setContentView(R.layout.activity_tilemap);
|
||||
@@ -149,21 +149,14 @@ public class TileMap extends MapActivity implements MapEventsReceiver {
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.menu_info_about:
|
||||
int itemId = item.getItemId();
|
||||
if (itemId == R.id.menu_info_about) {
|
||||
startActivity(new Intent(this, InfoView.class));
|
||||
break;
|
||||
|
||||
case R.id.menu_position:
|
||||
break;
|
||||
|
||||
case R.id.menu_poi_nearby:
|
||||
} else if (itemId == R.id.menu_position) {
|
||||
} else if (itemId == R.id.menu_poi_nearby) {
|
||||
Intent intent = new Intent(this, POIActivity.class);
|
||||
startActivityForResult(intent, TileMap.POIS_REQUEST);
|
||||
break;
|
||||
|
||||
case R.id.menu_compass_2d:
|
||||
} else if (itemId == R.id.menu_compass_2d) {
|
||||
if (!item.isChecked()) {
|
||||
// FIXME
|
||||
//mMapView.getMapViewPosition().setTilt(0);
|
||||
@@ -171,35 +164,26 @@ public class TileMap extends MapActivity implements MapEventsReceiver {
|
||||
} else {
|
||||
mCompass.setMode(Compass.Mode.OFF);
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.menu_compass_3d:
|
||||
} else if (itemId == R.id.menu_compass_3d) {
|
||||
if (!item.isChecked()) {
|
||||
mCompass.setMode(Compass.Mode.C3D);
|
||||
} else {
|
||||
mCompass.setMode(Compass.Mode.OFF);
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.menu_position_my_location_enable:
|
||||
} else if (itemId == R.id.menu_position_my_location_enable) {
|
||||
if (!item.isChecked()) {
|
||||
mLocation.setMode(LocationHandler.Mode.SHOW);
|
||||
mLocation.setCenterOnFirstFix();
|
||||
} else {
|
||||
mLocation.setMode(LocationHandler.Mode.OFF);
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.menu_position_follow_location:
|
||||
} else if (itemId == R.id.menu_position_follow_location) {
|
||||
if (!item.isChecked()) {
|
||||
mLocation.setMode(LocationHandler.Mode.SNAP);
|
||||
} else {
|
||||
mLocation.setMode(LocationHandler.Mode.OFF);
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.menu_layer_openstreetmap:
|
||||
case R.id.menu_layer_naturalearth:
|
||||
} else if (itemId == R.id.menu_layer_openstreetmap || itemId == R.id.menu_layer_naturalearth) {
|
||||
int bgId = item.getItemId();
|
||||
// toggle if already enabled
|
||||
if (bgId == mMapLayers.getBackgroundId())
|
||||
@@ -207,29 +191,19 @@ public class TileMap extends MapActivity implements MapEventsReceiver {
|
||||
|
||||
mMapLayers.setBackgroundMap(bgId);
|
||||
mMap.updateMap(true);
|
||||
break;
|
||||
|
||||
case R.id.menu_layer_grid:
|
||||
} else if (itemId == R.id.menu_layer_grid) {
|
||||
mMapLayers.enableGridOverlay(this, !mMapLayers.isGridEnabled());
|
||||
mMap.updateMap(true);
|
||||
break;
|
||||
|
||||
case R.id.menu_position_enter_coordinates:
|
||||
} else if (itemId == R.id.menu_position_enter_coordinates) {
|
||||
showDialog(DIALOG_ENTER_COORDINATES);
|
||||
break;
|
||||
|
||||
//case R.id.menu_position_map_center:
|
||||
// MapPosition mapCenter = mBaseLayer.getMapFileCenter();
|
||||
// if (mapCenter != null)
|
||||
// mMap.setCenter(mapCenter.getGeoPoint());
|
||||
// break;
|
||||
|
||||
case R.id.menu_preferences:
|
||||
/*} else if (itemId == R.id.menu_position_map_center) {
|
||||
MapPosition mapCenter = mBaseLayer.getMapFileCenter();
|
||||
if (mapCenter != null)
|
||||
mMap.setCenter(mapCenter.getGeoPoint());*/
|
||||
} else if (itemId == R.id.menu_preferences) {
|
||||
startActivity(new Intent(this, EditPreferences.class));
|
||||
overridePendingTransition(R.anim.slide_right, R.anim.slide_left2);
|
||||
break;
|
||||
|
||||
default:
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
dependencies {
|
||||
api project(':vtm-desktop')
|
||||
@@ -7,8 +7,14 @@ dependencies {
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java.srcDirs = ['src']
|
||||
main.java.srcDirs = ['src']
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.nio.*;
|
||||
/**
|
||||
* See https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglGL30.java
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class LwjglGL30 extends LwjglGL20 implements org.oscim.backend.GL30 {
|
||||
@Override
|
||||
public void readBuffer(int mode) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
dependencies {
|
||||
api project(':vtm-desktop')
|
||||
@@ -7,8 +7,14 @@ dependencies {
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java.srcDirs = ['src']
|
||||
main.java.srcDirs = ['src']
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.nio.*;
|
||||
/**
|
||||
* See https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3GL30.java
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class Lwjgl3GL30 extends Lwjgl3GL20 implements org.oscim.backend.GL30 {
|
||||
@Override
|
||||
public void readBuffer(int mode) {
|
||||
|
||||
@@ -1,25 +1,31 @@
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
dependencies {
|
||||
api project(':vtm-gdx')
|
||||
api 'com.formdev:svgSalamander:1.1.2.4'
|
||||
api 'guru.nidi.com.kitfox:svgSalamander:1.1.3'
|
||||
api 'net.sf.kxml:kxml2:2.3.0'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java.srcDirs = ['src']
|
||||
}
|
||||
main.java.srcDirs = ['src']
|
||||
}
|
||||
|
||||
file('natives').eachDir() { dir ->
|
||||
task("nativesJar-${dir.name}", type: Jar) {
|
||||
classifier = "natives-${dir.name}"
|
||||
archiveClassifier = "natives-${dir.name}"
|
||||
from(dir.path)
|
||||
}
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives tasks["nativesJar-${dir.name}"]
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
file('natives').eachDir() { dir ->
|
||||
artifact tasks["nativesJar-${dir.name}"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
|
||||
* Copyright 2013 Hannes Janetzek
|
||||
* Copyright 2016-2017 devemux86
|
||||
* Copyright 2016-2021 devemux86
|
||||
* Copyright 2017 nebular
|
||||
* Copyright 2017 Longri
|
||||
*
|
||||
@@ -25,12 +25,7 @@ import org.oscim.backend.canvas.Canvas;
|
||||
import org.oscim.backend.canvas.Color;
|
||||
import org.oscim.backend.canvas.Paint;
|
||||
|
||||
import java.awt.AlphaComposite;
|
||||
import java.awt.Composite;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Image;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.Shape;
|
||||
import java.awt.*;
|
||||
import java.awt.font.TextLayout;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.image.BufferedImage;
|
||||
@@ -188,7 +183,7 @@ public class AwtCanvas implements Canvas {
|
||||
|
||||
@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, true);
|
||||
Composite originalComposite = this.canvas.getComposite();
|
||||
this.canvas.setComposite(AlphaComposite.getInstance(color == Color.TRANSPARENT ? AlphaComposite.CLEAR : AlphaComposite.SRC_OVER));
|
||||
this.canvas.setColor(awtColor);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
dependencies {
|
||||
api project(':vtm')
|
||||
@@ -13,6 +13,14 @@ sourceSets {
|
||||
main.java.srcDirs = ['src']
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||
afterEvaluate {
|
||||
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
dependencies {
|
||||
api project(':vtm-gdx')
|
||||
@@ -10,6 +10,14 @@ sourceSets {
|
||||
main.java.srcDirs = ['src']
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||
afterEvaluate {
|
||||
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
||||
|
||||
@@ -60,7 +60,7 @@ public class GdxModelRenderer extends LayerRenderer {
|
||||
cam = new MapCamera(mMap);
|
||||
|
||||
renderContext =
|
||||
new RenderContext(new DefaultTextureBinder(DefaultTextureBinder.WEIGHTED, 1));
|
||||
new RenderContext(new DefaultTextureBinder(DefaultTextureBinder.LRU, 1));
|
||||
|
||||
// shader = new DefaultShader(renderable.material,
|
||||
// renderable.mesh.getVertexAttributes(), true, false, 1, 0, 0, 0);
|
||||
|
||||
@@ -61,7 +61,7 @@ public class GdxRenderer3D extends LayerRenderer {
|
||||
cam = new MapCamera(mMap);
|
||||
|
||||
renderContext =
|
||||
new RenderContext(new DefaultTextureBinder(DefaultTextureBinder.WEIGHTED, 1));
|
||||
new RenderContext(new DefaultTextureBinder(DefaultTextureBinder.LRU, 1));
|
||||
|
||||
// shader = new DefaultShader(renderable.material,
|
||||
// renderable.mesh.getVertexAttributes(), true, false, 1, 0, 0, 0);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
dependencies {
|
||||
api project(':vtm')
|
||||
@@ -12,8 +12,19 @@ sourceSets {
|
||||
main.resources.srcDirs = ['src']
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||
afterEvaluate {
|
||||
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
||||
tasks.named("sourcesJar") {
|
||||
duplicatesStrategy DuplicatesStrategy.INCLUDE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import com.badlogic.gdx.graphics.glutils.GLVersion;
|
||||
import com.badlogic.gdx.input.GestureDetector;
|
||||
import com.badlogic.gdx.utils.Timer;
|
||||
import com.badlogic.gdx.utils.Timer.Task;
|
||||
|
||||
import org.oscim.layers.TileGridLayer;
|
||||
import org.oscim.layers.tile.buildings.BuildingLayer;
|
||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||
@@ -150,6 +149,10 @@ public abstract class GdxMap implements ApplicationListener {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean onKeyUp(int keycode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Map getMap() {
|
||||
return mMap;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ import java.util.List;
|
||||
|
||||
public class InputHandler implements InputProcessor {
|
||||
|
||||
private ViewController mViewport;
|
||||
private final ViewController mViewport;
|
||||
private final Map mMap;
|
||||
private GenericLayer mGridLayer;
|
||||
private final GdxMap mGdxApp;
|
||||
@@ -102,19 +102,15 @@ public class InputHandler implements InputProcessor {
|
||||
mMap.updateMap(true);
|
||||
break;
|
||||
case Input.Keys.S:
|
||||
mMap.animator().animateZoom(500, 0.5, 0, 0);
|
||||
mMap.updateMap(false);
|
||||
break;
|
||||
case Input.Keys.W:
|
||||
mMap.animator().animateZoom(500, 2, 0, 0);
|
||||
mMap.updateMap(false);
|
||||
break;
|
||||
case Input.Keys.MINUS:
|
||||
case Input.Keys.NUMPAD_SUBTRACT:
|
||||
mMap.animator().animateZoom(500, 0.5, 0, 0);
|
||||
mMap.updateMap(true);
|
||||
break;
|
||||
case Input.Keys.W:
|
||||
case Input.Keys.PLUS:
|
||||
case Input.Keys.EQUALS:
|
||||
case Input.Keys.NUMPAD_ADD:
|
||||
mMap.animator().animateZoom(500, 2, 0, 0);
|
||||
mMap.updateMap(true);
|
||||
break;
|
||||
@@ -130,16 +126,31 @@ public class InputHandler implements InputProcessor {
|
||||
break;
|
||||
|
||||
case Input.Keys.NUM_3:
|
||||
mMap.setTheme(VtmThemes.OSMAGRAY);
|
||||
mMap.setTheme(VtmThemes.BIKER);
|
||||
mMap.updateMap(false);
|
||||
break;
|
||||
|
||||
case Input.Keys.NUM_4:
|
||||
mMap.setTheme(VtmThemes.TRONRENDER);
|
||||
mMap.setTheme(VtmThemes.MOTORIDER);
|
||||
mMap.updateMap(false);
|
||||
break;
|
||||
|
||||
case Input.Keys.NUM_5:
|
||||
mMap.setTheme(VtmThemes.MOTORIDER_DARK);
|
||||
mMap.updateMap(false);
|
||||
break;
|
||||
|
||||
case Input.Keys.NUM_6:
|
||||
mMap.setTheme(VtmThemes.OSMAGRAY);
|
||||
mMap.updateMap(false);
|
||||
break;
|
||||
|
||||
case Input.Keys.NUM_7:
|
||||
mMap.setTheme(VtmThemes.TRONRENDER);
|
||||
mMap.updateMap(false);
|
||||
break;
|
||||
|
||||
case Input.Keys.NUM_8:
|
||||
mMap.setTheme(VtmThemes.NEWTRON);
|
||||
mMap.updateMap(false);
|
||||
break;
|
||||
@@ -171,6 +182,9 @@ public class InputHandler implements InputProcessor {
|
||||
|
||||
@Override
|
||||
public boolean keyUp(int keycode) {
|
||||
if (mGdxApp.onKeyUp(keycode))
|
||||
return true;
|
||||
|
||||
switch (keycode) {
|
||||
case Input.Keys.SHIFT_LEFT:
|
||||
case Input.Keys.SHIFT_RIGHT:
|
||||
@@ -255,10 +269,10 @@ public class InputHandler implements InputProcessor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean scrolled(int amount) {
|
||||
float fx = mPosX - mMap.getWidth() / 2;
|
||||
float fy = mPosY - mMap.getHeight() / 2;
|
||||
mMap.animator().animateZoom(250, amount > 0 ? 0.75f : 1.333f, fx, fy, Easing.Type.LINEAR);
|
||||
public boolean scrolled(float amountX, float amountY) {
|
||||
float fx = mPosX - (mMap.getWidth() >> 1);
|
||||
float fy = mPosY - (mMap.getHeight() >> 1);
|
||||
mMap.animator().animateZoom(250, amountY > 0 ? 0.75f : 1.333f, fx, fy, Easing.Type.LINEAR);
|
||||
mMap.updateMap(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ public class MotionHandler extends MotionEvent implements InputProcessor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean scrolled(int amount) {
|
||||
public boolean scrolled(float amountX, float amountY) {
|
||||
mTime = Gdx.input.getCurrentEventTime();
|
||||
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
dependencies {
|
||||
api project(':vtm')
|
||||
@@ -11,6 +11,14 @@ sourceSets {
|
||||
main.java.srcDirs = ['src']
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||
afterEvaluate {
|
||||
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright 2014 Charles Greb
|
||||
* Copyright 2014 Hannes Janetzek
|
||||
* Copyright 2017 devemux86
|
||||
* Copyright 2017-2021 devemux86
|
||||
* Copyright 2017 Mathieu De Brito
|
||||
*
|
||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||
@@ -19,8 +19,10 @@
|
||||
*/
|
||||
package org.oscim.tiling.source;
|
||||
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.utils.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -31,10 +33,6 @@ import java.io.OutputStream;
|
||||
import java.net.URL;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class OkHttpEngine implements HttpEngine {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(OkHttpEngine.class);
|
||||
@@ -100,7 +98,11 @@ public class OkHttpEngine implements HttpEngine {
|
||||
if (mInputStream == null)
|
||||
return;
|
||||
|
||||
IOUtils.closeQuietly(mInputStream);
|
||||
try {
|
||||
mInputStream.close();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
mInputStream = null;
|
||||
}
|
||||
|
||||
@@ -117,9 +119,7 @@ public class OkHttpEngine implements HttpEngine {
|
||||
|
||||
@Override
|
||||
public boolean requestCompleted(boolean success) {
|
||||
IOUtils.closeQuietly(mInputStream);
|
||||
mInputStream = null;
|
||||
|
||||
close();
|
||||
return success;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.7'
|
||||
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.18'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ sourceSets.main.java.srcDirs = ["src/"]
|
||||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||
|
||||
ext {
|
||||
roboVMVersion = "2.3.7"
|
||||
roboVMVersion = "2.3.18"
|
||||
}
|
||||
|
||||
launchIPhoneSimulator.dependsOn build
|
||||
|
||||
@@ -3,12 +3,12 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.7'
|
||||
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.18'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'robovm'
|
||||
|
||||
sourceSets.main.java.srcDirs = ["src/"]
|
||||
@@ -16,7 +16,7 @@ sourceSets.main.java.srcDirs = ["src/"]
|
||||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||
|
||||
ext {
|
||||
roboVMVersion = "2.3.7"
|
||||
roboVMVersion = "2.3.18"
|
||||
}
|
||||
|
||||
launchIPhoneSimulator.dependsOn build
|
||||
@@ -42,7 +42,6 @@ task copyVtmThemesResources(type: Copy) {
|
||||
into("${buildDir}")
|
||||
}
|
||||
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
compileTask -> compileTask.dependsOn copyVtmResources
|
||||
}
|
||||
@@ -52,7 +51,8 @@ tasks.withType(JavaCompile) {
|
||||
}
|
||||
|
||||
task nativesJar(type: Jar) {
|
||||
classifier = 'natives'
|
||||
dependsOn copyVtmResources, copyVtmThemesResources
|
||||
archiveClassifier = 'natives'
|
||||
from('natives')
|
||||
}
|
||||
|
||||
@@ -60,8 +60,20 @@ artifacts {
|
||||
archives nativesJar
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
artifact nativesJar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||
afterEvaluate {
|
||||
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
||||
tasks.named("sourcesJar") {
|
||||
dependsOn copyVtmResources, copyVtmThemesResources
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,21 +17,15 @@ package org.oscim.ios.backend;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Pixmap;
|
||||
|
||||
import org.oscim.backend.AssetAdapter;
|
||||
import org.oscim.backend.GL;
|
||||
import org.oscim.backend.canvas.Bitmap;
|
||||
import org.oscim.backend.canvas.Color;
|
||||
import org.robovm.apple.coregraphics.CGBitmapContext;
|
||||
import org.robovm.apple.coregraphics.CGBlendMode;
|
||||
import org.robovm.apple.coregraphics.CGColor;
|
||||
import org.robovm.apple.coregraphics.CGColorSpace;
|
||||
import org.robovm.apple.coregraphics.CGImage;
|
||||
import org.robovm.apple.coregraphics.CGImageAlphaInfo;
|
||||
import org.robovm.apple.coregraphics.CGRect;
|
||||
import org.robovm.apple.coregraphics.*;
|
||||
import org.robovm.apple.foundation.NSData;
|
||||
import org.robovm.apple.uikit.UIColor;
|
||||
import org.robovm.apple.uikit.UIImage;
|
||||
import org.robovm.rt.VM;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -39,6 +33,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
/**
|
||||
* iOS specific implementation of {@link Bitmap}.
|
||||
@@ -217,7 +212,7 @@ public class IosBitmap implements Bitmap {
|
||||
glFormat = pixmap.getGLFormat();
|
||||
glType = pixmap.getGLType();
|
||||
|
||||
directPixelBuffer = cgBitmapContext.getData().asIntBuffer(encodedData.length / 4);
|
||||
directPixelBuffer = VM.newDirectByteBuffer(cgBitmapContext.getData(), (encodedData.length / 4) << 2).order(ByteOrder.nativeOrder()).asIntBuffer();
|
||||
pixmap.dispose();
|
||||
|
||||
}
|
||||
|
||||
@@ -563,7 +563,7 @@ public class IosGL implements GL {
|
||||
program,
|
||||
index,
|
||||
size,
|
||||
type);
|
||||
(IntBuffer) type);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -572,7 +572,7 @@ public class IosGL implements GL {
|
||||
program,
|
||||
index,
|
||||
size,
|
||||
type);
|
||||
(IntBuffer) type);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
package org.oscim.ios.backend;
|
||||
|
||||
import com.badlogic.gdx.backends.iosrobovm.IOSGLES30;
|
||||
|
||||
import org.oscim.backend.GL30;
|
||||
|
||||
import java.nio.Buffer;
|
||||
@@ -26,6 +25,7 @@ import java.nio.LongBuffer;
|
||||
/**
|
||||
* iOS specific implementation of {@link GL30}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class IosGL30 extends IosGL implements GL30 {
|
||||
|
||||
private static final IOSGLES30 iOSGL = new IOSGLES30();
|
||||
|
||||
@@ -23,8 +23,7 @@ public class SVGParser extends NSObject {
|
||||
public SVGParser() {
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
protected SVGParser(long handle) {
|
||||
super(handle);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
dependencies {
|
||||
api project(':vtm')
|
||||
@@ -12,6 +12,14 @@ sourceSets {
|
||||
main.java.srcDirs = ['src']
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||
afterEvaluate {
|
||||
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
dependencies {
|
||||
api project(':vtm')
|
||||
@@ -10,6 +10,14 @@ sourceSets {
|
||||
main.java.srcDirs = ['src']
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||
afterEvaluate {
|
||||
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
dependencies {
|
||||
api project(':vtm')
|
||||
@@ -11,6 +11,14 @@ sourceSets {
|
||||
main.java.srcDirs = ['src']
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty("SONATYPE_USERNAME")) {
|
||||
afterEvaluate {
|
||||
project.apply from: "${rootProject.projectDir}/deploy.gradle"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2014 Hannes Janetzek
|
||||
* Copyright 2016-2019 devemux86
|
||||
* Copyright 2016-2021 devemux86
|
||||
* Copyright 2020 marq24
|
||||
*
|
||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||
@@ -32,6 +32,7 @@ import org.oscim.layers.vector.geometries.PointDrawable;
|
||||
import org.oscim.layers.vector.geometries.Style;
|
||||
import org.oscim.map.Map;
|
||||
import org.oscim.renderer.bucket.LineBucket;
|
||||
import org.oscim.renderer.bucket.LineTexBucket;
|
||||
import org.oscim.renderer.bucket.MeshBucket;
|
||||
import org.oscim.theme.styles.AreaStyle;
|
||||
import org.oscim.theme.styles.LineStyle;
|
||||
@@ -43,6 +44,8 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import static org.oscim.core.MercatorProjection.latitudeToY;
|
||||
@@ -65,6 +68,7 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
|
||||
protected final SpatialIndex<Drawable> mDrawables = new QuadTree<Drawable>(1 << 30, 18);
|
||||
|
||||
protected final List<Drawable> tmpDrawables = new ArrayList<Drawable>(128);
|
||||
private final Comparator<Drawable> mComparator;
|
||||
|
||||
protected final JtsConverter mConverter;
|
||||
protected double mMinX;
|
||||
@@ -73,10 +77,16 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
|
||||
private static class GeometryWithStyle implements Drawable {
|
||||
final Geometry geometry;
|
||||
final Style style;
|
||||
final int priority;
|
||||
|
||||
GeometryWithStyle(Geometry g, Style s) {
|
||||
this(g, s, 0);
|
||||
}
|
||||
|
||||
GeometryWithStyle(Geometry g, Style s, int p) {
|
||||
geometry = g;
|
||||
style = s;
|
||||
priority = p;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,6 +98,11 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
|
||||
public Geometry getGeometry() {
|
||||
return geometry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
}
|
||||
|
||||
protected Polygon mEnvelope;
|
||||
@@ -99,6 +114,12 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
|
||||
public VectorLayer(Map map) {
|
||||
super(map);
|
||||
mConverter = new JtsConverter(Tile.SIZE / UNSCALE_COORD);
|
||||
mComparator = new Comparator<Drawable>() {
|
||||
@Override
|
||||
public int compare(Drawable o1, Drawable o2) {
|
||||
return Integer.compare(o1.getPriority(), o2.getPriority());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static Box bbox(Geometry geometry, Style style) {
|
||||
@@ -198,7 +219,8 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
|
||||
synchronized (this) {
|
||||
tmpDrawables.clear();
|
||||
mDrawables.search(bbox, tmpDrawables);
|
||||
// TODO sort by some order...
|
||||
// sort by some order...
|
||||
Collections.sort(tmpDrawables, mComparator);
|
||||
|
||||
for (Drawable d : tmpDrawables) {
|
||||
Style style = d.getStyle();
|
||||
@@ -235,6 +257,7 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
|
||||
LineBucket ll = t.buckets.getLineBucket(level + 1);
|
||||
if (ll.line == null) {
|
||||
ll.line = new LineStyle(2, style.strokeColor, style.strokeWidth);
|
||||
ll.setDropDistance(style.pointReduction ? LineBucket.MIN_DIST : 0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < points.getNumGeometries(); i++) {
|
||||
@@ -273,6 +296,9 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
|
||||
.strokeWidth(style.strokeWidth)
|
||||
.texture(style.texture)
|
||||
.build();
|
||||
ll.setDropDistance(style.pointReduction ? LineBucket.MIN_DIST : 0);
|
||||
if (ll instanceof LineTexBucket)
|
||||
((LineTexBucket) ll).setTexRepeat(style.textureRepeat);
|
||||
}
|
||||
|
||||
if (!style.fixed && style.strokeIncrease > 1)
|
||||
@@ -304,6 +330,7 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
|
||||
LineBucket ll = t.buckets.getLineBucket(level + 1);
|
||||
if (ll.line == null) {
|
||||
ll.line = new LineStyle(2, style.strokeColor, style.strokeWidth);
|
||||
ll.setDropDistance(style.pointReduction ? LineBucket.MIN_DIST : 0);
|
||||
}
|
||||
|
||||
if (style.generalization != Style.GENERALIZATION_NONE) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user