perspectivain / yii2-mapbox-leaflet-helper
Helper to use Mapbox with Leaflet
Installs: 525
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 2
Open Issues: 1
pkg:composer/perspectivain/yii2-mapbox-leaflet-helper
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-10-11 22:38:05 UTC
README
Helper to call javascripts for Mapbox using Leaflet
Usage
Register in view file..
<?php
use perspectivain\mapbox\MapboxAPIHelper;
MapBoxAPIHelper::registerScript($this, ['drawing', 'fullScreen', 'minimap', 'omnivore']);
And use it...
L.mapbox.accessToken = 'XXXX';
var map = L.mapbox
.map('map', 'XXX.kjkb4j0a')
.setView([LAT, LON], 13)
.on('ready', function() {
new L.Control.MiniMap(L.mapbox.tileLayer('XXX.kjkb4j0a')) //minimap plugin use
.addTo(map);
});
L.control.fullscreen().addTo(map); //fullscreen plugin use
...
Installing
The preferred way to install this extension is through composer.
{
"require": {
"perspectivain/yii2-mapbox-leaflet-helper": "dev-master"
}
}