pieterv / react-googlemaps

A declarative React interface to Google Maps
MIT License
226 stars 68 forks source link

compare to tomchentw/react-google-maps #14

Closed razum2um closed 9 years ago

razum2um commented 9 years ago

There is another lib to get react & gmaps to play with each other https://github.com/tomchentw/react-google-maps

Could you describe the difference and suggest what to use and when

vid commented 9 years ago

I tried to use that other lib, but its examples aren't designed to be simple (they introduce unnecessary concepts), and it acts at a lower level basis, whereas from what I can tell react-googlemaps provides higher level components.

pieterv commented 9 years ago

I haven't personally used tomchentw/react-google-maps so can't provide a comparison but the intention of this projects API is to hide the implementation details of google maps entirely from you and provide a pure declarative API much like React does with the DOM.

rektide commented 9 years ago

tomchentw/react-google-maps#21 relates to extensive use of React context, which is a big no no and prevents multiple instances from working well together. Note how in the demos Marker isn't inside of Map, it's alongside it: it's using a singleton Map instance stuffed in context.

On the downside for react-googlemaps is that if you require() it from Node it'll throw. Neither module renders a map during renderToStaticMarkup, but react-googlemaps not even being requireable by Node is a bit frustrating.