This form class is responsible to create a geolocation latitude/longitude coordinates field.
| Option | Type | Default value | Description |
|---|---|---|---|
| label_longitude | string | Longitude | Longitude label |
| label_latitude | string | Latitude | Latitude label |
None.
Add GeoCoordinatesType to your form.
<?php
// path/to/your/CustomType.php
use PrestaShopBundle\Form\Admin\Type\GeoCoordinatesType;
class CustomType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('coordinates', GeoCoordinatesType::class)
;
}
}
Find a complete implementation in the demosymfonyform module.
The GeoCoordinatesType renders two input fields that must be provided when updating the value:
