For collaborators: There is currently only several main components refactored to new React APIs
You can start with any of components which is commented out in index..js file
You need to run npm run watch in root, and npm start in /examples/react-google-map-api-gatsby/ to run example page. Please add new examples only in /examples/react-google-map-api-gatsby/src/pages/index.js file. I'm planning to add documentation in the same gatsby example.
@urikphytech welcome onboard
@JustFly1984 Thanks! I prefer using my personal account for OSS. Can you invite @uriklar to be a collaborator instead of this account? Thanks!
@uriklar done
@uriklar so in this case just don't commit your google API key), and lets coordinate features we are working on.
Thanks! @JustFly1984 I sent you an invite on google hangouts. We can chat there. I'd be happy to have a chat about roadmap, open issues etc...
There is components left to refactor to new API
LoadScript - done GoogleMapProvider - done GoogleMap -done TrafficLayer - done BicyclingLayer - almost done, there is a bug, which errors out onload.
Circle - not done Marker - not done Polyline - not done Polygon - not done Rectangle - not done InfoWindow - not done OverlayView - not done DirectionsRenderer - not done FusionTablesLayer - not done KmlLayer - not done StreetViewPanorama - not done
Now I will continue with OverlayView DirectionsRenderer FusionTablesLayer KmlLayer
Ok, so i'll take shape components: Polyline Polygon Rectangle Circle
Thanx Them you do examples, just add one more < GoogleMapProvider /> to index.js, and you can comment out first 2 temporary, so it does not heat up your CPU
@JustFly1984 I see that you're creating the google maps instances in the constructor. This will create a bug when using StrictMode (and later on ConcurrentMode)
See this issue I opened on react-google-maps, it's explained in details there by alexrussel:
https://github.com/tomchentw/react-google-maps/issues/921
The solution is to create the component instance in cDM. The downside of this is that you then have to call setState in cDM... Maybe you can think of a better solution for this.
@JustFly1984 also, can you give me a brief explanation as to why you are using the prevProps in derived state? What use case does it solve for you?
I've tried to work on top of what we had in original react-google-maps, and
there was a lot of componentWillMount and componentWillUpdate, which is
deprecated, what is I decide to refactor it to gDSFP. It is not possible to
use this, nor context in gDSFP, and the only way is return the state, so
I did exactly that.
I'm reading your tomchentw/react-google-maps#921 and will comment on that shortly later.
@uriklar Ok, so I've read all of this) and here is my thoughts - lets finish up current implementation first, And after that you can create separate example with StrictMode and test it out. Currently I have made a lot of changes to original API, so it could fix itself, or not. I'm pretty sure I'll find the way to handle this issue.
A little off topic: What do you think about switching the bundler from webpack to rollup? if there any benefits? I want to support as many platforms as possible
Current progress:
LoadScript - done GoogleMap -done TrafficLayer - done BicyclingLayer - done
Circle - done Marker - add support for MarkerCluster Polyline - done Polygon - done Rectangle - done InfoWindow - done OverlayView - done DirectionsRenderer - done FusionTablesLayer - not done KmlLayer - ? StreetViewPanorama - not done
addons: do we really need it?