# @pluginjs/map-picker

> A flexible modern map-picker js plugin.

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

## Install

```sh
npm install @pluginjs/map-picker
pnpm add @pluginjs/map-picker
yarn add @pluginjs/map-picker
bun add @pluginjs/map-picker
```

## 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.16 |
| 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 | 13 |
| Unpacked size | 159.2 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/map-picker
- 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/map-picker

## Dependencies (13)

- [@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/gmap](https://npm.io/package/@pluginjs/gmap.md) ^0.8.11
- [@pluginjs/utils](https://npm.io/package/@pluginjs/utils.md) ^0.8.10
- [@pluginjs/events](https://npm.io/package/@pluginjs/events.md) ^0.8.11
- [@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/dropdown](https://npm.io/package/@pluginjs/dropdown.md) ^0.8.16
- [@pluginjs/template](https://npm.io/package/@pluginjs/template.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
- [@pluginjs/pop-dialog](https://npm.io/package/@pluginjs/pop-dialog.md) ^0.8.12
- [@pluginjs/place-complete](https://npm.io/package/@pluginjs/place-complete.md) ^0.8.16

## Recent versions

- 0.8.16 (latest) — 2022-08-29
- 0.8.15 — 2022-01-08
- 0.8.11 — 2021-03-25
- 0.8.10 — 2021-03-01
- 0.8.9 — 2020-08-27
- 0.8.8 — 2020-07-11
- 0.8.7 — 2020-03-12
- 0.8.6 — 2020-03-10
- 0.8.5 — 2020-03-04
- 0.8.4 — 2020-03-02
- 0.8.3 — 2020-02-11
- 0.8.2 — 2020-02-11
- 0.7.33 — 2020-02-06
- 0.7.31 — 2019-12-17
- 0.7.30 — 2019-12-16
- … 53 more at https://npm.io/package/@pluginjs/map-picker/versions

## README

# MapPicker

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

A flexible modern map-picker js plugin.

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

## Introduction
### Installation

#### Yarn

```javascript
yarn add @pluginjs/map-picker
```

#### NPM

```javascript
npm i @pluginjs/map-picker
```

## Getting Started

**CDN:**

Development:

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

Production:

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

### Initialize

HTML:

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

ECMAScript Module:

```javascript
import MapPicker from "@pluginjs/map-picker"
import "@pluginjs/map-picker/dist/map-picker.css"

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

CommonJS:

```javascript
require("@pluginjs/map-picker/dist/map-picker.css")
const MapPicker = require("@pluginjs/map-picker")

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

Browser:

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

## API

### Options

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

Name | Description | Default
--|--|--
`"theme"` | Set plugin theme option | `null`
`"locale"` | Set locale environment | `en`
`"localeFallbacks"` | Set the plugin is localeFallbacks or not | `true`
`"icon"` | Set default icon | `pj-icon pj-icon-map-pin`
`"disabled"` | Disabled plugin | `false`
`"place"` | Set place | `null`
`"latlng"` | Set latlng | `{}`
`"showLatlng"` | Set the plugin is showLatlng or not | `true`
`"gmapOptions"` | Set gmapOptions | `{"apiKey":"AIzaSyDSx-q31rWQKqLwUahg6TrZ3R_5NT0LhFE","mapTypeControl":false,"zoomControl":true,"zoom":12,"libraries":"places"}`
`"markerOptions"` | Set markerOptions | `{"draggable":true}`
`"templates"` | Set default templates | `{}`
`"parse"` | The type of JSON change the type of object | `function() {...}`
`"process"` | The type of object change the type of JSON | `function() {...}`

### Events

Events are called on mapPicker instances through the mapPicker 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 mapPicker instances through the mapPicker method itself.
You can also save the instances to variable for further use.

Name | Description
--|--
`"set"` | Set value by key
`"get"` | Get value by key
`"val"` | Set or get value by key
`"enable"` | Enabled plugin if plugin is disabled
`"disable"` | Disable plugin
`"destroy"` | Destroy plugin

### Classes

Name | Description | Default
--||
`"NAMESPACE"` | Declare plugin namespace | `pj-mapPicker`
`"THEME"` | Declare plugin theme | `{namespace}--{theme}`
`"MAP"` | Declare plugin map | `{namespace}-map`
`"INFO"` | Declare plugin info | `{namespace}-info`
`"INIT"` | Declare plugin init | `{namespace}-init`
`"FILL"` | Declare plugin fill | `{namespace}-fill`
`"HOVER"` | Announce plugin is hover | `{namespace}-hover`
`"REMOVEANIMATE"` | Announce plugin is removeanimate | `{namespace}-remove-animate`
`"PREVIEW"` | Announce plugin is preview | `{namespace}-preview`
`"PREVIEWACTION"` | Announce plugin is previewaction | `{namespace}-preview-action`
`"PREVIEWCONTENT"` | Announce plugin is previewcontent | `{namespace}-preview-content`
`"PREVIEWNAME"` | Announce plugin is previewname | `{namespace}-preview-name`
`"PREVIEWCOORD"` | Announce plugin is previewcoord | `{namespace}-preview-coord`
`"EDIT"` | Announce plugin is edit | `{namespace}-edit`
`"REMOVE"` | Announce plugin is remove | `{namespace}-remove`
`"ICON"` | Announce plugin is icon | `{namespace}-icon`
`"PANEL"` | Announce plugin is panel | `{namespace}-panel`
`"CONTENT"` | Announce plugin is content | `{namespace}-panel-content`
`"ITEM"` | Announce plugin is item | `{namespace}-item`
`"ITEMTITLE"` | Announce plugin is itemitle | `{namespace}-item-title`
`"LAT"` | Announce plugin is lat | `{namespace}-lat`
`"LNG"` | Announce plugin is lng | `{namespace}-lng`
`"PLACE"` | Announce plugin is place | `{namespace}-place`
`"ACTION"` | Announce plugin is action | `{namespace}-action`
`"CANCEL"` | Announce plugin is cancel | `{namespace}-canel`
`"SAVE"` | Announce plugin is save | `{namespace}-save`
`"SHOW"` | Announce plugin is show | `{namespace}-show`
`"LOADING"` | Announce plugin is loading | `{namespace}-loading`
`"LOADINGWRAP"` | Announce plugin is loadingwrap | `{namespace}-loading-wrap`
`"DISABLED"` | Announce plugin is disabled | `{namespace}-disabled`

### Translations

Name | EN | ZH
--||-
`"cancel"` | Cancel | 取消
`"deleteTitle"` | Are you sure you want to delete? | 你确定要删除？
`"delete"` | Delete | 删除
`"addPlace"` | Add Places | 添加地址
`"save"` | Save | 保存
`"place"` | Places | 地址
`"latitude"` | Latitude | 纬度
`"longitude"` | Longitude | 经度

## 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/map-picker is Licensed under [the GPL-v3 license](LICENSE).

If you want to use @pluginjs/map-picker 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/map-picker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
