Overview
This document describes the Tcl object API for the Rappture::Map object which interoperates with the Rappture MapViewer. Rappture-based tools should not use this API. You should instead use the Rappture get/put API together with the XML description of the Map Object. This API is intended for use in integrating the Rappture MapViewer into Tcl/Tk applications outside of Rappture.
Public Method Listing
public method addLayer { type name paramArray driver driverParamArray {stylesheet {}} {script {}} {selectors {}} } public method addSelector { layerName selectorName paramArray } public method addViewpoint { name paramArray } public method clearExtents {} public method deleteLayer { layerName } public method deleteSelector { layerName selectorName } public method deleteViewpoint { viewpointName } public method dirty { key args } public method getPlacardConfig { layerName } public method hasLayer { layerName } public method hasSelector { layerName selectorName } public method hasViewpoint { viewpointName } public method hints { args } public method isGeocentric {} public method isvalid {} public method layer { layerName args } public method layers {} public method selectors { layerName } public method selector { layerName selectorName } public method setAttribution { attribution } public method setCamera { camera } public method setColormap { layerName colormap } public method setDescription { description } public method setExtents { xmin ymin xmax ymax {srs "wgs84"} } public method setLabel { label } public method setPlacardConfig { layerName attrlist style padding } public method setProjection { projection } public method setScript { layerName script } public method setStyle { style } public method setStylesheet { layerName stylesheet } public method setToolInfo { id name command title revision } public method setType { type } public method viewpoint { viewpointName } public method viewpoints {} public proc getFilesFromStylesheet { stylesheet }
Map Properties
Map "Hints"
The following table lists the array keys for the hints method. To set these properties, use the individual setter methods such as setAttribution, setCamera, etc.
Hint Description type The type of map. Can be either "geocentric" or "projected". projection A string representing the projection of the map. May be WKT, EPSG Codes, PROJ4, or aliases like "spherical-mercator". extents A list of 4 numbers (xmin, ymin, xmax, ymax) representing the extents of the map in map coordinates. The fifth and final list element is the SRS (default is 'wgs84'). label Label of the map description Description of the map. attribution Attribution for map data. style Style array camera Initial camera settings toolName Short name of the tool toolId Id of the tool toolCommand Command used to invoke the tool. toolTitle Title of the tool. toolRevision Revision of the tool.
Layers
Layer Types
The following list of layer types may be used for the type parameter of the addLayer method.
General Types
"elevation", "feature", "image", "mask", "model"
Pre-Styled Feature Layer Types
"icon", "label", "line", "point", "polygon"
Layer Properties
The following table lists the array keys for layers used by the addLayer and layer methods.
Property Description name ID of layer (must be supplied by user) type The type of layer. profile Optional projection of the layer. For use when there is no embedded projection or .prj file. srs Optional projection of the layer. Use this OR profile. For use when there is no embedded projection or .prj file. verticalDatum Optional projection of the layer. Use this OR profile. For use when there is no embedded projection or .prj file. label Title of the layer. description Description of the layer. attribution Attribution string for layer data visible Boolean: is layer visible by default? cache Boolean: can layer be cached to disk? shared Boolean: is layer a base/overlay layer? minrange Float: Applies only to feature layers. Minimum camera distance in meters at which layer should be shown. maxrange Float: Applies only to feature layers. Maximum camera distance in meters at which layer should be shown. terrainPatch Boolean: should layer be used for elevation queries. coverage Boolean: if set, don't interpolate values. Only valid for image layers. opacity [0.0,1.0] Opacity of layer. Not valid for elevation layers. driver Layer driver (Included in layer property query, but unused for addLayer)
Selectors
Selector Properties
The following table lists the array keys for selectors used by the addSelector and selector methods as well as the selectors parameter of addLayer.
Property Description id ID of selector (supplied by user) name Selector name style Name of style. Use this OR styleExpression styleExpression JavaScript returning a style name or CSS style string. Use this OR style. query SQL where clause. May be empty to select all records. queryBounds Restrict query to these bounds. List (space separated) of xmin ymin xmax ymax in SRS of feature source. queryOrderBy SQL order by clause
Viewpoints
Viewpoint Properties
The following table lists the array keys for viewpoints used by the addViewpoint and viewpoint methods.
Property Description label Label to display on button/link description Longer description of viewpoint x,y Easting and Northing coordinates in map SRS latitude,longitude Optional alternative to x,y in WGS84 z OR altitude Optional altitude coordinate distance Camera distance to focal point in meters heading Optional camera azimuth/heading angle in degrees (-180,180) pitch Optional camera pitch angle in degrees (-90,0) srs Projection string, if different from map SRS verticalDatum Vertical reference, if different from map vertical datum