From e46aa9509447a57408968940a5f596f80d4543e4 Mon Sep 17 00:00:00 2001 From: Tobrun Date: Tue, 8 May 2018 18:20:31 +0200 Subject: [android] - add downstream project integration in a seperate test module --- platform/android/.gitignore | 1 + .../android/MapboxGLDownstreamTestApp/.gitignore | 1 + .../android/MapboxGLDownstreamTestApp/build.gradle | 34 + .../MapboxGLDownstreamTestApp/proguard-rules.pro | 21 + .../src/main/AndroidManifest.xml | 21 + .../src/main/assets/directions-route.json | 3795 ++++++++++++++++++++ .../mapboxsdk/downstream/testapp/MainActivity.java | 248 ++ .../res/drawable-v24/ic_launcher_foreground.xml | 34 + .../main/res/drawable/ic_launcher_background.xml | 171 + .../src/main/res/layout/activity_main.xml | 49 + .../src/main/res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../res/mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3056 bytes .../src/main/res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5024 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2096 bytes .../src/main/res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2858 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4569 bytes .../main/res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7098 bytes .../src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 6464 bytes .../main/res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10676 bytes .../src/main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 9250 bytes .../main/res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 15523 bytes .../src/main/res/values/colors.xml | 6 + .../src/main/res/values/strings.xml | 3 + .../src/main/res/values/styles.xml | 11 + platform/android/gradle/dependencies.gradle | 30 +- platform/android/settings.gradle | 2 +- 27 files changed, 4421 insertions(+), 16 deletions(-) create mode 100644 platform/android/MapboxGLDownstreamTestApp/.gitignore create mode 100644 platform/android/MapboxGLDownstreamTestApp/build.gradle create mode 100644 platform/android/MapboxGLDownstreamTestApp/proguard-rules.pro create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/AndroidManifest.xml create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/assets/directions-route.json create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/java/com/mapbox/mapboxsdk/downstream/testapp/MainActivity.java create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/drawable/ic_launcher_background.xml create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/layout/activity_main.xml create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/values/colors.xml create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/values/strings.xml create mode 100644 platform/android/MapboxGLDownstreamTestApp/src/main/res/values/styles.xml diff --git a/platform/android/.gitignore b/platform/android/.gitignore index 3d6d48dc02..e28c42bf69 100644 --- a/platform/android/.gitignore +++ b/platform/android/.gitignore @@ -20,6 +20,7 @@ gradle/configuration.gradle # Token file MapboxGLAndroidSDKTestApp/src/main/res/values/developer-config.xml +MapboxGLDownstreamTestApp/src/main/res/values/developer-config.xml # Twitter Fabric / Crashlytics fabric.properties diff --git a/platform/android/MapboxGLDownstreamTestApp/.gitignore b/platform/android/MapboxGLDownstreamTestApp/.gitignore new file mode 100644 index 0000000000..796b96d1c4 --- /dev/null +++ b/platform/android/MapboxGLDownstreamTestApp/.gitignore @@ -0,0 +1 @@ +/build diff --git a/platform/android/MapboxGLDownstreamTestApp/build.gradle b/platform/android/MapboxGLDownstreamTestApp/build.gradle new file mode 100644 index 0000000000..3ba44d0d63 --- /dev/null +++ b/platform/android/MapboxGLDownstreamTestApp/build.gradle @@ -0,0 +1,34 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 27 + + defaultConfig { + applicationId "com.mapbox.mapboxsdk.downstream.testapp" + minSdkVersion 15 + targetSdkVersion 27 + versionCode 1 + versionName "1.0" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + api(project(':MapboxGLAndroidSDK')) + implementation(dependenciesList.mapboxNavigation) { + exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-android-sdk' + } + + implementation dependenciesList.supportAppcompatV7 + implementation dependenciesList.supportDesign + implementation dependenciesList.gmsLocation + implementation dependenciesList.timber +} + +apply from: "${rootDir}/gradle/gradle-config.gradle" \ No newline at end of file diff --git a/platform/android/MapboxGLDownstreamTestApp/proguard-rules.pro b/platform/android/MapboxGLDownstreamTestApp/proguard-rules.pro new file mode 100644 index 0000000000..f1b424510d --- /dev/null +++ b/platform/android/MapboxGLDownstreamTestApp/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/AndroidManifest.xml b/platform/android/MapboxGLDownstreamTestApp/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..7f97c68b6d --- /dev/null +++ b/platform/android/MapboxGLDownstreamTestApp/src/main/AndroidManifest.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/assets/directions-route.json b/platform/android/MapboxGLDownstreamTestApp/src/main/assets/directions-route.json new file mode 100644 index 0000000000..5d00107db3 --- /dev/null +++ b/platform/android/MapboxGLDownstreamTestApp/src/main/assets/directions-route.json @@ -0,0 +1,3795 @@ +{ + "waypoints": [ + { + "location": [ + -74.037424, + 40.777247 + ], + "name": "" + }, + { + "location": [ + -73.912029, + 40.680148 + ], + "name": "MacDougal Street" + } + ], + "routes": [ + { + "legs": [ + { + "steps": [ + { + "intersections": [ + { + "out": 0, + "entry": [ + true + ], + "location": [ + -74.037424, + 40.777247 + ], + "bearings": [ + 312 + ] + }, + { + "out": 2, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -74.037658, + 40.777646 + ], + "bearings": [ + 165, + 300, + 345 + ] + } + ], + "geometry": "}`zwlA~i{elCyBnDcTbHiGrBaKr@mC\\", + "duration": 43.1, + "distance": 94.8, + "name": "", + "weight": 171, + "mode": "driving", + "maneuver": { + "bearing_after": 312, + "location": [ + -74.037424, + 40.777247 + ], + "type": "depart", + "bearing_before": 0, + "modifier": "left", + "instruction": "Head northwest" + } + }, + { + "intersections": [ + { + "out": 2, + "in": 1, + "entry": [ + true, + false, + true + ], + "location": [ + -74.037757, + 40.778043 + ], + "bearings": [ + 105, + 165, + 300 + ] + } + ], + "geometry": "ur{wlAx~{elCkCfG", + "duration": 9.9, + "distance": 13.6, + "name": "34th Street", + "weight": 13.6, + "mode": "driving", + "maneuver": { + "bearing_after": 303, + "location": [ + -74.037757, + 40.778043 + ], + "type": "turn", + "bearing_before": 350, + "modifier": "left", + "instruction": "Turn left onto 34th Street" + } + }, + { + "intersections": [ + { + "out": 2, + "in": 1, + "entry": [ + true, + false, + true, + true + ], + "location": [ + -74.037889, + 40.778113 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + }, + { + "out": 2, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -74.038432, + 40.777316 + ], + "bearings": [ + 30, + 165, + 210 + ] + } + ], + "geometry": "aw{wlA`g|elCv@b@`o@x_@fq@b]jd@tTt`@t\\", + "duration": 53.4, + "distance": 342.7, + "name": "Liberty Avenue", + "weight": 53.4, + "mode": "driving", + "maneuver": { + "bearing_after": 206, + "location": [ + -74.037889, + 40.778113 + ], + "type": "turn", + "bearing_before": 303, + "modifier": "left", + "instruction": "Turn left onto Liberty Avenue" + } + }, + { + "intersections": [ + { + "out": 2, + "in": 1, + "entry": [ + true, + false, + true + ], + "location": [ + -74.039736, + 40.775375 + ], + "bearings": [ + 15, + 30, + 195 + ] + }, + { + "out": 1, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -74.039816, + 40.775018 + ], + "bearings": [ + 15, + 195, + 300 + ] + } + ], + "maneuver": { + "bearing_after": 188, + "location": [ + -74.039736, + 40.775375 + ], + "type": "turn", + "bearing_before": 212, + "modifier": "straight", + "instruction": "Go straight onto Paterson Plank Road (CR 681)" + }, + "duration": 19, + "distance": 120.3, + "name": "Paterson Plank Road (CR 681)", + "geometry": "}kvwlAnz_flChU~CbObBh[~D", + "ref": "CR 681", + "weight": 19, + "mode": "driving" + }, + { + "intersections": [ + { + "out": 1, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -74.039962, + 40.774307 + ], + "bearings": [ + 15, + 105, + 195 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + false, + false + ], + "location": [ + -74.039538, + 40.774252 + ], + "bearings": [ + 75, + 120, + 285 + ] + } + ], + "geometry": "eitwlArh`flCjAyJb@sGAaE[sCq@iDuAsCwAqCmBaCkFeFuQkK", + "duration": 19.700000000000003, + "distance": 128, + "name": "Columbia Avenue", + "weight": 19.700000000000003, + "mode": "driving", + "maneuver": { + "bearing_after": 104, + "location": [ + -74.039962, + 40.774307 + ], + "type": "turn", + "bearing_before": 188, + "modifier": "left", + "instruction": "Turn left onto Columbia Avenue" + } + }, + { + "intersections": [ + { + "out": 1, + "in": 2, + "entry": [ + false, + true, + false + ], + "location": [ + -74.038854, + 40.77485 + ], + "bearings": [ + 0, + 60, + 210 + ] + }, + { + "out": 0, + "in": 1, + "entry": [ + true, + false, + false + ], + "location": [ + -74.038577, + 40.77492 + ], + "bearings": [ + 120, + 270, + 300 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -74.037412, + 40.774415 + ], + "bearings": [ + 120, + 165, + 300 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + false, + false + ], + "location": [ + -74.037104, + 40.774277 + ], + "bearings": [ + 120, + 270, + 300 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -74.036872, + 40.774184 + ], + "bearings": [ + 105, + 120, + 300 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false, + false + ], + "location": [ + -74.035043, + 40.773613 + ], + "bearings": [ + 120, + 150, + 285, + 330 + ] + } + ], + "geometry": "ckuwlAjc~elCcB}Dq@kBH_GnQoh@`Li^vCeItAeEd@{AxDoMtb@iqBrIw[", + "duration": 49.5, + "distance": 401, + "name": "30th Street", + "weight": 49.5, + "mode": "driving", + "maneuver": { + "bearing_after": 54, + "location": [ + -74.038854, + 40.77485 + ], + "type": "turn", + "bearing_before": 25, + "modifier": "right", + "instruction": "Turn right onto 30th Street" + } + }, + { + "intersections": [ + { + "out": 1, + "in": 3, + "entry": [ + true, + true, + false, + false + ], + "location": [ + -74.034583, + 40.773443 + ], + "bearings": [ + 75, + 120, + 285, + 300 + ] + } + ], + "geometry": "esrwlAlxuelCpPsh@jWk}@", + "duration": 7.9, + "distance": 158.8, + "name": "", + "weight": 7.9, + "mode": "driving", + "maneuver": { + "bearing_after": 118, + "location": [ + -74.034583, + 40.773443 + ], + "type": "on ramp", + "bearing_before": 115, + "modifier": "straight", + "instruction": "Take the ramp" + } + }, + { + "intersections": [ + { + "out": 0, + "in": 1, + "entry": [ + true, + false, + false + ], + "location": [ + -74.032919, + 40.772772 + ], + "bearings": [ + 122, + 297, + 303 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -74.026127, + 40.769737 + ], + "bearings": [ + 120, + 135, + 300 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + false, + false + ], + "location": [ + -74.02158, + 40.76746 + ], + "bearings": [ + 157, + 326, + 332 + ] + }, + { + "out": 0, + "in": 1, + "entry": [ + true, + false + ], + "location": [ + -74.024552, + 40.763594 + ], + "bearings": [ + 15, + 180 + ] + } + ], + "maneuver": { + "bearing_after": 120, + "location": [ + -74.032919, + 40.772772 + ], + "type": "merge", + "bearing_before": 116, + "modifier": "slight left", + "instruction": "Merge left onto NJ 495" + }, + "duration": 121.9, + "distance": 2025.7, + "name": "NJ 495", + "geometry": "giqwlAlprelCtZuy@f^a`At[sy@pSik@xRqm@f`@opAl[wdApN}f@rZe}@lT{o@pc@gqAdC_HpCiGtCcF`DmEjDaEzDoDvDsCrD{BtDcBdEwAvDaAnDo@xD]jDSdEC~DH`F^nI~@lL|AvLjBjLjBpLvBtLbCvZbHrKvCfLdDtKbDbLvDrKvDhLjEdI~CtErBlFpCdEpChDlCrDfE|CrFtBbGxA`Hv@tHPhGIhGc@nGcAdG{AvFmBvEkCjE}CnDoDtCuDpB}CfAaDh@eDHgDY_Ds@qCmAeC_BmCgCgHaJ{P_RcEyD}D}CsWuM", + "ref": "NJ 495", + "weight": 121.9, + "mode": "driving" + }, + { + "intersections": [ + { + "out": 1, + "in": 3, + "entry": [ + true, + true, + false, + false + ], + "location": [ + -74.023483, + 40.764906 + ], + "bearings": [ + 15, + 30, + 180, + 210 + ] + } + ], + "maneuver": { + "bearing_after": 26, + "location": [ + -74.023483, + 40.764906 + ], + "type": "fork", + "bearing_before": 23, + "modifier": "slight right", + "instruction": "Keep right at the fork onto Lincoln Tunnel access (NJ 495)" + }, + "duration": 115.9, + "distance": 1361.9, + "name": "Lincoln Tunnel access (NJ 495)", + "geometry": "s}awlAtb`elCk|@qi@}EmDoEqDiE{DwDoEaE{GuDmIcDmJsCeKiBwKmAkMc@oNAyMRyNx@{LvAsMxBoLrCyJfwFioQpEsN", + "ref": "NJ 495", + "weight": 115.9, + "mode": "driving" + }, + { + "intersections": [ + { + "out": 0, + "in": 1, + "entry": [ + true, + false + ], + "location": [ + -74.009981, + 40.762456 + ], + "bearings": [ + 120, + 300 + ] + } + ], + "maneuver": { + "bearing_after": 118, + "location": [ + -74.009981, + 40.762456 + ], + "type": "new name", + "bearing_before": 118, + "modifier": "straight", + "instruction": "Continue straight onto Lincoln Tunnel (NY 495)" + }, + "duration": 178.4, + "distance": 1238.6, + "name": "Lincoln Tunnel (NY 495)", + "geometry": "od}vlAxvedlCn`Ia~VpBmHdBwHrAwIx@mH", + "ref": "NY 495", + "weight": 178.4, + "mode": "driving" + }, + { + "intersections": [ + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.997078, + 40.757133 + ], + "bearings": [ + 105, + 120, + 285 + ] + } + ], + "geometry": "ywrvlAjplclCdCeLv@gFlAmGbA_FjAgExHyU", + "duration": 15.1, + "distance": 96.7, + "name": "Dyer Avenue", + "weight": 15.1, + "mode": "driving", + "maneuver": { + "bearing_after": 112, + "location": [ + -73.997078, + 40.757133 + ], + "type": "fork", + "bearing_before": 104, + "modifier": "slight right", + "instruction": "Keep right at the fork onto Dyer Avenue" + } + }, + { + "intersections": [ + { + "out": 1, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.996039, + 40.75677 + ], + "bearings": [ + 105, + 135, + 300 + ] + }, + { + "out": 2, + "in": 0, + "entry": [ + false, + false, + true + ], + "location": [ + -73.996494, + 40.755402 + ], + "bearings": [ + 30, + 60, + 210 + ] + }, + { + "out": 2, + "in": 0, + "entry": [ + false, + true, + true, + true, + false + ], + "location": [ + -73.996661, + 40.755211 + ], + "bearings": [ + 30, + 120, + 210, + 270, + 300 + ] + }, + { + "out": 3, + "in": 0, + "entry": [ + false, + true, + false, + true, + true + ], + "location": [ + -73.997152, + 40.754619 + ], + "bearings": [ + 30, + 45, + 120, + 210, + 300 + ] + } + ], + "geometry": "carvlAlojclChBcDnAuAjBsAtDqAhFa@|Dd@dEfBdr@`e@lErDnDxC~c@t]bi@b\\", + "duration": 70.5, + "distance": 360.5, + "name": "Dyer Avenue", + "weight": 70.5, + "mode": "driving", + "maneuver": { + "bearing_after": 129, + "location": [ + -73.996039, + 40.75677 + ], + "type": "fork", + "bearing_before": 119, + "modifier": "slight right", + "instruction": "Keep right at the fork onto Dyer Avenue" + } + }, + { + "intersections": [ + { + "out": 1, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -73.997618, + 40.753945 + ], + "bearings": [ + 30, + 120, + 300 + ] + }, + { + "out": 1, + "in": 3, + "entry": [ + false, + true, + true, + false + ], + "location": [ + -73.996324, + 40.753406 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + }, + { + "out": 1, + "in": 3, + "entry": [ + false, + true, + false, + false + ], + "location": [ + -73.99346, + 40.752196 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.992694, + 40.751874 + ], + "bearings": [ + 120, + 210, + 300 + ] + }, + { + "out": 1, + "in": 3, + "entry": [ + false, + true, + true, + false + ], + "location": [ + -73.990617, + 40.751 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + }, + { + "out": 1, + "in": 3, + "entry": [ + true, + true, + false, + false + ], + "location": [ + -73.987765, + 40.749792 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + }, + { + "out": 1, + "in": 3, + "entry": [ + false, + true, + true, + false + ], + "location": [ + -73.98456, + 40.748439 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + }, + { + "out": 1, + "in": 3, + "lanes": [ + { + "valid": false, + "indications": [ + "left" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + } + ], + "entry": [ + true, + true, + false, + false + ], + "location": [ + -73.982957, + 40.747765 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + }, + { + "out": 1, + "in": 3, + "entry": [ + false, + true, + true, + false + ], + "location": [ + -73.981449, + 40.747123 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + } + ], + "geometry": "qplvlAbrmclCt`@{oAbBqEni@adB~\\kfAbS{n@ru@y`Cz|@mpCdDiKn@uBl@}Bj@kBJ]z@eCz@kCfB{F|AiF|AqEljAqqDzZkaAfMy`@bg@g}AtCwJ", + "duration": 339.5, + "distance": 1577.4, + "name": "West 34th Street", + "weight": 337.5, + "mode": "driving", + "maneuver": { + "bearing_after": 118, + "location": [ + -73.997618, + 40.753945 + ], + "type": "end of road", + "bearing_before": 206, + "modifier": "left", + "instruction": "Turn left onto West 34th Street" + } + }, + { + "intersections": [ + { + "out": 0, + "in": 3, + "entry": [ + true, + true, + false, + false + ], + "location": [ + -73.981261, + 40.747048 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + false, + false, + true + ], + "location": [ + -73.980761, + 40.747716 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + } + ], + "geometry": "oa_vlAxsmblC{E{D{a@kXwe@e[", + "duration": 30.599999999999998, + "distance": 164.2, + "name": "Park Avenue", + "weight": 30.599999999999998, + "mode": "driving", + "maneuver": { + "bearing_after": 29, + "location": [ + -73.981261, + 40.747048 + ], + "type": "turn", + "bearing_before": 116, + "modifier": "left", + "instruction": "Turn left onto Park Avenue" + } + }, + { + "intersections": [ + { + "out": 1, + "in": 2, + "entry": [ + true, + true, + false, + false + ], + "location": [ + -73.98031, + 40.748336 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + }, + { + "out": 1, + "in": 3, + "entry": [ + false, + true, + false, + false + ], + "location": [ + -73.978788, + 40.747684 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.977812, + 40.747273 + ], + "bearings": [ + 120, + 210, + 300 + ] + }, + { + "out": 1, + "in": 3, + "entry": [ + true, + true, + false, + false + ], + "location": [ + -73.977146, + 40.746996 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + }, + { + "out": 3, + "in": 5, + "entry": [ + false, + true, + true, + true, + true, + false + ], + "location": [ + -73.974927, + 40.746068 + ], + "bearings": [ + 30, + 75, + 90, + 120, + 210, + 300 + ] + } + ], + "geometry": "_ravlAjxkblCvg@c~AtX_|@hPsh@~Rgn@lCoI|Jw[tPsi@|BqHjBmFhBmF", + "duration": 138.5, + "distance": 542.4, + "name": "East 36th Street", + "weight": 138.5, + "mode": "driving", + "maneuver": { + "bearing_after": 118, + "location": [ + -73.98031, + 40.748336 + ], + "type": "turn", + "bearing_before": 28, + "modifier": "right", + "instruction": "Turn right onto East 36th Street" + } + }, + { + "intersections": [ + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.974689, + 40.745961 + ], + "bearings": [ + 105, + 120, + 300 + ] + } + ], + "geometry": "q}|ulA`y`blCbB_KtBqV", + "duration": 9.9, + "distance": 49.5, + "name": "", + "weight": 9.9, + "mode": "driving", + "maneuver": { + "bearing_after": 104, + "location": [ + -73.974689, + 40.745961 + ], + "type": "on ramp", + "bearing_before": 119, + "modifier": "slight left", + "instruction": "Take the ramp on the left" + } + }, + { + "intersections": [ + { + "out": 1, + "in": 3, + "entry": [ + true, + true, + false, + false + ], + "location": [ + -73.97412, + 40.745852 + ], + "bearings": [ + 90, + 120, + 255, + 285 + ] + }, + { + "out": 0, + "in": 1, + "entry": [ + true, + false, + false + ], + "location": [ + -73.97308, + 40.745573 + ], + "bearings": [ + 90, + 270, + 285 + ] + } + ], + "geometry": "wv|ulAnu_blCfEuPpEmQjAiH`AcKDmFJyFc@oLmAoG", + "duration": 15.9, + "distance": 134.9, + "name": "", + "weight": 15.9, + "mode": "driving", + "maneuver": { + "bearing_after": 113, + "location": [ + -73.97412, + 40.745852 + ], + "type": "fork", + "bearing_before": 101, + "modifier": "slight right", + "instruction": "Keep right at the fork" + } + }, + { + "intersections": [ + { + "out": 0, + "in": 1, + "entry": [ + true, + false, + false + ], + "location": [ + -73.972603, + 40.745624 + ], + "bearings": [ + 72, + 265, + 267 + ] + }, + { + "out": 0, + "in": 1, + "entry": [ + true, + false + ], + "location": [ + -73.954069, + 40.741426 + ], + "bearings": [ + 90, + 270 + ] + }, + { + "out": 1, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.954034, + 40.741423 + ], + "bearings": [ + 75, + 105, + 270 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.953927, + 40.741412 + ], + "bearings": [ + 98, + 103, + 278 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.952418, + 40.741258 + ], + "bearings": [ + 90, + 120, + 285 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.952147, + 40.741269 + ], + "bearings": [ + 75, + 105, + 270 + ] + }, + { + "out": 0, + "in": 1, + "entry": [ + true, + false, + false + ], + "location": [ + -73.951466, + 40.741382 + ], + "bearings": [ + 75, + 258, + 260 + ] + }, + { + "out": 0, + "in": 1, + "entry": [ + true, + false, + false + ], + "location": [ + -73.951104, + 40.741455 + ], + "bearings": [ + 75, + 255, + 261 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + false, + false + ], + "location": [ + -73.950672, + 40.741543 + ], + "bearings": [ + 75, + 240, + 255 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.93208, + 40.737057 + ], + "bearings": [ + 102, + 108, + 282 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + false, + false + ], + "location": [ + -73.920389, + 40.732789 + ], + "bearings": [ + 134, + 308, + 316 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + false, + false + ], + "location": [ + -73.901354, + 40.725811 + ], + "bearings": [ + 90, + 270, + 285 + ] + } + ], + "maneuver": { + "bearing_after": 71, + "location": [ + -73.972603, + 40.745624 + ], + "type": "new name", + "bearing_before": 84, + "modifier": "straight", + "instruction": "Continue straight onto I 495" + }, + "duration": 505.3, + "distance": 8147.5, + "name": "I 495", + "geometry": "oh|ulAtv|alCiAiHgC_OmIqQkJ{KsMyJuk@g`@gPeNaP{SsGeNsEaTkAmQAkTf@kXrIgh@rHaXhQu^rgHgrM|Pa^dKmb@jEib@fQuzAhFki@lDy^lAe_@iC}t@DeATuEpGyqALqCR}EU}OuCc\\kAmLqCsUoD_Zy@wKy@aVNc\\n@kM~@aIzS{lB`UomBrEo]zEeY`HkZzI_\\he@g{Aj}@{qCtLka@pIu]hGo[|Fo`@pEa_@zDqe@jByXzBqa@nAwP~A_RjQi{AzQ}oBpOuaBtFmj@jm@ojFtFe_@vHe_@dI_\\lLg`@tNia@tJySxJeRbNuT|p@q_AxEwGlZub@pOmThQkXlP}Z`Pu]jLy\\rJm_@bHo]rKym@xL{q@vJug@dIac@lJai@rZuoBzGi`@tIa`@jKm]dMe]vNwZnq@_pA|DsHne@m}@tKcUfSsd@xN}`@dL{a@pJcd@bHed@rEee@lJcoBfCwU`DmcAxGu_BxHwgBrHafB`Ciq@Zoe@]kZaBcc@eDgb@sFab@aIud@}Ju`@cKa[yMm\\ez@sbBmKiU_M{Z{GkScLgd@", + "ref": "I 495", + "weight": 505.3, + "mode": "driving" + }, + { + "intersections": [ + { + "out": 1, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.886444, + 40.727973 + ], + "bearings": [ + 70, + 78, + 245 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + false, + false + ], + "location": [ + -73.883611, + 40.72828 + ], + "bearings": [ + 90, + 255, + 270 + ] + } + ], + "geometry": "iyytlAvmt|kC{E{h@eCq[qC}m@qBuz@cGowA_A{_@aBec@qCe_@", + "maneuver": { + "bearing_after": 77, + "location": [ + -73.886444, + 40.727973 + ], + "type": "off ramp", + "bearing_before": 64, + "modifier": "slight right", + "instruction": "Take the ramp on the right towards Woodhaven Boulevard" + }, + "duration": 28.5, + "distance": 499.6, + "destinations": "Woodhaven Boulevard, NY 25 (Queens Boulevard)", + "name": "", + "weight": 28.5, + "mode": "driving" + }, + { + "intersections": [ + { + "out": 1, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.880575, + 40.728564 + ], + "bearings": [ + 69, + 76, + 259 + ] + } + ], + "geometry": "g~ztlA|~h|kCsG}k@eJgc@wLy]iS}i@gNec@gOgi@yQk}@ek@ymC", + "duration": 77.3, + "distance": 650.1, + "name": "", + "weight": 77.3, + "mode": "driving", + "maneuver": { + "bearing_after": 74, + "location": [ + -73.880575, + 40.728564 + ], + "type": "fork", + "bearing_before": 78, + "modifier": "slight right", + "instruction": "Keep right at the fork" + } + }, + { + "intersections": [ + { + "out": 1, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.873558, + 40.730938 + ], + "bearings": [ + 69, + 78, + 248 + ] + } + ], + "geometry": "sr_ulAjh{{kCcFqj@aCe[McCS{DOiIFmKTeI", + "duration": 25.9, + "distance": 156.9, + "name": "", + "weight": 25.9, + "mode": "driving", + "maneuver": { + "bearing_after": 77, + "location": [ + -73.873558, + 40.730938 + ], + "type": "fork", + "bearing_before": 67, + "modifier": "slight right", + "instruction": "Keep right at the fork" + } + }, + { + "intersections": [ + { + "out": 2, + "in": 3, + "lanes": [ + { + "valid": false, + "indications": [ + "left" + ] + }, + { + "valid": true, + "indications": [ + "right" + ] + }, + { + "valid": true, + "indications": [ + "right" + ] + } + ], + "entry": [ + false, + true, + true, + false + ], + "location": [ + -73.871723, + 40.731127 + ], + "bearings": [ + 15, + 90, + 180, + 270 + ] + }, + { + "out": 2, + "in": 0, + "entry": [ + false, + false, + true, + true + ], + "location": [ + -73.87175, + 40.730902 + ], + "bearings": [ + 0, + 90, + 180, + 270 + ] + }, + { + "out": 1, + "in": 0, + "entry": [ + false, + true, + false + ], + "location": [ + -73.871756, + 40.730818 + ], + "bearings": [ + 0, + 180, + 270 + ] + }, + { + "out": 1, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -73.87168, + 40.730045 + ], + "bearings": [ + 0, + 180, + 225 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.871493, + 40.729176 + ], + "bearings": [ + 165, + 240, + 345 + ] + }, + { + "out": 1, + "in": 3, + "lanes": [ + { + "valid": false, + "indications": [ + "left" + ] + }, + { + "valid": true, + "indications": [ + "straight" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + } + ], + "entry": [ + true, + true, + true, + false + ], + "location": [ + -73.871238, + 40.728306 + ], + "bearings": [ + 75, + 165, + 225, + 345 + ] + }, + { + "out": 1, + "in": 3, + "entry": [ + true, + true, + true, + false + ], + "location": [ + -73.871101, + 40.727834 + ], + "bearings": [ + 45, + 165, + 210, + 345 + ] + }, + { + "out": 1, + "in": 2, + "lanes": [ + { + "valid": false, + "indications": [ + "left" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + } + ], + "entry": [ + true, + true, + false + ], + "location": [ + -73.870318, + 40.726159 + ], + "bearings": [ + 75, + 165, + 345 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + false, + false + ], + "location": [ + -73.869804, + 40.725107 + ], + "bearings": [ + 150, + 240, + 345 + ] + }, + { + "out": 1, + "in": 3, + "lanes": [ + { + "valid": false, + "indications": [ + "left" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + } + ], + "entry": [ + true, + true, + true, + false + ], + "location": [ + -73.869373, + 40.724389 + ], + "bearings": [ + 60, + 150, + 240, + 330 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.868873, + 40.723788 + ], + "bearings": [ + 150, + 240, + 330 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.868362, + 40.72321 + ], + "bearings": [ + 150, + 240, + 330 + ] + }, + { + "out": 1, + "in": 3, + "lanes": [ + { + "valid": false, + "indications": [ + "left" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + } + ], + "entry": [ + true, + true, + true, + false + ], + "location": [ + -73.86777, + 40.722612 + ], + "bearings": [ + 60, + 150, + 240, + 315 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.867235, + 40.722019 + ], + "bearings": [ + 150, + 240, + 315 + ] + }, + { + "out": 1, + "in": 3, + "lanes": [ + { + "valid": false, + "indications": [ + "left" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + } + ], + "entry": [ + true, + true, + true, + false + ], + "location": [ + -73.866713, + 40.721432 + ], + "bearings": [ + 60, + 150, + 240, + 330 + ] + }, + { + "out": 0, + "in": 2, + "entry": [ + true, + true, + false + ], + "location": [ + -73.86617, + 40.720834 + ], + "bearings": [ + 150, + 240, + 330 + ] + }, + { + "out": 1, + "in": 3, + "entry": [ + true, + true, + true, + false + ], + "location": [ + -73.865636, + 40.720249 + ], + "bearings": [ + 60, + 150, + 240, + 330 + ] + }, + { + "out": 1, + "in": 2, + "lanes": [ + { + "valid": false, + "indications": [ + "left" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + } + ], + "entry": [ + true, + true, + false + ], + "location": [ + -73.863714, + 40.718221 + ], + "bearings": [ + 60, + 150, + 330 + ] + }, + { + "out": 1, + "in": 2, + "lanes": [ + { + "valid": false, + "indications": [ + "left" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + } + ], + "entry": [ + true, + true, + false + ], + "location": [ + -73.861977, + 40.716505 + ], + "bearings": [ + 60, + 135, + 315 + ] + }, + { + "out": 1, + "in": 2, + "lanes": [ + { + "valid": false, + "indications": [ + "left" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + } + ], + "entry": [ + true, + true, + false + ], + "location": [ + -73.859826, + 40.71397 + ], + "bearings": [ + 75, + 180, + 345 + ] + }, + { + "out": 2, + "in": 0, + "entry": [ + false, + true, + true, + true + ], + "location": [ + -73.859825, + 40.713308 + ], + "bearings": [ + 0, + 75, + 180, + 240 + ] + }, + { + "out": 2, + "in": 0, + "lanes": [ + { + "valid": false, + "indications": [ + "left" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + }, + { + "valid": true, + "indications": [ + "none" + ] + } + ], + "entry": [ + false, + true, + true, + true + ], + "location": [ + -73.859872, + 40.711864 + ], + "bearings": [ + 0, + 105, + 180, + 285 + ] + }, + { + "out": 1, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -73.859896, + 40.711585 + ], + "bearings": [ + 0, + 180, + 240 + ] + }, + { + "out": 1, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -73.859762, + 40.710624 + ], + "bearings": [ + 0, + 165, + 255 + ] + }, + { + "out": 1, + "in": 3, + "entry": [ + true, + true, + true, + false + ], + "location": [ + -73.859714, + 40.710378 + ], + "bearings": [ + 90, + 180, + 210, + 345 + ] + }, + { + "out": 1, + "in": 3, + "lanes": [ + { + "valid": false, + "indications": [ + "left" + ] + }, + { + "valid": true, + "indications": [ + "straight" + ] + }, + { + "valid": true, + "indications": [ + "straight" + ] + } + ], + "entry": [ + true, + true, + false, + false + ], + "location": [ + -73.858287, + 40.705558 + ], + "bearings": [ + 60, + 135, + 240, + 330 + ] + } + ], + "geometry": "m~_ulAtuw{kC`Mt@fDJho@wC|RmBja@gGze@kJnNqCn\\qG|f@uQjk@wSjSoHv`Ac_@lNgHl\\uPpd@g^dT{P|MaMnFeEvF}FbU{UhUoQvM}MlQmOfQeOjd@}`@pc@k`@dRmQ~a@yb@`e@ab@tGwFxXaVjd@ka@db@ed@bSoTpMoNxa@ee@ja@id@b`@kc@xDqCpZgJ~GuBvLaBna@@zEC|k@GhFN~d@tAlPn@`{@kGjN_Bl^kDxd@wChl@qDzs@uEvUyApYiDbJuCvJ}CxRoJxh@qd@jc@gp@f\\qg@", + "duration": 272.7, + "distance": 3328.1, + "name": "Woodhaven Boulevard", + "weight": 272.7, + "mode": "driving", + "maneuver": { + "bearing_after": 184, + "location": [ + -73.871723, + 40.731127 + ], + "type": "turn", + "bearing_before": 92, + "modifier": "right", + "instruction": "Turn right onto Woodhaven Boulevard" + } + }, + { + "intersections": [ + { + "out": 2, + "in": 3, + "entry": [ + true, + true, + true, + false + ], + "location": [ + -73.85685, + 40.704508 + ], + "bearings": [ + 60, + 120, + 240, + 315 + ] + }, + { + "out": 2, + "in": 0, + "entry": [ + false, + true, + true, + true + ], + "location": [ + -73.8569, + 40.704486 + ], + "bearings": [ + 60, + 135, + 240, + 315 + ] + }, + { + "out": 2, + "in": 0, + "entry": [ + false, + true, + true, + true + ], + "location": [ + -73.859144, + 40.703485 + ], + "bearings": [ + 60, + 150, + 240, + 330 + ] + } + ], + "geometry": "w~kslAbtzzkCj@bBp}@fkCnV|r@", + "duration": 56.3, + "distance": 306, + "name": "81st Road", + "weight": 57.7, + "mode": "driving", + "maneuver": { + "bearing_after": 239, + "location": [ + -73.85685, + 40.704508 + ], + "type": "turn", + "bearing_before": 132, + "modifier": "right", + "instruction": "Turn right onto 81st Road" + } + }, + { + "intersections": [ + { + "out": 2, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -73.859975, + 40.703109 + ], + "bearings": [ + 60, + 105, + 285 + ] + } + ], + "geometry": "igislAlw`{kCsAtWaAnR", + "duration": 13.5, + "distance": 60.2, + "name": "Myrtle Avenue", + "weight": 13.5, + "mode": "driving", + "maneuver": { + "bearing_after": 277, + "location": [ + -73.859975, + 40.703109 + ], + "type": "turn", + "bearing_before": 239, + "modifier": "straight", + "instruction": "Go straight onto Myrtle Avenue" + } + }, + { + "intersections": [ + { + "out": 1, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -73.860682, + 40.703184 + ], + "bearings": [ + 105, + 195, + 285 + ] + } + ], + "geometry": "_lislArcb{kCrIpBvIlFzEnIzB|R?hQ", + "duration": 11.9, + "distance": 112.3, + "name": "", + "weight": 11.9, + "mode": "driving", + "maneuver": { + "bearing_after": 194, + "location": [ + -73.860682, + 40.703184 + ], + "type": "on ramp", + "bearing_before": 277, + "modifier": "left", + "instruction": "Take the ramp on the left" + } + }, + { + "intersections": [ + { + "out": 2, + "in": 0, + "entry": [ + false, + false, + true + ], + "location": [ + -73.861638, + 40.70267 + ], + "bearings": [ + 90, + 105, + 285 + ] + }, + { + "out": 1, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -73.867076, + 40.702183 + ], + "bearings": [ + 60, + 225, + 240 + ] + }, + { + "out": 2, + "in": 1, + "entry": [ + false, + false, + true + ], + "location": [ + -73.867853, + 40.701617 + ], + "bearings": [ + 15, + 45, + 210 + ] + }, + { + "out": 1, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -73.879177, + 40.692627 + ], + "bearings": [ + 75, + 255, + 270 + ] + }, + { + "out": 1, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -73.887935, + 40.690962 + ], + "bearings": [ + 77, + 254, + 259 + ] + }, + { + "out": 2, + "in": 1, + "entry": [ + false, + false, + true + ], + "location": [ + -73.890251, + 40.689914 + ], + "bearings": [ + 26, + 35, + 213 + ] + } + ], + "geometry": "{khslAj_d{kCeDbX_Epj@cA~f@\\xh@vBrl@vCt`@hEb]|E`ZhIb\\lFhNhBlGhQzY`PtTnI`HdTbOtO~FzRzEz`@dGvTrDtYtF`P~FtQpKlMbLpL|ObJtP|HhSpDhOfDdRvDx_@|R~tBhErS|FlPjHxM~KjOlf@dg@vXx]|G~I|FbGhMrHvKvD`InDnFbEjEnE`E`HdNbe@xDnL~ElHlE|EbGdDrGhBjGz@vIXbFV|Fz@bDbBxCrDfEvGzBnFzA`Hn@pJlCzh@rG`nAjGhsA~BdX`Jbj@~YjgB~Mp}@jIxl@jMbgAfDx]bFp`@tBrQnDlQlCbKdEtLdJ`QbGzIdI|I`HlGfQpNpaClgBxq@fi@rd@da@tg@ph@nj@fj@l`@t]tZlVj[rSp`@bXnKdE|K~CrQzC", + "duration": 212.29999999999998, + "distance": 4096.7, + "name": "Jackie Robinson Parkway", + "weight": 212.29999999999998, + "mode": "driving", + "maneuver": { + "bearing_after": 284, + "location": [ + -73.861638, + 40.70267 + ], + "type": "merge", + "bearing_before": 268, + "modifier": "slight left", + "instruction": "Merge left onto Jackie Robinson Parkway" + } + }, + { + "intersections": [ + { + "out": 2, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -73.896606, + 40.682097 + ], + "bearings": [ + 15, + 180, + 195 + ] + } + ], + "geometry": "af`rlAzhh}kCbKfCv|@zJ|VfHxNbOjVx_@", + "duration": 18.7, + "distance": 274.1, + "name": "", + "weight": 18.7, + "mode": "driving", + "maneuver": { + "bearing_after": 194, + "location": [ + -73.896606, + 40.682097 + ], + "type": "off ramp", + "bearing_before": 189, + "modifier": "slight right", + "instruction": "Take the ramp on the right" + } + }, + { + "intersections": [ + { + "out": 2, + "in": 0, + "entry": [ + false, + false, + true + ], + "location": [ + -73.897795, + 40.679905 + ], + "bearings": [ + 45, + 60, + 240 + ] + }, + { + "out": 3, + "in": 0, + "entry": [ + false, + true, + false, + true + ], + "location": [ + -73.898899, + 40.679561 + ], + "bearings": [ + 75, + 90, + 180, + 270 + ] + }, + { + "out": 3, + "in": 0, + "entry": [ + false, + false, + false, + true + ], + "location": [ + -73.899582, + 40.679548 + ], + "bearings": [ + 90, + 240, + 255, + 285 + ] + } + ], + "geometry": "a}{qlAdsj}kCrHdWzJxk@Xti@aGbhA", + "duration": 40, + "distance": 258.3, + "name": "Highland Boulevard", + "weight": 40, + "mode": "driving", + "maneuver": { + "bearing_after": 241, + "location": [ + -73.897795, + 40.679905 + ], + "type": "new name", + "bearing_before": 226, + "modifier": "straight", + "instruction": "Continue straight onto Highland Boulevard" + } + }, + { + "intersections": [ + { + "out": 2, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -73.900752, + 40.679677 + ], + "bearings": [ + 105, + 120, + 300 + ] + }, + { + "out": 3, + "in": 1, + "entry": [ + true, + false, + false, + true + ], + "location": [ + -73.902622, + 40.680664 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + }, + { + "out": 3, + "in": 1, + "entry": [ + true, + false, + true, + true + ], + "location": [ + -73.903371, + 40.681092 + ], + "bearings": [ + 30, + 120, + 210, + 300 + ] + }, + { + "out": 2, + "in": 0, + "entry": [ + false, + false, + true + ], + "location": [ + -73.904022, + 40.681447 + ], + "bearings": [ + 120, + 210, + 315 + ] + } + ], + "geometry": "yn{qlA~kp}kCu|@zsBwYxm@aF~KcNtZ{BrE", + "duration": 68.7, + "distance": 350.2, + "name": "Bushwick Avenue", + "weight": 68.7, + "mode": "driving", + "maneuver": { + "bearing_after": 303, + "location": [ + -73.900752, + 40.679677 + ], + "type": "turn", + "bearing_before": 277, + "modifier": "straight", + "instruction": "Go straight onto Bushwick Avenue" + } + }, + { + "intersections": [ + { + "out": 2, + "in": 1, + "lanes": [ + { + "valid": true, + "indications": [ + "left" + ] + }, + { + "valid": true, + "indications": [ + "straight", + "left" + ] + }, + { + "valid": false, + "indications": [ + "none" + ] + } + ], + "entry": [ + true, + false, + true, + true + ], + "location": [ + -73.904128, + 40.681509 + ], + "bearings": [ + 30, + 135, + 210, + 315 + ] + } + ], + "geometry": "ia_rlA~~v}kCnpAboAzFxF", + "duration": 22.8, + "distance": 198.5, + "name": "Eastern Parkway", + "weight": 22.8, + "mode": "driving", + "maneuver": { + "bearing_after": 216, + "location": [ + -73.904128, + 40.681509 + ], + "type": "turn", + "bearing_before": 306, + "modifier": "left", + "instruction": "Turn left onto Eastern Parkway" + } + }, + { + "intersections": [ + { + "out": 3, + "in": 0, + "entry": [ + false, + true, + true, + true + ], + "location": [ + -73.905535, + 40.680079 + ], + "bearings": [ + 30, + 135, + 225, + 300 + ] + }, + { + "out": 2, + "in": 0, + "entry": [ + false, + false, + true + ], + "location": [ + -73.905659, + 40.680141 + ], + "bearings": [ + 120, + 255, + 315 + ] + }, + { + "out": 2, + "in": 1, + "entry": [ + true, + false, + true + ], + "location": [ + -73.906282, + 40.680507 + ], + "bearings": [ + 30, + 135, + 315 + ] + } + ], + "geometry": "}g|qlA|vy}kC{BvF{U|e@sMfW", + "duration": 20.8, + "distance": 120.8, + "name": "Broadway", + "weight": 20.8, + "mode": "driving", + "maneuver": { + "bearing_after": 302, + "location": [ + -73.905535, + 40.680079 + ], + "type": "turn", + "bearing_before": 216, + "modifier": "right", + "instruction": "Turn right onto Broadway" + } + }, + { + "intersections": [ + { + "out": 1, + "in": 0, + "entry": [ + false, + true, + true + ], + "location": [ + -73.90667, + 40.680741 + ], + "bearings": [ + 135, + 270, + 315 + ] + }, + { + "out": 2, + "in": 0, + "entry": [ + false, + true, + true, + true + ], + "location": [ + -73.908571, + 40.680554 + ], + "bearings": [ + 90, + 165, + 255, + 345 + ] + }, + { + "out": 2, + "in": 0, + "entry": [ + false, + true, + true, + true + ], + "location": [ + -73.911225, + 40.68024 + ], + "bearings": [ + 75, + 165, + 255, + 345 + ] + } + ], + "geometry": "iq}qlAz}{}kCtJxuBrRzdDvDfq@", + "duration": 84.10000000000001, + "distance": 456.8, + "name": "MacDougal Street", + "weight": 84.10000000000001, + "mode": "driving", + "maneuver": { + "bearing_after": 261, + "location": [ + -73.90667, + 40.680741 + ], + "type": "turn", + "bearing_before": 307, + "modifier": "left", + "instruction": "Turn left onto MacDougal Street" + } + }, + { + "intersections": [ + { + "in": 0, + "entry": [ + true + ], + "location": [ + -73.912029, + 40.680148 + ], + "bearings": [ + 81 + ] + } + ], + "geometry": "gl|qlAxlf~kC", + "duration": 0, + "distance": 0, + "name": "MacDougal Street", + "weight": 0, + "mode": "driving", + "maneuver": { + "bearing_after": 0, + "location": [ + -73.912029, + 40.680148 + ], + "type": "arrive", + "bearing_before": 261, + "modifier": "right", + "instruction": "You have arrived at your destination, on the right" + } + } + ], + "weight": 2828.5, + "distance": 27827, + "annotation": { + "congestion": [ + "unknown", + "unknown", + "unknown", + "unknown", + "unknown", + "unknown", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "moderate", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "moderate", + "moderate", + "moderate", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "heavy", + "heavy", + "heavy", + "heavy", + "heavy", + "heavy", + "moderate", + "moderate", + "moderate", + "moderate", + "moderate", + "moderate", + "moderate", + "moderate", + "low", + "moderate", + "moderate", + "moderate", + "moderate", + "moderate", + "low", + "moderate", + "moderate", + "heavy", + "moderate", + "heavy", + "heavy", + "heavy", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "heavy", + "low", + "low", + "low", + "moderate", + "low", + "moderate", + "moderate", + "heavy", + "moderate", + "heavy", + "moderate", + "moderate", + "heavy", + "low", + "low", + "unknown", + "low", + "low", + "heavy", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "heavy", + "heavy", + "heavy", + "heavy", + "heavy", + "heavy", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "moderate", + "moderate", + "moderate", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "heavy", + "heavy", + "heavy", + "heavy", + "heavy", + "heavy", + "heavy", + "heavy", + "low", + "low", + "low", + "low", + "low", + "low", + "heavy", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "moderate", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "moderate", + "low", + "heavy", + "unknown", + "low", + "low", + "low", + "heavy", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "low", + "heavy", + "heavy", + "moderate", + "low", + "low", + "severe", + "low", + "moderate", + "low", + "moderate", + "moderate", + "low", + "low", + "low" + ] + }, + "summary": "Long Island Expressway, Woodhaven Boulevard", + "duration": 2697.5 + } + ], + "weight_name": "routability", + "geometry": "}`zwlA~i{elCyBnDcTbHiGrBaKr@mC\\kCfGv@b@`o@x_@fq@b]jd@tTt`@t\\hU~CbObBh[~DjAyJb@sGAaE[sCq@iDuAsCwAqCmBaCkFeFuQkKcB}Dq@kBH_GnQoh@`Li^vCeItAeEd@{AxDoMtb@iqBrIw[pPsh@jWk}@tZuy@f^a`At[sy@pSik@xRqm@f`@opAl[wdApN}f@rZe}@lT{o@pc@gqAdC_HpCiGtCcF`DmEjDaEzDoDvDsCrD{BtDcBdEwAvDaAnDo@xD]jDSdEC~DH`F^nI~@lL|AvLjBjLjBpLvBtLbCvZbHrKvCfLdDtKbDbLvDrKvDhLjEdI~CtErBlFpCdEpChDlCrDfE|CrFtBbGxA`Hv@tHPhGIhGc@nGcAdG{AvFmBvEkCjE}CnDoDtCuDpB}CfAaDh@eDHgDY_Ds@qCmAeC_BmCgCgHaJ{P_RcEyD}D}CsWuMk|@qi@}EmDoEqDiE{DwDoEaE{GuDmIcDmJsCeKiBwKmAkMc@oNAyMRyNx@{LvAsMxBoLrCyJfwFioQpEsNn`Ia~VpBmHdBwHrAwIx@mHdCeLv@gFlAmGbA_FjAgExHyUhBcDnAuAjBsAtDqAhFa@|Dd@dEfBdr@`e@lErDnDxC~c@t]bi@b\\t`@{oAbBqEni@adB~\\kfAbS{n@ru@y`Cz|@mpCdDiKn@uBl@}Bj@kBJ]z@eCz@kCfB{F|AiF|AqEljAqqDzZkaAfMy`@bg@g}AtCwJ{E{D{a@kXwe@e[vg@c~AtX_|@hPsh@~Rgn@lCoI|Jw[tPsi@|BqHjBmFhBmFbB_KtBqVfEuPpEmQjAiH`AcKDmFJyFc@oLmAoGiAiHgC_OmIqQkJ{KsMyJuk@g`@gPeNaP{SsGeNsEaTkAmQAkTf@kXrIgh@rHaXhQu^rgHgrM|Pa^dKmb@jEib@fQuzAhFki@lDy^lAe_@iC}t@DeATuEpGyqALqCR}EU}OuCc\\kAmLqCsUoD_Zy@wKy@aVNc\\n@kM~@aIzS{lB`UomBrEo]zEeY`HkZzI_\\he@g{Aj}@{qCtLka@pIu]hGo[|Fo`@pEa_@zDqe@jByXzBqa@nAwP~A_RjQi{AzQ}oBpOuaBtFmj@jm@ojFtFe_@vHe_@dI_\\lLg`@tNia@tJySxJeRbNuT|p@q_AxEwGlZub@pOmThQkXlP}Z`Pu]jLy\\rJm_@bHo]rKym@xL{q@vJug@dIac@lJai@rZuoBzGi`@tIa`@jKm]dMe]vNwZnq@_pA|DsHne@m}@tKcUfSsd@xN}`@dL{a@pJcd@bHed@rEee@lJcoBfCwU`DmcAxGu_BxHwgBrHafB`Ciq@Zoe@]kZaBcc@eDgb@sFab@aIud@}Ju`@cKa[yMm\\ez@sbBmKiU_M{Z{GkScLgd@{E{h@eCq[qC}m@qBuz@cGowA_A{_@aBec@qCe_@sG}k@eJgc@wLy]iS}i@gNec@gOgi@yQk}@ek@ymCcFqj@aCe[McCS{DOiIFmKTeI`Mt@fDJho@wC|RmBja@gGze@kJnNqCn\\qG|f@uQjk@wSjSoHv`Ac_@lNgHl\\uPpd@g^dT{P|MaMnFeEvF}FbU{UhUoQvM}MlQmOfQeOjd@}`@pc@k`@dRmQ~a@yb@`e@ab@tGwFxXaVjd@ka@db@ed@bSoTpMoNxa@ee@ja@id@b`@kc@xDqCpZgJ~GuBvLaBna@@zEC|k@GhFN~d@tAlPn@`{@kGjN_Bl^kDxd@wChl@qDzs@uEvUyApYiDbJuCvJ}CxRoJxh@qd@jc@gp@f\\qg@j@bBp}@fkCnV|r@sAtWaAnRrIpBvIlFzEnIzB|R?hQeDbX_Epj@cA~f@\\xh@vBrl@vCt`@hEb]|E`ZhIb\\lFhNhBlGhQzY`PtTnI`HdTbOtO~FzRzEz`@dGvTrDtYtF`P~FtQpKlMbLpL|ObJtP|HhSpDhOfDdRvDx_@|R~tBhErS|FlPjHxM~KjOlf@dg@vXx]|G~I|FbGhMrHvKvD`InDnFbEjEnE`E`HdNbe@xDnL~ElHlE|EbGdDrGhBjGz@vIXbFV|Fz@bDbBxCrDfEvGzBnFzA`Hn@pJlCzh@rG`nAjGhsA~BdX`Jbj@~YjgB~Mp}@jIxl@jMbgAfDx]bFp`@tBrQnDlQlCbKdEtLdJ`QbGzIdI|I`HlGfQpNpaClgBxq@fi@rd@da@tg@ph@nj@fj@l`@t]tZlVj[rSp`@bXnKdE|K~CrQzCbKfCv|@zJ|VfHxNbOjVx_@rHdWzJxk@Xti@aGbhAu|@zsBwYxm@aF~KcNtZ{BrEnpAboAzFxF{BvF{U|e@sMfWtJxuBrRzdDvDfq@", + "weight": 2828.5, + "distance": 27827, + "duration": 2697.5 + } + ], + "code": "Ok" +} \ No newline at end of file diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/java/com/mapbox/mapboxsdk/downstream/testapp/MainActivity.java b/platform/android/MapboxGLDownstreamTestApp/src/main/java/com/mapbox/mapboxsdk/downstream/testapp/MainActivity.java new file mode 100644 index 0000000000..b7144eca35 --- /dev/null +++ b/platform/android/MapboxGLDownstreamTestApp/src/main/java/com/mapbox/mapboxsdk/downstream/testapp/MainActivity.java @@ -0,0 +1,248 @@ +package com.mapbox.mapboxsdk.downstream.testapp; + +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.v7.app.AppCompatActivity; +import android.view.View; +import android.widget.TextView; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.mapbox.api.directions.v5.DirectionsAdapterFactory; +import com.mapbox.api.directions.v5.DirectionsCriteria; +import com.mapbox.api.directions.v5.MapboxDirections; +import com.mapbox.api.directions.v5.models.DirectionsResponse; +import com.mapbox.api.directions.v5.models.DirectionsRoute; +import com.mapbox.geojson.Point; +import com.mapbox.mapboxsdk.Mapbox; +import com.mapbox.mapboxsdk.annotations.Marker; +import com.mapbox.mapboxsdk.annotations.MarkerOptions; +import com.mapbox.mapboxsdk.constants.Style; +import com.mapbox.mapboxsdk.geometry.LatLng; +import com.mapbox.mapboxsdk.maps.MapView; +import com.mapbox.mapboxsdk.maps.MapboxMap; +import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; +import com.mapbox.services.android.navigation.ui.v5.route.NavigationMapRoute; +import com.mapbox.services.android.navigation.ui.v5.route.OnRouteSelectionChangeListener; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +import timber.log.Timber; + +public class MainActivity extends AppCompatActivity implements OnMapReadyCallback, + MapboxMap.OnMapClickListener, Callback, OnRouteSelectionChangeListener { + + private static final String DIRECTIONS_RESPONSE = "directions-route.json"; + + private MapView mapView; + private TextView primaryRouteIndexTextView; + + private MapboxMap mapboxMap; + private NavigationMapRoute navigationMapRoute; + private StyleCycle styleCycle = new StyleCycle(); + + private Marker originMarker; + private Marker destinationMarker; + private boolean alternativesVisible = true; + private List routes = new ArrayList<>(); + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + Mapbox.getInstance(this, getString(R.string.mapbox_access_token)); + + setContentView(R.layout.activity_main); + + primaryRouteIndexTextView = findViewById(R.id.primaryRouteIndexTextView); + + mapView = (MapView) findViewById(R.id.mapView); + mapView.setStyleUrl(styleCycle.getStyle()); + mapView.onCreate(savedInstanceState); + mapView.getMapAsync(this); + + findViewById(R.id.fabStyles).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (mapboxMap != null) { + mapboxMap.setStyleUrl(styleCycle.getNextStyle()); + } + } + }); + + findViewById(R.id.fabToggleAlternatives).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + alternativesVisible = !alternativesVisible; + if (navigationMapRoute != null) { + navigationMapRoute.showAlternativeRoutes(alternativesVisible); + } + } + }); + } + + @Override + public void onNewPrimaryRouteSelected(DirectionsRoute directionsRoute) { + primaryRouteIndexTextView.setText(String.valueOf(routes.indexOf(directionsRoute))); + } + + @Override + public void onMapReady(MapboxMap mapboxMap) { + this.mapboxMap = mapboxMap; + navigationMapRoute = new NavigationMapRoute(null, mapView, mapboxMap, + "admin-3-4-boundaries-bg"); + Gson gson = new GsonBuilder().registerTypeAdapterFactory(DirectionsAdapterFactory.create()) + .create(); + DirectionsResponse response = gson.fromJson(loadJsonFromAsset(DIRECTIONS_RESPONSE), + DirectionsResponse.class); + navigationMapRoute.addRoute(response.routes().get(0)); + mapboxMap.addOnMapClickListener(this); + navigationMapRoute.setOnRouteSelectionChangeListener(this); + } + + @Override + public void onMapClick(@NonNull LatLng point) { + if (originMarker == null) { + originMarker = mapboxMap.addMarker(new MarkerOptions().position(point)); + } else if (destinationMarker == null) { + destinationMarker = mapboxMap.addMarker(new MarkerOptions().position(point)); + Point originPoint = Point.fromLngLat( + originMarker.getPosition().getLongitude(), originMarker.getPosition().getLatitude()); + Point destinationPoint = Point.fromLngLat( + destinationMarker.getPosition().getLongitude(), destinationMarker.getPosition().getLatitude()); + requestDirectionsRoute(originPoint, destinationPoint); + mapboxMap.removeMarker(originMarker); + mapboxMap.removeMarker(destinationMarker); + } else { + originMarker = null; + destinationMarker = null; + navigationMapRoute.removeRoute(); + } + } + +// @Override +// public void onMapLongClick(@NonNull LatLng point) { +// +// } + + public void requestDirectionsRoute(Point origin, Point destination) { + MapboxDirections directions = MapboxDirections.builder() + .origin(origin) + .destination(destination) + .accessToken(Mapbox.getAccessToken()) + .profile(DirectionsCriteria.PROFILE_DRIVING_TRAFFIC) + .overview(DirectionsCriteria.OVERVIEW_FULL) + .annotations(DirectionsCriteria.ANNOTATION_CONGESTION) + .alternatives(true) + .steps(true) + .build(); + + directions.enqueueCall(this); + } + + @Override + public void onResponse(Call call, Response response) { + if (response.body() != null && !response.body().routes().isEmpty()) { + List routes = response.body().routes(); + this.routes = routes; + navigationMapRoute.addRoutes(routes); + } + } + + @Override + public void onFailure(Call call, Throwable throwable) { + Timber.e(throwable); + } + + @Override + public void onResume() { + super.onResume(); + mapView.onResume(); + } + + @Override + protected void onStart() { + super.onStart(); + mapView.onStart(); + } + + @Override + protected void onStop() { + super.onStop(); + mapView.onStop(); + } + + @Override + public void onPause() { + super.onPause(); + mapView.onPause(); + } + + @Override + public void onLowMemory() { + super.onLowMemory(); + mapView.onLowMemory(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + mapView.onDestroy(); + } + + @Override + protected void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + mapView.onSaveInstanceState(outState); + } + + public NavigationMapRoute getNavigationMapRoute() { + return navigationMapRoute; + } + + private String loadJsonFromAsset(String filename) { + // Using this method to load in GeoJSON files from the assets folder. + + try { + InputStream is = getAssets().open(filename); + int size = is.available(); + byte[] buffer = new byte[size]; + is.read(buffer); + is.close(); + return new String(buffer, "UTF-8"); + + } catch (IOException ex) { + ex.printStackTrace(); + return null; + } + } + + private static class StyleCycle { + private static final String[] STYLES = new String[] { + Style.MAPBOX_STREETS, + Style.OUTDOORS, + Style.LIGHT, + Style.DARK, + Style.SATELLITE_STREETS + }; + + private int index; + + private String getNextStyle() { + index++; + if (index == STYLES.length) { + index = 0; + } + return getStyle(); + } + + private String getStyle() { + return STYLES[index]; + } + } +} \ No newline at end of file diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/drawable-v24/ic_launcher_foreground.xml b/platform/android/MapboxGLDownstreamTestApp/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000000..c3903edf43 --- /dev/null +++ b/platform/android/MapboxGLDownstreamTestApp/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/drawable/ic_launcher_background.xml b/platform/android/MapboxGLDownstreamTestApp/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000000..5713f34a5f --- /dev/null +++ b/platform/android/MapboxGLDownstreamTestApp/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/layout/activity_main.xml b/platform/android/MapboxGLDownstreamTestApp/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000000..f2f88f7330 --- /dev/null +++ b/platform/android/MapboxGLDownstreamTestApp/src/main/res/layout/activity_main.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000000..bbd3e02123 --- /dev/null +++ b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000000..bbd3e02123 --- /dev/null +++ b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-hdpi/ic_launcher.png b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..a2f5908281 Binary files /dev/null and b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-hdpi/ic_launcher_round.png b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000000..1b52399808 Binary files /dev/null and b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-mdpi/ic_launcher.png b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..ff10afd6e1 Binary files /dev/null and b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-mdpi/ic_launcher_round.png b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000000..115a4c768a Binary files /dev/null and b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xhdpi/ic_launcher.png b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..dcd3cd8083 Binary files /dev/null and b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000000..459ca609d3 Binary files /dev/null and b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxhdpi/ic_launcher.png b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..8ca12fe024 Binary files /dev/null and b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000000..8e19b410a1 Binary files /dev/null and b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000..b824ebdd48 Binary files /dev/null and b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000000..4c19a13c23 Binary files /dev/null and b/platform/android/MapboxGLDownstreamTestApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/values/colors.xml b/platform/android/MapboxGLDownstreamTestApp/src/main/res/values/colors.xml new file mode 100644 index 0000000000..3ab3e9cbce --- /dev/null +++ b/platform/android/MapboxGLDownstreamTestApp/src/main/res/values/colors.xml @@ -0,0 +1,6 @@ + + + #3F51B5 + #303F9F + #FF4081 + diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/values/strings.xml b/platform/android/MapboxGLDownstreamTestApp/src/main/res/values/strings.xml new file mode 100644 index 0000000000..a6bc5005c4 --- /dev/null +++ b/platform/android/MapboxGLDownstreamTestApp/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + Mapbox Integration TestApp + diff --git a/platform/android/MapboxGLDownstreamTestApp/src/main/res/values/styles.xml b/platform/android/MapboxGLDownstreamTestApp/src/main/res/values/styles.xml new file mode 100644 index 0000000000..5885930df6 --- /dev/null +++ b/platform/android/MapboxGLDownstreamTestApp/src/main/res/values/styles.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/platform/android/gradle/dependencies.gradle b/platform/android/gradle/dependencies.gradle index 07a9938915..ac23b3d284 100644 --- a/platform/android/gradle/dependencies.gradle +++ b/platform/android/gradle/dependencies.gradle @@ -8,19 +8,20 @@ ext { ] versions = [ - mapboxServices : '3.0.1', - mapboxTelemetry: '3.1.0', - mapboxGestures : '0.2.0', - supportLib : '25.4.0', - espresso : '3.0.1', - testRunner : '1.0.1', - leakCanary : '1.5.1', - lost : '3.0.4', - junit : '4.12', - mockito : '2.10.0', - robolectric : '3.5.1', - timber : '4.5.1', - okhttp : '3.10.0' + mapboxServices : '3.0.1', + mapboxTelemetry : '3.1.0', + mapboxGestures : '0.2.0', + mapboxNavigation: '0.13.0', + supportLib : '25.4.0', + espresso : '3.0.1', + testRunner : '1.0.1', + leakCanary : '1.5.1', + lost : '3.0.4', + junit : '4.12', + mockito : '2.10.0', + robolectric : '3.5.1', + timber : '4.5.1', + okhttp : '3.10.0' ] dependenciesList = [ @@ -28,8 +29,7 @@ ext { mapboxJavaGeoJSON : "com.mapbox.mapboxsdk:mapbox-sdk-geojson:${versions.mapboxServices}", mapboxAndroidTelemetry: "com.mapbox.mapboxsdk:mapbox-android-telemetry:${versions.mapboxTelemetry}", mapboxAndroidGestures : "com.mapbox.mapboxsdk:mapbox-android-gestures:${versions.mapboxGestures}", - - // for testApp + mapboxNavigation : "com.mapbox.mapboxsdk:mapbox-android-navigation-ui:${versions.mapboxNavigation}", mapboxJavaTurf : "com.mapbox.mapboxsdk:mapbox-sdk-turf:${versions.mapboxServices}", junit : "junit:junit:${versions.junit}", diff --git a/platform/android/settings.gradle b/platform/android/settings.gradle index b5ab80b5ec..19a5ba7ff7 100644 --- a/platform/android/settings.gradle +++ b/platform/android/settings.gradle @@ -1 +1 @@ -include ':MapboxGLAndroidSDK', ':MapboxGLAndroidSDKTestApp' \ No newline at end of file +include ':MapboxGLAndroidSDK', ':MapboxGLAndroidSDKTestApp', ':MapboxGLDownstreamTestApp' \ No newline at end of file -- cgit v1.2.1