Search code examples
androidandroid-mapviewosmdroid

Add a view/layout to a Map on OsmDroid


I am working with osmdroid and I'm wondering if there is a way to "stick" a view on a map. The problem with the OverlayItem is that is impossible to change it without delete it. Delete and create another item is not energy-friendly.

Thank you in advance.


Solution

  • You can add a geo-located View to the maps using mapView.addView() if you set the LayoutParams of your view to MapView.LayoutParams. In the LayoutParams you can set the location of the view.