Good Day
I already know about setAttribute, my question is how save the update so my attribute become available?
this.grabData().then(() => {
this.queryAllFeatures(this._layers[0]).then((features: Graphic[]) => {
features.forEach((feature, idx) => {
const matchedFeature = this.data.find(d => d.x === feature.attributes.x)
if (matchedFeature) {
const value1 =
matchedFeature?.box?.find(i => i.type === 'a').value ?? 0;
feature.setAttribute('someValue', Number(value1));
// Repeated X times
}
})
})
})
If I do this, and try to reference "someValue" I get an error that it doesn't exist, so I tried to use "applyEdits" to update the value:
this._layers[0].applyEdits({ updateFeatures: features })
.then((editsResult) => {
console.log('Edit Results');
console.log(editsResult);
})
.catch((error) => {
console.log("error = ", error);
});
Which works, but I still don't see my new attributes. Previous I was getting an error from applyEdits, but I resolved that problem!
Can anyone see what I'm doing wrong?
Thanks