fix MyLocationPage&LimitMapBoundsPage mis-match
This commit is contained in:
17
lib/src/utils/location_utils.dart
Normal file
17
lib/src/utils/location_utils.dart
Normal file
@ -0,0 +1,17 @@
|
||||
part of amap_map;
|
||||
|
||||
bool isLocationValid(AMapLocation location) {
|
||||
final LatLng latLng = location.latLng;
|
||||
|
||||
if (latLng.latitude < -90 ||
|
||||
latLng.latitude > 90 ||
|
||||
latLng.longitude < -180 ||
|
||||
latLng.longitude > 180) {
|
||||
return false;
|
||||
}
|
||||
if (location.accuracy < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
Reference in New Issue
Block a user