I have a map that relates to a table. When the user selects a table row, I would like to highlight the corresponding map feature. This is the only way I found to do it:
const siteGeoJSON = SitesToGeoJSON(sites, activeId); const newSource = new carto.source.GeoJSON(siteGeoJSON); siteLayer.update(newSource, siteViz);
What I'm doing here is regenerating the entire
GeoJSON object to set a single property indicating whether each feature is active or not, then digesting that into Carto anew. Features with the active property have a different symbol.
This probably isn't a very efficient way to do this, though. Is there any way to change feature properties without creating a new source?