rootlocal / yii2-yandexmaps
Yii2 Yandex Maps API
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 2
Type:yii2-extension
Requires
- php: >=7.1
- yiisoft/yii2: ~2.0
Requires (Dev)
- codeception/codeception: ^4.0
- codeception/module-asserts: ^1.0
- codeception/module-filesystem: ^1.0
- codeception/module-yii2: ^1.0
- codeception/verify: ~0.5.0 || ~1.1.0
- symfony/browser-kit: >=2.7 <=4.2.4
- yiisoft/yii2-debug: ~2.1.0
- yiisoft/yii2-faker: ~2.0.0
This package is auto-updated.
Last update: 2024-11-11 07:35:54 UTC
README
Install
composer require rootlocal/yii2-yandexmaps
or add
"rootlocal/yii2-yandexmaps": "~1.0",
to the require section of your composer.json.
Example usage config 1:
config:
<?php return [ // ... 'components' => [ // ... 'assetManager' => [ 'bundles' => [ \rootlocal\widgets\yandexmaps\ApiYandexMapAsset::class => [ 'version' => '2.1', 'language' => 'ru-RU', 'apiKey' => 'MY_API_KEY' ], ], // ... ], // ... ] ];
view:
<?php use yii\web\View; use rootlocal\widgets\yandexmaps\YandexMapWidget; /** @var View $this */ ?> <?= YandexMapWidget::widget([ 'content' => $this->render('yamapscontent'), 'htmlOptions' => ['class' => 'yamap'], 'options' => [ 'center' => [xx.xx, yy.yy], 'zoom' => 16, 'controls' => ['zoomControl'], 'placemarks' => [ [ 'position' => [xx.xx, yy.yy], 'content' => [ 'hintContent' => 'test', 'balloonContentHeader' => 'test', 'balloonContentBody' => 'test', 'balloonContentFooter' => 'test', ], ], ], ] ]) ?>
Example usage config 2:
<?php use yii\web\View; use rootlocal\widgets\yandexmaps\YandexMapWidget; /** @var View $this */ ?> <?= YandexMapWidget::widget([ 'apiKey' => 'MY_API_KEY', 'language' => 'ru-RU', 'content' => $this->render('yamapscontent'), 'htmlOptions' => ['class' => 'yamap'], 'options' => [ 'center' => [xx.xx, yy.yy], 'zoom' => 16, 'controls' => ['zoomControl'], 'placemarks' => [ [ 'position' => [xx.xx, yy.yy], 'content' => [ 'hintContent' => 'test', 'balloonContentHeader' => 'test', 'balloonContentBody' => 'test', 'balloonContentFooter' => 'test', ], ], ], ] ]) ?>