Spatial support for Sonata Admin with Google Maps
This package is a Sonata Admin integration of djlambert/doctrine2-spatial.
$ php composer.phar require looptribe/sonata-spatial dev-master
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Looptribe\SonataSpatialBundle\LooptribeSonataSpatialBundle(),
// ...
);
}
Simply add to your Sonata admin class
// src/Looptribe/MyBundle/Admin/FooAdmin.php
<?php
// Fields to be shown on create/edit forms
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
// ...
->add('location', 'point')
// ...
;
}
At the moment only the Point type is supported.