Constructor
new FeatureCollectionUI(group, optsopt)
Create a new FeatureCollectionUI instance.
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
group |
paper.Group | The paper group object. | |||||||||
opts |
object |
<optional> |
The initialization options.
Properties
|
Properties:
Name | Type | Description |
---|---|---|
displayName |
string | The display name of the group. |
paperItem |
paper.Item | The paper item object. |
element |
HTMLElement | The HTML element of the feature collection UI. |
- Source:
Members
_addFeature
Add a feature to the feature collection UI element.
- Source:
createFeature
Create a new feature and add it to the paper group using the default style properties of the group.
This function also creates a geoJSON object for the feature and converts it to a paper item.
Properties:
Name | Type | Description |
---|---|---|
fillColor |
paper.Color | The fill color of the group. |
strokeColor |
paper.Color | The stroke color of the group. |
rescale |
Object | The rescale properties of the group. |
fillOpacity |
number | The fill opacity of the group. |
strokeOpacity |
number | The stroke opacity of the group. |
strokeWidth |
number | The stroke width of the group. |
type |
string | The type of the feature (e.g., "Feature"). |
geometry |
Object | The geometry object. |
properties |
Object | The properties object containing style information. |
- Source:
features
Get the features in the feature collection.
- Source:
numFeatures
Get the number of features in the feature collection.
- Source:
Methods
openStyleEditor(ev)
Open the style editor for the feature collection.
Parameters:
Name | Type | Description |
---|---|---|
ev |
object | The event object. |
- Source:
removeLayer(confirmopt)
Remove the paper layer associated with the feature collection.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
confirm |
boolean |
<optional> |
true | Whether to confirm before removing or not. |
- Source:
setLabel(text, source) → {string}
Set the label of the feature collection with a source.
Parameters:
Name | Type | Description |
---|---|---|
text |
string | The new label of the feature collection. |
source |
string | The source of the label (e.g. 'user-defined' or 'initializing'). |
- Source:
Returns:
The new label of the feature collection.
- Type
- string
toggleVisibility()
Toggle the visibility of the feature collection UI element and the paper group.
- Source:
updateLabel()
Update the label of the feature collection in the UI element.
- Source: