fysoul17 / google_maps_place_picker

Place picker on Google Maps for Flutter
MIT License
222 stars 356 forks source link

after enabling strict bounds search results not working #155

Open suthura opened 2 years ago

suthura commented 2 years ago

Hi, I tried to enable the strict bounds in this plugin. So I added region: 'LK' and strictbounds: true properties. After enabling the strict bound search results are not appearing.

In my case I want to stop the searching the results from other countries. Since these parameters didn't work I tried using autocompleteRadius: 500. But the issue was same. No search results !.

my plugin version : ### google_maps_place_picker: ^2.1.0-nullsafety.3 my flutter version : ### 2.5.3

Code I used


                   PlacePicker(
                          apiKey: "${Constants.GOOGLE_API_KEY}",
                          automaticallyImplyAppBarLeading: true,
                          enableMapTypeButton: false,
                          usePlaceDetailSearch: false,
                          searchForInitialValue: true,
                          selectInitialPosition: true,
                          region: 'LK',
                          strictbounds: true,
                          autocompleteRadius: 500,
                          onPlacePicked: (result) {
                            setState(() {
                              selectedLat = result.geometry!.location.lat;
                              selectedLng = result.geometry!.location.lng;                        
                            });
                          },
                          initialPosition: LatLng(
                              selectedLat ?? _location.getLat,
                              selectedLng ?? _location.getLng),
                          useCurrentLocation: false,
                     )

Please let me know if the way I used parameters is incorrect. Thanks.

meloDramatic007 commented 2 years ago

did you solve it @suthura