open-index/open-npm huggingface dataset:
npm package: @neshan-maps-platform/react-openlayers
Description: A react map component wrapping neshan openlayers map.
Latest version: 3.0.5

<p align="center">
  <a href="https://platform.neshan.org">
    <img width="150" src="https://static.neshanmap.ir/content/places/assets/images/21.png">
  </a>
</p>

<h1 align="center">React Neshan Map Openlayers</h1>
<div align="center">
  An official React wrapper for neshan-map-openlayers library
</div>

## ⚙️ Before Install
You need a map key to use our map on your react web application.
You can signup and get a key from [Our Platfrom](https://platform.neshan.org/panel/api-key).
<br/>
For more information, visit our [doc page](https://platform.neshan.org/sdk/react-component#).


## 📦 Install

```bash
npm install @neshan-maps-platform/react-openlayers
npm install @neshan-maps-platform/ol
```

```bash
yarn add @neshan-maps-platform/react-openlayers
yarn add @neshan-maps-platform/ol
```


## 🔨 Usage

```jsx
import {useEffect, useRef} from "react"
import {Map} from "@neshan-maps-platform/ol"
import NeshanMap, {NeshanMapRef} from "@neshan-maps-platform/react-openlayers"

function App() {
    const mapRef = useRef<NeshanMapRef | null>(null)

    const onInit = (map: Map) => {
        map.setMapType("osm-bright")
        map.switchTrafficLayer(true)
    }

    useEffect(() => {
        if (mapRef.current?.map) {
            mapRef.current?.map.switchTrafficLayer(true)
            mapRef.current?.map.setMapType("standard-night")
        }
    }, [])


    return (
        <div style={{ width: "100vh"}}>
            <NeshanMap
                mapKey="Your_Map_Key"
                defaultType="neshan"
                center={{latitude: 35.7665394, longitude: 51.4749824}}
                style={{height: "48vh", width: "100%"}}
                onInit={onInit}
                zoom={13}
                traffic={false}
                poi={false}
            ></NeshanMap>
            <hr/>
            <NeshanMap
                ref={mapRef}
                mapKey="Your_Map_Key"
                defaultType="dreamy"
                style={{height: "48vh", width: "100%"}}
                traffic={false}
                poi={false}
            ></NeshanMap>
        </div>
    )
}

export default App
```

### TypeScript

`@neshan-maps-platform/react-openlayers` is written in TypeScript with complete definitions.
npm package: @neshan-maps-platform/vue3-openlayers
Description: <p align="center">   <a href="https://platform.neshan.org">     <img width="150" src="https://static.neshanmap.ir/content/places/assets/images/21.png">   </a> </p>
Latest version: 2.0.1

<p align="center">
  <a href="https://platform.neshan.org">
    <img width="150" src="https://static.neshanmap.ir/content/places/assets/images/21.png">
  </a>
</p>

<h1 align="center">Vue3 Neshan Map Openlayers</h1>
<div align="center">
  An official Vue wrapper for neshan-map-openlayers library
</div>

## ⚙️ Before Install
You need a map key to use our map on your vue web application.
You can signup and get a key from [Our Platfrom](https://platform.neshan.org/panel/api-key).
<br/>
For more information, visit our [doc page](https://platform.neshan.org/sdk/react-component#).


## 📦 Install

```bash
npm install @neshan-maps-platform/vue3-openlayers
npm install @neshan-maps-platform/ol
```

```bash
yarn add @neshan-maps-platform/vue3-openlayers
yarn add @neshan-maps-platform/ol
```

## 🔨 Usage

```html
<template>
    <div class="page">
        <NeshanMap
            defaultType="neshan"
            mapKey="YOUR_MAP_KEY"
            serviceKey="YOUR_SERVICE_KEY"
            :center="{latitude: 36.311559, longitude: 59.5870851}"
            :zoom="14"
            :poi="true"
            :traffic="true"
            @on-init="onInit"
        />
    </div>
</template>
<style>
    @import url("@neshan-maps-platform/vue3-openlayers/dist/style.css");
    html, body, .page, #app {
        width: 100%;
        height: 100%;
        display: block;
        padding: 0;
        margin: 0;
    }
</style>
```
```html
<script setup lang="ts">
import NeshanMap from "@neshan-maps-platform/vue3-openlayers"
import { Map } from "@neshan-maps-platform/ol"
import {fromLonLat} from '@neshan-maps-platform/ol/proj'

function onInit(map:Map) {
    const view = map?.getView()
    view?.animate({
        center: olProj.fromLonLat([59.5870851, 36.311559]),
        zoom: 11,
        duration: 1000,
    })
}
</script> 
```

### TypeScript

`@neshan-maps-platform/vue-openlayers` is written in TypeScript with complete definitions.
npm package: @neshanth/tixie-raise-ticket
Description: This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
Latest version: 1.0.3

# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).