PHPackages                             rastik1584/laravel-mapycz-api - 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. rastik1584/laravel-mapycz-api

ActiveLibrary[API Development](/categories/api)

rastik1584/laravel-mapycz-api
=============================

Unofficial Laravel package for the Mapy.com / Mapy.cz REST API

v2.0.0(2mo ago)020MITPHPPHP ^8.1CI passing

Since Jun 25Pushed 2mo agoCompare

[ Source](https://github.com/rastik1584/laravel-mapycz-api)[ Packagist](https://packagist.org/packages/rastik1584/laravel-mapycz-api)[ RSS](/packages/rastik1584-laravel-mapycz-api/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (10)Versions (4)Used By (0)

Laravel Mapy.com API
====================

[](#laravel-mapycom-api)

Unofficial Laravel package for the Mapy.com / Mapy.cz REST API.

This package is not affiliated with, endorsed by, or developed in cooperation with Mapy.com or Seznam.cz. It is an independent community package.

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, 12, or 13

Framework-specific PHP minimums:

- Laravel 10: PHP 8.1+
- Laravel 11: PHP 8.2+
- Laravel 12: PHP 8.2+
- Laravel 13: PHP 8.3+

Coverage
--------

[](#coverage)

The package currently implements all `13/13` REST endpoints documented in the official Mapy.com API docs checked on April 7, 2026:

- `GET /v1/geocode`
- `GET /v1/suggest`
- `GET /v1/rgeocode`
- `GET /v1/routing/route`
- `GET /v1/routing/matrix-m`
- `GET /v1/static/map`
- `GET /v1/static/pano`
- `GET /v1/maptiles/{mapset}/{tileSize}/{z}/{x}/{y}`
- `GET /v1/maptiles/{mapset}/tiles.json`
- `GET /v1/elevation`
- `GET /v1/timezone/list-timezones`
- `GET /v1/timezone/timezone`
- `GET /v1/timezone/coordinate`

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

[](#installation)

```
composer require rastik1584/laravel-mapycz-api
```

Laravel package auto-discovery is supported.

Verified locally:

- Laravel 13 with `illuminate/support ^13.0`
- Orchestra Testbench 11
- PHPUnit 12

Configuration
-------------

[](#configuration)

Publish configuration:

```
php artisan vendor:publish --provider="Rastik1584\\LaravelMapyczApi\\MapyczApiServiceProvider" --tag="config"
```

Set your API key in `.env`:

```
MAPYCZ_API_KEY=your-api-key
MAPYCZ_API_BASE_URL=https://api.mapy.cz/v1/
MAPYCZ_API_TIMEOUT=30
MAPYCZ_API_VERIFY_SSL=true
```

Quick start
-----------

[](#quick-start)

### Facade

[](#facade)

```
use Rastik1584\LaravelMapyczApi\Facades\MapyczApi;

$geocode = MapyczApi::geocode('Praha');
$route = MapyczApi::route([
    'start' => '14.40094,50.0711',
    'end' => '16.5990122,49.1718222',
    'routeType' => 'car_fast',
]);
$elevation = MapyczApi::elevations([
    'positions' => ['14.40094,50.0711'],
]);
$timezone = MapyczApi::timezoneInfo('Europe/Prague');
```

### Dependency injection

[](#dependency-injection)

```
use Rastik1584\LaravelMapyczApi\MapyczApi;

class MapController
{
    public function __construct(private MapyczApi $mapyczApi)
    {
    }

    public function show(): array
    {
        return $this->mapyczApi->geocode('Brno');
    }
}
```

Response styles
---------------

[](#response-styles)

JSON endpoints support both raw arrays and typed response objects.

Raw array examples:

- `geocode()`
- `suggest()`
- `reverse()`
- `route()`
- `matrixM()`
- `tileJson()`
- `elevations()`
- `listTimezones()`
- `timezoneInfo()`
- `timezoneByCoordinates()`

Typed response examples:

- `geocodeResult()`
- `suggestResult()`
- `reverseResult()`
- `routeResult()`
- `matrixResult()`
- `tileJsonResult()`
- `elevationsResult()`
- `listTimezonesResult()`
- `timezoneInfoResult()`
- `timezoneByCoordinatesResult()`

Geocode examples
----------------

[](#geocode-examples)

```
use Rastik1584\LaravelMapyczApi\DTO\Geocoding\GeocodeParams;

$geocode = app(MapyczApi::class)->geocode('Praha');
$suggest = app(MapyczApi::class)->suggest('Pra');
$reverse = app(MapyczApi::class)->reverse(50.08861, 14.42212);

$filtered = app(MapyczApi::class)->geocoding()->geocode(
    new GeocodeParams(
        query: 'Praha',
        type: ['regional', 'poi'],
        locality: ['Praha', 'cz'],
        preferBBox: [14.2, 49.9, 14.7, 50.2]
    )
);

$typed = app(MapyczApi::class)->geocodeResult('Praha');
$firstName = $typed->items[0]->name;
```

Supported geocode and suggest filters in DTOs:

- `lang`
- `limit`
- `type`
- `locality`
- `preferBBox`
- `preferNear`
- `preferNearPrecision`

Routing examples
----------------

[](#routing-examples)

```
use Rastik1584\LaravelMapyczApi\DTO\Routing\RouteMapParams;
use Rastik1584\LaravelMapyczApi\DTO\Routing\MatrixMapParams;

$route = app(MapyczApi::class)->route(
    new RouteMapParams(
        start: [14.40094, 50.0711],
        end: [16.5990122, 49.1718222],
        routeType: 'car_fast'
    )
);

$matrix = app(MapyczApi::class)->matrixM(
    new MatrixMapParams(
        starts: [[14.40094, 50.0711], [14.3951303, 50.0704094]],
        ends: [[14.40194, 50.0721]],
        routeType: 'car_fast'
    )
);

$typedRoute = app(MapyczApi::class)->routeResult(
    new RouteMapParams(
        start: [14.40094, 50.0711],
        end: [16.5990122, 49.1718222],
        routeType: 'car_fast'
    )
);
```

Static image examples
---------------------

[](#static-image-examples)

```
use Rastik1584\LaravelMapyczApi\DTO\StaticMapParams;
use Rastik1584\LaravelMapyczApi\DTO\StaticPanoramaParams;

$filename = app(MapyczApi::class)->staticImage(
    storagePath: 'maps',
    params: new StaticMapParams(
        width: 400,
        height: 300,
        markers: [[
            'color' => 'red',
            'size' => 'normal',
            'points' => [
                ['lon' => 14.42212, 'lat' => 50.08861, 'label' => 'A'],
            ],
        ]]
    ),
    filename: 'map.png'
);

$shapeMap = app(MapyczApi::class)->staticImage(
    storagePath: 'maps',
    params: new StaticMapParams(
        width: 400,
        height: 300,
        markers: [[
            'points' => [
                ['lon' => 14.42212, 'lat' => 50.08861],
            ],
        ]],
        shapes: [
            [
                'color' => 'green',
                'width' => 2,
                'path' => [
                    [14.4196, 50.0869],
                    [14.4197, 50.0867],
                ],
            ],
            [
                'color' => 'blue',
                'fill' => '#82bd51aa',
                'polygon' => [[
                    [14.4219, 50.0869],
                    [14.4220, 50.0867],
                    [14.4223, 50.0867],
                ]],
            ],
        ]
    ),
    filename: 'shape-map.png'
);

$panorama = app(MapyczApi::class)->panoramaImage(
    storagePath: 'panorama',
    params: new StaticPanoramaParams(
        lon: 14.42212,
        lat: 50.08861
    ),
    filename: 'pano.jpg'
);
```

Tile examples
-------------

[](#tile-examples)

```
$tile = app(MapyczApi::class)->tile(
    mapset: 'basic',
    zoom: 6,
    x: 34,
    y: 21,
    path: 'tiles',
    tileSize: '256@2x',
    filename: 'tile.png',
    lang: 'en'
);

$tileJson = app(MapyczApi::class)->tileJson('basic', 'en');
$typedTileJson = app(MapyczApi::class)->tileJsonResult('basic', 'en');
```

Elevation examples
------------------

[](#elevation-examples)

```
use Rastik1584\LaravelMapyczApi\DTO\ElevationParams;

$elevations = app(MapyczApi::class)->elevations(
    new ElevationParams(
        positions: [
            [14.40094, 50.0711],
            [14.3951303, 50.0704094],
        ],
        lang: 'en'
    )
);

$typedElevations = app(MapyczApi::class)->elevationsResult(
    new ElevationParams(
        positions: [[14.40094, 50.0711]]
    )
);
```

Timezone examples
-----------------

[](#timezone-examples)

```
use Rastik1584\LaravelMapyczApi\DTO\Timezone\TimezoneCoordinateParams;
use Rastik1584\LaravelMapyczApi\DTO\Timezone\TimezoneListParams;
use Rastik1584\LaravelMapyczApi\DTO\Timezone\TimezoneNameParams;

$list = app(MapyczApi::class)->listTimezones(
    new TimezoneListParams(lang: 'en')
);

$timezone = app(MapyczApi::class)->timezoneInfo(
    new TimezoneNameParams(timezone: 'Europe/Prague', lang: 'en')
);

$timezoneByCoordinates = app(MapyczApi::class)->timezoneByCoordinates(
    new TimezoneCoordinateParams(lon: 14.42076, lat: 50.08804)
);

$typedTimezone = app(MapyczApi::class)->timezoneInfoResult('Europe/Prague');
```

Notes
-----

[](#notes)

- Binary endpoints for static maps, panorama images, and tiles store files through Laravel Storage and return the stored filename.
- Shared client caching is available for GET requests through `mapycz-api.cache.enabled` and `mapycz-api.cache.ttl`.
- The package exposes dedicated exceptions for missing API keys, invalid DTO payloads, and remote API failures.
- Route DTO validation enforces official limits for waypoint count and matrix size.
- Static map shapes can be passed as raw API strings or as structured `path` and `polygon` arrays.
- `functions()` was removed from the public API because it is not part of the currently documented and verified Mapy.com REST surface.

Quality checks
--------------

[](#quality-checks)

Available Composer scripts:

- `composer test`
- `composer analyse`
- `composer format`
- `composer format:test`
- `composer qa`

Official documentation
----------------------

[](#official-documentation)

-
-
-
-
-
-
-

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance83

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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 ~143 days

Total

3

Last Release

88d ago

Major Versions

v1.0.1 → v2.0.02026-04-07

PHP version history (2 changes)v1.0.0PHP ^8.0

v1.0.1PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/350c053df80c924994836ff71156aa28e2290d3b5b79828caf106576a0a15455?d=identicon)[rastislav.vozar](/maintainers/rastislav.vozar)

---

Top Contributors

[![rastik1584](https://avatars.githubusercontent.com/u/1572018?v=4)](https://github.com/rastik1584 "rastik1584 (6 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rastik1584-laravel-mapycz-api/health.svg)

```
[![Health](https://phpackages.com/badges/rastik1584-laravel-mapycz-api/health.svg)](https://phpackages.com/packages/rastik1584-laravel-mapycz-api)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.7k1](/packages/jasara-php-amzn-selling-partner-api)

PHPackages © 2026

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