A dynamic list of map markers for use with the Google Map control. The data model for this control is an com.webmethods.caf.faces.data.ITableContentProvider
. A marker is rendered for each row in the table content provider.
The properties of this control can be bound to row properties, so that for example, if the provider's row object has street, city, state, and zipCode properties, the Dynamic Map Marker List control's initialAddress
property could be bound to the expression #{marker.street} #{marker.city} #{marker.state} #{marker.zipCode}
. assuming the control's row variable is set to its default value of marker. In this example, if the provider has two addresses (two rows), the control renders two markers, each with the initialAddress
property bound to the an address.
Each marker's location is specified using the Dynamic Map Marker List control's latitude
and longitude
property values. You can also specify marker locations using the initialAddress
property, if the latitude
and longitude
properties are both set to 0. You can format the address as a natural-language address with multiple lines concatenated into a single line with spaces, for example, 123 A Street NE, Bellevue, WA 98004 USA. You can specify the two-letter ISO-3166 country code with the initialCountry
property as a country/locale hint.
You can specify the marker's icon using the Dynamic Map Marker List control's icon
property. Use the standard Composite Application Framework marker icons by configuring the icon
property with an icon color name such as red, purple, or magenta. In addition, you can use a custom icon by configuring the icon
property with the URL of the icon, for example,http://maps.google.com/mapfiles/arrow.png. You can configure the marker's selected icon using a selectedImage
property. If you use a custom icon, you might want to configure other properties of the Dynamic Map Marker List control, such as the iconSizeWidth
, shadow
, or shadowSizeWidth
property.
The content of the marker list is used to render each marker's information (bubble) window. A user can click on a marker to display the information window, and also to select the marker, if the control's clickable
property is set to true for the marker. A user can drag the marker to a new location if the controls's draggable
property is set to true for the marker.
Scripting
The Google Maps API is a client-side JavaScript API that is accessible for use with the Composite Application Framework Google Maps controls. For more information, refer to Google documenation about Google Maps API.
To access the GMarker object (the Google Maps API marker object) associated with a particular marker in the marker list, use the get()
method the control's CAF client-side model object to get the CAF model object for the marker, and then the getOverlay()
method on the CAF marker model object to get the GMarker object. The following example looks up the GMarker object with an ID of "myMarker" from the marker list control model with an ID of "myMarkerList", and uses the Google Maps API to hide the marker:
var marker =
CAF.model("#{caf:cid("myMarkerList")}").get("myMarker")
.getOverlay();
marker.hide();
You can configure the marker's ID on a table content provider using a binding expression with the provider's rowId
property. You can also identify the marker using its zero-based row index. The following example looks up the first GMarker object from the marker list control model with an ID of "myMarkerList", and uses the Google Maps API to hide the marker:
var marker CAF.model("#{caf:cid("myMarkerList")}")
.get(0).getOverlay();
marker.hide();
Client-Side Model
The CAF client-side model object for this control extends from the CAF.Table.Model object. For more information, see information about the client-side model in the webMethods CAF Development Help.
The object's value is the selected marker's ID, or if the control's multiple
property is set to true, an array of selected marker IDs. For example, you can set the selected marker of the marker list with an ID of "myMarkerList" to the marker with an ID of "myMarker" with the following script:
var marker = CAF.model("#{caf:cid("myMarkerList")}")
.setValue("myMarker");
You can get the coordinates of a particular marker's location in String form, for example, 37.0625;-95.67706, by using the getCoords()
method of the client-side model. The following script gets the coordinates of the marker with an ID of "myMarker" in a marker list with an ID of "myMarkerList":
var coords =
CAF.model("#{caf:cid("myMarkerList")}").get("myMarker")
.getCoords();
The CAF.GMap.stringToGLatLng()
and CAF.GMap.gLatLngToString()
functions convert String coordinates to and from a GLatLng object, the Google Maps API coordinates object. To set the coordinates, you must change the marker model's coordinates using the model's setCoords()
method and then update the marker list with the changed marker model using the marker list model's set()
method. The following script sets the marker with an ID of "myMarker" in a marker list with an ID of "myMarkerList":
CAF.model("#{caf:cid("myMarkerList")}")
.set(CAF.model("#{caf:cid("myMarker")}")
.setCoords("37.0625;-95.677068"));
You can use the CAF client-side model to set a marker's location with a natural-language address. The following script sets the location of the marker with an ID of "myMarker":
CAF.model("#{caf:cid("myMarkerList")}")
.set(CAF.model("#{caf:cid("myMarker")}")
.setAddress("600 108th Ave NE,
Bellevue, WA 98004"));
Script Controls
You can use the standard script-type controls like Return Value Script or Invoke Script to manipulate the marker list with the standard client-side actions (such as getValue
or setValue
). You can also use the custom Return Map Value Script and Invoke Map Script controls to access special map-only properties and actions of the individual markers in a marker list such as getLatitude
or setAddress
. Additionally, the Return Map Coords Script control allows latitude and longitude coordinates to be specified separately when invoking a marker's setCoords
action.
Children
Any. Children are rendered as the content of the marker's information (bubble) window
Info | Value |
---|---|
Component Type | com.webmethods.caf.faces.gmap.GMarkerList |
Handler Class | com.webmethods.caf.faces.component.table.html.DataListHandler |
Renderer Type | com.webmethods.caf.faces.gmap.GMarkerList |
Description | List of map markers populated by a table content-provider |
Palette Location | CAF Html/Control/Map/Dynamic Map Marker List |
Client-Side Model | CAF.GMap.MarkerList.Model |
Name | Required | Type | Description |
---|---|---|---|
autoPan | false | javax.el.ValueExpression
(must evaluate to java.lang.Boolean )
|
True to auto-pan map if user drags marker near map's edge
If not specified, the default value is "true". |
bounceGravity | false | javax.el.ValueExpression
(must evaluate to java.lang.Double )
|
Acceleration rate of marker when bouncing
If not specified, the default value is "1". |
bouncy | false | javax.el.ValueExpression
(must evaluate to java.lang.Boolean )
|
True to make marker bounce up and down after user finishes dragging it
If not specified, the default value is "true". |
clickable | false | javax.el.ValueExpression
(must evaluate to java.lang.Boolean )
|
True to allow user to click marker to select it or open the info window
If not specified, the default value is "false". |
converter | false | javax.el.ValueExpression
(must evaluate to javax.faces.convert.Converter )
| A value binding expression for a method that returns a converter instance. |
converterMessage | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Will be used as the text of the converter message, replacing any message that comes from the converter. |
dragCrossAnchorX | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Horizontal offset of cross image from Icon Anchor in pixels (for example, 10) |
dragCrossAnchorY | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Vertical offset of cross image from Icon Anchor in pixels (for example, 10) |
dragCrossImage | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| URL of cross image to display over exact marker location when marker is dragged |
dragCrossMove | false | javax.el.ValueExpression
(must evaluate to java.lang.Boolean )
|
True to keep marker under cursor when dragging; false to keep cross under cursor when dragging
If not specified, the default value is "false". |
dragCrossSizeHeight | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Height of cross image in pixels (for example, 16) |
dragCrossSizeWidth | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Width of cross image in pixels (for example, 16) |
draggable | false | javax.el.ValueExpression
(must evaluate to java.lang.Boolean )
|
True to allow user to drag marker to a different location
If not specified, the default value is "false". |
icon | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
|
URL of marker icon or pre-defined icon name
If not specified, the default value is "red". Valid values are:
|
iconAnchorX | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Horizontal offset of left edge of icon from marker location in pixels (for example, 10) |
iconAnchorY | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Vertical offset of top edge of icon from marker location in pixels (for example, 10) |
iconSizeHeight | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Height of icon in pixels (for example, 16) |
iconSizeWidth | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Width of icon in pixels (for example, 16) |
id | false | java.lang.String | Control identifier |
imageMap | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Comma-separated list of integers representing the x/y coordinates of the image map to use to specify the clickable part of the icon image in browsers other than Internet Explorer |
infoWindowAnchorX | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Horizontal offset of the pointy tip of the info window from the left edge of the icon in pixels (for example, 10) |
infoWindowAnchorY | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Vertical offset of the pointy tip of the info window from the left edge of the icon in pixels (for example, 10) |
initialAddress | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Initial marker location if latitude=0 and longitude=0 (for example, "600 108th Ave NE, Bellevue, WA 98004") |
initialCountry | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Two-letter country code (ISO 3166) hint for initial address (for example, "US") |
label | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| A localized user presentable name for this component. |
latitude | false | javax.el.ValueExpression
(must evaluate to java.lang.Double )
| Marker latitude in degrees (for example, 37.0625) |
longitude | false | javax.el.ValueExpression
(must evaluate to java.lang.Double )
| Marker longitude in dgrees (for example, -95.677068) |
maxHeight | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Height in pixels for marker to rise when dragged (for example, 10) |
mozPrintImage | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| URL of icon to use for printing in Firefox |
multiple | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True to allow multiple markers to be selected
If not specified, the default value is "false". |
printImage | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| URL of icon to use for printing in browsers other than Firefox |
printShadow | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| URL of image to use for marker's shadow when printing |
rendered | false | javax.el.ValueExpression
(must evaluate to boolean )
|
True to render control; false to ignore it
If not specified, the default value is "true". |
selected | false | javax.el.ValueExpression
(must evaluate to java.lang.Boolean )
|
True if marker is selected
If not specified, the default value is "false". |
selectedImage | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
|
URL of icon to use when marker is selected
If not specified, the default value is "yellow". Valid values are:
|
shadow | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| URL of image to use for marker's shadow |
shadowSizeHeight | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Height of shadow in pixels (for example, 16) |
shadowSizeWidth | false | javax.el.ValueExpression
(must evaluate to java.lang.Integer )
| Width of shadow in pixels (for example, 16) |
title | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Marker title |
transparent | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| URL of a virtually transparent version of the foreground icon image used to capture click events in Internet Explorer |
value | false | javax.el.ValueExpression
(must evaluate to java.lang.Object )
| Control value |
var | true | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Name of variable reference to the current row object |
Output generated by Vdldoc View Declaration Language Documentation Generator.