承接 2amigos/yii2-leaflet-geosearch-plugin 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

2amigos/yii2-leaflet-geosearch-plugin

最新稳定版本:1.0.5

Composer 安装命令:

composer require 2amigos/yii2-leaflet-geosearch-plugin

包简介

Yii2 LeafLet Plugin to provide support for address lookup (a.k.a. geocoding / geoseaching) to Leaflet.

README 文档

README

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

Yii 2 LeafletJs Plugin that adds support for address lookup (a.k.a. geocoding / geoseaching) to Leaflet. This Plugin works in conjunction with LeafLet library for Yii 2 framework.

Installation

The preferred way to install this extension is through composer.

Either run

composer require 2amigos/yii2-leaflet-geosearch-plugin:~1.0

or add

"2amigos/yii2-leaflet-geosearch-plugin" : "~1.0"

to the require section of your application's composer.json file.

Usage

use dosamigos\leaflet\layers\TileLayer;
use dosamigos\leaflet\LeafLet;
use dosamigos\leaflet\types\LatLng;
use dosamigos\leaflet\plugins\geosearch\GeoSearch;

$center = new LatLng(['lat' => 39.67442740076734, 'lng' => 2.9347229003906246]);

$geoSearchPlugin = new GeoSearch([
    'service' => GeoSearch::SERVICE_OPENSTREETMAP,
    // uncomment following block to define custom labels
    /*
    'clientOptions' => [
        'searchLabel' => 'enter address here',
        'notFoundMessage' => 'no address found',
    ],
    */
]);

$tileLayer = new TileLayer([
    'urlTemplate' => 'https://a.tile.openstreetmap.org/{z}/{x}/{y}.png',
    'clientOptions' => [
        'attribution' => 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors',
        'subdomains' => '1234'
    ]
]);

$leafLet = new LeafLet([
    'name' => 'geoMap',
    'tileLayer' => $tileLayer,
    'center' => $center,
    'zoom' => 10,
    'clientEvents' => [
        // setting up one of the geo search events for fun
        'geosearch_showlocation' => 'function(e){
            console.log(e.target);
        }'
    ]
]);

// add the plugin
$leafLet->installPlugin($geoSearchPlugin);

// run the widget (you can also use dosamigos\leaflet\widgets\Map::widget([...]))
echo $leafLet->widget();

Contributing

Please see CONTRIBUTING for details.

Credits

License

The BSD License (BSD). Please see License File for more information.

2amigOS!

Web development has never been so fun!
www.2amigos.us

统计信息

  • 总下载量: 26.7k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 18
  • Forks: 6
  • 开发语言: JavaScript

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-04-23