Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- points: route.polylinePoints
- .map((point) {
- final lat = point['latitude'];
- final lng = point['longitude'];
- if (lat is num && lng is num) {
- final latDouble = lat.toDouble();
- final lngDouble = lng.toDouble();
- if (latDouble >= 41.0 &&
- latDouble <= 41.5 &&
- lngDouble >= 21.2 &&
- lngDouble <= 21.8) {
- return LatLng(latDouble, lngDouble);
- }
- }
- return null;
- })
- .whereType<LatLng>() // 🔥 removes nulls safely
- .toList(),
Advertisement
Add Comment
Please, Sign In to add comment