From 0180c408558e4161b351fc0c96b3ea5d2e984dc5 Mon Sep 17 00:00:00 2001 From: Emux Date: Sat, 11 Feb 2017 22:16:07 +0200 Subject: [PATCH] Mapbox (Mapzen): use OkHttp engine #57 --- vtm-android-example/build.gradle | 1 + .../src/org/oscim/android/test/MapboxMapActivity.java | 4 +++- vtm-playground/src/org/oscim/test/MapboxTest.java | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/vtm-android-example/build.gradle b/vtm-android-example/build.gradle index b08043ac..40585c5e 100644 --- a/vtm-android-example/build.gradle +++ b/vtm-android-example/build.gradle @@ -3,6 +3,7 @@ apply plugin: 'com.android.application' dependencies { compile project(':vtm-android') compile project(':vtm-extras') + compile project(':vtm-http') compile project(':vtm-jeo') compile project(':vtm-jts') compile project(':vtm-themes') diff --git a/vtm-android-example/src/org/oscim/android/test/MapboxMapActivity.java b/vtm-android-example/src/org/oscim/android/test/MapboxMapActivity.java index 046dd2c6..2fbd02d9 100644 --- a/vtm-android-example/src/org/oscim/android/test/MapboxMapActivity.java +++ b/vtm-android-example/src/org/oscim/android/test/MapboxMapActivity.java @@ -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 @@ -20,6 +20,7 @@ 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.mvt.MapboxTileSource; @@ -31,6 +32,7 @@ public class MapboxMapActivity extends MapActivity { UrlTileSource tileSource = MapboxTileSource.builder() .apiKey("mapzen-xxxxxxx") // Put a proper API key + .httpFactory(new OkHttpEngine.OkHttpFactory()) //.locale("en") .build(); diff --git a/vtm-playground/src/org/oscim/test/MapboxTest.java b/vtm-playground/src/org/oscim/test/MapboxTest.java index 6b1648c2..a3e60eab 100644 --- a/vtm-playground/src/org/oscim/test/MapboxTest.java +++ b/vtm-playground/src/org/oscim/test/MapboxTest.java @@ -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 @@ -19,6 +19,7 @@ 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.mvt.MapboxTileSource; @@ -28,6 +29,7 @@ public class MapboxTest extends GdxMapApp { public void createLayers() { UrlTileSource tileSource = MapboxTileSource.builder() .apiKey("mapzen-xxxxxxx") // Put a proper API key + .httpFactory(new OkHttpEngine.OkHttpFactory()) //.locale("en") .build();