Files
contao-leaflet-geocode-widget/README.md

64 lines
2.0 KiB
Markdown
Raw Normal View History

2017-01-18 17:30:58 +01:00
Leaflet geocode widget
======================
2017-10-04 11:06:58 +02:00
[![Build Status](http://img.shields.io/travis/netzmacht/contao-leaflet-geocode-widget/master.svg?style=flat-square)](https://travis-ci.org/netzmacht/contao-leaflet-geocode-widget)
[![Version](http://img.shields.io/packagist/v/netzmacht/contao-leaflet-geocode-widget.svg?style=flat-square)](http://packagist.org/packages/netzmacht/contao-leaflet-geocode-widget)
[![License](http://img.shields.io/packagist/l/netzmacht/contao-leaflet-geocode-widget.svg?style=flat-square)](http://packagist.org/packages/netzmacht/contao-leaflet-geocode-widget)
[![Downloads](http://img.shields.io/packagist/dt/netzmacht/contao-leaflet-geocode-widget.svg?style=flat-square)](http://packagist.org/packages/netzmacht/contao-leaflet-geocode-widget)
[![Contao Community Alliance coding standard](http://img.shields.io/badge/cca-coding_standard-red.svg?style=flat-square)](https://github.com/contao-community-alliance/coding-standard)
2017-01-18 17:30:58 +01:00
This extension provides an widget to pick coordinates from a map. It uses the leaflet framework.
2017-10-04 11:10:03 +02:00
Changlog
--------
See [CHANGELOG](CHANGELOG.md).
2017-01-18 17:30:58 +01:00
Requirements
------------
2017-10-04 11:06:58 +02:00
- Contao ~4.4
2017-01-18 17:30:58 +01:00
Install
-------
### 1. Install using composer
```bash
php composer.phar require netzmacht/contao-leaflet-geocode-widget
```
### 2. Update your AppKernel.php
2017-01-26 17:11:05 +01:00
git
2017-01-26 16:56:43 +01:00
If you use the managed edition of Contao you can skip this step.
2017-01-18 17:30:58 +01:00
```php
// Dependency is automatically installed and has to be registered
new Contao\CoreBundle\HttpKernel\Bundle\ContaoModuleBundle('leaflet-libs', $this->getRootDir()),
// Register the bundle
new Netzmacht\Contao\Leaflet\GeocodeWidget\LeafletGeocodeWidgetBundle(),
```
### 3. Update the assets
```bash
bin/console assets:install --symlink
```
### 4. Use the widget
```php
$GLOBALS['TL_DCA']['tl_example']['fields']['coordinates'] = [
'label' => ['Koordinaten', 'Geben Sie die Koordinaten ein'],
'inputType' => 'leaflet_geocode',
'eval' => [
2017-10-04 11:10:03 +02:00
'tl_class' => 'w50',
2017-01-18 17:30:58 +01:00
],
'sql' => 'varchar(255) NOT NULL default \'\''
];
```