Skip to content

Instantly share code, notes, and snippets.

@PDXIII
Created April 15, 2013 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PDXIII/5387513 to your computer and use it in GitHub Desktop.
Save PDXIII/5387513 to your computer and use it in GitHub Desktop.
Code snippet for my Unfolding tutorial site.
// we need to get right the airport list for the current country
// because airportLists is sorted after the coutries i calls the right one
ArrayList<Marker> currentAirportList = airportLists.get(i);
// iterating through this airport list
for (Marker currentAirport : currentAirportList ){
// tell airport to draw itself
currentAirport.draw(map);
// check for mouse hover
if (currentAirport.isInside(map, mouseX, mouseY)){
// you should know this from the countries part
HashMap currentAirportProps = currentAirport.getProperties();
// Note: in this case "NAME" is written in uppercase,
// this depends on the given geo.json file
// it's better to know your data
String currentAirportName = currentAirportProps.get("NAME").toString();
// string output into the console
println(currentAirportName);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment