Skip to content

Commit

Permalink
Merge pull request #141 from martin-braun/patch-1
Browse files Browse the repository at this point in the history
Also search on zooming when location changed
  • Loading branch information
Terry Kwon authored Sep 8, 2021
2 parents d79c3a3 + 69336cd commit 575f0e9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/src/google_map_place_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ class GoogleMapPlacePicker extends StatelessWidget {

_searchByCameraLocation(PlaceProvider provider) async {
// We don't want to search location again if camera location is changed by zooming in/out.
bool hasZoomChanged = provider.cameraPosition != null && provider.prevCameraPosition != null && provider.cameraPosition!.zoom != provider.prevCameraPosition!.zoom;

if (forceSearchOnZoomChanged == false && hasZoomChanged) {
if (forceSearchOnZoomChanged == false && provider.prevCameraPosition != null && provider.prevCameraPosition!.target.latitude == provider.cameraPosition!.target.latitude && provider.prevCameraPosition!.target.longitude == provider.cameraPosition!.target.longitude) {
provider.placeSearchingState = SearchingState.Idle;
return;
}
Expand Down

0 comments on commit 575f0e9

Please sign in to comment.