mirror of
https://github.com/netzmacht/contao-leaflet-geocode-widget.git
synced 2025-11-29 12:13:40 +01:00
Update readme and changelog.
This commit is contained in:
@@ -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.
|
||||
|
||||
33
README.md
33
README.md
@@ -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 \'\''
|
||||
];
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user