Created
April 15, 2013 11:43
-
-
Save PDXIII/5387513 to your computer and use it in GitHub Desktop.
Code snippet for my Unfolding tutorial site.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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