Monthly Archives: June 2016

How to rotate flight marker towards arrival airport in leaflet ?

 

flight_market_heading

First it is important to know how it works –

    1. Check out Leaflet Rotated Marker  plugin https://github.com/bbecquet/Leaflet.RotatedMarker

rotationAngle property need a value and this is key. You will have to generate that dynamically based on aircraft position and destination airport.  Function below does the same calculate  and give rotationAngle.

Function in Python

Keep in mind that lat1 and long1 are the aircraft’s position. And lat2, long2 are airport destination where aircraft is heading.

 

Function in PHP

Function in JavaScript

Share