#894 - Initial port of selectAnnotation and removing auto display of InfoWindow on long press marker addition in TestApp
This commit is contained in:
committed by
Justin R. Miller
parent
4837a247e5
commit
902b80888f
@@ -438,7 +438,6 @@ public class MapView extends FrameLayout implements LocationListener {
|
||||
marker.setId(id); // the annotation needs to know its id
|
||||
marker.setMapView(this); // the annotation needs to know which map view it is in
|
||||
mAnnotations.add(marker);
|
||||
selectAnnotation(marker);
|
||||
return marker;
|
||||
}
|
||||
|
||||
@@ -1968,8 +1967,21 @@ public class MapView extends FrameLayout implements LocationListener {
|
||||
|
||||
private void selectAnnotation(Annotation annotation) {
|
||||
|
||||
// Need to deselect any currently selected annotation first
|
||||
if (annotation == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (annotation == mSelectedAnnotation) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (annotation instanceof Marker) {
|
||||
// Need to deselect any currently selected annotation first
|
||||
deselectAnnotation();
|
||||
|
||||
((Marker)annotation).showInfoWindow();
|
||||
mSelectedAnnotation = annotation;
|
||||
}
|
||||
}
|
||||
|
||||
private void deselectAnnotation() {
|
||||
|
||||
Reference in New Issue
Block a user