Download the PHP package kpebedko22/filament-yandex-map without Composer
On this page you can find all versions of the php package kpebedko22/filament-yandex-map. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kpebedko22/filament-yandex-map
More information about kpebedko22/filament-yandex-map
Files in kpebedko22/filament-yandex-map
Package filament-yandex-map
Short Description This is my package filament-yandex-map
License MIT
Homepage https://github.com/kpebedko22/filament-yandex-map
Informations about the package filament-yandex-map
Filament Yandex Map
This package provides a set of tools for using Yandex Map within the Laravel Filament.
Installation
You can install the package via composer:
Modify services.php
config file. This is the contents of the config file:
Optionally, you can publish the translations using:
Usage
Geometries
The package provides work with the following types of geometries (geo-objects):
- Point
- Linestring
- Polygon
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
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)
For ease of working with postgis columns it's recommended to use Laravel Magellan package.
The package supports work with the following geometries:
Class | Migration |
---|---|
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
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.
Localization
The list of available locales can be found in YandexMapLang
enum.
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:
You are free to change the visual state of this control buttons.
Geometries properties and options
You can modify geo-object properties and options.
Testing
No tests yet.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Alexander Voytsekhovsky
- All Contributors
License
The MIT License (MIT). Please see License File for more information.