# strapi-plugin-google-map-picker

> Strapi maintained Custom Fields

Latest version **1.0.8** (published 2023-01-24) · SEE LICENSE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install strapi-plugin-google-map-picker
pnpm add strapi-plugin-google-map-picker
yarn add strapi-plugin-google-map-picker
bun add strapi-plugin-google-map-picker
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2023-01-24 |
| First published | 2023-01-23 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=14.19.1 <=18.x.x |
| Dependencies | 2 |
| Unpacked size | 2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Yuriy Repin |
| Maintainers | spals |

## Links

- npm: https://www.npmjs.com/package/strapi-plugin-google-map-picker
- Repository: https://github.com/spalz/strapi-plugin-google-map-picker
- npm.io page: https://npm.io/package/strapi-plugin-google-map-picker

## Dependencies (2)

- [immer](https://npm.io/package/immer.md) ^9.0.18
- [@react-google-maps/api](https://npm.io/package/@react-google-maps/api.md) ^2.13.1

## Recent versions

- 1.0.8 (latest) — 2023-01-24
- 1.0.7 — 2023-01-24
- 1.0.6 — 2023-01-24
- 1.0.5 — 2023-01-23
- 1.0.4 — 2023-01-23
- 1.0.2 — 2023-01-23
- 1.0.1 — 2023-01-23
- 1.0.0 — 2023-01-23

## README

<div align="center">
  <img src="assets/logo.svg" alt="Logo - google map picker" />
</div>
<div align="center">
  <h1>Strapi v4 - google map picker</h1>
  <p>A simple plugin to add a point to the map, with the <a href="https://github.com/JustFly1984/react-google-maps-api">@react-google-maps/api
</a> package</p>
</div>

<img src="assets/banner.jpg" alt="Logo - google map picker" />

---

## 🗿 How to install

```javascript
# yarn
yarn add strapi-plugin-google-map-picker

# npm
npm i strapi-plugin-google-map-picker
```

## 🔧 Configuration

#### 1. Add plugin in plugins.js
```javascript
// config/plugins.js
...
...
"google-map-picker": {
    config: {
    apiKey: env("GOOGLE_PUBLIC_KEY"), // required
    default_center: { lat: 54.106438, lng: 11.556940 }, // required
    favorites_places: [
        {
        title: "Berlin",
        coordinates: { lat: 52.518536, lng: 52.518536 },
        },
        {
        title: "Zurich",
        coordinates: { lat: 47.384168, lng: 8.526831 },
        },
        {
        title: "Oslo",
        coordinates: { lat: 59.911002, lng: 10.756167},
        },
    ],
    },
},
...
...
```
#### 2. Add "strapi::security" in middlewares.js
```javascript
// config/middlewares.ts
...
...
'strapi::errors',
{
  name: "strapi::security",
  config: {
  contentSecurityPolicy: {
    directives: {
      "script-src": ["'self'", "maps.googleapis.com", "maps.gstatic.com"],
      "img-src": ["'self'", "data:", "maps.googleapis.com", "maps.gstatic.com"],
    },
  },
  },
},
'strapi::cors',
...
...
```

#### 3. Add custom field

<img src="assets/instruction.gif" alt="Logo - google map picker" />

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