<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
netzmacht / contao-leaflet-geocode-widget example snippets
// 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(),
$GLOBALS['TL_DCA']['tl_example']['fields']['coordinates'] = [
'label' => ['Koordinaten', 'Geben Sie die Koordinaten ein'],
'inputType' => 'leaflet_geocode',
'eval' => [
'tl_class' => 'w50',
],
'sql' => 'varchar(255) NOT NULL default \'\''
];
$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' => 'leaflet_radius', // Optional, you can use a text widget as well
'eval' => [
'default' => 500,
'minval' => 100,
'maxval' => 5000,
'steps' => 100, // Round value to the closest 100m.
'tl_class' => 'w50',
],
'sql' => 'varchar(255) NOT NULL default \'\''
];