简体   繁体   English

google-map-react 和 react-google-maps 的区别

[英]Difference between google-map-react and react-google-maps

There are two most popular react abstraction of google maps API( judging by the weekly npm downloads and github repo stars ).谷歌地图 API 有两种最流行的反应抽象(从每周 npm 下载量和 github repo 星数来看)。 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 .简而言之,使用google-map-reactreact-google-maps 的优缺点是什么。 I didn't find any comparison on the internet or SO.我没有在互联网或 SO 上找到任何比较。

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.小心, react-google-maps项目一年多没有维护,见https://github.com/tomchentw/react-google-maps/issues/986他们建议看@react-google-maps/api但是这是一个相当年轻的项目,在 GitHub 上还没有很多明星。 I personally like google-map-react which is still under (quite active) development.我个人喜欢google-map-react ,它仍在(相当活跃的)开发中。

I found the google-maps-react documentation a bit confusing because it utilizes a HOC, compose, to simplify the map.我发现 google-maps-react 文档有点令人困惑,因为它使用 HOC、compose 来简化地图。 For those new to React, it might be easier to start without compose.对于 React 新手来说,没有 compose 可能更容易上手。

react-google-maps, a package that essentially provides a React component wrapper for the Google Maps API. react-google-maps,一个本质上为 Google Maps API 提供 React 组件包装器的包。 react-google-maps allows users to use the full functionality of Google Maps Javascript API. react-google-maps 允许用户使用 Google Maps Javascript API 的全部功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM