PHPackages                             behinlab/mapir - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. behinlab/mapir

ActiveLibrary[API Development](/categories/api)

behinlab/mapir
==============

Custom Map.ir api

04PHP

Since Apr 10Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Behinlab/custom_mapir)[ Packagist](https://packagist.org/packages/behinlab/mapir)[ RSS](/packages/behinlab-mapir/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![](https://camo.githubusercontent.com/c0d10812c9cb451ca67bb1986722a851b16be855f9bd077044d1706351c651b4/68747470733a2f2f737570706f72742e6d61702e69722f77702d636f6e74656e742f75706c6f6164732f323031392f30332f736974652d6c6f676f2e706e67)](https://camo.githubusercontent.com/c0d10812c9cb451ca67bb1986722a851b16be855f9bd077044d1706351c651b4/68747470733a2f2f737570706f72742e6d61702e69722f77702d636f6e74656e742f75706c6f6164732f323031392f30332f736974652d6c6f676f2e706e67)

Official Laravel Package for map.ir

[![Latest Stable Version](https://camo.githubusercontent.com/cb356ace74cce6336be04c4c880fe09ac6bab22dafebef9ead88f99a4e01cc72/68747470733a2f2f706f7365722e707567782e6f72672f7368697665682f6d617069722f762f737461626c65)](https://packagist.org/packages/shiveh/mapir)[![Total Downloads](https://camo.githubusercontent.com/bdfd7865cce802c127a2b9497bc1a2e716798ca808537be204107dfab9c6ba62/68747470733a2f2f706f7365722e707567782e6f72672f7368697665682f6d617069722f646f776e6c6f616473)](https://packagist.org/packages/shiveh/mapir)[![License](https://camo.githubusercontent.com/08288d41a78042c0fcdb755db24fbba454a9cedb13433807050d2260a324cc7d/68747470733a2f2f706f7365722e707567782e6f72672f7368697665682f6d617069722f6c6963656e7365)](https://packagist.org/packages/shiveh/mapir)[![Monthly Downloads](https://camo.githubusercontent.com/e93121964a98e37a2e29456b548fbf9cbead4ee7a7b274eff2b6196c07dfde73/68747470733a2f2f706f7365722e707567782e6f72672f7368697665682f6d617069722f642f6d6f6e74686c79)](https://packagist.org/packages/shiveh/mapir)[![Daily Downloads](https://camo.githubusercontent.com/443a3ea54feb3ec31338b90f05a68d4f9e3ecc87d89a5452493a7dfe4e52ad8c/68747470733a2f2f706f7365722e707567782e6f72672f7368697665682f6d617069722f642f6461696c79)](https://packagist.org/packages/shiveh/mapir)[Service Documentation ](https://corp.map.ir)

Hi, if you have an account in map.ir, you can use this package for laravel

How to install:
---------------

[](#how-to-install)

```
 composer require shiveh/mapir
 php artisan vendor:publish --tag=mapir

```

> **Setup:**

> Laravel Installation

add this line to your app.php providers:

```
 Shiveh\Mapir\MapirLaravelServiceProvider::class,

```

and add this line to your app.php aliases:

```
'Mapir' => Shiveh\Mapir\MapirLaravelFacade::class,

```

After publish the package files you must open mapir.php in config folder and set the api-key.

> **Like this:**

```
'webservice-url' => env('MAPIR_WEBSERVICE_URL','https://map.ir'),
'api-key' => env('MAPIR_API_KEY','Your map.ir api key'),

```

> Lumen Installation

add package service provider in bootstrap/app.php.

```
$app->register(Shiveh\Mapir\MapirLaravelServiceProvider::class);
class_alias(Shiveh\Mapir\MapirLaravelFacade::class, 'Mapir');

```

copy package config directory `vendor/shiveh/mapir/config` to root folder alongside with app directory.

update bootstrap/app.php by adding this line in `Register Config Files` section:

```
$app->configure('mapir');

```

Making Lumen work with facades by uncommenting this line in bootstrap/app.php.

```
$app->withFacades();

```

> ### Note:
>
> [](#note)

you can set the keys in your .env file

> **like this:**

```
 MAPIR_WEBSERVICE_URL=https://map.ir

 MAPIR_API_KEY=your api-key

```

Methods:
--------

[](#methods)

> Mapir::search():

```
  \Mapir::search(
          'ساوجینیا',
          Select::POI,
          Filter::distance('20km'),
          [
              "type"=> "Point",
              "coordinates"=> [
                  51.3361930847168,
                  35.7006311416626
              ]
          ]
      );

```

The search method has four arguments.

> Text(Required):

This argument is used as a text, which you want to find it's location on map. for example (ساوجینیا)

> Select(Optional):

Inorder to apply your search request on specific group of entities.

```
 Select :: POI

```

> To select each of these land effects, first write "Select::" and then the name of the land effects according to the following table:

IDEntitiesDescriptionExample1POIThe search is on places recorded on the map.Select::POI2PROVINCEThe search is on provinces.Select::PROVINCE3CITYThe search is on cities.Select::CITY4COUNTYThe search is on counties.Select::COUNTY5DISTRICTThe search is on districts.Select::DISTRICT6NEIGHBORHOODThe search is on neighborhoods.Select::NEIGHBORHOOD7LANDUSEThe search is on landuse.Select::LANDUSE8WOODWATERThe search is on Natural resources (For example mountains, forests etc).Select::WOODWATER9ROADSThe search is on roads .Select::ROADS10multiLandEffectTo select a few itemsSelect::multiLandEffect(\[Select::POI,Select::ROADS\])> Filter(Optional):

To filter search results, for example, get results only in Tehran.

```
Filter :: city ('تهران')

```

> More filter features:

IDMethodsDescriptionExample1cityFilter by cityFilter::city('تهران')2countyFilter by countyFilter::county('رباط کریم')3districtFilter by districtFilter::district('درکه')4neighborhoodFilter by neighborhoodFilter::neighborhood('عباس آباد')5distanceFilter by distance for example 20m or 20kmFilter::distance('20m')6provinceFilter by provinceFilter::province('کردستان')> Geographic coordinates(Required):

Use this format for coordinates, inorder to get better result. look for other possible formats in this site [geojson.io](http://geojson.io/).

```
[
  "type"=> "Point",
  "coordinates"=> [
             51.3361930847168,
             35.7006311416626
    ]
]

```

> Mapir::searchAutocomplete()

```
\Mapir::searchAutocomplete(
        'ساوجی',
        Select::POI,
        Filter::distance('20km'),
        [
            "type"=> "Point",
            "coordinates"=> [
                51.3361930847168,
                35.7006311416626
            ]
        ]
    );

```

The search differs with the search (live search) in the concept of the structure of the search words. When using a normal search, the search algorithm looks for addresses that are exactly the same as the text of the input, while the live search matches some of the information entered with the existing data and suggests the closest and most likely results.

> Mapir::reverse()

```
   \Mapir::reverse(35.732634, 51.422571);

```

The reverse is the conversion of geographic coordinates to text addresses

> Mapir::fastReverse()

```
   \Mapir::fastReverse(35.732634, 51.422571);

```

The difference between these two different types of addressing is in detail and the response speed. In full mode, along with the details of the address, if the coordinates of the location are registered on the map, the registered place name is also returned in the response, while in the fast state of this feature does not exist. The main advantage of fast addressing is its speed, so that its response time is about 20ms, while in a full-time matching mode, this is about 70ms.

License
-------

[](#license)

![FOSSA Status]()

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/76691259?v=4)[Behinlab](/maintainers/Behinlab)[@Behinlab](https://github.com/Behinlab)

---

Top Contributors

[![Behinlab](https://avatars.githubusercontent.com/u/76691259?v=4)](https://github.com/Behinlab "Behinlab (20 commits)")[![MoHADev](https://avatars.githubusercontent.com/u/33175366?v=4)](https://github.com/MoHADev "MoHADev (2 commits)")

### Embed Badge

![Health badge](/badges/behinlab-mapir/health.svg)

```
[![Health](https://phpackages.com/badges/behinlab-mapir/health.svg)](https://phpackages.com/packages/behinlab-mapir)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
