Reputation: 3
I am using MapView from osmdroid (3.0.10) for Android project. My goal is to add layout to MapView using addView() and fixed at the top:
MapView.LayoutParams params = new MapView.LayoutParams(MapView.LayoutParams.MATCH_PARENT, MapView.LayoutParams.WRAP_CONTENT, null, MapView.LayoutParams.TOP_CENTER, 0, 0);
filterPanel.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
mapView.addView(filterPanel, params);
What I get is floating layout when sliding through the map. I can't add this layout on a separate ViewGroup it must be in a MapView.
Upvotes: 0
Views: 213
Reputation: 5575
MapView is not a normal ViewGroup. It daws tile bitmaps whenever it sees fit, that may cause your view to be "overdrawn" as you mention it. I would put the Mapview in a container in a Framelayout, and add your custom views to the same Framelayout in a different container. That should work. If you want to put your own custom view in between the map and an itemizedoverlay, then all I can think of is to change the MapView code and add a handle for your view there.
Upvotes: 1