Components

location

9min

The location component enables users to display a location on a map within a . It can be configured to appear in different formats, including the standard component layout, the jig header, or fullscreen mode. Additionally, display options can be set up to show the current location with markers or paths.

Configuration options

Some properties are common to all components, see Common component properties for a list and their configuration options.



Options



address

The actual address of the location. Valid formats are: - address string - city, street, e.g. address: 20 W 34th St., New York, NY 10001, USA or in an expression calling a datasource =@ctx.datasources.address.street & ',' & @ctx.datasources.address.city & ',' & @ctx.datasources.address.country - latitude and longitude, e.g. address: 40.759412, -73.912306

is AnimationDisabled

true or false to determine if map animation is disabled.

isFollowUserLocationEnabled

When enabled, the viewPoint will be centred on the user’s real-time location.

markers

Multiple markers can be configured to display on the map. There is a 10K limit for markers showing on the map. For example: - type: component.location options: markers: data: - latitude: 40.759412 longitude: -73.912306 - latitude: 40.745368 longitude: -74.057189 - latitude: 40.76479429122513 longitude: -73.97429291692742

You can use an expression to provide the latitude and longitude points from a datasource, for example: markers: data: | =@ctx.datasources.jobs.{"lng": $number($.lng), "lat": $number($.lat)}

marker-item

anchorTo: - Anchor the marker to a specific point, either bottom-center or center

radius - Display a circle around the marker. In the radius you can configure the color, unit (Default is kilometres)

icon - Choose an icon for the markers. You can style the icon color, emphasis, type, shape and size.

paths

Create one path from many points. The first point is the start destination, and the last is the end destination. There is a 10K limit for paths showing on the map. for example: - type: component.location options: paths: data: - latitude: 40.759412 longitude: -73.912306 - latitude: 40.803495 longitude: -73.950694 address: =@ctx.datasources.location[0].address

viewPoint

Controls the visible area of the map, defining what the user sees. It allows control over position, zoom and orientation. Options include: centerPosition: middle or top

zoomLevel

Defines the initial zoom level of the map. Zooming in enlarges the view, revealing finer details, improving readability, and enhancing location precision.

Action



open-map

The action.open-map lets you open your device's default map app (e.g., Google Maps, Apple Maps, or Waze) with the provided destination address. If multiple map apps are available, they will be listed for you to select one.

State Configuration

Key

Notes

=@ctx.component.state.

location

State is the variable of the component.

System variable Configuration

Key

Notes

=@ctx.system.locationPermisions.foreground

isGranted status

Determines the status of the permissions and evaluates if permissions are granted. See System locationPermissions example.

=@ctx.system.geolocation.

coords timestamp

See System geolocation example.

Considerations

  • Test the layout of the location component when combining it with other components, as it can cause spacing issues.
  • To display a location as a full screen, use the jig.fullscreen type with the component.location. See the Fullscreen location example down below.

Examples and code snippets 

Location from address
Location from address


An interactive map displaying the location using the address.

Examples: See the example using static data on GitHub. See the example using dynamic data on GitHub.

Datasource: See the full datasource for static data on GitHub. See the full datasource for dynamic data in GitHub.

location (static)
location (dynamic)
datasources (dynamic)
datasources (static)

Address - Latitude & Longitude
Address - Latitude & Longitude


In this example a location is shown using the latitude and longitude coordinates in the address property.



location-lat-lng.jigx
datasource

Location paths
Location paths


An interactive map displaying a path with three points, a starting point, middle and end point, with a marker-item at each point.

Examples: See the example using static data in GitHub.

Datasources: See the full datasource for static data in GitHub.

location-path (static-no -animation)
location-path (static- with-animation)
datasources (static)


In this example the component.location is used in the jig.fullscreen ensuring the map covers the entire .

Examples: See the example using dynamic data in GitHub.

Datasource: See the full datasource for dynamic data in GitHub

Using the code below requires data in the database, the jigx.sample solution has the data provided for location. You can use the location.csv file in GitHub and upload it via the Data configuration in .

Fullscreen location
Fullscreen location

location-fullscreen.jigx
datasources

Location in header
Location in header


The location component can be used as a small or medium size header in a . In the screenshot the difference between the set heights is shown. Examples: See the code samples using static data in GitHub for small and medium headers.

location-as-header(small)
location-as-header(medium)
datasource


See also



Updated 20 Mar 2025
Doc contributor
Did this page help you?