eagletracker/lib/class/geoPosition.dart
2024-07-08 23:03:37 +02:00

35 lines
732 B
Dart

class GeoPosition {
final double latitude;
final double longitude;
final double altitude;
final double speed;
/*
* Class for the geographical position element needed for tracking the bird
*/
GeoPosition({
required this.latitude,
required this.longitude,
required this.altitude,
this.speed = 0.0,
});
factory GeoPosition.fromJson(Map<String, dynamic> json) {
return GeoPosition(
latitude: json['latitude'],
longitude: json['longitude'],
altitude: json['altitude'],
speed: json['speed'],
);
}
Map<String, dynamic> toJson() {
return {
'latitude': latitude,
'longitude': longitude,
'altitude': altitude,
'speed': speed,
};
}
}