Skip to content

Commit e400e67

Browse files
authored
Merge pull request #21 from wingkwong/develop
0.4.1 Bug Fix
2 parents d9b1e55 + c5e9764 commit e400e67

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG
22

3+
## 0.4.1
4+
- fixed isGeoPointInBoundingBox typos & logic
5+
36
## 0.4.0
47
- added dart 3 compatible changes
58
- revised test cases

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ Convert degrees to radians
9090
num degrees = radiansToDegrees(latRadians);
9191
```
9292

93-
### isGeoPointInBoudingBox(LatLng l, LatLng topLeft, LatLng bottomRight)
93+
### isGeoPointInBoundingBox(LatLng l, LatLng topLeft, LatLng bottomRight)
9494

95-
Check if a given geo point is in the bouding box
95+
Check if a given geo point is in the bounding box
9696

9797
```dart
98-
bool inBoudingBox = geodesy.isGeoPointInBoudingBox(l1, l2, l3);
98+
bool inBoundingBox = geodesy.isGeoPointInBoundingBox(l1, l2, l3);
9999
```
100100

101101
### intersectionByPaths(LatLng l1, LatLng l2, num b1, num b2)

example/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ void main() async {
3333
print('[midPointBetweenTwoGeoPoints] Midpoint Lng: ' +
3434
midpoint.longitude.toString());
3535

36-
var inBoudingBox = geodesy.isGeoPointInBoudingBox(l3, l5, l4);
37-
print('[isGeoPointInBoudingBox]: ' + inBoudingBox.toString());
36+
var inBoundingBox = geodesy.isGeoPointInBoundingBox(l3, l5, l4);
37+
print('[isGeoPointInBoundingBox]: ' + inBoundingBox.toString());
3838

3939
num b1 = 108.547;
4040
num b2 = 32.435;

lib/src/geodesy.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ class Geodesy {
173173
return x * R;
174174
}
175175

176-
/// check if a given geo point is in the bouding box
177-
bool isGeoPointInBoudingBox(LatLng l, LatLng topLeft, LatLng bottomRight) {
178-
return topLeft.latitude <= l.latitude &&
179-
l.latitude <= bottomRight.latitude &&
176+
/// check if a given geo point is in the bounding box
177+
bool isGeoPointInBoundingBox(LatLng l, LatLng topLeft, LatLng bottomRight) {
178+
return bottomRight.latitude <= l.latitude &&
179+
l.latitude <= topLeft.latitude &&
180180
topLeft.longitude <= l.longitude &&
181181
l.longitude <= bottomRight.longitude
182182
? true

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: geodesy
22
description: A Dart library for geodesic and trigonometric calculations working with points and paths
3-
version: 0.4.0
3+
version: 0.4.1
44
homepage: https://github.com/wingkwong/geodesy
55

66
environment:

test/geodesy_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ void main() {
4444
expect(midpoint.toString(), expectedMidpoint.toString());
4545
});
4646

47-
test('isGeoPointInBoudingBox', () async {
47+
test('isGeoPointInBoundingBox', () async {
4848
final l3 = const LatLng(51.4778, -0.0015);
4949
final l4 = const LatLng(52.205, 0.119);
5050
final l5 = const LatLng(48.857, 2.351);
51-
final inBoudingBox = geodesy.isGeoPointInBoudingBox(l3, l5, l4);
52-
expect(inBoudingBox, false);
51+
final inBoundingBox = geodesy.isGeoPointInBoundingBox(l3, l5, l4);
52+
expect(inBoundingBox, false);
5353
});
5454

5555
test('intersectionByPaths', () async {

0 commit comments

Comments
 (0)