npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

rgm

v0.1.3

Published

Tiny but very powerful React Google Map

Downloads

804

Readme

RGM

Tiny 1kb less but very powerful React Google Map.

It allows you to render any React component on the Google Map, and provides easy access to native google map api.

examples, examples source

Example

import { Map, Overlay, Marker } from 'rgm';
...

<Map api={api} options={MAP_OPTIONS}>
  <Overlay debug={debug}>
    <Marker lat={lat} lng={lng}>
      <ReactComponent />
    </Marker>
  </Overlay>
</Map>

Install

yarn add rgm
# or
npm install rgm

API

Map

Draws google map.

properties:

  • api non nullable value of window.google.maps

  • options see MapOptions or (elt:HTMLDivElement) => MapOptions where elt is map holder element.

  • ref exposes instance of google.maps.Map

Overlay

Creates overlay to place React components inside.

properties:

  • debug to control React component placements in dev mode see example

Marker

Wrapper around your component to pass lat, lng into Overlay in a type safe way without touching props of your component.

properties:

  • lat latitude
  • lng longitude

useMap

hook to get access to instances of google.maps.Map and window.google.maps.

returns:

  • { api, map } object, where api is equal to window.google.maps and map is instance of google.maps.Map

Types

Flowtype, Typescript.

For typescript usage you probably need to add @types/googlemaps into your project.

Contribute

Get your api key at Google

Then start dev environment.

GOOGLE_API_KEY=<YOUR GOOGLE API KEY> yarn dev

Why

Why another library having that one of current library authors is also creator of google-map-react

React map libraries along with the ability to draw react on a map are also trying to provide access to google map via declarative API. It needs a lot of hacks, code and opinionated decisions.

We created a library with ability to draw react components on a map providing minimal subset of properties needed to use native api or create any additional declarative api.

Soon will be 1 year as we are happy with it. Small amount of code makes it easy to support and extend.