35 lines
732 B
Dart
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,
|
|
};
|
|
}
|
|
}
|