Skip to content
Permalink
Browse files

Add/update examples using get_feature function

reinforcing the need for uniqueness, since get_feature output is unpredictable
  • Loading branch information
DelazJ authored and nyalldawson committed Nov 15, 2020
1 parent 6ee681a commit fccfac8a6fbb112c9a759b8b89b9d6941c676b5c
Showing with 2 additions and 1 deletion.
  1. +2 −1 resources/function_help/json/is_selected
@@ -15,14 +15,15 @@
"variant_description": "If called with a 'feature' parameter only, the function returns true if the specified feature from the current layer is selected.",
"arguments": [ { "arg": "feature", "description": "The feature which should be checked for selection." } ],
"examples": [ { "expression": "is_selected(@atlas_feature)", "returns": "True if the current atlas feature is selected." },
{ "expression": "is_selected(get_feature('streets', 'name', 'Main St.')))", "returns": "True if the unique named \"Main St.\" feature on the active \"streets\" layer is selected." },
{ "expression": "is_selected(get_feature_by_id('streets', 1))", "returns": "True if the feature with the id 1 on the active \"streets\" layer is selected." }
]
},
{
"variant" : "Two parameters",
"variant_description": "If the function is called with both a layer and a feature, it will return true if the specified feature from the specified layer is selected.",
"arguments": [ { "arg": "layer", "description": "The layer (its ID or name) on which the selection will be checked." }, { "arg": "feature", "description": "The feature which should be checked for selection." } ],
"examples": [ { "expression": "is_selected( 'streets', get_feature('streets', 'name', \"street_name\"))", "returns": "True if the current building's street is selected (assuming the building layer has a field named 'street_name' and the 'streets' layer has a field called 'name')." },
"examples": [ { "expression": "is_selected( 'streets', get_feature('streets', 'name', \"street_name\"))", "returns": "True if the current building's street is selected (assuming the building layer has a field named 'street_name' and the 'streets' layer has a field called 'name' with unique values)." },
{ "expression": "is_selected( 'streets', get_feature_by_id('streets', 1))", "returns": "True if the feature with the id 1 on the \"streets\" layer is selected." }
]
}

0 comments on commit fccfac8

Please sign in to comment.
You can’t perform that action at this time.