-
Notifications
You must be signed in to change notification settings - Fork 493
Conversation
@langsmith I am trying to run demo app on my pixel and keep getting following exception when running on master branch as well as I am at commit I am running command Error I see is this:
|
Thanks @snijsure , putting out multiple 🔥 right now but will definitely look into it and get back to you. |
This reverts commit d21be91.
.gitignore
Outdated
@@ -11,3 +11,4 @@ build | |||
gradlew.bat | |||
*.properties | |||
src/main/res/ | |||
MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/account/AccountRetrievalService.java |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this being added to the gitignore file? Any chance you could add a comment above it explaining what the file is and why it's not being checked in to git?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed from gitignore file. Was part of an experiment 🔬
@@ -129,7 +132,11 @@ protected void onSaveInstanceState(Bundle outState) { | |||
inputStream.close(); | |||
FeatureCollection featureCollection = FeatureCollection.fromJson(sb.toString()); | |||
LineString lineString = (LineString) featureCollection.getFeatures().get(0).getGeometry(); | |||
points = lineString.getCoordinates(); | |||
for (int x = 0; x < lineString.getCoordinates().size(); x++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use foreach here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -181,16 +186,16 @@ public void onResponse(Call<MapMatchingResponse> call, Response<MapMatchingRespo | |||
// Convert the map matched response list from position to latlng coordinates. | |||
// By default, the SDK uses MapMatchingCriteria.GEOMETRY_POLYLINE_6, therefore | |||
// you need Constants.PRECISION_6 for the decode to be right | |||
String geometry = response.body().getMatchings().get(0).getGeometry(); | |||
String geometry = response.body().matchings().get(0).geometry(); | |||
List<Position> positions = PolylineUtils.decode(geometry, Constants.PRECISION_6); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be Point
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PolylineUtils.decode
returns List<Position>
@@ -181,16 +186,16 @@ public void onResponse(Call<MapMatchingResponse> call, Response<MapMatchingRespo | |||
// Convert the map matched response list from position to latlng coordinates. | |||
// By default, the SDK uses MapMatchingCriteria.GEOMETRY_POLYLINE_6, therefore | |||
// you need Constants.PRECISION_6 for the decode to be right | |||
String geometry = response.body().getMatchings().get(0).getGeometry(); | |||
String geometry = response.body().matchings().get(0).geometry(); | |||
List<Position> positions = PolylineUtils.decode(geometry, Constants.PRECISION_6); | |||
if (positions == null) { | |||
return; | |||
} | |||
|
|||
for (int i = 0; i < positions.size(); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convert to foreach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -174,7 +175,7 @@ public void onFailure(Call<DirectionsMatrixResponse> call, Throwable throwable) | |||
private void addMarkers() { | |||
Icon lightningBoltIcon = IconFactory.getInstance(MatrixApiActivity.this) | |||
.fromResource(R.drawable.lightning_bolt); | |||
for (Feature feature : featureCollection.getFeatures()) { | |||
for (com.mapbox.geojson.Feature feature : featureCollection.features()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason this is using the full namespace here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Full namespace removed
positionList.add(singleLocationPosition); | ||
for (Feature singleLocation : featureCollection.features()) { | ||
Point singleLocationPoint = (Point) singleLocation.geometry(); | ||
pointList.add(singleLocationPoint); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add the item directly to the list rather than declaring a local variable and then passing it in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
} | ||
} | ||
|
||
private void initMatrixLocationListForRecyclerView() { | ||
matrixLocationList = new ArrayList<>(); | ||
for (int x = 0; x < featureCollection.getFeatures().size(); x++) { | ||
for (int x = 0; x < featureCollection.features().size(); x++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
foreach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
.overview(DirectionsCriteria.OVERVIEW_FULL) | ||
.profile(DirectionsCriteria.PROFILE_DRIVING) | ||
.accessToken(Mapbox.getAccessToken()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove extra space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
mapboxMap.addOnCameraMoveListener(new MapboxMap.OnCameraMoveListener() { | ||
@Override | ||
public void onCameraMove() { | ||
if (mapboxMap.getCameraPosition().zoom > 16) { | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This turf exception can be removed, it's now runtime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -97,6 +101,7 @@ public void onCameraChange(CameraPosition position) { | |||
hideLevelButton(); | |||
} | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
This pr fixes many broken APIs, import lines, and other refactoring that are all related to recent changes in our tools (Mapbox Java, plugins, etc.). For some reason, CircleCI didn't catch this 😟