Configure an Open URL

You can configure an item on the I Want To Menu or as a Feature Action that opens a URL using the Open URL command. You use the Open URL command to configure a direct link to open websites or apps outside of GXM apps. In addition, you can expand the usefulness of Open URLs using location tokens that open the website or app in a particular state. Location tokens can provide information about the user's location, a feature's location, or the current map location. For example, you could open Open Street Maps to the same area as your current map and get directions to a specific feature.

For Open URLs Location Tokens to work, the location services on the device must be turned on.

Create an I-Want-To-Menu Item that Launches a URL

To create an I-Want-To-Menu item that launches a URL:

  1. In Mobile Designer, in the Configure Components panel, click I Want To Menu, and then Add Menu Item.

  2. In the Title box, type in the Menu Item name as it will appear in the I Want To Menu.

  3. Optionally, select an Icon.

  4. In the Command box type "Open", and then select Open a URL.

    A URL box appears with https://www.google.com in the box as an example.

  5. Replace the example URL with the URL that you want to launch, and then save the app.

  6. Open your app to preview the change in Geocortex Go, or if the app is open, click Refresh App on the I Want To Menu.

  7. Click the I Want To Menu.

    The new menu item appears. When you click it, Google opens.

Location Tokens

It is possible to add parameters into your URLs that represent information from the GXM app, for example, a user’s location, the location of a feature, the visible map area and others. These parameters are exposed through simple location tokens. Usually, Location tokens are used in pairs to provide both latitude and longitude.

This token

Provides this information

{Location.Geolocation.Latitude} / {Location.Geolocation.Longitude}

The device's current location

{Location.Feature.Latitude} / {Location.Feature.Longitude}

A feature's location

{Location.Map.Center.Latitude} / {Location.Map.Center.Longitude}

The location of the center of the map

{Location.Map.Scale}

The scale of the map view

{Location.Map.TopLeft.Longitude} / {Location.Map.TopLeft.Latitude

The detail (zoom) level of the map view

{Location.Map.TopLeft.Longitude} / {Location.Map.TopLeft.Latitude}

The location of the top left of the map view

{Location.Map.TopRight.Latitude} / {Location.Map.TopRight.Longitude}

The location of the top right of the map view

{Location.Map.BottomRight.Latitude} / {Location.Map.BottomRight.Longitude}

The location of the bottom right of the map view

{Location.Map.BottomLeft.Latitude} / {Location.Map.BottomLeft.Longitude}

The location of the bottom left of the map view

URL Examples Using Location Tokens:

The following are examples of location tokens you can add to an Open URL:

For the I Want To Menu:

Opens the current map view in Open Maps:

https://www.openstreetmap.org/#map=10/{Location.Map.Center.Latitude}/{Location.Map.Center.Longitude}

Shows the current location of the device in Open Maps:

https://www.openstreetmap.org/#map=10/{Location.Geolocation.Latitude}/{Location.Geolocation.Longitude}

For a Feature Action:

Added to Result Details, adds a feature action button to the feature Details panel. When you click a feature on the map and the panel appears, you can click the button to show directions from your current position to the feature in Open Maps.

Added to a specific layer under Maps, adds a button to the features of that layer. When you click a feature from the layer, the Details panel appears and you can click the button to show directions from your current position to the feature in Open Maps.

https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route={Location.Geolocation.Latitude}%2C{Location.Geolocation.Longitude}%3B{Location.Feature.Latitude}%2C{Location.Feature.Longitude}

© 2019 Latitude Geographics Group Ltd. All Rights Reserved.

Documentation Version 5.2