2amigos / yii2-leaflet-makimarker-plugin
此包已被弃用且不再维护。未建议替代包。
使用MapBox的Maki图标创建地图图标的Yii2 Leaflet插件。
1.0.2
2016-09-10 19:29 UTC
Requires
Requires (Dev)
- phpunit/phpunit: 4.*
This package is auto-updated.
Last update: 2023-08-16 02:38:33 UTC
README
使用MapBox的Maki图标创建地图图标的Yii 2 LeafletJs 插件。标记从MapBox的 静态标记API 中检索。
安装
通过 composer 安装此扩展是首选方式。
运行以下命令之一
composer require 2amigos/yii2-leaflet-makimarker-plugin:~1.0
或者将以下内容添加到应用composer.json
文件的require部分。
"2amigos/yii2-leaflet-makimarker-plugin" : "~1.0"
安装说明
用法
使用其make
方法
use dosamigos\leaflet\plugins\makimarker\MakiMarker;
use dosamigos\leaflet\types\LatLng;
use dosamigos\leaflet\layers\Marker;
// LeafLet initialization component
// ...
// Initialize plugin
$makimarkers = new MakiMarker(['name' => 'makimarker']);
// install
$leafLet->installPlugin($makimarkers);
// sample location
$center = new LatLng(['lat' => 51.508, 'lng' => -0.11]);
// generate icon through its icon
$marker = new Marker([
'latLng' => $center,
'icon' => $leafLet->plugins->makimarker->make("rocket",['color' => "#b0b", 'size' => "m"]),
'popupContent' => 'Hey! I am a marker'
]);
测试
$ ./vendor/bin/phpunit
贡献
请参阅CONTRIBUTING以获取详细信息。
鸣谢
许可证
BSD许可证(BSD)。有关更多信息,请参阅许可证文件。
网络开发从未如此有趣! www.2amigos.us