Added support for multipoint features#151
Open
super-bock wants to merge 11 commits intomapbox:mainfrom
super-bock:master
Open
Added support for multipoint features#151super-bock wants to merge 11 commits intomapbox:mainfrom super-bock:master
super-bock wants to merge 11 commits intomapbox:mainfrom
super-bock:master
Conversation
multiToSingles(multiPointFeature) returns a copy of the original multipoint feature for each point in it, replacing values of coordinates and geometry type with the values of the single point geometry
mourner
requested changes
Jun 2, 2020
Member
mourner
left a comment
There was a problem hiding this comment.
Apologies for a delay in reviewing this — left a comment.
| featureTemplate.geometry.coordinates = newCoordinates; | ||
| featureTemplate.geometry.type = 'Point'; | ||
| newFeatures.push(featureTemplate); | ||
| } |
Member
There was a problem hiding this comment.
This won't work because JavaScript passes objects by references, so you'll end up with an array of features with exactly the same feature. Additionally, multiPointFeature.properties is an array so [i] shouldn't be there.
Fixed function multiToSingles
|
I have the same need to support MultiPoint. @mourner the last version of this PR is not acceptable for you ? In the opposite case I can make a new PR to fix it. |
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.
multiToSingles(multiPointFeature) returns a single point feature for each point in the multipoint input feature