private void selectMarkerIfClicked(List<Marker> markers) { for (Marker marker : markers) { if (marker.isInside(map, mouseX, mouseY)) { marker.setSelected(true); lastClicked = (CommonMarker) marker; break; } } }
// If there is a marker under the cursor, and lastSelected is null // set the lastSelected to be the first marker found under the cursor // Make sure you do not select two markers. // private void selectMarkerIfHover(List<Marker> markers) { // TODO: Implement this method for (Marker marker : markers) { if (marker.isInside(map, mouseX, mouseY)) { marker.setSelected(true); lastSelected = (CommonMarker) marker; break; } } }