PHP code example of sircamp / google-map-form-type-builder

1. Go to this page and download the library: Download sircamp/google-map-form-type-builder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sircamp / google-map-form-type-builder example snippets


    "sircamp/google-map-form-type-bundle": "dev-master"


    new Sircamp\GoogleMapFormTypeBundle\SircampGoogleMapFormTypeBundle(),


    $builder->add('address', 'sircamp_google_maps');

    
    use Symfony\Component\Validator\Constraints as Assert;
    use Sircamp\GoogleMapFormTypeBundle\Validator\Constraints as OhAssert;

    class MyEntity
    {
        // ... de,
       'lng' => $this->longitude, 
       'street' => $this->street,
       'city' => $this->city, 
       'postcode'=>$this->postcode));
    }

    public function setAddress($address)
    {
       // die(var_dump($address,$address['address']['lat']));
       $this
          ->setCity($address['address']['city'])
          ->setPostcode($address['address']['postcode'])
          ->setStreet($address['address']['street'])
          ->setLatitude($address['address']['lat'])
          ->setLongitude($address['address']['lng']);
       
       return $this;
    }

  }

Include the twig template on your config.yalm for the layout.