PHPackages                             futuretek/yii2-leaflet-extension - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. futuretek/yii2-leaflet-extension

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

futuretek/yii2-leaflet-extension
================================

LeafLet Mobile-Friendly Interactive Maps Extension Library for Yii2.

1.1.0(4y ago)01941BSD-3-ClausePHP

Since Oct 31Pushed 4y ago1 watchersCompare

[ Source](https://github.com/futuretek-solutions-ltd/yii2-ext-leaflet)[ Packagist](https://packagist.org/packages/futuretek/yii2-leaflet-extension)[ Docs](http://yiiwheels.com/extension/leaflet-extension-library)[ RSS](/packages/futuretek-yii2-leaflet-extension/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (3)Used By (1)

LeafLet Extension for Yii2
==========================

[](#leaflet-extension-for-yii2)

Extension library to display interactive maps with [LeafletJs](http://leafletjs.com/)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/). This requires the [`composer-asset-plugin`](https://github.com/francoispluchino/composer-asset-plugin), which is also a dependency for yii2 – so if you have yii2 installed, you are most likely already set.

Either run

```
composer require 2amigos/yii2-leaflet-extension:~1.0

```

or add

```
"2amigos/yii2-leaflet-extension" : "~1.0"
```

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

Usage
-----

[](#usage)

One of the things to take into account when working with [LeafletJs](http://leafletjs.com/) is that we need a Tile Provider. Is very important, if we fail to provide a Tile Provider Url, the map will display plain, without any maps at all.

The following example, is making use of [MapQuest](http://developer.mapquest.com/):

```
// first lets setup the center of our map
$center = new futuretek\leaflet\types\LatLng(['lat' => 51.508, 'lng' => -0.11]);

// now lets create a marker that we are going to place on our map
$marker = new \futuretek\leaflet\layers\Marker(['latLng' => $center, 'popupContent' => 'Hi!']);

// The Tile Layer (very important)
$tileLayer = new \futuretek\leaflet\layers\TileLayer([
   'urlTemplate' => 'http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpeg',
    'clientOptions' => [
        'attribution' => 'Tiles Courtesy of MapQuest ' .
        ', ' .
        'Map data &copy; OpenStreetMap contributors, CC-BY-SA',
        'subdomains' => ['1', '2', '3', '4'],
    ],
]);

// now our component and we are going to configure it
$leaflet = new \futuretek\leaflet\LeafLet([
    'center' => $center, // set the center
]);
// Different layers can be added to our map using the `addLayer` function.
$leaflet->addLayer($marker)      // add the marker
        ->addLayer($tileLayer);  // add the tile layer

// finally render the widget
echo \futuretek\leaflet\widgets\Map::widget(['leafLet' => $leaflet]);

// we could also do
// echo $leaflet->widget();

```

Testing
-------

[](#testing)

To test the extension, is better to clone this repository on your computer. After, go to the extensions folder and do the following (assuming you have `composer` installed on your computer):

```
$ composer install --no-interaction --prefer-source --dev
```

Once all required libraries are installed then do:

```
$ vendor/bin/phpunit
```

Further Information
-------------------

[](#further-information)

For further information regarding the multiple settings of LeafLetJS library please visit [its API reference](http://leafletjs.com/reference.html)

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

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~1891 days

Total

2

Last Release

1641d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ce67c863775f4dd7237db0547fe39aaf85c9841f34773d67e88f62dcf948ae4?d=identicon)[futuretek](/maintainers/futuretek)

---

Top Contributors

[![lukascernydis](https://avatars.githubusercontent.com/u/3111717?v=4)](https://github.com/lukascernydis "lukascernydis (6 commits)")[![tarleb](https://avatars.githubusercontent.com/u/507994?v=4)](https://github.com/tarleb "tarleb (4 commits)")[![philippfrenzel](https://avatars.githubusercontent.com/u/2319890?v=4)](https://github.com/philippfrenzel "philippfrenzel (2 commits)")[![resurtm](https://avatars.githubusercontent.com/u/100198?v=4)](https://github.com/resurtm "resurtm (1 commits)")

---

Tags

yii2extensionwidgetmapsyiileaflet2amigos

### Embed Badge

![Health badge](/badges/futuretek-yii2-leaflet-extension/health.svg)

```
[![Health](https://phpackages.com/badges/futuretek-yii2-leaflet-extension/health.svg)](https://phpackages.com/packages/futuretek-yii2-leaflet-extension)
```

PHPackages © 2026

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