# mapscriptsupp.tcl

# Mapscript Supplemental Procedures

- 1. proc mapscript::classObjRef
- 2. proc mapscript::colorObjRef
- 3. proc mapscript::errorObjRef
- 4. proc mapscript::featureListNodeObjRef
- 5. proc mapscript::itemObjRef
- 6. proc mapscript::labelCacheMemberObjRef
- 7. proc mapscript::labelCacheObjRef
- 8. proc mapscript::labelObjRef
- 9. proc mapscript::layerObjRef
- 10. proc mapscript::legendObjRef
- 11. proc mapscript::lineObjRef
- 12. proc mapscript::mapObjRef
- 13. proc mapscript::markerCacheMemberObjRef
- 14. proc mapscript::pointObjRef
- 15. proc mapscript::projectionObjRef
- 16. proc mapscript::queryMapObjRef
- 17. proc mapscript::rectObjRef
- 18. proc mapscript::referenceMapObjRef
- 19. proc mapscript::resultCacheMemberObjRef
- 20. proc mapscript::resultCacheObjRef
- 21. proc mapscript::scalebarObjRef
- 22. proc mapscript::shapeObjRef
- 23. proc mapscript::shapefileObjRef
- 24. proc mapscript::symbolSetObjRef
- 25. proc mapscript::webObjRef
- 26. proc mapscript::DBFInfoRef

## Usage

These procedures allow methods to be invoked on object references (i.e., pointers), without having to convert a reference into an object. A valid object reference is required; procedures check for valid object types.

General syntax:

> objectRefProc $objectPtr args

Sample:

> set map [mapscript::mapObj -args $mapFile]
> set rectPtr [$map cget -extent]
> set minx [mapscript::rectObjRef $rectPtr cget -minx]
> set miny [mapscript::rectObjRef $rectPtr cget -miny]

Notes: each of the objectRef procedures is just a shortcut to invoke a SWIG generated method name. Method names of:

- cget
- configure
- delete

invoke that object's cget, configure, and delete method respectively.

Example:

> mapscript::rectObjRef $rectPtr cget -minx

is equivalent to:

> mapscript::rectObj_minx_get $rectPtr

# Mapscript Convenience Procedures

- 1. proc mapscript::getDBFNames
- 2. proc mapscript::getDBFTypes
- 3. proc mapscript::getDBFValues
- 4. proc mapscript::getQueryInfo

## Usage

mapscript::getDBFNames DBFInfo_handle
getDBFNames returns a list of field names from a DBF file handle. The DBFInfo_handle must be a valid DBFInfo handle returned from the DBFInfo constructor.

mapscript::getDBFTypes DBFInfo_handle
getDBFTypes returns a list of field types and lengths from a DBF file handle. The DBFInfo_handle must be a valid DBFInfo handle returned from the DBFInfo constructor. Each list element is itself a list of field type and field length. Valid field types are returned as: string, integer, and double.

mapscript::getDBFValues DBFInfo_handle record_number
getDBFValues returns a list of field values from a DBF file handle. The DBFInfo_handle must be a valid DBFInfo handle returned from the DBFInfo constructor. Record_number is the record number of the row to fetch.

mapscript::getQueryInfo mapObj_pointer layerObj_pointer
getQueryInfo returns a list of name-value pairs from a layer that map query has generated. mapObj_pointer and queryObj_pointer must be valid mapObj and layerObj pointers.

# See also

See mapscript_wrap.html for the full Mapscript Tcl interface.

Note also that the Mapscript objects described in mapscript_wrap.html are defined in the mapscript namespace.

Tom Poindexter
tpoindex@nyx.net