2017 © Pedro Peláez
 

library yii2-ymaps

Yii2 yandex maps input widget

image

kl83/yii2-ymaps

Yii2 yandex maps input widget

  • Thursday, June 21, 2018
  • by kl83
  • Repository
  • 1 Watchers
  • 0 Stars
  • 29 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 61 % Grown

The README.md

Yii2 toolset for working with Yandex Map

Widgets list: - CoordsInput: selection of coordinates on the map; - StreetInput: jui autocomplete with street names of specified city; - MapWidget: displays the Yandex map and the placemarks., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require kl83/yii2-ymaps @dev

or add, (*4)

"kl83/yii2-ymaps": "@dev"

to the require section of your composer.json file., (*5)

Usage

CoordsInput

<?= $form->field($model, 'coords')->widget('kl83\ymaps\CoordsInput', [
  'options' => [], // Html-attributes of container
  'ymapsClientOptions' => [], // Yandex map JS settings
  'placemarkClientProperties' => [], // Placemark JS properties
  'placemarkClientOptions' => [], // Placemark JS options
]) ?>

StreetInput

<?= $form->field($model, 'street')->widget('kl83\ymaps\StreetInput', [
  'options' => [], // Html-attributes
  'city' => '', // Search streets in specified city
]) ?>

MapWidget

<?= MapWidget::widget([
    'mapState' => [
        'center' => [55.76, 37.64],
        'zoom' => 16,
    ],
    'placemarks' => [
        [
            [55.76, 37.64],
            [], // properties
            [], // options
        ],
        [
            [55.76, 37.64],
        ],
    ],
]) ?>

Interactivity

CoordsInput

Finds the specified address on the map, and moves the placemark to it., (*6)

$('.widget').coordsInput('search', 'Some address');

StreetInput

Get or set the city to search on., (*7)

$('.widget').streetInput('city'); // Get
$('.widget').streetInput('city', 'Some city'); // Set

License

MIT License, (*8)

The Versions

21/06 2018

dev-master

9999999-dev

Yii2 yandex maps input widget

  Sources   Download

MIT

The Requires

 

The Development Requires

by Aleksandr Solovyov