Support Forum
Support › Meta Box Geolocation › OSM and Groups
I'm trying to get the autocomplete to work here (geolocation) using the address field but it doesnt seem to understand the reference to it, given that the loop is rewriting the id of the element referenced.
Any idea if i'm doing something wrong here?
It works when outside a group.
Thank you.
////////////// ITINÉRAIRE /////////////////
$meta_boxes[] = array(
'title' => __( 'Itinerary Tab', 'vtx-admin' ),
'post_types' => array( self::$name ),
'context' => 'normal',
'priority' => 'high',
'autosave' => true,
'fields' => array(
array(
'id' => "{$prefix}itineraries",
// 'name' => __('Itineraries' , 'vtx-admin'),
'type' => 'group',
'clone' => true,
'sort_clone' => true,
'clone_default' => true,
'collapsible' => false,
'save_state' => true,
'group_title' => array( 'field' => "{$prefix}itinerary_header" ),
'add_button' => __("Add an itinerary", "vtx-admin"),
'fields' => array(
array(
'id' => "{$prefix}itinerary_header",
'name' => __('Header' , 'vtx-admin'),
'desc' => __( 'Écrire Itinéraire ou Itinerary', 'vtx-admin' ),
'type' => 'text',
),
array(
'name' => __( "Header Image", 'vtx-admin' ),
'id' => "{$prefix}itinerary_header_img",
'desc' => __( 'Utile pour mettre les maps des croisières.', 'vtx-admin' ),
'type' => 'image_advanced',
'max_file_uploads' => 1,
),
array(
'type' => 'heading',
'name' => __( 'Itinerary points', 'vtx-admin' ),
),
array(
'id' => "{$prefix}itinerary",
// 'name' => __('Itinerary Points' , 'vtx-admin'),
'type' => 'group',
'clone' => true,
'sort_clone' => true,
'clone_default' => true,
'collapsible' => false,
'save_state' => true,
'group_title' => array( 'field' => "{$prefix}itelem_title" ),
'add_button' => __("Add an itinerary point", "vtx-admin"),
'clone_empty_start' => true,
'fields' => array(
array(
'id' => "{$prefix}itelem_label",
'name' => __('Label of timeline', 'vtx-admin'),
'desc' => __( 'Jour 1, Jour 2, etc.', 'vtx-admin' ),
'type' => 'text',
),
array(
'id' => "{$prefix}itelem_title",
'name' => __('Title', 'vtx-admin'),
'desc' => __( 'Nom de lendroit visité le plus souvent pendant cette journée-là, exemple Montréal - Québec', 'vtx-admin' ),
'type' => 'text',
),
array(
'id' => "{$prefix}itelem_text",
'name' => __('Description', 'vtx-admin'),
'desc' => __( 'La description optionnelle des visites ou activités effectuées au courant de cette journée-là.', 'vtx-admin' ),
'type' => 'wysiwyg',
'options' => get_default_wysiwyg_options(),
),
array(
'id' => "{$prefix}itelem_address",
'name' => __( 'Address', 'vtx-admin' ),
'desc' => __( 'Google autocomplete', 'vtx-admin' ),
'type' => 'text',
),
array(
'id' => "{$prefix}itelem_map",
'name' => __( 'Location Destination', 'vtx-admin' ),
'type' => 'osm',
// Default location: 'latitude,longitude[,zoom]' (zoom is optional)
'address_field' => "{$prefix}itelem_address",
),
),
),
),
),
array(
'id' => "{$prefix}itinerary_description",
'name' => __("Description sous l'itinéraire" , "vtx-admin"),
'desc' => __( "Texte qui affiche sous l'itinéraire", "vtx-admin" ),
'type' => 'wysiwyg',
'options' => get_default_wysiwyg_options(array( 'textarea_rows' => 4 )),
),
),
);
Hi,
Thank you for your feedback.
It is similar to this issue https://support.metabox.io/topic/issues-with-geocoding-address-field-map-field-in-groups/
the development is working to fix the issue with geolocation in a group field and you can try to apply the fix in the topic above to see if it works.