ollietb / OhGoogleMapFormTypeBundle

Set latitude and longitude values on a form using Google Maps
MIT License
30 stars 76 forks source link

Including Javascript #18

Open mohebifar opened 10 years ago

mohebifar commented 10 years ago

I am using this bundle and it's good for me. The problem is you included oh_google_maps_javascripts and oh_google_maps_javascript blocks in oh_google_maps_widget.

I don't know why you didn't write this blocks separated and attempt to use form_javascript(form). It can be better. If you want, I will request for pull.

Kleinast commented 9 years ago

That will be nice ^^, I really need this, thanks in advance.

Saint-Cyr commented 9 years ago

Hello after install that bundle I cannot load the form as mentionate in the documentation ... I still get the following error:

Variable "id" does not exist in OhGoogleMapFormTypeBundle:Form:google_maps.html.twig at line 4

I don't any idea about it this error while I've done all configuration

twig: form: resources:

This uses the default - you can put your own one here

        - 'MpkCmsBundle:Cms:index.html.twig'

->add('latlng', 'oh_google_maps', array( 'type' => 'text', // the types to render the lat and lng fields as 'options' => array(), // the options for both the fields 'lat_options' => array(), // the options for just the lat field 'lng_options' => array(), // the options for just the lng field 'lat_name' => 'lat', // the name of the lat field 'lng_name' => 'lng', // the name of the lng field 'map_width' => 300, // the width of the map 'map_height' => 300, // the height of the map 'default_lat' => 5.556767632714969, // the starting position on the map 'default_lng' => -0.20776189863681793, // the starting position on the map 'include_jquery' => false, // jquery needs to be included above the field (ie not at the bottom of the page) 'include_gmaps_js'=>true, // is this the best place to include the google maps javascript? ))

xmon commented 7 years ago

https://github.com/ollieLtd/OhGoogleMapFormTypeBundle/pull/17