CanvasMap
Getting Started Tutorials 3D Reference

Class CMLayerDataset extends CM2Layer

CMLayerDataset Class

Settings Group: Dataset

Setting Name Type Options Default Comments
URL URL CMTYPE_STRING null Full or partial URL to the dataset to load into the layer
Format Format CMTYPE_INDEXES CMDataset.FormatOptions, Default:CMDataset.GEOJSON CMDataset.GEOJSON Type of data to load.
NorthPoleColor NorthPoleColor CMTYPE_COLOR null Color used to fill in the north pole for pyramid layers
SouthPoleColor SouthPoleColor CMTYPE_COLOR null Color used to fill in the south pole for pyramid layers

Object Functions

Inherited From: CM2Layer
ReturnsFunctionThrows
SetBounds(NewBounds)
Bounds GetBounds()
SetSelectedFeature(NewFeatureIndex)
SetMouseOverFeature(NewFeatureIndex)
RequestData()
SetData(TheData, DataSetType)
TheDataset HaveDataset()
SetDataset(NewDataset)

Object Functions

SetBounds(NewBounds)

Check if the feature is visible in the view.
This should be called by subclasses but can also be called to limit a layer's bounds after loading.

Parameters:
    NewBounds - Object for Bounds with format {XMin,XMax,YMin,YMax}

Bounds=GetBounds()

Returns the bounds of the data within the layer. Computed after loading the data.

Returns: Bounds - with format {XMin,XMax,YMin,YMax}

SetSelectedFeature(NewFeatureIndex)

Sets the feature that is selected

Parameters:
    NewFeatureIndex - >=0 indicates a feature, -1 is for none.

SetMouseOverFeature(NewFeatureIndex)

Sets the current feature that the mouse is over

Parameters:
    NewFeatureIndex - index to the feature the mouse is over (typcially returned by In())

RequestData()

Called to obtain the data for the layer from a URL.

SetData(TheData, DataSetType)

Set existing data into the layer. Allocates a CMDataset object if needed.

Parameters:
    TheData - the URL to use to obtain data
    DataSetType - optional data set type (GeoJSON is the default)

TheDataset=HaveDataset()

Gets the dataset from this object. Allocates the dataset if it has not already
been allocated.

Returns: TheDataset - the data set associated with the layer or null for none

SetDataset(NewDataset)

Sets the dataset for this layer to get data from

Parameters:
    NewDataset - the new dataset