-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
lib>src>geojson_parser.dart : 307
Exception has occurred.
_TypeError (type 'int' is not a subtype of type 'double' in type cast)
before
for (final coords in path as List<dynamic>) {
if (pathIndex == 0) {
// add to polygon's outer ring
outerRing.add(LatLng(coords[1] as double, coords[0] as double));
} else {
// add it to a hole
hole.add(LatLng(coords[1] as double, coords[0] as double));
}
}
after
for (final coords in path as List<dynamic>) {
final double latitude = coords[1] is int ? (coords[1] as int).toDouble() : coords[1] as double;
final double longitude = coords[0] is int ? (coords[0] as int).toDouble() : coords[0] as double;
if (pathIndex == 0) {
// add to polygon's outer ring
outerRing.add(LatLng(latitude, longitude));
} else {
// add it to a hole
hole.add(LatLng(latitude, longitude));
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels