From dfa3cc6458a913b4be2e549ed0c3a47b2c3b9397 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Fri, 16 Aug 2024 17:58:49 +0200 Subject: [PATCH] Fix map bug --- lib/Screens/Map/geo_point_filter.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Screens/Map/geo_point_filter.dart b/lib/Screens/Map/geo_point_filter.dart index 27b74da..4e4df20 100644 --- a/lib/Screens/Map/geo_point_filter.dart +++ b/lib/Screens/Map/geo_point_filter.dart @@ -78,7 +78,7 @@ class _GeoPointFilterState extends State { if(pointWithoutCat.title!.where((l) => l.language == widget.language).firstOrNull != null) { TreeNode nodeWithoutCat = TreeNode( id: 000 + int.parse( - (pointWithoutCat.latitude ?? '').substring(0, min(pointWithoutCat.latitude!.length, 10)).replaceAll(".", "") + (pointWithoutCat.longitude ?? '').substring(0, min(pointWithoutCat.longitude!.length, 10)).replaceAll(".", "") + (pointWithoutCat.latitude ?? '').substring(0, min(pointWithoutCat.latitude!.length, 10)).replaceAll(".", "").replaceAll("-","") + (pointWithoutCat.longitude ?? '').substring(0, min(pointWithoutCat.longitude!.length, 10)).replaceAll(".", "").replaceAll("-","") ), title: parse(pointWithoutCat.title!.firstWhere((l) => l.language == widget.language).value!).documentElement!.text, children: [], @@ -110,7 +110,7 @@ class _GeoPointFilterState extends State { if (geoPoint.categorieId == category.id && geoPoint.title!.where((l) => l.language == widget.language).firstOrNull != null) { TreeNode geoPointNode = TreeNode( id: 000 + int.parse( - (geoPoint.latitude ?? '').substring(0, min(geoPoint.latitude!.length, 10)).replaceAll(".", "") + (geoPoint.longitude ?? '').substring(0, min(geoPoint.longitude!.length, 10)).replaceAll(".", "") + (geoPoint.latitude ?? '').substring(0, min(geoPoint.latitude!.length, 10)).replaceAll(".", "").replaceAll("-", "") + (geoPoint.longitude ?? '').substring(0, min(geoPoint.longitude!.length, 10)).replaceAll(".", "").replaceAll("-", "") ), title: parse(geoPoint.title!.firstWhere((l) => l.language == widget.language).value!).documentElement!.text, checked: true, // default true @@ -155,14 +155,14 @@ class _GeoPointFilterState extends State { for (var childNode in node.children) { if (childNode.checked) { checkedGeoPoints.add(widget.geoPoints.firstWhere((point) => int.parse( - (point.latitude ?? '').substring(0, min(point.latitude!.length, 10)).replaceAll(".", "") + (point.longitude ?? '').substring(0, min(point.longitude!.length, 10)).replaceAll(".", "") + (point.latitude ?? '').substring(0, min(point.latitude!.length, 10)).replaceAll(".", "").replaceAll("-", "") + (point.longitude ?? '').substring(0, min(point.longitude!.length, 10)).replaceAll(".", "").replaceAll("-", "") ) == childNode.id)); } } } else { if(node.checked) { checkedGeoPoints.add(widget.geoPoints.firstWhere((point) => int.parse( - (point.latitude ?? '').substring(0, min(point.latitude!.length, 10)).replaceAll(".", "") + (point.longitude ?? '').substring(0, min(point.longitude!.length, 10)).replaceAll(".", "") + (point.latitude ?? '').substring(0, min(point.latitude!.length, 10)).replaceAll(".", "").replaceAll("-", "") + (point.longitude ?? '').substring(0, min(point.longitude!.length, 10)).replaceAll(".", "").replaceAll("-", "") ) == node.id)); } } @@ -307,7 +307,7 @@ class _GeoPointFilterState extends State { onClicked: (node, commonID) { print("its clicked ! " + commonID.toString()); var selectedNode = widget.geoPoints.firstWhere((point) => int.parse( - (point.latitude ?? '').substring(0, min(point.latitude!.length, 10)).replaceAll(".", "") + (point.longitude ?? '').substring(0, min(point.longitude!.length, 10)).replaceAll(".", "") + (point.latitude ?? '').substring(0, min(point.latitude!.length, 10)).replaceAll(".", "").replaceAll("-", "") + (point.longitude ?? '').substring(0, min(point.longitude!.length, 10)).replaceAll(".", "").replaceAll("-", "") ) == commonID); mapContext.setSelectedPointForNavigate(selectedNode); },