Calling / Opening an App¶
The simplest way to open a published app is to click on the corresponding tile on the portal page. The tile for the app should appear under the selected category after publishing. However, this is only possible if visible was selected for visibility when publishing. Otherwise, the app is only shown to the map author (transparent tile) or can be opened directly via the link.
Calling via Link¶
The link becomes visible when the app is opened via the portal page. This should always be possible for the map author. The link has, for example, the following form:
https://myserver.com/App/PortalApp/{portal-page-id}?app={name-of-the-app}&category={category-of-the-app}
In addition to the mandatory URL parameters app and category, further optional parameters can be passed, for example to jump to a specific map extent within the app:
bbox: the bounding box to jump to. The parametersrscan also be passed for this, to specify the EPSG code for the bounding box (default: 4326).centerandscale: map center point (longitude, latitude) and scale.
Note
If, for example, the app is called from the map viewer, it is usually recommended to use center and scale instead of bbox. Since the size of the map window is not always the same, the application is not opened with the same scale when using bbox.
Note
If the app is called from the map viewer, the corresponding placeholders for the current extent can be specified in the link, e.g. ...¢er={map.centerx},{map.centery}&scale={map.scale}.
Calling via a Custom Tool¶
As already described, an app can also be called via a link that passes the current map extent. This makes it very easy to integrate an app into the map viewer as a custom tool.
Custom tools are defined in the custom.js file (see).
The definition of the tool looks roughly as follows:
webgis.custom.tools.add({
name: 'TOR Befliegungen',
command: 'https://myserver.com/App/PortalApp/dev?app=SideBySide&category=Allgemein¢er={map.centerx},{map.centery}&scale={map.scale}',
command_target: 'dialog',
image: 'https://myserver.com/openwin.png'
});
Here, a tool is defined that opens the app SideBySide from the category Allgemein with the same scale as the map, in a dialog window.