The top 50 airports in the US, selectable by state.
In this demo, KeyLines uses Leaflet, a JavaScript library for interactive maps.
When working with data that has geo / location information available you may want to have KeyLines chart elements interact with other map layers. These could be boundaries representing areas of jurisdiction or coverage - e.g. national boundaries or cellular tower service.
This demo illustrates how to directly access the underlying Leaflet map object. This allows you to use the Leaflet API directly, for example to add new layers to the map.
Users can select individual US States, which then highlights the airport(s) within that state and their primary routes in KeyLines.
This is achieved by drawing polygons onto a map layer and showing the 'capture' of KeyLines nodes and links within each polygon.
This example makes use of a library that implements a point-in-polygon algorithm point-in-polygon-hao in order to identify if an airport belongs to a state.
Key function used: