Skip to content

Commit

Permalink
pull mapbox java deps from mapboxSdkServices 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahsnow1 committed Jan 19, 2018
1 parent d407881 commit 41fea84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions libandroid-navigation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ dependencies {
// Mapbox Android Services
api (dependenciesList.mapboxServices) {
transitive = true
exclude module: 'mapbox-java-geojson'
exclude module: 'mapbox-java-core'
exclude module: 'mapbox-java-services'
}

api dependenciesList.mapboxSdkServices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import com.mapbox.api.directions.v5.models.DirectionsRoute;
import com.mapbox.core.constants.Constants;
import com.mapbox.geojson.LineString;
import com.mapbox.geojson.Point;
import com.mapbox.services.commons.geojson.LineString;
import com.mapbox.turf.TurfConstants;
import com.mapbox.turf.TurfMeasurement;

Expand Down Expand Up @@ -48,8 +48,8 @@ public Point target(RouteInformation routeInformation) {
double bearing = 0;
if (routeInformation.route() != null) {
setupLineStringAndBearing(routeInformation.route());
lng = lineString.getCoordinates().get(0).getLongitude();
lat = lineString.getCoordinates().get(0).getLatitude();
lng = lineString.coordinates().get(0).longitude();
lat = lineString.coordinates().get(0).latitude();
bearing = initialBearing;
} else if (routeInformation.location() != null) {
lng = routeInformation.location().getLongitude();
Expand Down Expand Up @@ -82,10 +82,10 @@ private void setupLineStringAndBearing(DirectionsRoute route) {
lineString = LineString.fromPolyline(route.geometry(), Constants.PRECISION_6);
initialBearing = TurfMeasurement.bearing(
Point.fromLngLat(
lineString.getCoordinates().get(0).getLongitude(), lineString.getCoordinates().get(0).getLatitude()
lineString.coordinates().get(0).longitude(), lineString.coordinates().get(0).latitude()
),
Point.fromLngLat(
lineString.getCoordinates().get(1).getLongitude(), lineString.getCoordinates().get(1).getLatitude()
lineString.coordinates().get(1).longitude(), lineString.coordinates().get(1).latitude()
)
);
}
Expand Down

0 comments on commit 41fea84

Please sign in to comment.