Search code examples
androidosmdroid

Is it possible to move Zoom Controls to a different location on Screen in OSMdroid


I'm looking at moving default zoom controls of osmdroid to a different position. Is it possible to do this? If so, can anyone point me how?

I tried digging deep, through much of stackoverflow but no result. Or should I go with customizing by creating a custom zoom controls again for my app?

My intention is to relocate the already available zoom controls to a different place on screen.


Solution

  • You cannot relocate the MapView's integrated zoom control using the OSMDroid API.

    The only way to do that without modifying the library's source code is to implement a FrameLayout over your MapView and that will include the controls you wish, where you wish. This also allows you to customize them (by showing a slider for example).

    Once this done, you should ensure that MapView.setBuiltInZoomControls() is set to false.