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

ActiveLibrary[API Development](/categories/api)

logipro/datamaps-php
====================

A PHP component to use Datamaps API within your PHP project.

v1.0.4(1y ago)042MITPHPPHP &gt;=8.1

Since Jan 16Pushed 1y agoCompare

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

READMEChangelog (5)Dependencies (7)Versions (7)Used By (0)

Datamaps PHP
============

[](#datamaps-php)

A PHP component to use Datamaps' API within your PHP project.

**DatamapsClient** allows you to

- *get* a specific map via its ID,
- *search* the last maps created,
- *create* a new map.

A map is defined by 4 values :

- `string $mapId` is the id of the map.
- `string $createdAt` is the creation date and time of the map, with format ATOM.
- `[[float, float], [float, float]] $bounds` sets the limit of the map.
- `Layer[] $layers` contains every layer. Each of them has a `string $name` and an array of `Marker` (storing a geographic point `[float, float] $point`, a `string $description` and a `string $color`).

Check DatamapsClient factories to obtain mocked versions of **DatamapsClient** for your tests.

Usage
-----

[](#usage)

### In source files

[](#in-source-files)

**DatamapsClient** contains 3 public methods :

- `get(string $mapId)` to retrieve a specific map of id `mapId`. Returns a `Map`.
- `search(int $amount)` to retrieve the `amount` last created maps. Returns an array of `Map`.
- `create(Map $map)` to create and save a new map. Only `bounds` and `layers` will be persisted, `mapId` and `createdAt` will be generated on creation by Datamaps. Returns a `Map`.

### In test files

[](#in-test-files)

**SucceedingDatamapsClientMockFactory** allows to test **DatamapsClient** if everything goes **right**.

- `make()` creates a mock of **DatamapsClient** that will **never** respond with failures.
- `getExpectedResponseFromGet(string $mapId)` returns the map the mocked version of the `get($mapId) `method will return.
- `getExpectedResponseFromSearch(int $amount)` returns the map the mocked version of the `search($amount) `method will return.
- `getExpectedResponseFromCreate(Map $map)` returns the map the mocked version of the `create($map) `method will return.

**FailingDatamapsClientMockFactory** allows to test **DatamapsClient** if everything goes **wrong**.

- `make()` creates a mock of **DatamapsClient** that will **always** respond with failures.
- `get($mapId)` will always result on `Error on request to Datamaps. Map with mapId $mapId not found`.
- `search($amount)` will always result on `Error on request to Datamaps. Can't retrieve data from an empty repository`.
- `create($map)` will always result on `Error on request to Datamaps. /bounds: Array should have at least 2 items, 1 found`.

Install
-------

[](#install)

```
composer require logipro/datamaps-php
```

To contribute to Datamaps PHP
-----------------------------

[](#to-contribute-to-datamaps-php)

### Requirements:

[](#requirements)

- docker
- git

### Unit tests

[](#unit-tests)

```
bin/phpunit
```

### Integration tests

[](#integration-tests)

```
bin/phpunit-integration
```

### Quality

[](#quality)

#### Some indicators:

[](#some-indicators)

- phpcs PSR12
- phpstan level 9
- coverage &gt;= 100%
- infection MSI &gt;= 100%

#### Quick check with:

[](#quick-check-with)

```
./codecheck
```

#### Check coverage with:

[](#check-coverage-with)

```
bin/phpunit --coverage-html var
```

and view 'var/index.html' in your browser

#### Check infection with:

[](#check-infection-with)

```
bin/infection
```

and view 'var/infection.html' in your browser

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance42

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80.8% 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 ~92 days

Total

5

Last Release

483d ago

### Community

Maintainers

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

---

Top Contributors

[![Boubounech](https://avatars.githubusercontent.com/u/71706996?v=4)](https://github.com/Boubounech "Boubounech (21 commits)")[![frederic100](https://avatars.githubusercontent.com/u/50176793?v=4)](https://github.com/frederic100 "frederic100 (3 commits)")[![brudert](https://avatars.githubusercontent.com/u/74777353?v=4)](https://github.com/brudert "brudert (2 commits)")

---

Tags

mapdatamaps

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[dantsu/php-osm-static-api

PHP library to easily get static image from OpenStreetMap (OSM), add markers and draw lines.

97141.0k1](/packages/dantsu-php-osm-static-api)[ivory/google-map

Google Map API v3 integration for PHP ^8.1

14363.2k4](/packages/ivory-google-map)

PHPackages © 2026

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