@@ -59,14 +59,15 @@ public final class Mapbox {
|
||||
FileSource.initializeFileDirsPaths(appContext);
|
||||
INSTANCE = new Mapbox(appContext, null);
|
||||
ConnectivityReceiver.instance(appContext);
|
||||
} else {
|
||||
TileServerOptions tileServerOptions = TileServerOptions.get(WellKnownTileServer.MapLibre);
|
||||
INSTANCE.tileServerOptions = tileServerOptions;
|
||||
INSTANCE.apiKey = null;
|
||||
FileSource fileSource = FileSource.getInstance(context);
|
||||
fileSource.setTileServerOptions(tileServerOptions);
|
||||
fileSource.setApiKey(null);
|
||||
}
|
||||
|
||||
TileServerOptions tileServerOptions = TileServerOptions.get(WellKnownTileServer.MapLibre);
|
||||
INSTANCE.tileServerOptions = tileServerOptions;
|
||||
INSTANCE.apiKey = null;
|
||||
FileSource fileSource = FileSource.getInstance(context);
|
||||
fileSource.setTileServerOptions(tileServerOptions);
|
||||
fileSource.setApiKey(null);
|
||||
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.mapbox.mapboxsdk.maps.MapView;
|
||||
import com.mapbox.mapboxsdk.maps.Style;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.NavUtils;
|
||||
import com.mapbox.mapboxsdk.util.DefaultStyle;
|
||||
|
||||
/**
|
||||
* Test activity showcasing a simple MapView without any MapboxMap interaction.
|
||||
@@ -23,9 +24,13 @@ public class SimpleMapActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.activity_map_simple);
|
||||
mapView = findViewById(R.id.mapView);
|
||||
mapView.onCreate(savedInstanceState);
|
||||
mapView.getMapAsync(mapboxMap -> mapboxMap.setStyle(
|
||||
new Style.Builder().fromUri(Style.getPredefinedStyle("Streets"))
|
||||
));
|
||||
mapView.getMapAsync(mapboxMap -> {
|
||||
DefaultStyle[] styles = Style.getPredefinedStyles();
|
||||
if (styles != null && styles.length > 0) {
|
||||
String styleUrl = styles[0].getUrl();
|
||||
mapboxMap.setStyle(new Style.Builder().fromUri(styleUrl));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user