Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stepankuzmin committed Jul 30, 2024
1 parent a5e4432 commit 4d22d34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
10 changes: 0 additions & 10 deletions src/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,6 @@ export default function render() {
features: store.sources.hot
});

if (store._addedFeaturesToEmit.length) {
const geojsonToEmit = store._addedFeaturesToEmit.map(feature => feature.toGeoJSON());

store._addedFeaturesToEmit = [];

store.ctx.map.fire(Constants.events.CREATE, {
features: geojsonToEmit
});
}

cleanup();

function cleanup() {
Expand Down
6 changes: 3 additions & 3 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ Store.prototype.add = function(feature, options = {}) {
this._featureIds.add(feature.id);

if (options.silent != null && options.silent === false) {
if (this._addedFeaturesToEmit.indexOf(this._features[feature.id]) === -1) {
this._addedFeaturesToEmit.push(this._features[feature.id]);
}
this.ctx.map.fire(Constants.events.CREATE, {
features: [this._features[feature.id].toGeoJSON()]
});
}

return this;
Expand Down

0 comments on commit 4d22d34

Please sign in to comment.