4
$\begingroup$
GeoListPlot[AirportData[{"ORD"}], GeoLabels -> True]  

shows correctly a red point, labeled "Chicago O'Hare Internation Airport".

Is it possible to label that point by the airports IATA-Code, which is already a property of AirportData[]?

Thanks Volker

$\endgroup$
8
$\begingroup$

The GeoLabels docs says that it accepts a function of the form

function[graphics_, region_, position_]

when used in GeoListPlot. A little experimentation shows that region is the Entity, itself, e.g.

GeoListPlot[AirportData[{"ORD"}], GeoLabels -> (Tooltip[#1, #2]&)]

So, we can then use that info to create the IATA-Code label,

GeoListPlot[AirportData[{"ORD"}], 
  GeoLabels -> ({Black, Text[#2["IATACode"], #2, {0, -1}]} &)]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.