Custom Fields
Re-Envisioned
Support Meta Box Builder Dot notation for MB Geolocation "type"

  • Creator
    Topic
  • #15993
    Resolved pza
    Participant

    I may be missing something obvious, but I’ve tested and searched on here to no avail.

    Here’s what I’m trying to do:
    – Using MB Builder + MB Geolocation, set the “Types” option to return 2 types. Like in the example on the MB Geolocation docs, I would like to set it to “(cities)” and “”establishment”

    'geo' => array(
        'api_key' => 'YOUR API KEY',
        'types' => array( '(cities)', 'establishment' )
    ),

    How can I do that in the Settings tab of MB Builder?

    I tried adding a custom attribute of geo.types => [{"establishment","(cities)"}]

    But on the front end I get the following error:

    InvalidValueError: setTypes: not an Array
    _.Wc @ js?libraries=places&key=AIzaSyDgNeQLcJwxuVJC8yC_F1HYfXONXoTVaxc&ver=5.2.2:60

    Can this be done with MB Builder + Geolocation?

    Thanks for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #16001
    Anh Tran
    Keymaster

    Hi pza,

    Please set as follows:

    • geo.types.0 = (cities)
    • geo.types.1 = establishment
    #16010
    pza
    Participant

    I tried this also but no results show in autocomplete. Perhaps it’s just not valid to pass two arguments here? For my purposes address will work for now. Thanks Anh.

    #16424
    brandonjp
    Participant

    @pza I use JSON syntax and it seems to work fine.

    On your custom attribute (in your original post) you’re creating an object inside an array:

    I tried adding a custom attribute of geo.types => [{"establishment","(cities)"}]

    But it just needs to be an array with two values: ['establishment','(cities)'] (no inner curly brackets)

    #16566
    pza
    Participant

    Ohh, I feel silly now. Thank you!

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