Creating a Hyperlink to a Map
You can create a hyperlink from an item on a Mimic to a Map item in the ClearSCADA database. A user can then click on the hyperlink when the Mimic is in Run mode and ClearSCADA will display the Map in the Document Display Area.
To create a hyperlink from a Mimic item to a Map item in the database:
- In Design Mode, display the Mimic that you want to work with (see Displaying a Mimic).
- Either:
- Drag and drop a Map database item from the Database Bar onto the Mimic. ClearSCADA will then create a text box on the Mimic and automatically create a hyperlink from it to the Map. For more information, see Using Drag and Drop to Create a Hyperlink.
To append parameters, or otherwise change the hyperlink URL, you will need to use the Pick Action Wizard to edit the hyperlink URL (see Using the Pick Action Wizard to Create a Hyperlink).
- Use the Pick Action Wizard to create a Hyperlink pick action that has its URL set to the Map database item. For more information, see Using the Pick Action Wizard to Create a Hyperlink.
- Use the Animations feature to set the value of PickParam to the address of the Map database item. For more information, see Using Animations to Create a Hyperlink.
- Drag and drop a Map database item from the Database Bar onto the Mimic. ClearSCADA will then create a text box on the Mimic and automatically create a hyperlink from it to the Map. For more information, see Using Drag and Drop to Create a Hyperlink.
- Save the Mimic.
When you create the hyperlink, you can append parameters to the hyperlink's URL that will determine how and what the Map displays, as follows:
- Location. You can specify a Latitude and Longitude for the Map. This will define the center of the displayed Map.
- Zoom. You can set a zoom level for the Map display. This can be an integer value between 0 and 20, where 0 represents the most zoomed-out display and 20 the most zoomed-in display.
- Query. This can be a User Query item or an SQL query that determines which database items ClearSCADA will display on the Map.
The general format of the hyperlink's URL is as follows:
SCX:///<System>/<Class>/<Object>#<Map Parameter Name>=<Map Parameter Value>
In this example, we will create a hyperlink to a map set called 'England.Bing' in a system called 'Main. We will set a Zoom level of 10 and the center of the displayed Map will be at Latitude 52.4777°N and Longitude 1.8988°W.
SCX:///Main/CGISMapSet/England.Bing#zoom=10&Latitude=52.4777&Longitude=-1.8988
The system in this example is Main.
All numeric values in a URL use the English decimal point (a dot).
In this example, we will create a hyperlink to a map set called 'England.Bing' in a system called 'Main. We will set a Zoom level of 10 and the center of the displayed Map will be at Latitude 52.4777°N and Longitude 1.8988°W. We will display all of the items in the database on the Map.
SCX:///Main/CGISMapSet/England.Bing#zoom=10&Latitude=52.4777&Longitude=-1.8988&Query=SELECT FullName, gislocation->latitude, gislocation->longitude FROM CDBOBJECT
You should not use the symbols % and & directly in the query, you should replace them with the escaped versions: %25 for % and %26 for &. You also need to escape any double quotes in a string parameter value.
We recommend that you configure and use User Queries with maps and within hyperlinks relating to maps as this simplifies the hyperlink:
SCX:///Main/CGISMapSet/England.Bing#zoom=10&Latitude=52.4777&Longitude=-1.8988&Query=MapUsersQuery
Where MapUserQuery
is the full name of a User Query item within the database.
Or if the User Query is located within a group:
SCX:///Main/CGISMapSet/England.Bing#zoom=10&Latitude=52.4777&Longitude=-1.8988&Query=Map Queries.MapUserQuery
Where Map Queries.MapUserQuery
is the group and full name of a User Query item within the database.
The portion of the URL after the # character is called a fragment and contains the parameters discussed above.
The URL components are as follows:
- <System> this entry can be left blank for the current system. You need to enter the name of the system if the map is located in a different database, see Cross Database Hyperlinks for WebX Clients.
- <Class> is the type of the object in the ClearSCADA database hierarchy. The Class type is either CGISMapSet or CGISMapSource for a map hyperlink.
- <Object> is the full name of the Map Set or Source. This is the full address, including Groups. If you want, you can replace this with a relative reference. For more information, Relative References.
- # indicates that the remainder of the URL is a fragment that contains parameter settings.
- <Mimic Parameter Name> is the name of a Map parameter. For example, Zoom.
- = indicates that what follows is the parameter value.
- <Mimic Parameter Value> defines the parameter value. For example, Zoom=5. To enter more than one parameter, use an ampersand character (that is, &) between each parameter.