You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
I'm using Android SDK for offline maps and discover that none of the examples are really correct.
Here's my goal: I'm working on a firefighter App. The App receive Lat and Long of the accident location. It finds fire hidrants all around in order to create the bounds, then download the area. Then it takes accident location, firestation location, ask for the "direction", save polyline coord in SQL, get min and max to get the route bounds, and get it.
Then I unplug Wifi, and let's go.
But, I get an HTTP error...
In fact, all examples MapBox give are NOT real offline examples.
In order to get an Activity which download file, then being able to cut Wifi and use and other activity, you must respect a few points that (I think) must be explained in the examples:
when you download, you must set the style like mapView.setStyleUrl(Style.SATELLITE_STREETS); Because with Offline, the style is defined at download time and NOT at display time. The display will be done using the style you downloaded.
when you display, you must avoid everything which have a link with internet. So the XML code must be:
Thanks for reporting this, which version of the SDK are you using? We have recently reduced the amount of logging which occurs during offline usage and fixed a few issues (see #6210, #5781, and #6402). Could you try either the latest 4.2.0-beta.3 or the SNAPSHOT. The reason for some of the HTTP request when an offline regions loaded in would be to check if a more recent tile's available (and update if internets available).
For the map style, you'll need to use the same style for both the offline region you are downloading and the mapview style.
I'm using com.mapbox.mapboxsdk:mapbox-android-sdk:4.1.1@aar
As soon as I finished struggling with a displa (in a few minutes I hope), I'll try with the 4.2.0
Concerning the offline, I've made a suggestion here: #6550
I'm using Android SDK for offline maps and discover that none of the examples are really correct.
Here's my goal: I'm working on a firefighter App. The App receive Lat and Long of the accident location. It finds fire hidrants all around in order to create the bounds, then download the area. Then it takes accident location, firestation location, ask for the "direction", save polyline coord in SQL, get min and max to get the route bounds, and get it.
Then I unplug Wifi, and let's go.
But, I get an HTTP error...
In fact, all examples MapBox give are NOT real offline examples.
In order to get an Activity which download file, then being able to cut Wifi and use and other activity, you must respect a few points that (I think) must be explained in the examples:
Don't put the style and don't call mapView.setStyleUrl or you'll have an HTTP error and this will stop displaying your map.
The problem came from the fact the off line examples show how to download AND display at same time which is confused
Hope this will help and avoid headaches.
The text was updated successfully, but these errors were encountered: