Class CMLayerDataset extends CM2Layer
CMLayerDataset Class
Note that the CMDataVector has an array for selection so that
we can manage the selection of Features, Areas, Polys, and coordinates
Copyright (C) 2020, Humboldt State University, Jim Graham
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General
Public License as published by the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see
.
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, Values:CMDataset.FormatValues |
|
Type of data to load. This also defines the type of dataset object if this layer needs to define it. |
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
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.
SetRandomFillStyles(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
SetOnLoadProjector()
This function just exists so the projection for the spatial data can be set before the
dataset is created.