setProperty
Sets the value of the feature's property with the given name.
const height = feature.getProperty('Height'); // e.g., the height of a building
Content copied to clipboard
const name = 'clicked';
if (feature.getProperty(name)) {
console.log('already clicked');
} else {
feature.setProperty(name, true);
console.log('first click');
}
Content copied to clipboard
Return
true
if the property was set, false
otherwise.
Parameters
name
The case-sensitive name of the property.
value
The value of the property that will be copied.