Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move featuresAt ref work out of the worker/featureTree, contained in style #939

Merged
merged 2 commits into from
Jan 19, 2015

Conversation

lbud
Copy link
Contributor

@lbud lbud commented Jan 16, 2015

This essentially reverts #901, moving the featuresAt refs work to be contained within the Style so the worker doesn't parse ref layers into the featureTree.

if (Object.keys(this.refs).length) features.forEach((feature) => {
if (this.refs[feature.layer.id] && this.refs[feature.layer.id].length) {
this.refs[feature.layer.id].forEach(refLayer => {
var copiedFeature = JSON.parse(JSON.stringify(feature));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfirebaugh is there a less ugly way to deep clone here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You only need a one level deep clone right? var copiedFeature = util.extend({}, feature).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks

mourner added a commit that referenced this pull request Jan 19, 2015
Move featuresAt ref work out of the worker/featureTree, contained in style
@mourner mourner merged commit c86058d into mb-pages Jan 19, 2015
@mourner mourner deleted the featuresAt-refs-redux branch January 19, 2015 12:09
@mourner
Copy link
Member

mourner commented Jan 19, 2015

Merging this now because of the performance regression in #901 (refs created duplicate buckets which increased tile parsing time 2x — water, buildings, etc.). This approach looks much better.

jfirebaugh added a commit that referenced this pull request Jan 21, 2015
This is a blend of #901 and #939.

The format for featuresAt results changed again. Instead of
result-per-geometry-cross-layer, each result has a `layers`
array with all layers that contain the feature. Thus avoiding
duplication of geometry and properties in the result set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants