Skip to content

Commit

Permalink
Also search on zooming when location changed
Browse files Browse the repository at this point in the history
Fixes #120
  • Loading branch information
๖ۣۜMartinus authored Aug 18, 2021
1 parent d79c3a3 commit 69336cd
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 69336cd

Please sign in to comment.