-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Add is_selected and num_selected functions
* is_selected() returns if the current feature is selected * num_selected() returns the number of selected features on the current layer * is_selected(layer, feature) returns if the "feature" is selected. "feature" must be on "layer". * num_selected(layer) returns the number of selected features on "layer"
- Loading branch information
Showing
6 changed files
with
173 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "is_selected", | ||
"type": "function", | ||
"description": "Returns if a feature is selected. If called with no parameters checks the current feature.", | ||
"arguments": [ | ||
{"arg":"feature","description":"The feature which should be checked for selection"}, | ||
{"arg":"layer","description":"The layer (or its id or name) on which the selection will be checked"} | ||
], | ||
"examples": [ | ||
{ "expression":"is_selected()", "returns" : "True if the current feature is selected."}, | ||
{ "expression":"is_selected(get_feature('streets', 'name', \"street_name\"), 'streets')", "returns":"True if the current building's street is selected."} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "num_selected", | ||
"type": "function", | ||
"description": "Returns the number of selected features on a given layer. By default works on the layer on which the expression is evaluated.", | ||
"arguments": [ | ||
{"arg":"layer","description":"The layer (or its id or name) on which the selection will be checked"} | ||
], | ||
"examples": [ | ||
{ "expression":"num_selected()", "returns":"The number of selected features on the current layer."}, | ||
{ "expression":"num_selected('streets')", "returns":"The number of selected features on the layer streets"} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters