2amigos/yii2-leaflet-awesome-plugin

此包已被废弃,不再维护。未建议替代包。

使用 Font Awesome 图标创建地图图标的 Yii2 Leaflet 插件。

1.0.3 2016-09-10 19:36 UTC

This package is auto-updated.

Last update: 2023-08-16 02:49:46 UTC


README

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

使用 LeafletJs 创建地图图标,使用 Font Awesome 和 GlyphIcon 图标。

此插件与 LeafLet 库结合使用,适用于 Yii 2 框架,Bootstrap 和/或 Font Awesome 图标字体和 CSS 工具包。

为了使其与 GlyphIcon(包含在 Bootstrap 中)或 Font Awesome 文件一起工作,您需要自己添加所需文件。

要切换到 GlyphIcon(默认)和 FontAwesome,只需修改其前缀。应与其他遵循以下类签名的 Font Toolkit 一起工作:“prefix prefix-iconname”。

安装

安装此扩展的首选方式是通过 composer

运行

php composer.phar require "2amigos/yii2-leaflet-awesome-plugin" "*"

或添加

"2amigos/yii2-leaflet-awesome-plugin" : "*"

到您的应用程序 composer.json 文件的 require 部分中。

使用

// LeafLet initialization component
// ...

// Initialize plugin
$awesomeMarkers = new dosamigos\leaflet\plugins\awesome\AwesomeMarker(['name' => 'awesome']);

// install
$leafLet->installPlugin($awesomeMarkers);

// sample location
$center = new dosamigos\leaflet\types\LatLng(['lat' => 51.508, 'lng' => -0.11]);

// generate icon through its icon
$marker = new dosamigos\leaflet\layers\Marker([
    'latLng' => $center,
    'icon' => $leafLet->plugins->awesome->make("star",['markerColor' => "green", 'prefix' => "fa"]),
    'popupContent' => 'Hey! I am a marker'
]);

测试

$ ./vendor/bin/phpunit

贡献

请参阅 CONTRIBUTING 获取详细信息。

致谢

许可证

BSD 许可证(BSD)。请参阅 许可证文件 获取更多信息。

2amigOS!
网络开发从未如此有趣!
www.2amigos.us