Topic:
When launching a VertiGIS Studio Web app there are some out of the box URL parameters available that can be used to change the app's behaviour. There is the additional ability to use arbitrary URL parameters that can be consumed by a workflow on app initialization - separate from existing options for configuring a launch link workflow with parameters. Finally, there are two parameters available for changing how an app loads in the app designer interface. The following guide provides a walkthrough of configuring parameters for the listed situations with examples.
Guide:
The guide is separated into the following sub-sections:
Using a Workflow with the Parse URL Activity
App Parameters:
At the most basic an app will have a unique launch link with the parameter that identifies the app itself:
-
app=
- ex. app=af9b903746724d289b1a4fc087d6f80a where the expected value is the alphanumeric item ID for the app item in your ArcGIS Portal or ArcGIS Online.
The Social Sharing feature introduced in VertiGIS Studio Web 5.12 provided the "Get Sharing Link" command and the following URL parameters:
-
scale-<Layout ID>=
- ex. scale-default=5000 where the expected value is a numerical scale.
-
center-<Layout ID>=
- ex. center-default=-13733546.804885864,6177341.583529942 where the expected value is a coordinate pair for your map.
-
basemap-<Layout ID>=
- ex. basemap-default=69aea2b5-3ad2-4f11-9800-17fa628b6c66 where the expected value is the alphanumeric ID of a basemap extension object in the web app.
- ex. basemap-default=69aea2b5-3ad2-4f11-9800-17fa628b6c66 where the expected value is the alphanumeric ID of a basemap extension object in the web app.
-
layers-<Layout ID>=
- ex. layers-default=1,2 where a blank value loads the default webmap layer visibility, and including the zero based index value of a particular layer (counting up from the bottom of the layer list) toggles the visibility.
Put together into a single link they would look as follows below. Note in this example the name of the template in the app is 3e85d9e8-4ec0-4732-a112-1973f1665fd0, and not default as it was in the examples provided from the bulleted list above.
The link above will launch the VertiGIS Studio Sample App with a particular scale and center, the same basemap as normal, and with the Water Lines layer toggled off (it is on by default in the source webmap).
Note: If you need to get a basemap ID you can download a copy of you app configuration in the Web designer and use a text editor to browse the app's JSON. |
Instead of relying on automatic detection of the browser locale for an internationalized app, you can add a parameter to the end of a launch URL to force a particular language:
-
locale=
- ex. locale=fr where the expected value is a 2 letter language code - fr for french in this case.
If you are debugging an app in the end-user app view then you can add the following parameter:
-
debug=true
- Forces more detailed logging in the browser console.
- Forces an app to get a fresh copy of a workflow on each run, removing any need to refresh the browser if changes are made to the workflow.
- Note that if you are debugging workflows in the app designer (not end-user app view) then the above behaviour is true by default without the additional parameter being specified.
Using a Workflow with the Parse URL Activity:
Using the Get Browser Info and Parse URL activities in VertiGIS Studio Workflow it is possible to parse arbitrary URL parameters. In the example shown below there is a workflow that uses these activities to extract the 'title' and 'text' query parameters from an app's URL:
In the example the parsing is triggered by the button click of the workflow on the toolbar, but the workflow could equally as well be executed on app or map initialization depending on what actions the workflow subsequently performs - keeping the overall app initialization sequence in mind.
Launch Link Workflows:
This Knowledge Base Article provides an in-depth walkthrough of how to configure a launch link workflow and the associated parameters:
And the following is an example URL from the above walkthrough demonstrating how parameters are added for a launch link workflow:
-
workflowParams=
- ex. workflowParams={"parkUse":"camping"} where the expected value is a JavaScript object with key value pairs that can be used in the launch link workflow.
We also have some more general documentation on the topic:
App Designer Parameters:
VertiGIS Studio Web 5.28 added escape query string parameters to help with troubleshooting issues where the app errored on initialization, and prevented further configuration through the app designer interface.
-
preview=false
- Disables the preview of your web app in the app designer.
-
pinpoint=false
- Disables pinpoint search in the app designer.
Example usage: https://apps.vertigisstudio.com/web/designer/?preview=false#app=1c56e08072fe4d62ab075db9887bb409
Article last updated for VertiGIS Studio Web 5.28.1
Comments
0 comments
Please sign in to leave a comment.