Geolocation Map
A Geolocation Map control can be used to display the map of a specific area: in street, satellite, or hybrid view (the view is defined in the Map Type property). Points of interest in the area covered by the map can be shown by markers. Any number of markers can be defined in the control's Markers property. The current location as well as zoom controls can optionally be included in the map (see their respective properties below). The size and magnification of the map that is initially displayed in the control can be defined via the Viewport, Control Width, and Control Height properties. The Geolocation Map control also has a OnGeoMapMarkerClicked event, which enables you to define actions to perform when a particular marker is clicked by the user.
•When the control is associated with a data source node (page source link), placing the mouse over the control (in Page Design View) displays the associated node in a popup. •All page source links in the page source tree are displayed in a bold font. Tree nodes that are not page source links are displayed in normal font. •Placing the mouse over the page source link in the design tree displays information about the associated control. •To remove a data-source node association (and therefore the data in the control), right-click the control (in Page Design View) and click Unassign Page Source Link <NodeName>. •To reset a style or property (in the Styles & Properties Pane), select the property and click Reset in the pane's toolbar. •The values of several properties can be set by using XPath expressions. This allows values to be dynamic: that is, generated via calculations, or from data source nodes, at runtime. To set an XPath expression, click Edit XPath in the toolbar of the Styles & Properties Pane. •To edit the XPath expression of a style or property (in the Styles & Properties Pane), select the style or property, and click Edit XPath in the pane's toolbar. •To copy a control to another location in the design, press Ctrl and drag-and-drop the control to the desired copy location. •To assign specific properties for a control, define one or more classes for the control (via the Browser CSS Class property), and then assign rules for the class/es in an external CSS file (that you specify in the Browser Settings dialog). •A control's CSS properties can be defined in the Styles & Properties Pane and/or in an external CSS file. Those defined in the Styles & Properties Pane have priority. |
Geolocation Map events
The OnGeoMapMarkerClicked event is available, which enables you to define actions to perform when a marker in the map is clicked. In order to retrieve information about the marker that has been clicked, use the $MT_GeolocationMapMarker dynamic variable.
The dynamic variable $MT_GeolocationMapMarker contains information about the marker that was last clicked by the client's user. This information that is contained in the variable is stored in an XPath-map construct, in a format that is shown by the following example:
map {
"id":"vie",
"geolocation":(48.2143531, 16.3707266),
"title":"Vienna",
"text":"Altova EU"
}
To fetch a value from the XPath-map construct, use an XPath expression like this: map:get( $MT_GeolocationMapMarker, "id" ). This particular expression returns the value of the id key (that is, the id of the marker that was clicked).
For a description of the actions that can be defined for the OnGeoMapMarkerClicked event, see the Actions section.
Geolocation Map properties
The control's properties are available in the Styles & Properties Pane, and are listed below in the order in which they appear.
The name is used to reference the control from elsewhere in the page or project. Double-click inside the value field to edit.
|
The All Styles property becomes visible if the All Styles setting of the More Project Settings dialog has been set to true. (The default of this setting is false.)
The property enables you to set all of the component's styles via a single XPath map expression, such as the two map expressions below:
map{ "Bold Text" : $XML1/R/@bold = "1", "Italic Text" : true(), "Text" : "hello", "Text Color" : "red", "Background Color" : $XML1/R/@background, "Text Size" : $XML1/R/@textsize }
map{ "Style Sheet" : "Sheet-1" }
Note the following points:
•When you enter a value for the All Styles property—even if it is not a map—all the styling properties of the current component in the Styles & Properties Pane will no longer be visible . •This is an advanced feature, so you must ensure that your XPath map expression is correct, both syntax and values. •You can enter the key–value pairs of the map in any order. •The key names are the names of style properties (or styles). In the first map above, for example, Bold Text and Text Size are style names. The styles that are available for a particular component are listed under that component in the Styles & Properties Pane. •You can also specify a style sheet to use, as shown in the second map above.
|
Specifies the map type that is displayed in the Geolocation Map control. The options are:
•Default (no selection): Uses the map type that is selected on the client device •Street: Shows a street plan layout of the displayed •Satellite: Shows a satellite picture of the displayed area •Hybrid: Shows a combination of the street and satellite map types
Note: An XPath expression can also be used to specify the map type dynamically. The expression must evaluate to one of the following: (i) street, (ii) satellite, (iii) hybrid.
Note: On web clients and in the simulator, only a single map type is available no matter which option from those listed above is selected.
|
Specifies whether the current location of the client device is displayed in the map. This would be useful to help users locate themselves in the map. The values of the property are true or false, with the default being false. To define the property's value dynamically, use an XPath expression (for example: Element/@attribute="1" would evaluate to true or false depending on the value of Element/@attribute).
Note: For this feature to work, GPS permission must be granted on the client device.
|
Specifies whether zoom controls are displayed in the map. The values of the property are true or false, with the default being true. You can use an XPath expression to define the property's value dynamically. Note that zoom controls are not displayed on iOS devices.
|
An XPath expression that defines the number of markers that are placed in the map, as well as their properties. The XPath expression must resolve to one or more XPath-map constructs: map-1, map-2, ... map-N. Each XPath-map construct consists of a set of key–value pairs that together define the properties of one marker. The following keys are specified:
•id: The value is an ID for the marker •geolocation: This is a sequence of two strings or two numbers (integer or decimal): the latitude and the longitude; for example: (48.2143531, 16.3707266) •title: A string that is the title of the popup that appears when the marker (in the map) is clicked •text: A string that is the text of the popup that appears when the marker (in the map) is clicked
A full XPath-map construct would look something like this:
map { "id":"vie", "geolocation":(48.2143531, 16.3707266), "title":"Vienna", "text":"Altova EU" }
The XPath-map construct above would create a marker for the Altova EU office in Vienna. To add more markers to the map, enter additional XPath-map constructs with a preceding comma separator: map-1, map-2, ... map-N.
mt-geo-map-marker()The MobileTogether XPath extension function mt-geo-map-marker can be used to generate a marker dynamically. Each mt-geo-map-marker function returns an XPath-map construct, that is, one marker. To create multiple markers, multiple mt-geo-map-marker functions can be used. For more information about the function, see the description of mt-geo-map-marker().
|
An XPath expression that evaluates to two geolocation coordinates: the top-left corner and the bottom-right corner of the viewport rectangle. The viewport is the geolocation area that is shown in the geolocation map. Note, however, that the dimensions of the Geolocation Map control are defined by the Control Width and Control Height properties. The viewport, if correctly defined, will lie within the map area shown in the control.
The XPath expression must evaluate to a sequence of two strings, where each string is one set of coordinates. In the following example, for instance, the first string is the top-left coordinate while the second string is the bottom-right coordinate: ("61° -10°", "41° 10°"). The top-left coordinate would thus be 61°N 10°W, while the bottom-right coordinate would be 41°N 10°E. These coordinates would create a viewport of roughly 10° square centered on London (approx. 51°N 0°E).
The default setting for the viewport are the coordinates of a rectangle that displays all defined markers at the highest possible zoom level.
geolocations-bounding-rectangle()The Altova extension function geolocations-bounding-rectangle can be used to create a bounding rectangle around a set of submitted geolocations. The function returns the top-left corner and bottom-right corner of a rectangle that fits around the submitted geolocations at the greatest possible zoom level, that is, as closely as possible around the geolocations. The return value of the function is a sequence of two strings; so the function can be used in an XPath function to generate the value of the Viewport property.
For more information about the function, see the description of geolocations-bounding-rectangle().
|
Click the Additional Dialog button to display the control's Actions dialog. You can set actions to perform when a control event is triggered. The control's event/s are predefined and each is shown in its own tab in the right-hand pane of the Actions dialog. A library of actions is displayed in the left-hand pane. You can drag an action from the left-hand pane into an event's tab and then define the properties of the action. For each event, multiple actions can be set up. They will be executed in the order in which they occur, from top to bottom.
After defining a control's actions, you can access and edit them at any time by clicking the property's Additional Dialog button. Alternatively, you can access a control event by right-clicking the control and selecting the control's event in the context menu that appears.
|
An XPath expression that should evaluate to true() or false(). If the expression evaluates to false()—and only if it evaluates to false()—then the control is not visible. If the expression evaluates to true() or returns some other value, then the control is visible. The default is true(). Double-click inside the value field, or click the XPath button, to enter or edit an XPath expression. The Visible property can be used to render an object visible or not depending upon whether an XPath expression evaluates to true(). As a result, the display of an object can be made to be dynamically dependent on the content or structure of data.
Note: For information about the visibility of spanned columns/rows, see Table Properties.
Note: The $MTControlValue variable is not available for the evaluation of the Visible property. If it is used, then a validation error results.
|
Sets the text that appears as a tooltip when the end user hovers over the control with the mouse or long presses the control. A tooltip provides useful information to the end user about the control. Double-click inside the value field to edit. If an action has been set for a long press of the control, then no tooltip will be shown on a long press.
Note: Tooltips are not available on all controls, and for some controls they are not available on all platforms. On iOS, tooltips are not available for Edit Field or Signature controls.
|
This property applies in the case of some controls (such as images and vertical lines) to the control, in other cases (such as radio buttons and check boxes) to the text that accompanies the control. The property sets the horizontal alignment of the control or text to left, center, or right. Default is left for all controls except vertical lines, for which it is center. The property's value can also be specified via an XPath expression (which enables the value to be generated dynamically).
|
Sets the vertical alignment to top, middle, or bottom. Default is middle. The value can also be specified via an XPath expression (which enables the value to be generated dynamically). For Check Box controls, the property sets the vertical alignment of the check box relative to its text if the text is multiline (see the Multiline property)
|
Sets the width of the control. Select a value from the property's combo box. The following values are available:
•fill_parent: makes the control as wide as the parent, which could be, for example, a table cell or the page •wrap_content: makes the control only as wide as the control's content requires; when this value is selected, the property Max Control Width becomes available •wrap_content_longest_entry: is available for combo box controls and makes the combo box as wide as the longest content requires; when this property value is selected, the property Max Control Width becomes available •percent value: a percentage of the page width; select a value from the dropdown list, or enter a value directly •pixel, dp, or sp value: select a pixel, dp, or sp value from the dropdown list, or enter a value directly
In effect, fill_parent creates a maximum width, while wrap_content creates a minimum width. If the combo box is within a table cell, for example, fill_parent would let the combo box fill the cell whereas wrap_content might not fill the cell.
The default value is fill_parent for all controls except the following:
•Image and Chart: For these, the default is wrap_content. •Geolocation Map: The default is the smaller of the two values $MT_CanvasX and $MT_CanvasY. These two dynamic variables give, respectively, the width and height of the device's viewport. Since the default of both Control Height and Control Width are the same (in each case, the smaller of $MT_CanvasX and $MT_CanvasY), the default shape and size of the viewport in the control will always be a square with side equal to min($MT_CanvasX, $MT_CanvasY).
For information about the relationships between pixels, dp (device-independent pixels), and sp (scale-independent pixels), see Sizes: Pixels, DPI, DP, SP.
|
Sets the height of the control. Select a value from the property's combo box. The following values are available:
•fill_parent: makes the control as high as the parent, which could be, for example, a table cell or the page •wrap_content: makes the control only as high as the control's content requires.
In effect, fill_parent creates a maximum height, while wrap_content creates a minimum height.
Default values •For the the Geolocation Map control, the default is the smaller of the two values $MT_CanvasX and $MT_CanvasY. These two dynamic variables give, respectively, the width and height of the device's viewport. Since the default of both Control Height and Control Width are the same (in each case, the smaller of $MT_CanvasX and $MT_CanvasY), the default shape and size of the viewport in the control will always be a square with side equal to min($MT_CanvasX, $MT_CanvasY). •For all other controls, the default is wrap_content.
|
Sets the margin offsets of the control (or page) relative to the surrounding objects or to the borders of the containing object. Select a value in pixels, dp, or sp from the dropdown list of the combo box, or double-click in the value field to enter a length value. The specified offset will be created on all four sides of the control or page. If you wish to set a different margin for any of the four sides, expand the Margin property to display the individual margin properties (left, right, top and bottom), and set the different value. For example: If you set Margin to be 6px and Margin Bottom to be 12px, then the top, left and right margins will be 6px and the bottom margin will be 12px.
For information about the relationships between pixels, dp (device-independent pixels), and sp (scale-independent pixels), see Sizes: Pixels, DPI, DP, SP.
|
The Style Sheet property sets the style sheet to use for the control. The dropdown list of the Style Sheet property's combo box displays all the user-created style sheets that have been defined in the project. Select the style sheet you want to use for the control. Alternatively, you can use an XPath expression to select the style sheet you want; this has the advantage that you can make the selection of the style sheet conditional (see Applying User-Created Style Sheets). See the section Style Sheets for more information.
|
The name of one or more CSS classes that you want to associate with this control. Use a space to assign multiple classes: LabelClassOne LabelClassTwo. These classes can then be used in a CSS file (specified in the Browser Settings dialog) to assign properties specifically for this control. You can also use an XPath expression to generate or fetch the names of the class(es).
|