Always show zoom controls on a MapView

前端 未结 2 1381
天命终不由人
天命终不由人 2020-12-24 08:22

Is there a way to always show the zoom controls on a MapView? I have added the zoom controls using

map=(MapView)findViewById(R.id.map);
map.setBuiltInZoomCon         


        
2条回答
  •  无人及你
    2020-12-24 09:07

    Intrications' solution does work, but you lose the built in functionality where the button disables when you have zoomed in or out all the way. You can retain this functionality by using the following instead:

    localMapView.getZoomButtonsController().setAutoDismissed(false);
    

    However, this does not let you place the controls wherer you want in the panel, and although it does not go away, it does not show up the first time until the user touches the screen once. I tried calling setVisible(true) on the controller, but that does not seem to work for some reason.

提交回复
热议问题