Support

Account

Home Forums General Issues Google Map Field and HEIGHT

Helping

Google Map Field and HEIGHT

  • Hi Guys

    I’m working with the Google Map field (http://www.advancedcustomfields.com/resources/google-map/). I setup the height but I’m not getting that value on the array.

    If I var_dump($map_field), I’m just getting this data:

    array (size=3)
    ‘address’ => string ‘600 Orrong Road, Armadale, VIC, 3143, Australia’ (length=47)
    ‘lat’ => string ‘-37.85017759999999’ (length=18)
    ‘lng’ => string ‘145.0121567’ (length=11)

    Do you know where is this value? I’m working with ACF Pro.

    I;m not sure if this is a bug, so I will post it on General Issues…

    Thanks
    Emiliano

  • I needed this answer, too, so for posterity:
    You need to get the field object:

    $map_object = get_field_object('your_map_field_name');

    That will give you all the field settings. e.g. print_r($map_object):

    Array (
        [key] => field_1234567890
        [label] => Map
        [name] => your_map_field_name
        [_name] => your_map_field_name
        [type] => google_map
        [order_no] => 1
        [instructions] =>
        [required] => 0
        [id] => acf-field-map
        [class] => google_map
        [conditional_logic] => Array (
            [status] => 0
            [rules] => Array (
                [0] => Array (
                    [field] => null
                    [operator] => ==
                )
            )
            [allorany] => all
        )
        [center_lat] =>
        [center_lng] =>
        [zoom] => 12
        [height] => 300 (there it is, yay!)
        [field_group] => 123
        [value] => Array (
            [address] => 123 Main St Anywhere USA
            [lat] => 12.3456789
            [lng] => -123.456789
        )
    )

    ps – just realized this is exactly one year later. weird.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Google Map Field and HEIGHT’ is closed to new replies.