setProperty
Sets the value of the feature's property with the given name.
If a property with the given name doesn't exist, it is created.
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
Parameters
name
The case-sensitive name of the property.
value
The value of the property that will be copied.