Skip to content

Commit ff8b3f4

Browse files
committed
fixed issue where no style was set when offline.
1 parent 96e29b9 commit ff8b3f4

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/android/Map.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,6 @@ public void showUserLocation(boolean enabled) {
161161
}
162162

163163
private void applyOptions(JSONObject options) throws JSONException {
164-
if (options.has("style")) {
165-
this.mapView.setStyleUrl(Mapbox.getStyle(options.optString("style")));
166-
}
167-
168164
if (!options.isNull("showUserLocation")) {
169165
this.showUserLocation(options.getBoolean("showUserLocation"));
170166
}

src/android/Mapbox.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ public void onError(String error) {
389389
private MapView createMapView(String accessToken, JSONObject options) throws JSONException {
390390
MapView mapView = new MapView(this.webView.getContext());
391391
mapView.setAccessToken(accessToken);
392+
mapView.setStyleUrl(Mapbox.getStyle(options.optString("style")));
392393

393394
final JSONObject margins = options.isNull("margins") ? null : options.getJSONObject("margins");
394395
final int left = (int) (retinaFactor * (margins == null || margins.isNull("left") ? 0 : margins.getInt("left")));

0 commit comments

Comments
 (0)