mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 00:21:19 +00:00
Fix map bug
This commit is contained in:
parent
8f6913407c
commit
dfa3cc6458
@ -78,7 +78,7 @@ class _GeoPointFilterState extends State<GeoPointFilter> {
|
||||
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<GeoPointFilter> {
|
||||
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<GeoPointFilter> {
|
||||
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<GeoPointFilter> {
|
||||
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);
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user