React-mapbox-gl is now more than 1 year old, I think it is time to think about a new major version 2.0.0 and I am happy to have any opinion on what such a release could include, I spotted the following issues / improvements:
Feature draggable functionality: https://github.com/alex3165/react-mapbox-gl/issues/251GeoJsonLayer when updating map style: https://github.com/alex3165/react-mapbox-gl/issues/261How about viewport data structure as a way to set exact state of map and track map state?
const viewPort = {
lat: 1.111
lng: 1.111
zoom: 12
}
<Map viewPort={props.viewPort} onChange={(viewport) => { ... }} />
Just an idea for your consideration.
@stereobooster we would have an issue with the zoom, if the zoom of the map is being updated (when user zoom using his mouse) then when you re-render your map component the zoom value will default back to 12. That's why zoom is an array and the map component does a reference equality check for your zoom. If you break the reference it will update the zoom otherwise it won't.
Not sure I understood your point. If zoom updated its change will be cathed by onChange function, onchange function will store new state, new state will be passed to <Map>, map will be rendered with new state, which will have appropriate zoom value.
Expose css for import in webpack project instead of injecting in header. This way it will be minified e.g.
import from "react-mapbox-gl/css";
Pass pointerEvents: none to markers in examples (everywhere where zoom with scroll enabled)
@stereobooster Could you open an issue for the pointerEvents suggestion? For the css one I am not sure because then it would force everyone to have an extra step for using react-mapbox-gl, they will have to have a webpack css loader and explicitly import the css file, I want to keep things as simple as possible. Do you think of any downside by injecting the css as it is done right now?
I have released v2 under @next tag on npm, feel free to try out: npm i react-mapbox-gl@next, the API changed a bit, the new documentation is available here: https://github.com/alex3165/react-mapbox-gl/blob/v2.0.0/docs/API.md