I'm using Mapbox Android SDK v4.0.0 in an Android app that at some point needs to "freeze" a MapView at a given position and a given zoom level.
It seems to me that there are no methods in the API to:
How to get this done?
The Mapbox Maps SDKs for iOS and Android allow you to add interactive maps to your mobile applications, define custom and dynamic style rules, manipulate custom data, and interface with Mapbox web APIs.
Mapbox maps do away with the basemap-overlay strategy and treat everything on the map as a layer that you can style independently and move up and down the rendering stack.
4 major features for the new Android SDK. Our new Android SDK launches today, baking in support for offline maps, intelligent telemetry, better map interactions, and improved compatibility with the Google Maps Android API. Offline maps. Your app can now download arbitrary regions of the globe for offline use.
The Mapbox Styles API lets you read and change map styles, fonts, and images. This API is the basis for Mapbox Studio. If you use Studio, Mapbox GL JS, or the Mapbox Mobile SDKs, you are already using the Styles API. This documentation is useful for software developers who want to programmatically read and write these resources.
It seems the API has changed between versions 3.2.0 and 4.0.0. Currently, to achieve the above goal, you need to use a CameraPosition
and inject it into your mapboxMap
:
mapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(MapboxMap mapboxMap) {
mapboxMap.setCameraPosition(new CameraPosition.Builder()
.target(yourLatLng)
.zoom(yourZoom)
.build());
}
});
Works like a charm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With