Search & Geocoding
Find places as users type, turn addresses into coordinates, and turn coordinates back into Thai addresses.
Combine Autocomplete, Place Detail, Geocode and Reverse Geocode into one consistent search flow.
Choose the endpoint
Autocomplete powers interactive suggestions. Place Detail resolves a selected suggestion. Geocode is for complete addresses or batch-like server lookup. Reverse Geocode labels a clicked or GPS coordinate.
Geocode a place
Results are GeoJSON. geometry.coordinates is always [longitude, latitude]. Use bbox or proximity to make local results more relevant.
A second geocode example
Same endpoint, a different query — the response shape never changes.
Build a reliable search box
Debounce keystrokes, keep one session_token from the first suggestion request through Place Detail, and wait until the user selects a result before moving the map.