Update readme and changelog.

This commit is contained in:
David Molineus
2018-02-08 21:57:20 +01:00
parent e7b930f4a1
commit a4c24a80c2
2 changed files with 34 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ Version 1.3.0 (2018-02-xx)
[Full Changelog](https://github.com/netzmacht/contao-leaflet-geocode-widget/compare/1.2.1...1.3.0)
- Move apply button to the modal footer.
- Deprecate `Netzmacht\Contao\Leaflet\GeocodeWidget`. Use `Netzmacht\Contao\Leaflet\Widget\GeocodeWidget` instead.
- Add feature to adjust a radius.
- Allow Contao 4.5.0.

View File

@@ -51,6 +51,8 @@ bin/console assets:install --symlink
### 4. Use the widget
#### Coordinates only
```php
$GLOBALS['TL_DCA']['tl_example']['fields']['coordinates'] = [
'label' => ['Koordinaten', 'Geben Sie die Koordinaten ein'],
@@ -61,3 +63,34 @@ $GLOBALS['TL_DCA']['tl_example']['fields']['coordinates'] = [
'sql' => 'varchar(255) NOT NULL default \'\''
];
```
#### Coordinates and radius
To pick the radius in meters as well, you have to configure the `eval.radius` option for the related radius field.
The radius field should be a simle text input. The `default`, `minval` and `maxval` flags are passed to the geocode
widget so that only radius in that boundary can be chosen.
```php
$GLOBALS['TL_DCA']['tl_page']['fields']['coordinates'] = [
'label' => ['Koordinaten', 'Geben Sie die Koordinaten ein'],
'inputType' => 'leaflet_geocode',
'eval' => [
'tl_class' => 'w50',
'radius' => 'radius'
],
'sql' => 'varchar(255) NOT NULL default \'\''
];
$GLOBALS['TL_DCA']['tl_page']['fields']['radius'] = [
'label' => ['Radius', 'Angabe des Radius in Metern'],
'inputType' => 'text',
'eval' => [
'rgxp' => 'natural',
'default' => 500,
'minval' => 100,
'maxval' => 5000,
'tl_class' => 'w50',
],
'sql' => 'varchar(255) NOT NULL default \'\''
];
```