/** * Set markers to display on map * * @param locations_and_texts List of locations and associated texts. Must be an array of Position * 1, label 1, Position 2, label 2, ... */ public void mark(final List<Object> locations_and_texts) { earth.clearMarkers(); if ((locations_and_texts.size() % 2) != 0) throw new IllegalArgumentException("Need matched number of locations and texts"); for (int i = 0; i < locations_and_texts.size(); i += 2) { if (!(locations_and_texts.get(i) instanceof Position)) throw new IllegalArgumentException("Expected location, got " + locations_and_texts.get(i)); earth.addMarker( (Position) locations_and_texts.get(i), locations_and_texts.get(i + 1).toString()); } }