How to close infoWindow when i touch map android Osm
Asked Answered
R

1

7

I do not know how i can close the InfoWindow in OSMDroid when i click anywhere on the map . I tried to check setMapListener but this way is bad and did not work. Have any idea?

Robson answered 29/1, 2016 at 12:42 Comment(0)
G
15
MapEventsOverlay mapEventsOverlay = new MapEventsOverlay(this, this);
map.getOverlays().add(0, mapEventsOverlay);

@Override public boolean singleTapConfirmedHelper(GeoPoint p) {
    InfoWindow.closeAllInfoWindowsOn(map);
    return true;
}

@Override public boolean longPressHelper(GeoPoint p) {
    //DO NOTHING FOR NOW:
    return false;
}

Tutorial: https://github.com/MKergall/osmbonuspack/wiki/Tutorial_5

Gunpoint answered 21/7, 2016 at 18:34 Comment(1)
this closes all windows, not just oneFictile

© 2022 - 2024 — McMap. All rights reserved.