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

lineEach returns LineString including properties, bbox & id #1010

Merged
merged 2 commits into from
Oct 11, 2017

Conversation

DenisCarriere
Copy link
Member

@DenisCarriere DenisCarriere commented Oct 10, 2017

lineEach callback => LineString including properties, bbox & id

Don't know if this was intentional, but the lineEach method was only returning coordinates of a lineString instead of the Feature<LineString>. Not returning the Feature makes it difficult to extract things like Properties/id/BBox of the given feature.

Example (once PR is merged)

const properties = {foo: 'bar'};
const bbox = [0, 0, 10, 10];
const id = 'foo';
const line = lineString([[0, 0], [10, 10]], properties, bbox, id);

meta.lineEach(line, currentLine => {
  //= currentLine.id => 'foo'
  //= currentLine.bbox => [0, 0, 10, 10]
  //= currentLine.properties => {foo: 'bar'}
});

CC: @rowanwins @stebogit

@DenisCarriere DenisCarriere added this to the 5.0.0 milestone Oct 10, 2017
@DenisCarriere DenisCarriere self-assigned this Oct 10, 2017
@DenisCarriere DenisCarriere merged commit 856a222 into master Oct 11, 2017
@DenisCarriere DenisCarriere deleted the lineEach-return-lineString branch October 11, 2017 03:53
@DenisCarriere DenisCarriere mentioned this pull request Nov 9, 2017
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant