Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 0.37.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	example/pubspec.lock
#	pubspec.lock
  • Loading branch information
liodali committed Jul 10, 2022
2 parents 39c0934 + 671da40 commit 28e3547
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
## 0.34.1+6 : fix bug in boundingbox
## 0.34.1+5 : fix dependencies
## 0.34.1+4 : fix dependencies
## 0.34.1+3 : fix bugs
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# flutter_osm_plugin
![pub](https://img.shields.io/badge/pub-v0.34.1%2B5-orange)
![pub](https://img.shields.io/badge/pub-v0.34.1%2B6-orange)


## Platform Support
Expand Down Expand Up @@ -41,7 +41,7 @@
Add the following to your `pubspec.yaml` file:

dependencies:
flutter_osm_plugin: ^0.34.1+5
flutter_osm_plugin: ^0.34.1+6

### Migration to `0.34.0` (Android Only)
> if you are using this plugin before Flutter 3
Expand Down
12 changes: 6 additions & 6 deletions flutter_osm_interface/lib/src/types/bounding_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class BoundingBox {
required this.east,
required this.south,
required this.west,
}) : assert(north <= 85.0),
}) : assert(north <= 86.0),
assert(east <= 180.0),
assert(south >= -85.0),
assert(west > -180.0);
assert(south >= -86.0),
assert(west >= -180.0);

const BoundingBox.world()
: this.north = 85.0,
Expand All @@ -30,9 +30,9 @@ class BoundingBox {
if (geoPoints.isEmpty) {
throw Exception("list of geopint shouldn't be empty");
}
double maxLat = -85.0;
double maxLat = -86.0;
double maxLon = -180.0;
double minLat = 85.0;
double minLat = 86.0;
double minLon = 180.0;
for (final gp in geoPoints) {
final lat = gp.latitude;
Expand Down Expand Up @@ -93,7 +93,7 @@ class BoundingBox {

extension ExtBoundingBox on BoundingBox {
bool isWorld() {
return north == 85.0 && east == 180.0 && south == -85.0 && west == -180.0;
return north >= 85.0 && east == 180.0 && south <= -85.0 && west == -180.0;
}

bool inBoundingBox(GeoPoint point) {
Expand Down
2 changes: 1 addition & 1 deletion flutter_osm_interface/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_osm_interface
description: osm flutter controller and utilities.
version: 0.1.22
version: 0.1.23
homepage: https://github.com/liodali/osm_flutter

environment:
Expand Down
6 changes: 6 additions & 0 deletions flutter_osm_interface/test/flutter_osm_interface_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@ void main() {
final p2 = GeoPoint(latitude: 15.0312, longitude: 44.12073);
expect(p1.toString() == p2.toString(), false);
});
test("test bounding box is world", () {
final box = BoundingBox(north: 85.05, east: 180, south: -85.06, west: -180);
expect(box.isWorld(), true);
final box2 = BoundingBox(north: 84.05, east: 170, south: -85.06, west: -180);
expect(box2.isWorld(), false);
});
}
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ packages:
path: flutter_osm_interface
relative: true
source: path
version: "0.1.22"
version: "0.1.23"
flutter_plugin_android_lifecycle:
dependency: "direct main"
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_osm_plugin
description: OpenStreetMap Plugin Native for flutter apps (Andoird/iOS supported,web is under-dev)
version: 0.34.1+5
version: 0.34.1+6


homepage: https://github.com/liodali/osm_flutter
Expand Down

0 comments on commit 28e3547

Please sign in to comment.