PHPackages                             sircamp/google-map-form-type-builder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sircamp/google-map-form-type-builder

ActiveLibrary

sircamp/google-map-form-type-builder
====================================

A form buoilder for google maps and symfony

1.0(10y ago)051MITCSSPHP &gt;=5.4

Since Sep 1Pushed 10y ago1 watchersCompare

[ Source](https://github.com/sirCamp/GoogleMapFormTypeBundle)[ Packagist](https://packagist.org/packages/sircamp/google-map-form-type-builder)[ RSS](/packages/sircamp-google-map-form-type-builder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

GoogleMapFormTypeBundle
=======================

[](#googlemapformtypebundle)

Set latitude, longitude, street, postcode and city values on a form using Google Maps. The map allows you to search the place by a data that you have filled or by current location button. When a pin is placed or dragged on the map, the latitude longitude fields are updated.

Installation
------------

[](#installation)

This bundle is compatible with *Symfony &gt;= 2.1*. Add the following to your `composer.json`:

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

Register the bundle in your `app/AppKernel.php` by adding this line in the bundles array:

```
    new Sircamp\GoogleMapFormTypeBundle\SircampGoogleMapFormTypeBundle(),
```

Remember to add the bundle on **assetic** field present in your configuration file ( config.yalm or others )

Add OhGoogleMapFormTypeBundle to assetic

```
# app/config/config.yml
# Assetic Configuration
assetic:
    bundles:        [ 'SircampGoogleMapFormTypeBundle' ]
```

Usage
-----

[](#usage)

This bundle contains a new FormType called GoogleMapType which can be used in your forms like so:

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

On your model you will have to process the latitude, longitude, street, city, postcode array

```

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

    class MyEntity
    {
        // ... include your latitude,longitude,street,city,postacode fields here

   /**
    * @Assert\NotBlank()
    * @SircampAssert\Address()
    */
    public function getAddress()
    {
       return array('address' => array(
       'lat' => $this->latitude,
       '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.
```yaml
    # your config.yml
    twig:
        form:
            resources:
                # This uses the default - you can put your own one here
                - 'SircampGoogleMapFormTypeBundle:Form:fields.html.twig'
```

If you are intending to override some of the elements in the template then you can do so by extending the default `google_maps.html.twig`. This example adds a callback to the javascript when a new map position is selected.

Credits
-------

[](#credits)

This librabry is based on the orignal made by

- Ollie Harridge (ollietb)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3912d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6a45bd7c5644ca2c22d0cc89bfb7b0c017060e0e088088906fc7c78c614c314?d=identicon)[sircamp](/maintainers/sircamp)

---

Top Contributors

[![stefanocampeseomnys](https://avatars.githubusercontent.com/u/125976728?v=4)](https://github.com/stefanocampeseomnys "stefanocampeseomnys (6 commits)")[![sirCamp](https://avatars.githubusercontent.com/u/7548001?v=4)](https://github.com/sirCamp "sirCamp (1 commits)")

### Embed Badge

![Health badge](/badges/sircamp-google-map-form-type-builder/health.svg)

```
[![Health](https://phpackages.com/badges/sircamp-google-map-form-type-builder/health.svg)](https://phpackages.com/packages/sircamp-google-map-form-type-builder)
```

###  Alternatives

[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[stfalcon/tinymce-bundle

This Bundle integrates TinyMCE WYSIWYG editor into a Symfony2 project.

2692.9M24](/packages/stfalcon-tinymce-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[symfony/ai-bundle

Integration bundle for Symfony AI components

30282.3k6](/packages/symfony-ai-bundle)[rikudou/psr6-dynamo-db-bundle

PSR-6 and PSR-16 cache implementation using AWS DynamoDB for Symfony

2077.8k](/packages/rikudou-psr6-dynamo-db-bundle)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
