Class CMDataset extends CMBase
CMDataset Class
This is effecitvely an abstract class that provides an API between
the layer class and the data that may be shared between muliptle layers.
The data typically contains individual spatial features with attributes
But can also contain raster data organized as tiles.
Datasets are stored in a global CMDataset.TheDataSets[] array object
Enumerated Types
CMDataset.GEOJSON=1
CMDataset.PYRAMID=2
CMDataset.PYRAMID_OPEN_FORMAT=3
CMDataset.RASTER=4
CMDataset.SQL=5
CMDataset.LOAD_STATUS_NONE=1 - have not started a load yet
CMDataset.LOAD_STATUS_LOADING=2 - waiting for element to load
CMDataset.LOAD_STATUS_LOADED=3 - element had loaded and is ready to go
CMDataset.LOAD_STATUS_PENDING=4 - element is waiting in the que
CMDataset.LOAD_STATUS_CANCELED=5 - request was canceled, probably from the user changing the zoom level
CMDataset.REQUEST_TYPE_IMAGE=1 - img element with a "src" attribute (jjg - not sure this is being used )
Object Functions
Object Functions
Number=GetNumAttributeRows()
Returns the number of rows of attributes in the current dataset. Needs to be overriden by subclasses.
@override
Returns: Number - of rows or 0 if no data loaded
Number=GetNumAttributeColumns()
Returns the number of columns of attributes in the current dataset. Needs to be overriden by subclasses.
@override
Returns: Number - of columns or 0 if no data loaded
Specified=GetAttributeHeading()
Returns the a heading for a specified column. Does not need to be overriden as it calls GetAttributeHeadings().
@override
Returns: Specified - column heading or "" if no data loaded.
Array=GetAttributeHeadings()
Gets the array of attribute headings. Needs to be overriden by subclasses.
@override
Returns: Array - with the attribute headings or null for none.
Array=GetAttributeIndexFromHeading()
Gets the array of attribute headings. Does not need to be overriden as it calls GetAttributeHeadings().
@override
Returns: Array - with the attribute headings or null for none.
Specified=GetAttributeCell(ColumnIndex, RowIndex)
Gets the contents of an attribute cell (row and column). Needs to be overriden by subclasses.
@override
Parameters:
ColumnIndex
RowIndex
Returns: Specified - value or "" if no data loaded.
Specified=GetAttributeCellByHeading(Heading, RowIndex)
Gets the contents of an attribute cell using the attribute name and a row index.
Does not need to be overriden as it calls GetAttributeIndexFromHeading().
@override
Parameters:
Heading
RowIndex
Returns: Specified - value or "" if no data loaded.
AddAttributeHeading(NewHeading, DefaultValue)
Inserts a new column into the dataset with the specified heading and
sets all values in the column to the specified DefaultValue.
Needs to be overriden by subclasses if supported.
@override
Parameters:
NewHeading
DefaultValue
SetAttributeCell(ColumnIndex, RowIndex, Value)
Sets the value of a cell in an attribute table using a row and column index.
Needs to be overriden by subclasses.
@override
Parameters:
ColumnIndex
RowIndex
Value
GetAttributeArray(Heading)
Helper function to return an entire array for an attribute
Does not need to be overriden as it calls GetNumAttributeRows() and GetAttributeCell().
Parameters:
Heading - the atribute/column heading to get the array from
SetProjector(NewProjector)
Sets up a projector for layer data to be projected on loading the data.
Parameters:
NewProjector - an STProjector object to project layer data after it is loaded.
Current=GetProjector()
Gets the current projector used to project data on load.
Returns: Current - projector or null.