Skip to content

Component export#54

Merged
gmaclennan merged 6 commits intorewritefrom
component-export
Dec 9, 2016
Merged

Component export#54
gmaclennan merged 6 commits intorewritefrom
component-export

Conversation

@gmaclennan
Copy link
Member

@gmaclennan gmaclennan commented Dec 6, 2016

Export MapFilter as a React component, that can be imported and rendered.

Currently only expects one prop: features which should be an array of GeoJSON Point features.

See example/index.js for how to use. For now properties that are dates must be manually coerced to Date type.

Should merge #53 first

This is a little tricky because Mapbox filters do not work on arrays. Instead we flatten the array into:

arrayField.0: arrayValue0, arrayField.1: arrayValue1, arrayField.2: arrayValue2

Then pass the same filter to each of these and group with an ‘any’ filter.
This makes the whole thing self contained for export.
Only using woff for now, wouldn’t make sense to embed woff2 as well. Space difference is minor
@mojodna mojodna mentioned this pull request Dec 6, 2016
5 tasks
@gmaclennan gmaclennan merged commit 34b30e1 into rewrite Dec 9, 2016
@gmaclennan gmaclennan deleted the component-export branch December 9, 2016 21:02
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.

1 participant