Ecommerce Checkout Demo — Auto Address Fill

This demo page showcases how to automatically fill address fields in an ecommerce checkout form using your current location. It demonstrates two methods for location encoding:

How It Works:

  1. Select a location code type (Plus Code or H3) from the dropdown.
  2. Click the "Detect & Fill Address" button to get your current location using the browser's geolocation API.
  3. The app fetches your coordinates.
  4. It sends the coordinates to the Latlens reverse geocoding API to retrieve a human-readable address.
  5. The address fields are auto-filled, with the selected location code prefixed to the street address.
  6. Alternatively, enter a Plus Code or H3 code and click "Decode" to find and fill the address.

Example Output in Street Address field:
7F4VQX2V+G5 — 123 Main St
8a2a1072b59ffff — 123 Main St

Technologies Used:

Limitations:

Try either detecting your location or decoding a known location code!

Checkout

Or Decode a Location Code