wiki:MapObjectAPI

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.

HintDescription
typeThe type of map. Can be either "geocentric" or "projected".
projectionA string representing the projection of the map. May be WKT, EPSG Codes, PROJ4, or aliases like "spherical-mercator".
extentsA 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').
labelLabel of the map
descriptionDescription of the map.
attributionAttribution for map data.
styleStyle array
cameraInitial camera settings
toolNameShort name of the tool
toolIdId of the tool
toolCommandCommand used to invoke the tool.
toolTitleTitle of the tool.
toolRevisionRevision 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.

PropertyDescription
nameID of layer (must be supplied by user)
typeThe type of layer.
profileOptional projection of the layer. For use when there is no embedded projection or .prj file.
srsOptional projection of the layer. Use this OR profile. For use when there is no embedded projection or .prj file.
verticalDatumOptional projection of the layer. Use this OR profile. For use when there is no embedded projection or .prj file.
labelTitle of the layer.
descriptionDescription of the layer.
attributionAttribution string for layer data
visibleBoolean: is layer visible by default?
cacheBoolean: can layer be cached to disk?
sharedBoolean: is layer a base/overlay layer?
minrangeFloat: Applies only to feature layers. Minimum camera distance in meters at which layer should be shown.
maxrangeFloat: Applies only to feature layers. Maximum camera distance in meters at which layer should be shown.
terrainPatchBoolean: should layer be used for elevation queries.
coverageBoolean: if set, don't interpolate values. Only valid for image layers.
opacity[0.0,1.0] Opacity of layer. Not valid for elevation layers.
driverLayer 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.

PropertyDescription
idID of selector (supplied by user)
nameSelector name
styleName of style. Use this OR styleExpression
styleExpressionJavaScript returning a style name or CSS style string. Use this OR style.
querySQL where clause. May be empty to select all records.
queryBoundsRestrict query to these bounds. List (space separated) of xmin ymin xmax ymax in SRS of feature source.
queryOrderBySQL order by clause

Viewpoints

Viewpoint Properties

The following table lists the array keys for viewpoints used by the addViewpoint and viewpoint methods.

PropertyDescription
labelLabel to display on button/link
descriptionLonger description of viewpoint
x,yEasting and Northing coordinates in map SRS
latitude,longitudeOptional alternative to x,y in WGS84
z OR altitudeOptional altitude coordinate
distanceCamera distance to focal point in meters
headingOptional camera azimuth/heading angle in degrees (-180,180)
pitchOptional camera pitch angle in degrees (-90,0)
srsProjection string, if different from map SRS
verticalDatumVertical reference, if different from map vertical datum
Last modified 2 years ago Last modified on Jan 5, 2017, 3:13:50 PM