[Maps] Remove redundant .setData call (#40628) (#40677)

This commit is contained in:
Thomas Neirynck 2019-07-09 16:13:23 -04:00 committed by GitHub
parent c81132b5bf
commit 58a67b7e79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -524,18 +524,15 @@ export class VectorLayer extends AbstractLayer {
return;
}
if (featureCollection !== featureCollectionOnMap) {
mbGeoJSONSource.setData(featureCollection);
}
const hasGeoJsonProperties = this._style.setFeatureState(featureCollection, mbMap, this.getId());
// "feature-state" data expressions are not supported with layout properties.
// To work around this limitation,
// scaled layout properties (like icon-size) must fall back to geojson property values :(
if (hasGeoJsonProperties) {
const hasGeoJsonProperties = this._style.setFeatureState(featureCollection, mbMap, this.getId());
if (featureCollection !== featureCollectionOnMap || hasGeoJsonProperties) {
mbGeoJSONSource.setData(featureCollection);
}
}
_setMbPointsProperties(mbMap) {