codru / yii2-static-map
用于生成静态地图的扩展程序(例如用于联系页面)。现在支持谷歌地图和开源街道地图
dev-master
2016-02-01 20:00 UTC
Requires
- yiisoft/yii2: *
Requires (Dev)
- yiisoft/yii2-codeception: ~2.0
This package is not auto-updated.
Last update: 2024-09-24 07:22:09 UTC
README
用于生成静态地图的扩展程序(例如用于联系页面)。现在支持谷歌地图和开源街道地图
安装
安装此扩展程序的首选方式是通过 composer。
运行以下命令之一
php composer.phar require --prefer-dist codru/yii2-static-map "*"
或者将以下内容添加到您的 composer.json
文件的 require 部分中。
"codru/yii2-static-map": "*"
用法
扩展程序安装后,只需在代码中使用它即可
<?= \codru\staticmap\StaticMap::widget( [ 'map' => [ 'class' => \codru\staticmap\types\Google::className(), 'options' => [ 'center' => '40,50', 'zoom' => '13', 'size' => '640x100', 'scale' => '2', 'language' => Yii::$app->language, 'markers' => [ 'size' => 'tiny', '40,50', ], ], ], ] ) ?>
或
<?= \codru\staticmap\StaticMap::widget( [ 'map' => [ 'class' => \codru\staticmap\types\OpenStreet::className(), 'options' => [ 'center' => '40,50', 'zoom' => '15', 'size' => '1024x200', 'language' => Yii::$app->language, 'markers' => [ '40,50', 'ol-marker', ], ], ], ] ) ?>