# react-neshan-map-leaflet

> ⚛️ React component for 🍃 Neshan Leaflet map.

Latest version **1.2.1** (published 2021-06-22) · 0 weekly downloads

## Install

```sh
npm install react-neshan-map-leaflet
pnpm add react-neshan-map-leaflet
yarn add react-neshan-map-leaflet
bun add react-neshan-map-leaflet
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2021-06-22 |
| First published | 2020-08-28 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 33.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | seyfollahi |

## Links

- npm: https://www.npmjs.com/package/react-neshan-map-leaflet
- npm.io page: https://npm.io/package/react-neshan-map-leaflet

## Dependencies (7)

- [react](https://npm.io/package/react.md) ^17.0.2
- [react-dom](https://npm.io/package/react-dom.md) ^17.0.2
- [web-vitals](https://npm.io/package/web-vitals.md) ^1.1.1
- [react-scripts](https://npm.io/package/react-scripts.md) 4.0.3
- [@testing-library/react](https://npm.io/package/@testing-library/react.md) ^11.2.6
- [@testing-library/jest-dom](https://npm.io/package/@testing-library/jest-dom.md) ^5.11.10
- [@testing-library/user-event](https://npm.io/package/@testing-library/user-event.md) ^12.8.3

## Recent versions

- 1.2.1 (latest) — 2021-06-22
- 1.2.0 — 2021-06-14
- 1.1.3 — 2021-06-14
- 1.1.2 — 2021-06-14
- 1.1.1 — 2021-04-11
- 1.1.0 — 2021-04-11
- 1.0.11 — 2021-04-11
- 1.0.10 — 2021-04-11
- 1.0.9 — 2021-04-11
- 1.0.8 — 2021-04-11
- 1.0.7 — 2021-04-11
- 1.0.6 — 2021-04-11
- 1.0.5 — 2021-04-11
- 1.0.4 — 2021-02-21
- 1.0.3 — 2020-11-03
- … 3 more at https://npm.io/package/react-neshan-map-leaflet/versions

## README

# ⚛️ React component for 🍃 Neshan Leaflet map.

## Getting started

In the simple case you just need to add `options` prop to `NeshanMap` component.


```javascript
import React from 'react';
import NeshanMap from 'react-neshan-map-leaflet'

function SimpleMap() {
  return (
    <NeshanMap
      options={{
        key: 'YOUR_API_KEY',
        center: [35.699739, 51.338097],
        zoom: 13
      }}
    />
  );
}

export default SimpleMap;

```

## Installation

npm:
```
npm install react-neshan-map-leaflet
```

## Features

### Neshan Maps API Loads on Demand

There is no need to place a `<script src=` tag at top of page. The Neshan Maps API loads upon the first usage of the `NeshanMap` component.

### Use Laflet Maps API 

You can access to Leaflet Maps `L` , `map`  objects by using `onInit`.

```javascript
...
<NeshanMap
  options={{
    key: 'YOUR_API_KEY',
    maptype: 'dreamy',
    poi: true,
    traffic: false,
    center: [35.699739, 51.338097],
    zoom: 13
  }}

  onInit={(L, myMap) => {
    let marker = L.marker([35.699739, 51.338097])
      .addTo(myMap)
      .bindPopup('I am a popup.');

    myMap.on('click', function (e) {
      marker.setLatLng(e.latlng)
    });

    L.circle([35.699739, 51.348097], {
      color: 'red',
      fillColor: '#f03',
      fillOpacity: 0.5,
      radius: 500
    }).addTo(myMap);
  }}
/>

```

[Example here](https://github.com/AliSeyfollahi/react-neshan-map-leaflet/blob/master/src/index.js#L8)

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