2017 © Pedro Peláez
 

yii2-extension yii2-yamap

Yandex map widget. One or more maps on a page. Lightweight & Simple in use.

image

sergmoro1/yii2-yamap

Yandex map widget. One or more maps on a page. Lightweight & Simple in use.

  • Monday, February 15, 2016
  • by sergmoro1
  • Repository
  • 1 Watchers
  • 1 Stars
  • 85 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 9 % Grown

The README.md

Yandex map for Yii2

Yii2 extension for Yandex map., (*1)

Installation

$ composer require sergmoro1/yii2-yamap "dev-master"

Usage

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],
        ],
]]); ?>

The Versions

15/02 2016

dev-master

9999999-dev

Yandex map widget. One or more maps on a page. Lightweight & Simple in use.

  Sources   Download

MIT

The Requires

 

by Sergey Morozov

yii2 map yandex