Skip to content
MyAppBuilder
StableGuide

Location and maps

Two components bring location into your app: the Location input captures the device's current GPS position into a record, and the Map component shows an address or coordinates on a map. Together they cover check-ins, job site records and "where is it" views, without any mapping a

Two components bring location into your app: the Location input captures the device's current GPS position into a record, and the Map component shows an address or coordinates on a map. Together they cover check-ins, job site records and "where is it" views, without any mapping account.

When to use

  • Technicians confirming where a job was done.
  • Delivery or inspection check-ins with a position.
  • Showing a customer's address, a store or a job site on a map.

Location input

  1. Add a Location input (Forms category) inside a Form bound to an entity, and set its Field to a text field (for example "Position").
  2. In the published app the user taps the button; the browser asks for permission to use the location.
  3. The field receives the coordinates as latitude,longitude with six decimals, for example 51.507351,-0.127758. Save the form to store them with the record.

The position is captured only while the app is open and only when the user taps the button. There is no background tracking.

Map component

  1. Add a Map (Data category) to a page.
  2. Set Address or 'lat,lng' to a fixed value or bind it to a record field: the saved lat,lng from a Location input, or a text address such as 12 High Street, Leeds.
  3. Adjust Zoom (1–19) and Height (120–900 px); add a Title and an Empty-state text for records without a location.
Example
┌ Job site ─────────────────────────────┐
│   ~~~~ ~~~~~~~ ~~~~~ ~~~~~~~~ ~~~~~   │
│   ~~~~~~~~ ~~~~  ●  ~~~~~ ~~~~~~~~    │
│   ~~ ~~~~~~~~~ ~~~~~~~~ ~~~~ ~~~~~~   │
└────────────────────────────────────────┘

Maps use OpenStreetMap tiles; no API key is required.

Example: job check-in

  • Entity Jobs with a text field Check-in position.
  • A "Check in" drawer page with a Form in update mode: Location input bound to Check-in position, a Save button.
  • The Job details page shows a Map bound to record.check_in_position.

Common mistakes

  • Binding the Map to a field that holds only a street name. Address lookup needs a reasonably complete address; coordinates are the most reliable.
  • Testing location in the builder preview. Inputs are disabled on the canvas; use the full-screen preview or staging in a browser that can share location (HTTPS required on phones).
  • Expecting continuous tracking. The position is read once per tap.
  • Forgetting permission denial. If the user refuses, the field stays empty; let them type an address instead.

Advanced

The Location input calls navigator.geolocation.getCurrentPosition() and writes ${lat.toFixed(6)},${lng.toFixed(6)}; it does nothing when the browser has no geolocation API. The Map component's address prop accepts either a lat,lng pair or free text, with zoom (default 13) and height (default 300). Browsers only allow geolocation on secure origins (HTTPS or localhost), which published apps satisfy.

Related

Was this helpful?