lngLatToLocalMeter function
Converts lng, lat geographic coordinates into local meters (x, y) relative to a center.
Implementation
Map<String, double> lngLatToLocalMeter(double lng, double lat, LatLng center) {
final double originLat = center.latitude;
final double originLng = center.longitude;
final double mPerDegLng =
mPerDegLat * math.cos((originLat * math.pi) / 180.0);
final double dLng = lng - originLng;
final double dLat = lat - originLat;
final double x = dLng * mPerDegLng;
final double y = dLat * mPerDegLat;
return {'x': x, 'y': y};
}