In my MapShapeSublayer, when I update my mapsource property from
MapShapeSource myMapSource = MapShapeSource.asset(
'assets/json_data/2_provincias.json',
shapeDataField: 'Provincia',
dataCount: provinciaKeys.length,
primaryValueMapper: (int index) => provinciaKeys.entries.elementAt(index).key,
shapeColorValueMapper: (int index) =>
provinciaKeys[provinciaKeys.entries.elementAt(index).key]!.baseColor,
);
to
Future<MapShapeSource> myMapSource() async {
return MapShapeSource.asset(
'assets/json_data/2_provincias.json',
shapeDataField: 'Provincia',
dataCount: provinciaKeys.length,
primaryValueMapper: (int index) =>
provinciaKeys.entries.elementAt(index).key,
shapeColorValueMapper: (int index) =>
provinciaKeys[provinciaKeys.entries.elementAt(index).key]!.baseColor,
);
}
then the select shape functionality seems to go haywire. Any ideas? I appreciate that the 2nd code snippet isn't really a future. But I will make it a proper future once I have resolved this issue. Many thanks!