Download the PHP package sircamp/google-map-form-type-builder without Composer
On this page you can find all versions of the php package sircamp/google-map-form-type-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sircamp/google-map-form-type-builder
More information about sircamp/google-map-form-type-builder
Files in sircamp/google-map-form-type-builder
Package google-map-form-type-builder
Short Description A form buoilder for google maps and symfony
License MIT
Informations about the package google-map-form-type-builder
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
This bundle is compatible with Symfony >= 2.1. Add the following to your composer.json
:
Register the bundle in your app/AppKernel.php
by adding this line in the bundles array:
Remember to add the bundle on assetic field present in your configuration file ( config.yalm or others )
Add OhGoogleMapFormTypeBundle to assetic
Usage
This bundle contains a new FormType called GoogleMapType which can be used in your forms like so:
On your model you will have to process the latitude, longitude, street, city, postcode array 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
-------
This librabry is based on the orignal made by
* Ollie Harridge (ollietb)