Skip to content

Commit

Permalink
Add both map style support. From json and from mapbox url
Browse files Browse the repository at this point in the history
  • Loading branch information
babeone committed May 26, 2021
1 parent 91b43e1 commit 949f4f1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,11 @@ public void waitForLayer(String layerID, FoundLayerCallback callback) {
public void onMapReady(final MapboxMap mapboxMap) {
mMap = mapboxMap;

//mMap.setStyle(new Style.Builder().fromUrl(mStyleURL));
mMap.setStyle(new Style.Builder().fromJson(mStyleURL));
//if the myStyleURL contains "mapbox" the library will get the style from internet, else myStyleURL is a json and the library will load it
if(mStyleURL.substring(0,6).contains("mapbox"))
mMap.setStyle(new Style.Builder().fromUrl(mStyleURL));
else
mMap.setStyle(new Style.Builder().fromJson(mStyleURL));

reflow();

Expand Down

0 comments on commit 949f4f1

Please sign in to comment.