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 |
Type |
|---|---|
{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 |
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 Result Action:
Added to Result Details, adds a Result 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}