bearing function
Takes two Points and finds the geographic bearing between them, i.e. the angle measured in degrees from the north line (0 degrees) For example:
var point1 = Point(coordinates: Position(-75.343, 39.984));
var point2 = Point(coordinates: Position((-75.543, 39.123));
var bearing = bearing(point1, point2);
//addToMap
var addToMap = [point1, point2]
point1.properties['marker-color'] = '#f00'
point2.properties['marker-color'] = '#0f0'
point1.properties.bearing = bearing
Implementation
num bearing(Point start, Point end, {bool calcFinal = false}) =>
bearingRaw(start.coordinates, end.coordinates, calcFinal: calcFinal);