PHPackages                             2amigos/yii2-leaflet-geosearch-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. 2amigos/yii2-leaflet-geosearch-plugin

AbandonedArchivedYii2-extension[API Development](/categories/api)

2amigos/yii2-leaflet-geosearch-plugin
=====================================

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

1.0.5(9y ago)126.8k7[1 PRs](https://github.com/2amigos/yii2-leaflet-geosearch-plugin/pulls)BSD-3-ClauseJavaScript

Since Apr 23Pushed 8y ago16 watchersCompare

[ Source](https://github.com/2amigos/yii2-leaflet-geosearch-plugin)[ Packagist](https://packagist.org/packages/2amigos/yii2-leaflet-geosearch-plugin)[ Docs](http://yiiwheels.com/extension/leaflet-geosearch-plugin)[ RSS](/packages/2amigos-yii2-leaflet-geosearch-plugin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (8)Used By (0)

Geo Search Plugin
=================

[](#geo-search-plugin)

[![Latest Version](https://camo.githubusercontent.com/2eede041caad2a66bcf6604c69d174c1834666f69aa34529c8563fa05b966fb4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f32616d69676f732f796969322d6c6561666c65742d67656f7365617263682d706c7567696e2e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://github.com/2amigos/yii2-leaflet-geosearch-plugin/tags)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/b0e5c0bf4e4d984daa72f2a3a7a5565f1536e958988f13066d071d270f8d3c05/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f32616d69676f732f796969322d6c6561666c65742d67656f7365617263682d706c7567696e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/2amigos/yii2-leaflet-geosearch-plugin)[![Coverage Status](https://camo.githubusercontent.com/2a80bbf278cb32efa2870c93ff4e067f3e06149f22c47b65494064f96e339b69/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f32616d69676f732f796969322d6c6561666c65742d67656f7365617263682d706c7567696e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/2amigos/yii2-leaflet-geosearch-plugin/code-structure)[![Quality Score](https://camo.githubusercontent.com/597964af538743df1ede8c54631d5c42be4faec3b378c66fd24ecc3cb30bba05/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f32616d69676f732f796969322d6c6561666c65742d67656f7365617263682d706c7567696e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/2amigos/yii2-leaflet-geosearch-plugin)[![Total Downloads](https://camo.githubusercontent.com/98c24449163b160e8b4cd16b73403e5f94fe5c4a9d98e015a0e8879a75019948/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f32616d69676f732f796969322d6c6561666c65742d67656f7365617263682d706c7567696e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/2amigos/yii2-leaflet-geosearch-plugin)

Yii 2 [LeafletJs](http://leafletjs.com/) Plugin that adds support for address lookup (a.k.a. geocoding / geoseaching) to Leaflet. This Plugin works in conjunction with [LeafLet](https://github.com/2amigos/yii2-leaflet-extension) library for [Yii 2](https://github.com/yiisoft/yii2) framework.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

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
-----

[](#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 © OpenStreetMap 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
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Antonio Ramirez](https://github.com/tonydspaniard)
- [All Contributors](../../contributors)

License
-------

[](#license)

The BSD License (BSD). Please see [License File](LICENSE.md) for more information.

> [![2amigOS!](https://camo.githubusercontent.com/9fd8f1de41dc23003bb2a54034cb6658dde5be97092e195a62d629d0d7fa7f6c/687474703a2f2f7777772e67726176617461722e636f6d2f6176617461722f35353336333339346437323934356666376564333132353536656330343165302e706e67)](http://www.2amigos.us)

*Web development has never been so fun!*
[www.2amigos.us](http://www.2amigos.us)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 76.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~145 days

Recently: every ~132 days

Total

7

Last Release

3531d ago

Major Versions

0.1.0 → 1.0.02015-03-31

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/566016?v=4)[Antonio Ramirez](/maintainers/tonydspaniard)[@tonydspaniard](https://github.com/tonydspaniard)

---

Top Contributors

[![tonydspaniard](https://avatars.githubusercontent.com/u/566016?v=4)](https://github.com/tonydspaniard "tonydspaniard (16 commits)")[![sheershoff](https://avatars.githubusercontent.com/u/1510318?v=4)](https://github.com/sheershoff "sheershoff (3 commits)")[![davidjeddy](https://avatars.githubusercontent.com/u/6232455?v=4)](https://github.com/davidjeddy "davidjeddy (1 commits)")[![robwent](https://avatars.githubusercontent.com/u/411678?v=4)](https://github.com/robwent "robwent (1 commits)")

---

Tags

pluginyii2extensionwidgetmapsyiileafletyii 22amigos

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/2amigos-yii2-leaflet-geosearch-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/2amigos-yii2-leaflet-geosearch-plugin/health.svg)](https://phpackages.com/packages/2amigos-yii2-leaflet-geosearch-plugin)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
