Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] #5004 - Rewiring MapView to look for Access Token from Mapb…
Browse files Browse the repository at this point in the history
…oxAccountManager fist and options second
  • Loading branch information
bleege committed May 13, 2016
1 parent 05ab48d commit d67687d
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import com.almeros.android.multitouch.gesturedetectors.RotateGestureDetector;
import com.almeros.android.multitouch.gesturedetectors.ShoveGestureDetector;
import com.almeros.android.multitouch.gesturedetectors.TwoFingerGestureDetector;
import com.mapbox.mapboxsdk.MapboxAccountManager;
import com.mapbox.mapboxsdk.R;
import com.mapbox.mapboxsdk.annotations.Annotation;
import com.mapbox.mapboxsdk.annotations.Icon;
Expand Down Expand Up @@ -257,7 +258,13 @@ private void setInitialState(MapboxMapOptions options) {
mMapboxMap.moveCamera(CameraUpdateFactory.newCameraPosition(position));
}

String accessToken = options.getAccessToken();
String accessToken = null;
if (MapboxAccountManager.getInstance() != null) {
accessToken = MapboxAccountManager.getInstance().getAccessToken();
} else {
accessToken = options.getAccessToken();
}

String style = options.getStyle();
if (!TextUtils.isEmpty(accessToken)) {
mMapboxMap.setAccessToken(accessToken);
Expand Down

0 comments on commit d67687d

Please sign in to comment.