Download the PHP package shiveh/mapir without Composer

On this page you can find all versions of the php package shiveh/mapir. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mapir

Official Laravel Package for map.ir

Latest Stable Version Total Downloads License Monthly Downloads Daily Downloads Service Documentation

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

How to install:

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:

you can set the keys in your .env file

like this:


MAPIR_WEBSERVICE_URL=https://map.ir

MAPIR_API_KEY=your api-key


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:
 >
 | ID | Entities        | Description                                                              | Example                            |
 |----|-----------------|--------------------------------------------------------------------------|------------------------------------|
 | 1  | POI             | The search is on places recorded on the map.                  | Select::POI                        |
 | 2  | PROVINCE        | The search is on provinces.                                               | Select::PROVINCE                   |
 | 3  | CITY            | The search is on cities.                                                   | Select::CITY                       |
 | 4  | COUNTY          | The search is on counties.                                                 | Select::COUNTY                     |
 | 5  | DISTRICT        | The search is on districts.                                               | Select::DISTRICT                   |
 | 6  | NEIGHBORHOOD    | The search is on neighborhoods.                                           | Select::NEIGHBORHOOD               |
 | 7  | LANDUSE         | The search is on landuse.                                                | Select::LANDUSE                    |
 | 8  | WOODWATER       | The search is on Natural resources (For example mountains, forests etc). | Select::WOODWATER                  |
 | 9  | ROADS           | The search is on roads .                                                 | Select::ROADS                      |
 | 10 | multiLandEffect | To select a few items |                                  Select::multiLandEffect([Select::POI,Select::ROADS]) |

 >Filter(Optional):
 >
  To filter search results, for example, get results only in Tehran.

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

 >More filter features:
 >
 | ID | Methods      | Description                                | Example                     |
 |----|--------------|--------------------------------------------|-----------------------------|
 | 1  | city         | Filter by city                             | Filter::city('تهران')       |
 | 2  | county       | Filter by county                           | Filter::county('رباط کریم') |
 | 3  | district     | Filter by district                         | Filter::district('درکه')    |
 | 4  | neighborhood | Filter by neighborhood                     | Filter::neighborhood('عباس آباد')    |
 | 5  | distance     | Filter by distance for example 20m or 20km | Filter::distance('20m')     |
 | 6  | province     | Filter by province                         | Filter::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
[![FOSSA Status]()]()

All versions of mapir with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ~6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package shiveh/mapir contains the following files

Loading the files please wait ....