Download the PHP package beastbytes/yii-leaflet without Composer
On this page you can find all versions of the php package beastbytes/yii-leaflet. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii-leaflet
BeastBytes\Widgets\Yii-Leaflet
Widget that integrates the Leaflet JavaScript mapping library with Yii3.
Features
- For Leaflet V1.*
- Easy to use predefined tile providers (port of Leaflet Providers)
- Simple popup creation for markers and vector components; just set the 'content' option
- Leaflet plugin support
For license information see the LICENSE file.
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json.
Leaflet Package
Install Leaflet using your chosen package mananger, e.g.
or add Leaflet to the dependencies of your package.json.
Usage
An instance of the map widget must be assigned to a variable; this instance is used to render the HTML then to get the JavaScript to be registered in the view.
The widget does not publish or register Leaflet assets, i.e. Leaflet's JavaScript and CSS. LeafletAsset is provided for use in the Yii framework.
The example below displays a map using OpenStreetMap as the tile provider. It has a marker in the centre of the map and a 5km radius circle centred on the marker; these are in a layer group that is not initially displayed. When the layer is shown using the Layers control, the centre marker can be dragged and dropped and its new position is shown - this demonstrates using component events. Three other markers are added in another layer group, and a layers and fullscreen control is added to the map; the fullscreen control is a plugin.
Example
All versions of yii-leaflet with dependencies
yiisoft/assets Version ^4.0
yiisoft/html Version ^3.0
yiisoft/widget Version ^2.0
npm-asset/leaflet Version ^1.0