Skip to content

Commit

Permalink
Add back removed logic copying feature properties for injected data p…
Browse files Browse the repository at this point in the history
…rior to modification
  • Loading branch information
Aaron Caldwell committed Oct 25, 2019
1 parent 467dfcc commit 07b71bc
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions x-pack/legacy/plugins/maps/public/layers/vector_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,21 @@ export class VectorLayer extends AbstractLayer {
if (!featureCollection) {
return null;
}
// Set default visible property on data
featureCollection.features.forEach(
feature => _.set(feature, `properties.${FEATURE_VISIBLE_PROPERTY_NAME}`, true)
);
return featureCollection;
const copiedPropsFeatures = featureCollection.features
.map(feature => ({
type: 'Feature',
geometry: feature.geometry,
properties: feature.properties
? {
...feature.properties,
[FEATURE_VISIBLE_PROPERTY_NAME]: true
}
: {}
}));
return {
type: 'FeatureCollection',
features: copiedPropsFeatures
};
}

getCustomIconAndTooltipContent() {
Expand Down

0 comments on commit 07b71bc

Please sign in to comment.