You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| onError | (error: any) => void | No | - | Callback when API errors occur |
277
279
| enableDebug | boolean | No | false | Enable detailed console logging for troubleshooting |
278
280
281
+
## Location Filtering
282
+
283
+
You can filter or bias search results based on geographic location using `locationBias` or `locationRestriction`.
284
+
285
+
### Location Bias (Soft Filter)
286
+
287
+
**Biases** results towards a location but can still return results outside the area if they're highly relevant:
288
+
289
+
```javascript
290
+
<GooglePlacesTextInput
291
+
apiKey="YOUR_GOOGLE_PLACES_API_KEY"
292
+
onPlaceSelect={handlePlaceSelect}
293
+
locationBias={{
294
+
circle: {
295
+
center: {
296
+
latitude:37.7937,
297
+
longitude:-122.3965
298
+
},
299
+
radius:500.0// meters
300
+
}
301
+
}}
302
+
/>
303
+
```
304
+
305
+
### Location Restriction (Hard Filter)
306
+
307
+
**Restricts** results to only those within the specified area:
308
+
309
+
```javascript
310
+
<GooglePlacesTextInput
311
+
apiKey="YOUR_GOOGLE_PLACES_API_KEY"
312
+
onPlaceSelect={handlePlaceSelect}
313
+
locationRestriction={{
314
+
rectangle: {
315
+
low: { latitude:37.7749, longitude:-122.4194 },
316
+
high: { latitude:37.8049, longitude:-122.3894 }
317
+
}
318
+
}}
319
+
/>
320
+
```
321
+
322
+
**Supported shapes:**
323
+
-**Circle**: Define center (lat/lng) and radius in meters
324
+
-**Rectangle**: Define southwest and northeast corners (low/high)
325
+
326
+
**Use cases:**
327
+
- Show places near user's current GPS location
328
+
- Limit results to delivery radius
329
+
- Search within a specific neighborhood or city bounds
330
+
331
+
For more details, see [Google Places API Location Biasing](https://developers.google.com/maps/documentation/places/web-service/autocomplete#location_biasing).
332
+
279
333
## Place Details Fetching
280
334
281
335
You can automatically fetch detailed place information when a user selects a place suggestion by enabling the `fetchDetails` prop:
0 commit comments