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 Mobile 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 Components panel, click I Want To Menu, and then Add Menu Item.

    The Select Command window appears.

  2. Click Open a URL.

  3. Click the new menu item.

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

  5. Optionally, select an Icon.

  6. Find the URL box with the https://www.google.com example URL.

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

  8. Open your app to preview the change in VertiGIS Studio Go, or if the app is open, click Refresh App in the I Want To menu.

  9. 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 Mobile 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}