record->$group->fields) * @return string the src value for the iframe */ function xnau_gmap_src( $fields ) { /** * these are the fieldnames for the address * * change these to match the names of the address fields in your setup */ $address_fields = array('address', 'city', 'state', 'country'); // assemble the address search string from the address fields $address = array(); foreach ( $address_fields as $field ) { $v = $fields->$field->value; if ( !empty( $v ) ) $address[] = $v; } // convert the array of values into a comma-separated list $search = implode( ',', $address ); /* * this is where the default parameters of the map are set with notes on some * of the more useful ones. There are more, these are just the ones most likely * to need setting. A full explanation of the parameters can be found here: * https://moz.com/ugc/everything-you-never-wanted-to-know-about-google-maps-parameters */ $gmap_params = array( 'q' => $search, // address search 'mrt' => 'loc', // search type: loc = location, yp - business 't' => 'm', // map type: m - map, k - satellite, h - hybrid, p - terrain 'z' => 10, // zoom level: 1 - 20 'om' => 0, // overview map: 1 - show, 0 - don't show 'output' => 'embed', // output type 'f' => 'q', // search form type: q - standard, d - directions, l - local ); return 'https://maps.google.com/maps?' . build_query( $gmap_params ); } endif; ?>

have_groups() ) : $this->the_group(); ?>
group->print_title( '

', '

' ) ?> group->print_description( '

', '

' ) ?> have_fields() ) : $this->the_field(); // CSS class for empty fields $empty_class = $this->get_empty_class( $this->field ); ?>
field->print_label() ?>
field->print_value() ?>
Map