[android] #5296 - Add a container ViewGroup for MarkerViews
Fixes #5296
This commit is contained in:
committed by
Tobrun Van Nuland
parent
5782c9a6ba
commit
8c86252103
@@ -387,7 +387,7 @@ public class MarkerViewManager {
|
||||
|
||||
markerViewMap.put(marker, adaptedView);
|
||||
if (convertView == null) {
|
||||
mapView.addView(adaptedView);
|
||||
mapView.getMarkerViewContainer().addView(adaptedView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ import android.view.Surface;
|
||||
import android.view.TextureView;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.FrameLayout;
|
||||
@@ -124,6 +125,7 @@ public class MapView extends FrameLayout {
|
||||
private NativeMapView mNativeMapView;
|
||||
private boolean mHasSurface = false;
|
||||
|
||||
private ViewGroup mMarkerViewContainer;
|
||||
private CompassView mCompassView;
|
||||
private ImageView mLogoView;
|
||||
private ImageView mAttributionsView;
|
||||
@@ -224,6 +226,8 @@ public class MapView extends FrameLayout {
|
||||
// Connectivity
|
||||
onConnectivityChanged(isConnected());
|
||||
|
||||
mMarkerViewContainer = (ViewGroup) view.findViewById(R.id.markerViewContainer);
|
||||
|
||||
mMyLocationView = (MyLocationView) view.findViewById(R.id.userLocationView);
|
||||
mMyLocationView.setMapboxMap(mMapboxMap);
|
||||
|
||||
@@ -1132,6 +1136,13 @@ public class MapView extends FrameLayout {
|
||||
return new ArrayList<>(annotations);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the ViewGroup containing the marker views
|
||||
*/
|
||||
public ViewGroup getMarkerViewContainer() {
|
||||
return mMarkerViewContainer;
|
||||
}
|
||||
|
||||
|
||||
int getTopOffsetPixelsForIcon(Icon icon) {
|
||||
if (mDestroyed) {
|
||||
|
||||
Reference in New Issue
Block a user