Difference between google-map-react and react-google-maps

喜欢而已 提交于 2020-01-14 09:58:06

问题


There are two most popular react abstraction of google maps API(judging by the weekly npm downloads and github repo stars). For a beginner like me, it is very confusing as I am not able to decide what can these libraries bring to my project and what not by merely looking at the documentation?

In short what are the pros and cons of using google-map-react and react-google-maps. I didn't find any comparison on the internet or SO.


回答1:


Be carefull, react-google-maps project is unmaintained more than a year, see https://github.com/tomchentw/react-google-maps/issues/986 They suggest to look at @react-google-maps/api but it is quite a young project and doesn't have a lot of stars on GitHub yet. I personally like google-map-react which is still under (quite active) development.




回答2:


I found the google-maps-react documentation a bit confusing because it utilizes a HOC, compose, to simplify the map. For those new to React, it might be easier to start without compose.

react-google-maps, a package that essentially provides a React component wrapper for the Google Maps API. react-google-maps allows users to use the full functionality of Google Maps Javascript API.



来源:https://stackoverflow.com/questions/55468502/difference-between-google-map-react-and-react-google-maps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!