From 4ebca73023d8ec286f25e87421c4cbcb95133326 Mon Sep 17 00:00:00 2001 From: Emux <devemux86@gmail.com> Date: Sun, 10 Jun 2018 16:00:50 +0300 Subject: [PATCH] Android 9 compatibility, fix #550 --- docs/Changelog.md | 1 + docs/Integration.md | 12 ++++++++-- vtm-android-example/AndroidManifest.xml | 3 ++- vtm-android/build.gradle | 2 +- vtm-app/AndroidManifest.xml | 3 ++- .../src/org/oscim/web/client/GwtMap.java | 4 ---- .../tiling/source/bitmap/DefaultSources.java | 24 +++++++------------ 7 files changed, 24 insertions(+), 25 deletions(-) diff --git a/docs/Changelog.md b/docs/Changelog.md index 8646f851..ddafe488 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -29,6 +29,7 @@ - ViewController refactor [#523](https://github.com/mapsforge/vtm/pull/523) - `ViewController.setScreenSize` renamed to `setViewSize` - `ViewController.setMapScreenCenter` renamed to `setMapViewCenter` +- Android 9 compatibility [#550](https://github.com/mapsforge/vtm/issues/550) - JTS (LocationTech) [#484](https://github.com/mapsforge/vtm/issues/484) - Many other minor improvements and bug fixes - [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.10.0) diff --git a/docs/Integration.md b/docs/Integration.md index 2d6f907f..3225c428 100644 --- a/docs/Integration.md +++ b/docs/Integration.md @@ -15,6 +15,10 @@ implementation 'org.slf4j:slf4j-api:1.7.25' ### Android ```groovy +repositories { + maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } +} + 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' @@ -23,11 +27,15 @@ implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-mips' implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-mips64' implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86' implementation 'org.mapsforge:vtm-android:[CURRENT-VERSION]:natives-x86_64' -implementation 'com.caverock:androidsvg:1.2.2-beta-1' +implementation 'com.caverock:androidsvg:1.3-SNAPSHOT' ``` ### Android (libGDX) ```groovy +repositories { + maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } +} + 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' @@ -43,7 +51,7 @@ 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.8' implementation 'com.badlogicgames.gdx:gdx-backend-android:1.9.8' -implementation 'com.caverock:androidsvg:1.2.2-beta-1' +implementation 'com.caverock:androidsvg:1.3-SNAPSHOT' ``` ### iOS diff --git a/vtm-android-example/AndroidManifest.xml b/vtm-android-example/AndroidManifest.xml index cb75dbad..acf2b8a1 100644 --- a/vtm-android-example/AndroidManifest.xml +++ b/vtm-android-example/AndroidManifest.xml @@ -12,7 +12,8 @@ <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" - android:label="@string/app_name"> + android:label="@string/app_name" + android:usesCleartextTraffic="true"> <activity android:name=".Samples" android:configChanges="keyboardHidden|orientation|screenSize"> diff --git a/vtm-android/build.gradle b/vtm-android/build.gradle index 623544e1..d1eb29fe 100644 --- a/vtm-android/build.gradle +++ b/vtm-android/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'com.github.dcendents.android-maven' dependencies { api project(':vtm') - api 'com.caverock:androidsvg:1.2.2-beta-1' + api 'com.caverock:androidsvg:1.3-SNAPSHOT' } android { diff --git a/vtm-app/AndroidManifest.xml b/vtm-app/AndroidManifest.xml index 628002c7..3881a03f 100644 --- a/vtm-app/AndroidManifest.xml +++ b/vtm-app/AndroidManifest.xml @@ -15,7 +15,8 @@ android:name=".App" android:allowBackup="true" android:icon="@mipmap/ic_launcher" - android:label="@string/application_name"> + android:label="@string/application_name" + android:usesCleartextTraffic="true"> <!-- android:theme="@style/Theme.TileMap" --> <activity diff --git a/vtm-web-app/src/org/oscim/web/client/GwtMap.java b/vtm-web-app/src/org/oscim/web/client/GwtMap.java index dc22f845..e347a8f0 100644 --- a/vtm-web-app/src/org/oscim/web/client/GwtMap.java +++ b/vtm-web-app/src/org/oscim/web/client/GwtMap.java @@ -100,12 +100,8 @@ class GwtMap extends GdxMap { ts = DefaultSources.STAMEN_TONER.build(); else if ("osm".equals(mapName)) ts = DefaultSources.OPENSTREETMAP.build(); - else if ("osm-transport".equals(mapName)) - ts = DefaultSources.OSM_TRANSPORT.build(); else if ("watercolor".equals(mapName)) ts = DefaultSources.STAMEN_WATERCOLOR.build(); - else if ("imagico".equals(mapName)) - ts = DefaultSources.IMAGICO_LANDCOVER.build(); else if ("ne-landcover".equals(mapName)) ts = DefaultSources.NE_LANDCOVER.build(); else if ("hikebike".equals(mapName)) diff --git a/vtm/src/org/oscim/tiling/source/bitmap/DefaultSources.java b/vtm/src/org/oscim/tiling/source/bitmap/DefaultSources.java index af6b1b15..96d8eb85 100644 --- a/vtm/src/org/oscim/tiling/source/bitmap/DefaultSources.java +++ b/vtm/src/org/oscim/tiling/source/bitmap/DefaultSources.java @@ -1,6 +1,7 @@ /* + * Copyright 2013 Hannes Janetzek * Copyright 2016 Andrey Novikov - * Copyright 2016 devemux86 + * Copyright 2016-2018 devemux86 * * This file is part of the OpenScienceMap project (http://www.opensciencemap.org). * @@ -28,45 +29,36 @@ public class DefaultSources { private static final FadeStep[] FADE_STEPS = new FadeStep[]{ new FadeStep(0, 8 - 1, 1, 0.7f), - // dont fade between zoom-min/max + // don't fade between zoom-min/max // fade above zoom max + 2, interpolate 1 to 0 new FadeStep(8 - 1, 8 + 1, 0.7f, 0) }; public static Builder<?> OPENSTREETMAP = BitmapTileSource.builder() - .url("http://tile.openstreetmap.org") - .zoomMax(18); - - public static Builder<?> OSM_TRANSPORT = BitmapTileSource.builder() - .url("http://a.tile.thunderforest.com/transport") + .url("https://tile.openstreetmap.org") .zoomMax(18); public static Builder<?> STAMEN_TONER = BitmapTileSource.builder() - .url("http://a.tile.stamen.com/toner") + .url("https://stamen-tiles.a.ssl.fastly.net/toner") .zoomMax(18); public static Builder<?> STAMEN_WATERCOLOR = BitmapTileSource.builder() - .url("http://a.tile.stamen.com/watercolor") + .url("https://stamen-tiles.a.ssl.fastly.net/watercolor") .tilePath("/{Z}/{X}/{Y}.jpg") .zoomMax(18); - public static Builder<?> IMAGICO_LANDCOVER = BitmapTileSource.builder() - .url("http://www.imagico.de/map/tiles/landcover") - .tilePath("/{Z}/{X}/{Y}.jpg") - .zoomMax(6); - public static Builder<?> NE_LANDCOVER = BitmapTileSource.builder() .url("http://opensciencemap.org/tiles/ne") .fadeSteps(FADE_STEPS) .zoomMax(8); public static Builder<?> HIKEBIKE = BitmapTileSource.builder() - .url("http://tiles.wmflabs.org/hikebike") + .url("https://tiles.wmflabs.org/hikebike") .tilePath("/{Z}/{X}/{Y}.png") .zoomMax(17); public static Builder<?> HIKEBIKE_HILLSHADE = BitmapTileSource.builder() - .url("http://tiles.wmflabs.org/hillshading") + .url("https://tiles.wmflabs.org/hillshading") .tilePath("/{Z}/{X}/{Y}.png") .zoomMax(14); }