Google Maps and gravity forms live map entry

I posted this in another thread but it is a big deal I think so I am adding here in as well.

1.Is there a post or section in the docs that I am missing for a list of all the shortcodes? I have not been able to find it.

2.With WPgeo I was able to, with the addition of some code, make a google map appear in a gravity form. Allow the user to select and mark an address. This address/lat-lon was then placed in my form -> custom fields. Then I was able to use this in a post.

As done here

3.Implement google search for content? As in make money from map searches? Some of the ‘other’ plugins attach your adsense ID and allow the addition of a search box on the map itself.

4.Is it possible to add the map ID to the map editor? I will have hundreds, possibly thousands of maps. Finding them by name is not ideal. Maybe filter by maps attached to this post checkbox?

5.Is it possible to add default shortcodes? Say in a page/post template? Or in the plugin settings?

There was some other stuff you had to do like add a section break and apply the form to it I believe. I had this working previously but the plugin itself was to limited.

-> #2 is the main reason for my use of this plugin. Is this possible with the WPMU plugin? This is a huge deal for me as I dont want users to be able to access ALL of the maps on my site. Giving them access to the back end to edit appears to do this?

I do love the feature of being able to add multiple pins to a single post map. This works great!

I guess what I am really asking for is the ability to call the plugins create map features from the front end with a shortcode. Or at least as with WPgeo, add some custom code to make it work.

The code used to make this happen with WPgeo is:

01 add_filter(“gform_pre_render”, “gravityforms_wpgeo_mashup”:wink:;

02 function gravityforms_wpgeo_mashup($form) {


04 //REPLACE 1 with your actual form id

05 $my_geo_form = 1;

06 if($form[“id”] !=$my_geo_form)

07 return;


09 // find IDs of latitude&longitude custom fields

10 foreach($form[“fields”] as &$field){

11 if($field[“postCustomFieldName”]==”_wp_geo_longitude”:wink: $field_lng = $field[“id”];

12 if($field[“postCustomFieldName”]==”_wp_geo_latitude”:wink: $field_lat = $field[“id”];

13 //print_r($field);

14 }


16 // show map only if latitude&longitude custom fields exist

17 if($field_lng && $field_lat ) :

18 // load “WP Geo” plugin

19 require_once( WP_PLUGIN_DIR . ‘/wp-geo/wp-geo.php’ );

20 global $wpgeo;

21 $wpgeo = new WPGeo();

22 $zoom = 2;

23 $map = $wpgeo->mapScriptsInit( 20, 0,$zoom, true, false );

24 $map .=’

25 <input type=”hidden” name=”wpgeo_map_settings_zoom” id=”wpgeo_map_settings_zoom” value=”” />

26 <input type=”hidden” name=”wpgeo_map_settings_type” id=”wpgeo_map_settings_type” value=”” />

27 <input type=”hidden” name=”wpgeo_map_settings_centre” id=”wpgeo_map_settings_centre” value=”” />

28 <input name=”wp_geo_latitude” type=”hidden” size=”25″ id=”wp_geo_latitude” value=”” />

29 <input name=”wp_geo_longitude” type=”hidden” size=”25″ id=”wp_geo_longitude” value=”” />

30 <script type=”text/javascript”>

31 <!–

32 jQuery(document).ready(function() {‘;


34 $map .=’var my_geo_form= ‘.$my_geo_form.’;’;

35 $map .=’var field_lng= ‘.$field_lng.’;’;

36 $map .=’var field_lat= ‘.$field_lat.’;’;

37 $map .=’

38 jQuery(“#wp_geo_map” {


40 jQuery(“#input_”+my_geo_form+”_”+field_lat).val(jQuery(“#wp_geo_latitude”:wink:.val());

41 jQuery(“#input_”+my_geo_form+”_”+field_lng).val(jQuery(“#wp_geo_longitude”:wink:.val());


43 });


45 });

46 –>

47 </script>

48 <div id=”wp_geo_map” style=”width:auto; height:400px”></div>’;


50 // find ID of section with cssClass “wpgeo” and put the map into description

51 foreach($form[“fields”] as &$field){

52 if($field[“cssClass”]==”wpgeo”:wink:$field[“description”].=$map;

53 }

54 endif;

55 return $form;

56 }