Skip to content

Commit

Permalink
fixed issue where no style was set when offline.
Browse files Browse the repository at this point in the history
  • Loading branch information
tnightingale committed Mar 25, 2016
1 parent 866f381 commit 09f1e44
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 0 additions & 4 deletions src/android/Map.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,6 @@ public void showUserLocation(boolean enabled) {
}

private void applyOptions(JSONObject options) throws JSONException {
if (options.has("style")) {
this.mapView.setStyleUrl(Mapbox.getStyle(options.optString("style")));
}

if (!options.isNull("showUserLocation")) {
this.showUserLocation(options.getBoolean("showUserLocation"));
}
Expand Down
1 change: 1 addition & 0 deletions src/android/Mapbox.java
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ public void onError(String error) {
private MapView createMapView(String accessToken, JSONObject options) throws JSONException {
MapView mapView = new MapView(this.webView.getContext());
mapView.setAccessToken(accessToken);
mapView.setStyleUrl(Mapbox.getStyle(options.optString("style")));

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

0 comments on commit 09f1e44

Please sign in to comment.