dev-master
9999999-devYandex map widget. One or more maps on a page. Lightweight & Simple in use.
MIT
The Requires
- php >=5.4.0
- yiisoft/yii2 *
by Sergey Morozov
yii2 map yandex
Yandex map widget. One or more maps on a page. Lightweight & Simple in use.
Yii2 extension for Yandex map., (*1)
$ composer require sergmoro1/yii2-yamap "dev-master"
If you have one map in a view, define points on the map , set params, and place the widget., (*2)
<?= Yamap::widget([ 'points' => [ [ 'lat' => 55.780669, 'lng' => 49.144449, 'icon' => '', 'header' => 'Company name', 'body'=> 'Sales & Marketing</br><small>Office</small>', 'footer' => '8-800-200-07-71', ], ], 'params' => ['visible' => true, 'zoom' => 13] ]); ?>
If you have more then one map, then place maps divs for each of them, and place the widget., (*3)
... <div id='kazan_office' style='width:100%; height:300px; margin-right:10px; display:none;'></div> ... <div id='moscow_office' style='width:100%; height:300px; margin-right:10px; display:none;'></div> ... <?= Yamap::widget(['areas' => [ 'kazan_office' => [ 'points' => [ [ 'lat' => 55.780669, 'lng' => 49.144449, 'icon' => '', 'header' => 'Company name', 'body' => 'Sales & Marketing</br><small>Kazan office</small>', 'footer' => '8-800-000-00-00', ], ], 'params' => ['visible' => true, 'zoom' => 13] ], 'moscow_office' => [ 'points' => [ [ 'lat' => 55.7643, 'lng' => 37.6454, 'icon' => '', 'header' => 'Company name', 'body' => 'Sales & Marketing</br><small>Moscow office</small>', 'footer' => '+7 495 222-22-22', ], ], 'params' => ['visible' => true,'zoom' => 15], ], ]]); ?>
Yandex map widget. One or more maps on a page. Lightweight & Simple in use.
MIT
yii2 map yandex