PHPackages                             mapslat/mapslat-php - 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. mapslat/mapslat-php

ActiveLibrary[API Development](/categories/api)

mapslat/mapslat-php
===================

Package provides the ability to interact with the Maps.lat API.

v2.0.0(2y ago)06MITPHPPHP ^8.0

Since Oct 30Pushed 2y agoCompare

[ Source](https://github.com/mapslat/mapslat-php)[ Packagist](https://packagist.org/packages/mapslat/mapslat-php)[ RSS](/packages/mapslat-mapslat-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Maps.lat PHP client
===================

[](#mapslat-php-client)

This is a Maps.lat APi client written in PHP. This package contains methods for interacting with APi. Below are some usage examples. You can find more information about the APi in the [Maps.lat documentation](https://maps.lat/docs).

Installation
------------

[](#installation)

You must use [Composer](http://getcomposer.org/) to install this package. You can install Composer using the command.

```
curl -sS https://getcomposer.org/installer | php
```

Package supports PHP version 8.0 and higher. To install this package, run the following command.

```
composer require mapslat/mapslat-php
```

Usage
-----

[](#usage)

The examples below assume that you are using Composer autoloader in your application. The autoloader is called by the following code.

```
require 'vendor/autoload.php';
use Mapslat\Mapslat;
```

### Request structure

[](#request-structure)

Create an instance of the class and pass one or two parameters. The first parameter is your API key. The second optional parameter is the `$throw` flag, which determines whether to throw exceptions on errors (defaults to true).

```
$mapslat = new Mapslat($apiKey);
```

The request is built from an array or from a json string that you pass to the method you are calling.

```
// array as input data
$search = $mapslat->search([
	'query' => 'chicago',
	'limit' => 1
]);

// or json as input data
$search = $mapslat->search('{
	"query": "london",
	"limit": 1
}');
```

### Response structure

[](#response-structure)

The response is returned as an instance of `Symfony\Contracts\HttpClient\ResponseInterface`. You can call interface methods that return headers, data, http status, etc. See the [Symfony HttpClient documentation](https://symfony.com/doc/current/http_client.html#processing-responses) for more details.

```
// get response data
$isoline = $mapslat->isoline('{
	"lon": 13.37467722463873,
	"lat": 52.55351817997314,
	"costing": "auto",
	"polygons": true,
	"time": 5
}')->toArray();

// get status code
$statusCode = $mapslat->search([
	'query' => 'chicago',
	'limit' => 1
])->getStatusCode();

// get response headers
$reverse = $mapslat->reverse([
	'lon' => -73.99672895945677,
	'lat' => 40.72494710252593
]);
$headers = $reverse->getHeaders();

// get raw response
$rawResponse = $mapslat->search([
	'query' => 'miami beach',
	'limit' => 3
])->getContent();
```

Requests to API
---------------

[](#requests-to-api)

For each Maps.lat API endpoint, there is a method for interactions.

### Geocoding

[](#geocoding)

```
// forward geocoding
$data = $mapslat->search($payload)->toArray();

// reverse geocoding
$data = $mapslat->reverse($payload)->toArray();

// geocoding lookup
$data = $mapslat->lookup($payload)->toArray();
```

### Address autocomplete

[](#address-autocomplete)

```
$data = $mapslat->autocomplete($payload)->toArray();
```

### Routing

[](#routing)

```
// routing
$data = $mapslat->route($payload)->toArray();

// optimal route
$data = $mapslat->optimal($payload)->toArray();

//routing locate
$data = $mapslat->locate($payload)->toArray();
```

### Isoline

[](#isoline)

```
$data = $mapslat->isoline($payload)->toArray();
```

### Matrix

[](#matrix)

```
$data = $mapslat->matrix($payload)->toArray();
```

### Map matching

[](#map-matching)

```
// matching routes
$data = $mapslat->match($payload)->toArray();

// matching attributes
$data = $mapslat->attributes($payload)->toArray();
```

Contribute
----------

[](#contribute)

This package is Open Source, published under the [MIT license](https://opensource.org/license/mit/). You can participate in its development and improvement.

We will be glad if you take part in the work on this package. Create issues if you find bugs, develop your own and review other people's pull requests, respond to other people's issues, and so on.

Support and feedback
--------------------

[](#support-and-feedback)

Be sure to visit the [Maps.lat documentation](https://maps.lat/api-reference) for additional information about our API.

If you find a bug, please submit the issue in [Github directly](https://github.com/mapslat/mapslat-php/issues).

If you need further assistance email us at [support@maps.lat](support@maps.lat).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~33 days

Total

4

Last Release

833d ago

Major Versions

v1.0.2 → v2.0.02024-02-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/f065a67bb3fc9f2cbb7c20c1b0db79ea03440c66033bd060c3b95d503d0fb087?d=identicon)[mapslat](/maintainers/mapslat)

---

Top Contributors

[![artemrudakov](https://avatars.githubusercontent.com/u/94847830?v=4)](https://github.com/artemrudakov "artemrudakov (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mapslat-mapslat-php/health.svg)

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

###  Alternatives

[temporal/sdk

Temporal SDK

4002.2M18](/packages/temporal-sdk)[storyblok/php-content-api-client

PHP Client for Storyblok Content API

11136.8k4](/packages/storyblok-php-content-api-client)[storyblok/php-management-api-client

Storyblok PHP Client for Management API

1224.4k1](/packages/storyblok-php-management-api-client)[smnandre/pagespeed-api

PageSpeed Insight PHP Api Client 🚀 Analyse web pages for performances metrics, core web vitals...

1511.5k](/packages/smnandre-pagespeed-api)

PHPackages © 2026

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