JQueryAddressPicker Field (view demo)
<?php
// ...
public function buildForm(FormBuilder $builder, array $options)
{
$builder
// ...
->add('geolocation', 'genemu_jquerygeolocation')
}
<?php
// ...
public function buildForm(FormBuilder $builder, array $options)
{
$builder
// ...
->add('geolocation', 'genemu_jquerygeolocation', array(
'map' => false,
'latitude' => array(
'enabled' => false,
'hidden' => true,
),
'longitude' => array(
'enabled' => false,
'hidden' => true,
),
'locality' => array(
'enabled' => false,
'hidden' => true,
),
'country' => array(
'enabled' => false,
'hidden' => false,
),
))
}
To see which jQuery libraries to include, see the html code of the demo
The mapped property (in this example "geolocation") will receive an AddressGeolocation
object.
This object is serializable, for example you can map it to a Doctrine object
field.