This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
packages/google_maps_flutter/google_maps_flutter_platform_interface Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,13 @@ class LatLng {
14
14
/// The latitude is clamped to the inclusive interval from -90.0 to +90.0.
15
15
///
16
16
/// The longitude is normalized to the half-open interval from -180.0
17
- /// (inclusive) to +180.0 (exclusive). Avoids normalization if possible to
18
- /// avoid unnecessary loss of precision
17
+ /// (inclusive) to +180.0 (exclusive).
19
18
const LatLng (double latitude, double longitude)
20
19
: assert (latitude != null ),
21
20
assert (longitude != null ),
22
21
latitude =
23
22
(latitude < - 90.0 ? - 90.0 : (90.0 < latitude ? 90.0 : latitude)),
23
+ // Avoids normalization if possible to prevent unnecessary loss of precision
24
24
longitude = longitude >= - 180 && longitude < 180
25
25
? longitude
26
26
: (longitude + 180.0 ) % 360.0 - 180.0 ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ void main() {
9
9
TestWidgetsFlutterBinding .ensureInitialized ();
10
10
11
11
group ('LanLng constructor' , () {
12
- test ('Maintains longitude precision if within acceptable range' , () async {
12
+ test ('Maintains longitude precision if within acceptable range' , () async {
13
13
const lat = - 34.509981 ;
14
14
const lng = 150.792384 ;
15
15
You can’t perform that action at this time.
0 commit comments