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