mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 08:31: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) {
|
if(pointWithoutCat.title!.where((l) => l.language == widget.language).firstOrNull != null) {
|
||||||
TreeNode nodeWithoutCat = TreeNode(
|
TreeNode nodeWithoutCat = TreeNode(
|
||||||
id: 000 + int.parse(
|
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,
|
title: parse(pointWithoutCat.title!.firstWhere((l) => l.language == widget.language).value!).documentElement!.text,
|
||||||
children: [],
|
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) {
|
if (geoPoint.categorieId == category.id && geoPoint.title!.where((l) => l.language == widget.language).firstOrNull != null) {
|
||||||
TreeNode geoPointNode = TreeNode(
|
TreeNode geoPointNode = TreeNode(
|
||||||
id: 000 + int.parse(
|
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,
|
title: parse(geoPoint.title!.firstWhere((l) => l.language == widget.language).value!).documentElement!.text,
|
||||||
checked: true, // default true
|
checked: true, // default true
|
||||||
@ -155,14 +155,14 @@ class _GeoPointFilterState extends State<GeoPointFilter> {
|
|||||||
for (var childNode in node.children) {
|
for (var childNode in node.children) {
|
||||||
if (childNode.checked) {
|
if (childNode.checked) {
|
||||||
checkedGeoPoints.add(widget.geoPoints.firstWhere((point) => int.parse(
|
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));
|
) == childNode.id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(node.checked) {
|
if(node.checked) {
|
||||||
checkedGeoPoints.add(widget.geoPoints.firstWhere((point) => int.parse(
|
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));
|
) == node.id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -307,7 +307,7 @@ class _GeoPointFilterState extends State<GeoPointFilter> {
|
|||||||
onClicked: (node, commonID) {
|
onClicked: (node, commonID) {
|
||||||
print("its clicked ! " + commonID.toString());
|
print("its clicked ! " + commonID.toString());
|
||||||
var selectedNode = widget.geoPoints.firstWhere((point) => int.parse(
|
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);
|
) == commonID);
|
||||||
mapContext.setSelectedPointForNavigate(selectedNode);
|
mapContext.setSelectedPointForNavigate(selectedNode);
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user