# @pluginjs/gmap

> A flexible modern gmap js plugin.

Latest version **0.8.11** (published 2022-08-29) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install @pluginjs/gmap
pnpm add @pluginjs/gmap
yarn add @pluginjs/gmap
bun add @pluginjs/gmap
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.11 |
| Published | 2022-08-29 |
| First published | 2017-12-26 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 8 |
| Dependencies | 6 |
| Unpacked size | 71.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Creation Studio Limited |
| Maintainers | thecreation, kaptinlin |

## Links

- npm: https://www.npmjs.com/package/@pluginjs/gmap
- Repository: https://github.com/pluginjs/pluginjs
- Homepage: https://pluginjs.com
- Issues: https://github.com/pluginjs/pluginjs/issues
- npm.io page: https://npm.io/package/@pluginjs/gmap

## Dependencies (6)

- [@pluginjs/is](https://npm.io/package/@pluginjs/is.md) ^0.8.9
- [@pluginjs/dom](https://npm.io/package/@pluginjs/dom.md) ^0.8.10
- [@pluginjs/classes](https://npm.io/package/@pluginjs/classes.md) ^0.8.10
- [@pluginjs/factory](https://npm.io/package/@pluginjs/factory.md) ^0.8.10
- [@pluginjs/component](https://npm.io/package/@pluginjs/component.md) ^0.8.9
- [@pluginjs/decorator](https://npm.io/package/@pluginjs/decorator.md) ^0.8.11

## Recent versions

- 0.8.11 (latest) — 2022-08-29
- 0.8.10 — 2022-01-08
- 0.8.9 — 2021-09-26
- 0.8.8 — 2021-07-01
- 0.8.7 — 2021-03-25
- 0.8.6 — 2021-03-01
- 0.8.5 — 2020-08-27
- 0.8.4 — 2020-07-11
- 0.8.3 — 2020-02-11
- 0.8.2 — 2020-02-11
- 0.7.21 — 2020-01-15
- 0.7.20 — 2019-12-17
- 0.7.19 — 2019-12-16
- 0.7.18 — 2019-09-20
- 0.7.17 — 2019-08-06
- … 40 more at https://npm.io/package/@pluginjs/gmap/versions

## README

# Gmap

[![npm package](https://img.shields.io/npm/v/@pluginjs/gmap.svg)](https://www.npmjs.com/package/@pluginjs/gmap)

A flexible modern gmap js plugin.

**[Samples](https://codesandbox.io/s/github/pluginjs/pluginjs/tree/master/modules/gmap/samples)**

## Introduction
### Installation

#### Yarn

```javascript
yarn add @pluginjs/gmap
```

#### NPM

```javascript
npm i @pluginjs/gmap
```

## Getting Started

**CDN:**

Development:

```html
<script src="https://unpkg.com/@pluginjs/gmap/dist/gmap.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/gmap/dist/gmap.css">
```

Production:

```html
<script src="https://unpkg.com/@pluginjs/gmap/dist/gmap.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/gmap/dist/gmap.min.css">
```

### Initialize

HTML:

```html
<div class="element"></div>
```

ECMAScript Module:

```javascript
import Gmap from "@pluginjs/gmap"
import "@pluginjs/gmap/dist/gmap.css"

Gmap.of(document.querySelector('.element'), options)
```

CommonJS:

```javascript
require("@pluginjs/gmap/dist/gmap.css")
const Gmap = require("@pluginjs/gmap")

Gmap.of(document.querySelector('.element'), options)
```

Browser:

```html
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/gmap/dist/gmap.css">
<script src="https://unpkg.com/@pluginjs/gmap/dist/gmap.js"></script>
<script>
  Pj.gmap('.element', options)
</script>
```

## API

### Options

Options are called on gmap instances through the gmap options itself.
You can also save the instances to variable for further use.

Name | Description | Default
--|--|--
`"theme"` | Set plugin theme option | `null`
`"apiKey"` | Set apiKey | ``
`"mapType"` | Set mapType | `ROADMAP`
`"backgroundColor"` | Set background color | `#e5e3df`
`"defaultUI"` | Set default UI | `true`
`"doubleClickZoom"` | Set double click zoom | `false`
`"mapTypeControl"` | Set mapTypeControl | `true`
`"maxZoom"` | Set maxZoom | `null`
`"minZoom"` | Set maxZoom | `null`
`"panControl"` | Set panControl | `false`
`"rotateControl"` | Set rotateControl | `false`
`"scaleControl"` | Set scaleControl | `false`
`"scrollwheel"` | Set scrollwheel | `false`
`"streetViewControl"` | Set streetViewControl | `false`
`"styles"` | Set styles | `false`
`"zoom"` | Set zoom | `3`
`"zoomControl"` | Set zoomControl | `true`
`"controlsPositions"` | Set controlsPositions | `{"mapType":null,"pan":null,"rotate":null,"scale":null,"streetView":null,"zoom":null}`
`"latitude"` | Set latitude | `null`
`"longitude"` | Set longitude | `null`
`"address"` | Set address | ``
`"markers"` | Set markers | `[]`
`"icon"` | Set default icon | `{"url":"http://www.google.com/mapfiles/marker.png","size":[20,34],"anchor":[9,34]}`
`"marker"` | Set marker | `true`
`"content"` | Set content | ``
`"popup"` | Set poup | `true`
`"libraries"` | Set libraries | `null`
`"onInit"` | Set onInit | `null`
`"onReady"` | Set onReady | `null`

### Events

Events are called on gmap instances through the gmap events itself.
You can also save the instances to variable for further use.

Name | Description
--|--
`"ready"` | Gets fired when plugin has ready
`"enable"` | Gets fired when plugin has enabled
`"disable"` | Gets fired when plugin has disabled
`"destroy"` | Gets fired when plugin has destroy

### Methods

Methods are called on gmap instances through the gmap method itself.
You can also save the instances to variable for further use.

Name | Description
--|--
`"enable"` | Enabled plugin if plugin is disabled
`"disable"` | Disable plugin
`"destroy"` | Destroy plugin
`"addMarker"` | Destroy plugin
`"addMarkers"` | Add value of addMarkers
`"removerMarker"` | Remove value of removerMarker
`"clearMarkers"` | Clear value of markers

### Classes

Name | Description | Default
--||
`"NAMESPACE"` | Declare plugin namespace | `as-gmap`
`"THEME"` | Declare plugin theme | `{namespace}--{theme}`
`"ELEMENT"` | Declare plugin element | `{namespace}`
`"CONTENT"` | Declare plugin content | `{namespace}-content`

## Browser support

Tested on all major browsers.

| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera |
| --------- | --------- | --------- | --------- | --------- |
| IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions|

## License

@pluginjs/gmap is Licensed under [the GPL-v3 license](LICENSE).

If you want to use @pluginjs/gmap project to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary.

For purchase an Commercial License, contact us purchase@thecreation.co.

## Copyright

Copyright (C) 2022 [Creation Studio Limited](creationstudio.com).

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