Frontend Submission - Google Maps - Hide Controls

Support MB Frontend Submission Frontend Submission - Google Maps - Hide ControlsResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #45706
    CodogCodog
    Participant

    Hi there,
    I have a frontend submission form that contains a Google Map and address field that uses the Geocoding API for autocomplete. All works as expected!

    However, I would like to 'Disable/Hide' the map controls such as:

    - zoomControl
    - fullscreenControl
    - mapTypeToControl

    Within the submission form Google Map.

    Looking at your documentation here - https://docs.metabox.io/fields/map/ I can see that the "frontend" display of the map can be customised via some $args. But within my submission form Google Map the 'js_options' have no effect?

    EG:

    				
    [
    'id'            => 'map',
    'type'          => 'map',
    'api_key'       => 'xxxxxxxxxxxxxxxxxxxxxxxx', 
    'zoom'         => 10,
    'std'           => '',
    'address_field' => 'address',
    'js_options' => [
       'zoomControl' => false,
       'fullscreenControl' => false,
       'mapTypeToControl' => false,
       ],
    ],
    
    

    How can this be achieved? What am I missing? Custom JS? An example would be very helpful 🙂

    #45718
    PeterPeter
    Moderator

    Hello,

    Using the frontend form means you are using the settings in the admin area, the form just brings settings to the frontend. It is different from the rendering map in the frontend when you output the field value. And there isn't a field setting to add JS options to the map in the admin area.

    #45733
    CodogCodog
    Participant

    Thanks Peter, understood. Custom JS solution it is!

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