react-google-maps-api icon indicating copy to clipboard operation
react-google-maps-api copied to clipboard

For collaborators: There is currently only several main components refactored to new React APIs

Open JustFly1984 opened this issue 8 years ago • 15 comments

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.

JustFly1984 avatar Nov 28 '18 05:11 JustFly1984

@urikphytech welcome onboard

JustFly1984 avatar Nov 28 '18 05:11 JustFly1984

@JustFly1984 Thanks! I prefer using my personal account for OSS. Can you invite @uriklar to be a collaborator instead of this account? Thanks!

urikphytech avatar Nov 28 '18 06:11 urikphytech

@uriklar done

JustFly1984 avatar Nov 28 '18 07:11 JustFly1984

@uriklar so in this case just don't commit your google API key), and lets coordinate features we are working on.

JustFly1984 avatar Nov 28 '18 07:11 JustFly1984

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...

uriklar avatar Nov 28 '18 07:11 uriklar

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

JustFly1984 avatar Nov 28 '18 07:11 JustFly1984

Now I will continue with OverlayView DirectionsRenderer FusionTablesLayer KmlLayer

JustFly1984 avatar Nov 28 '18 07:11 JustFly1984

Ok, so i'll take shape components: Polyline Polygon Rectangle Circle

uriklar avatar Nov 28 '18 07:11 uriklar

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 avatar Nov 28 '18 07:11 JustFly1984

@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.

uriklar avatar Nov 28 '18 07:11 uriklar

@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?

uriklar avatar Nov 28 '18 07:11 uriklar

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.

JustFly1984 avatar Nov 28 '18 07:11 JustFly1984

@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.

JustFly1984 avatar Nov 28 '18 08:11 JustFly1984

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

JustFly1984 avatar Nov 28 '18 08:11 JustFly1984

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?

JustFly1984 avatar Dec 10 '18 05:12 JustFly1984