PHPackages                             kpebedko22/filament-yandex-map - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kpebedko22/filament-yandex-map

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kpebedko22/filament-yandex-map
==============================

This is my package filament-yandex-map

v4.0.0(8mo ago)41.9k↓40.7%1[1 issues](https://github.com/kpebedko22/filament-yandex-map/issues)MITPHPPHP ^8.3

Since Dec 27Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/kpebedko22/filament-yandex-map)[ Packagist](https://packagist.org/packages/kpebedko22/filament-yandex-map)[ Docs](https://github.com/kpebedko22/filament-yandex-map)[ RSS](/packages/kpebedko22-filament-yandex-map/feed)WikiDiscussions v4 Synced 1mo ago

READMEChangelog (4)Dependencies (12)Versions (9)Used By (0)

Filament Yandex Map
===================

[](#filament-yandex-map)

This package provides a set of tools for using Yandex Map within the [Laravel Filament](https://github.com/filamentphp/filament).

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

[](#installation)

You can install the package via composer:

```
composer require kpebedko22/filament-yandex-map
```

Modify `services.php` config file. This is the contents of the config file:

```
return [
    // ...

    'yandex_map' => [
        'api_key' => env('YANDEX_MAP_API_KEY', ''),
        'suggest_api_key' => env('YANDEX_MAP_SUGGEST_API_KEY', ''),
        'lang' => 'ru_RU',
        'center' => [53.35, 83.75],
        'zoom' => 12,
    ],
];
```

Optionally, you can publish the translations using:

```
php artisan vendor:publish --tag="filament-yandex-map-translations"
```

Usage
-----

[](#usage)

### Form component

[](#form-component)

```
->schema([
    YandexMap::make('point')
        // Set mode of geo-object. Always required!
        ->mode(YandexMapMode::Placemark)
        // By default, values are taken from config
        // You are free to override them using plain values or closure
        ->apiKey('your_yandex_api_key')
        ->suggestApiKey('your_yandex_suggest_api_key')
        ->center([53.35, 83.75])
        ->zoom(12)
        ->lang('ru_RU')
        // By default: 600px
        ->height('600px')
        // Setup control buttons
        ->deleteBtnParameters(
            new ButtonData(__('filament-yandex-map::control-buttons.delete')),
            new ButtonOptions(
                float: ButtonFloat::Right,
                selectOnClick: false
            ),
        )
        ->drawBtnParameters()
        ->editBtnParameters()
        // Setup geo-object
        ->geoObjectOptions(new GeoObjectOptions())
        ->geoObjectProperties(new GeoObjectProperties())
        // It's required to set up `formatStateUsing`, `dehydrateStateUsing` methods
        // to properly take data from record. The package provides some implementations
        // for common cases. Find more information further below.
        ->usingArray('lat', 'lng')
        ->usingMagellan()
])
```

### Infolist component

[](#infolist-component)

```
->schema([
    YandexMapEntry::make('point')
        // Set mode of geo-object. Always required!
        ->mode(YandexMapMode::Placemark)
        // By default, values are taken from config
        // You are free to override them using plain values or closure
        ->apiKey('your_yandex_api_key')
        ->suggestApiKey('your_yandex_suggest_api_key')
        ->center([53.35, 83.75])
        ->zoom(12)
        ->lang('ru_RU')
        // By default: 600px
        ->height('600px')
        // Setup geo-object
        ->geoObjectOptions(new GeoObjectOptions())
        ->geoObjectProperties(new GeoObjectProperties())
        // It's required to set up `getStateUsing` method
        // to properly take data from record. The package provides some implementations
        // for common cases. Find more information further below.
        ->usingArray('lat', 'lng')
        ->usingMagellan()
])
```

Geometries
----------

[](#geometries)

The package provides work with the following types of geometries (geo-objects):

- **Point**
- **Linestring**
- **Polygon**

Storing geometries in database
------------------------------

[](#storing-geometries-in-database)

Since there are different ways to store geo-object data in database table, the package cannot cover all options. But it provides two out-of-the-box usage options:

- json column
- postgis column

### Json column

[](#json-column)

The package uses array of two coordinates `[lat, lng]` for storing point coordinates. E.g.: `[53.35, 83.75]`, where `53.35` is latitude and `83.75` is longitude.

If you're store coordinates of point as json-object, e.g.: `{"lat": 53.35, "lng": 83.75}`, then you should use `->usingArray('lat', 'lng')` method.

### Postgis column (PostgreSQL)

[](#postgis-column-postgresql)

For ease of working with postgis columns it's recommended to use [Laravel Magellan](https://github.com/clickbar/laravel-magellan) package.

The package supports work with the following geometries:

ClassMigration`Clickbar\Magellan\Data\Geometries\Point``$table->magellanPoint('point')``Clickbar\Magellan\Data\Geometries\LineString``$table->magellanLineString('line')``Clickbar\Magellan\Data\Geometries\Polygon``$table->magellanPolygon('polygon')`### Separate lat/lng columns

[](#separate-latlng-columns)

If you are storing latitude and longitude of the point in the different columns of your database table, then you need to write your own implementation of `formatStateUsing` and mutate data before saving.

```
// On the form
use Kpebedko22\FilamentYandexMap\Forms\Components\YandexMap;
use Kpebedko22\FilamentYandexMap\ValueObjects\Point;
use Kpebedko22\FilamentYandexMap\Enums\YandexMapMode;

YandexMap::make('point')
    ->mode(YandexMapMode::Placemark)
    ->formatStateUsing(static function (?Model $record) {
        return $record
            ? (new Point($record->lat, $record->lng))->toArray()
            : null;
    }),

// CreatePage
protected function mutateFormDataBeforeCreate(array $data): array
{
    $data['lat'] = $data['point']['lat'];
    $data['lng'] = $data['point']['lng'];
    unset($data['point']);

    return parent::mutateFormDataBeforeCreate($data);
}

// EditPage
protected function mutateFormDataBeforeSave(array $data): array
{
    $data['lat'] = $data['point']['lat'];
    $data['lng'] = $data['point']['lng'];
    unset($data['point']);

    return parent::mutateFormDataBeforeSave($data);
}
```

Localization
------------

[](#localization)

The list of available locales can be found in `YandexMapLang` enum.

Geometries control buttons
--------------------------

[](#geometries-control-buttons)

List of available control buttons:

- toggle editing mode
- toggle drawing mode
- delete geo-object

Since the form may require using several map components, there is a nuance with the automatic inclusion of `editor.startDrawing()`, `editor.startEditing()`. The last loaded map component will dominate. Therefore, in order to edit/draw on the map, control buttons are added that include these functions. There is also a button to delete a geo-object.

Default state of control buttons:

```
YandexMap::make('point')
    ->mode(YandexMapMode::Placemark)
    ->deleteBtnParameters(
        new ButtonData(__('filament-yandex-map::control-buttons.delete')),
        new ButtonOptions(
            float: ButtonFloat::Right,
            selectOnClick: false
        ),
    );
    ->drawBtnParameters(
        new ButtonData(__('filament-yandex-map::control-buttons.draw')),
        new ButtonOptions(float: ButtonFloat::Right),
    );
    ->editBtnParameters(
        new ButtonData(__('filament-yandex-map::control-buttons.edit')),
        new ButtonOptions(float: ButtonFloat::Right),
    );
```

You are free to change the visual state of this control buttons.

Geometries properties and options
---------------------------------

[](#geometries-properties-and-options)

You can modify geo-object properties and options.

Testing
-------

[](#testing)

No tests yet.

```
composer test
```

Sandbox
-------

[](#sandbox)

Detailed information about sandbox you can find in [Sandbox README](./sandbox/README.md) file.

### How to set up and run

[](#how-to-set-up-and-run)

Setup `./sandbox/.env` file.

Create a symlink to the `.env` file in the project root:

```
ln -sf ./sandbox/.env ./.env
```

Build and start Docker containers:

```
make build
make up
```

Run Artisan commands inside the `fpm` container.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Alexander Voytsekhovsky](https://github.com/kpebedko22)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance56

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.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 ~51 days

Recently: every ~9 days

Total

6

Last Release

246d ago

Major Versions

v3.x-dev → v4.0.02025-09-08

### Community

Maintainers

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

---

Top Contributors

[![kpebedko22](https://avatars.githubusercontent.com/u/36397871?v=4)](https://github.com/kpebedko22 "kpebedko22 (7 commits)")[![altrntv](https://avatars.githubusercontent.com/u/28820687?v=4)](https://github.com/altrntv "altrntv (2 commits)")

---

Tags

filamentphplaravelyandex-maplaravelfilamentfilament-yandex-mapfilament form componentyandex-map

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/kpebedko22-filament-yandex-map/health.svg)

```
[![Health](https://phpackages.com/badges/kpebedko22-filament-yandex-map/health.svg)](https://phpackages.com/packages/kpebedko22-filament-yandex-map)
```

###  Alternatives

[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

320392.1k17](/packages/codewithdennis-filament-select-tree)[pboivin/filament-peek

Full-screen page preview modal for Filament

253319.6k12](/packages/pboivin-filament-peek)[dotswan/filament-map-picker

Easily pick and retrieve geo-coordinates using a map-based interface in your Filament applications.

124139.3k2](/packages/dotswan-filament-map-picker)[creagia/filament-code-field

A Filamentphp input field to edit or view code data.

58289.3k3](/packages/creagia-filament-code-field)[jibaymcs/filament-tour

Bring the power of DriverJs to your Filament panels and start a tour !

12247.8k](/packages/jibaymcs-filament-tour)[aymanalhattami/filament-context-menu

context menu (right click menu) for filament

9838.0k](/packages/aymanalhattami-filament-context-menu)

PHPackages © 2026

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