现在 OSM setBuiltInZoomControls() 已弃用,我该使用什么? [英] What do I use now that OSM setBuiltInZoomControls() is deprecated?

查看:68
本文介绍了现在 OSM setBuiltInZoomControls() 已弃用,我该使用什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

setBuiltInZoomControls() 我想在 OSM 地图中隐藏缩放 +/- 按钮,是否有缩放控制的替代语法?

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?

推荐答案

@deprecated 使用 {@link #getZoomController().setVisibility()} 代替

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

代码:

     zoomController.setVisibility(CustomZoomButtonsController.Visibility.NEVER)

这篇关于现在 OSM setBuiltInZoomControls() 已弃用,我该使用什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆