Discontinue old API used for Mapbox projects/classic, replace with Mapbox Studio styled raster tiles #1902
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mapbox integration was faulty after Mapbox discontinued their "Projects" and stopped developing Mapbox Classic. New solution for map designers (or anyone interested in creating a free account to use their services) is Mapbox Studio. Tower threw error messages of incorrect credentials, but could partly display mapbox maps if . was entered into Tower Map ID field.
This pull request solves the error messages by switching out the API to retrieve raster tiles from styles. API documented here: https://docs.mapbox.com/api/maps/#retrieve-raster-tiles-from-styles
To support this API, a field to capture the users mapbox user name is introduced. In addition, the mapId field is re-used to enter the ID of the style rather than the mapId. Two API calls to retrieve additional "markers" and "polygons" are disabled since I had problems to support that and saw no obvious use case. But if these objects are included into their mapbox style, they will be retrieved by Tower anyway. In addition, the leak canary is disabled in this PR.
Solution works almost flawless. One problem remains: When user select the flight data screen, the style tiles are not shown. Seems to be caused in DroneMap.java, where use case start flight data only trigger function onStart(), while use cases starting editor/history/"flip orientation" all have a preceding call to onCreateView() upfront of onStart(). The workaround in flight data screen: Rotate device (horisontal <=> portrait), and mapbox tiles becomes visible again.