Search code examples
androidopenstreetmap

What do I use now that OSM setBuiltInZoomControls() is deprecated?


setBuiltInZoomControls() i want to hide zoom +/- button in OSM map, is there any alternate syntax for zoom control?

 Configuration.getInstance().userAgentValue = BuildConfig.APPLICATION_ID;
    binding!!.mapview.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE)
     
    binding!!.mapview.setBuiltInZoomControls(false)
   
    binding!!.mapview.setMultiTouchControls(true)
    val mapController: IMapController = binding!!.mapview.controller
    mapController.setZoom(10.0)
    //mapController.setCenter(startPoint)
    val zoomLocation = GeoPoint(38.1890118, -85.9569607)
    mapController.setCenter(zoomLocation)

How do I fix the deprecation warning in this code? Alternatively, are there any other options for doing this?


Solution

  • @deprecated Use {@link #getZoomController().setVisibility()} instead

    Code:

         zoomController.setVisibility(CustomZoomButtonsController.Visibility.NEVER)