mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-05-25 17:37:54 +02:00
More camera -> node, notifications for approaching
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import 'package:latlong2/latlong.dart';
|
||||
|
||||
class OsmCameraNode {
|
||||
class OsmNode {
|
||||
final int id;
|
||||
final LatLng coord;
|
||||
final Map<String, String> tags;
|
||||
|
||||
OsmCameraNode({
|
||||
OsmNode({
|
||||
required this.id,
|
||||
required this.coord,
|
||||
required this.tags,
|
||||
@@ -18,14 +18,14 @@ class OsmCameraNode {
|
||||
'tags': tags,
|
||||
};
|
||||
|
||||
factory OsmCameraNode.fromJson(Map<String, dynamic> json) {
|
||||
factory OsmNode.fromJson(Map<String, dynamic> json) {
|
||||
final tags = <String, String>{};
|
||||
if (json['tags'] != null) {
|
||||
(json['tags'] as Map<String, dynamic>).forEach((k, v) {
|
||||
tags[k.toString()] = v.toString();
|
||||
});
|
||||
}
|
||||
return OsmCameraNode(
|
||||
return OsmNode(
|
||||
id: json['id'] is int ? json['id'] as int : int.tryParse(json['id'].toString()) ?? 0,
|
||||
coord: LatLng((json['lat'] as num).toDouble(), (json['lon'] as num).toDouble()),
|
||||
tags: tags,
|
||||
@@ -51,5 +51,4 @@ class OsmCameraNode {
|
||||
final normalized = ((val % 360) + 360) % 360;
|
||||
return normalized;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user