# react-google-static

> 🌍 React Google Static Maps

Latest version **0.1.3** (published 2021-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-google-static
pnpm add react-google-static
yarn add react-google-static
bun add react-google-static
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2021-08-23 |
| First published | 2020-01-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Leonardo Maldonado |
| Maintainers | leonardomso |

## Links

- npm: https://www.npmjs.com/package/react-google-static
- npm.io page: https://npm.io/package/react-google-static

## Recent versions

- 0.1.3 (latest) — 2021-08-23
- 0.1.2 — 2020-11-20
- 0.1.1 — 2020-01-14
- 0.1.0 — 2020-01-14

## README

<h1 align="center">
   🌍 React Google Static Maps
</h1>

[![Actions Status](https://github.com/leonardomso/react-google-static/workflows/CI/badge.svg)](https://github.com/leonardomso/react-google-static/actions)
[![LICENSE MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/leonardomso/react-google-static)
[![npm version](https://badge.fury.io/js/react-google-static.svg)](https://badge.fury.io/js/react-google-static)

A React component wrapper to use the Google Static Maps API. Don't forget that to use this API you must have a billing account and an Static Maps API key. 

This library supports custom markers. To use a custom icon, you should provide a url link, for example: `https://img.icons8.com/dusk/64/000000/marker.png`.
  

## Installation

```
npm install react-google-static
```

```
yarn add react-google-static
```

## Usage

```jsx
import React from 'react';
import GoogleStaticMap from 'react-google-static';

const App = () => (
  <div>
    <h1>Google Static Maps API</h1>

    <GoogleStaticMap
      apiKey={API_KEY}
      latitude={32.064171}
      longitude={34.7748068}
      style={{ width: 200, height: 200 }}
      size={{ width: 200, height: 200 }}
      zoom={16}
    />
  </div>
);

export default App;
```

## Usage with Custom Icon

```jsx
import React from 'react';
import GoogleStaticMap from 'react-google-static';

const App = () => (
  <div>
    <h1>Google Static Maps API</h1>

    <GoogleStaticMap
      apiKey={API_KEY}
      latitude={32.064171}
      longitude={34.7748068}
      style={{ width: 200, height: 200 }}
      size={{ width: 200, height: 200 }}
      zoom={16}
      iconUrl="https://img.icons8.com/dusk/64/000000/marker.png"
    />
  </div>
);

export default App;
```


## Props

<table>
  <tr>
    <th>Name</th>
    <th>Type</th>
    <th>Required</th>
  </tr>
  <tr>
    <td><code>apiKey</code></td>
    <td><code>Boolean</code></td>
    <td><code>true</code></td>
  </tr>
  <tr>
    <td><code>latitude</code></td>
    <td><code>string | number</code></td>
    <td><code>true</code></td>
  </tr>
    <tr>
    <td><code>longitude</code></td>
    <td><code>string | number</code></td>
    <td><code>true</code></td>
  </tr>
   <tr>
    <td><code>size</code></td>
    <td><code>Object</code></td>
    <td><code>true</code></td>
  </tr>
   <tr>
    <td><code>zoom</code></td>
    <td><code>number</code></td>
    <td><code>true</code></td>
  </tr>
  <tr>
    <td><code>scale</code></td>
    <td><code>number</code></td>
    <td><code>false</code></td>
  </tr>
  <tr>
    <td><code>mapFormat</code></td>
    <td><code>'png'  |  'png32'  |  'gif'  |  'jpg'  |  'jpg-baseline'</code></td>
    <td><code>false</code></td>
  </tr>
   <tr>
    <td><code>mapType</code></td>
    <td><code>'roadmap'  |  'satellite'  |  'terrain'  |  'hybrid'</code></td>
    <td><code>false</code></td>
  </tr>
  <tr>
    <td><code>iconUrl</code></td>
    <td><code>string</code></td>
    <td><code>false</code></td>
  </tr>
  <tr>
    <td><code>style</code></td>
    <td><code>any</code></td>
    <td><code>false</code></td>
  </tr>
</table>

---
_Source: https://npm.io/package/react-google-static · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
