Pavel Kouznetsov
Pavel Kouznetsov

Reputation: 90

Zoom controls for MapBox Android

I'm trying to enable zoom controls for Mapbox Android but neither XML

mapbox:mapbox_uiZoomControls="true" 

nor Kotlin/Java

mapboxMap.getUiSettings().setZoomControlsEnabled(true)

work for SDK 8.6.1 - both seems deprecated. Any ideas how to enable this control and if it's available at all?

Upvotes: 2

Views: 1538

Answers (2)

NoSpeedLimit
NoSpeedLimit

Reputation: 1

done it by myself

  1. Create a button.
  2. Attach the button to the function.

private MapView mapView;

public void zoomIn(View v){ mapView.getMapboxMap().setCamera(new CameraOptions.Builder().center(mapView.getMapboxMap().getCameraState().getCenter()).bearing(mapView.getMapboxMap().getCameraState().getBearing()).zoom(mapView.getMapboxMap().getCameraState().getZoom() + 1.0).build()); };

Upvotes: 0

Pratik Satani
Pratik Satani

Reputation: 1205

Yes, correct. There is not any way to set ZommControl in the latest version of Mapbox. see

Upvotes: 8

Related Questions