Assign the cluster id to the returned GeoJSON Feature.id property - #94
Merged
Conversation
mourner
requested changes
Jul 4, 2018
mourner
left a comment
Member
There was a problem hiding this comment.
Let's just add the id all the time. We don't benefit much from having this as an option.
mourner
requested changes
Jul 9, 2018
| }); | ||
| tags: c.numPoints ? getClusterProperties(c) : this.points[c.index].properties | ||
| }; | ||
| if (c.id) { |
Member
There was a problem hiding this comment.
id can be 0 so let's do a !== undefined guard here.
| zoom: Infinity, // the last zoom the point was processed at | ||
| id: id, // index of the source feature in the original input array | ||
| index: id, // index of the source feature in the original input array, | ||
| id: p.id, // id of the source feature |
Member
There was a problem hiding this comment.
We don't have to store original feature ids in the cluster objects because we can trace them back from original features (i.e. points[p.index].id).
asheemmamoowala
force-pushed
the
88-cluster-feature-id
branch
from
July 10, 2018 18:28
019d611 to
abdaf84
Compare
This was referenced Jul 10, 2018
Closed
mourner
approved these changes
Jul 23, 2018
mourner
left a comment
Member
There was a problem hiding this comment.
Looks good, pending an id=0 fix.
| tags: c.numPoints ? getClusterProperties(c) : this.points[c.index].properties | ||
| }; | ||
| const id = c.numPoints ? c.id : this.points[c.index].id; | ||
| if (id) { |
Member
There was a problem hiding this comment.
id !== undefined to support id 0
…uster leaf features
asheemmamoowala
force-pushed
the
88-cluster-feature-id
branch
from
July 23, 2018 17:09
abdaf84 to
f9380e9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #88.
cc @mourner @ryanbaumann