-
Notifications
You must be signed in to change notification settings - Fork 11
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
Printable reports (and other miscellany) #56
Conversation
@mojodna this is looking great! thanks for the work on this. Some comments:
|
I was noticing that. Making them all the same color seems to resolve that (so it may be the result of "missing" markers, which could be causing other data to be missing elsewhere). Thoughts on how to force them to all be the same color / why it's not filtering on https://github.com/digidem/mapfilter/pull/56/files#diff-83418c5c1bc6a57e2dad4fbf90122b1fR69 |
It's not the map, fortunately. Something is triggering aggressive re-rendering that I need to track down. |
}) | ||
} | ||
|
||
const geojson = getMapGeoJSON(assign({}, state, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be causing re-rendering. getMapGeoJSON is a memoized function. but the argument is different on every call, so geojson will be different, so redux, which does a shallow compare on shallow compare to stop re-rendering, will continually rerender.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I suspected; I'm refactoring that now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most efficient approach I think is to pass the map the entire geojson file along with the filter, and let Mapbox-gl-js handle the filtering internally, and then for the features have that separate, pre-filtered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushing the filtering back into the MapView fixed the memoization and coloring, but at the expense of losing the labels (since they're no longer the first n features)...
I’ll have a look at the icons / coloring a bit later this afternoon (have some calls first). The coloring was always a little fragile. Mapbox-gl-js wants icons as PNGs, and rendering them as SVG would be a performance hit. We're waiting on mapbox/mapbox-gl-js#2059 to land to be able to dynamically add icons and not have a dependency on a specific mapbox style that needs to be kept in sync with the color list. Anyway, I'll investigate because I remember some of the hackiness to make this work. |
I'm spinning my wheels pretty hard on reintroducing labeling. The fundamental problem is that Passing At one point I was adding labels to both |
Dropped some flexbox-ness from MapView and FeatureModal to simplify re-use.
This seems to be stale! |
This implements the "report" page along with print CSS for it, re-using the existing
MapView
andFeatureModal
components (with some necessary modifications).When 62 or fewer (
[A-z0-9]
) features are displayed, their markers are labeled on the map and associated with the marker icon on their individual page.Filters are also persisted in the URL and are retained when switching tabs.
This also throws in a
.nvmrc
(for node-6.x) and an ESLint config (I use it with Atom).