Display googlemap in views

Support MB Views Display googlemap in views

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #39547
    Chris PChris P
    Participant

    How to display a google map in mb views when in a group?

    $args = [
        'width'      => '640px',
        'height'     => '480px',
        'js_options' => [
            'mapTypeId'   => 'HYBRID',
            'zoomControl' => false,
        ],
    ];
    $group_values = rwmb_meta( 'group_id' );
    $args = array(
        'api_key' => 'your-API-key'
    );
    // If group is cloneable
    foreach ( $group_values as $group_value ) {
        echo RWMB_Map_Field::render_map( $group_value['map_id'], $args );
    }

    Basically this but then in mb views twig shorthand?

    Anyone?

    Thx in advance

    #39590
    PeterPeter
    Moderator

    Hello Chris,

    If you want to display a subfield Google map in MB Views, please create a custom function to add the API key to the function render_map() like the code above then add the function to the view editor to render the map. In the view editor, it is not supported.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.