I need help with Mapbox Android. I drew a polyline and some custom default markers in the style without any problems, but when changing the default style to a custom style, I still see the polyline, but no markers are drawn (neither custom nor default markers).
Can someone help me with this problem?
This is my code:
mapView.setStyleUrl(Constants.MAP_URL_GREEN);
PolylineOptions options = new PolylineOptions();
for(double[] coordArray : route.getListCoords()) {
options.add(new LatLng(coordArray[0], coordArray[1]));
}
options.color(ContextCompat.getColor(getContext(), R.color.color_end_green));
options.width(5);
mapView.addPolyline(options);
MarkerOptions currentMarker;
for(Point point : route.getListPoints()){
currentMarker = getMarkerFromPoint(point);
markers.add(mapView.addMarker(currentMarker));
}
Where getMarkerFromPoint:
private MarkerOptions getMarkerFromPoint(Point point) {
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(new LatLng(point.getLat(), point.getLng()));
return markerOptions;
}
EDIT . I am using MapBox Android SDK 3.2.0.
Thank you in advance
source
share