rocknroi/2gis-yii2-input

Yii2 2gis map input widget. Allows you to select geographcal coordinates via a human-friendly inteface.

Installs: 21

Dependents: 0

Suggesters: 0

Security: 0

Type:yii2-extension

dev-master 2017-07-31 09:36 UTC

This package is auto-updated.

Last update: 2024-04-29 03:50:38 UTC


README

Description!

2gis map for YII2, replace input on map

Install

php composer.phar require rocknroi/2gis-yii2-input

Minimal example

echo $form->field($model, 'coordinates')->widget('rocknroi\yii2\map2gis\widgets\MapInputWidget');

Extended example

echo $form->field($model, 'coordinates')->widget(
    'rocknroi\yii2\widgets\MapInputWidget',
    [
        // Initial map center latitude. Used only when the input has no value.
        // Otherwise the input value latitude will be used as map center.
        // Defaults to 0.
        'latitude' => 42,

        // Initial map center longitude. Used only when the input has no value.
        // Otherwise the input value longitude will be used as map center.
        // Defaults to 0.
        'longitude' => 42,

        // Initial map zoom.
        // Defaults to 0.
        'zoom' => 12,

        // Map container width.
        // Defaults to '100%'.
        'width' => '420px',

        // Map container height.
        // Defaults to '300px'.
        'height' => '420px',
    ]
);