How to remove zoom level from Location output

Support MB Geolocation How to remove zoom level from Location outputResolved

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #26740
    picatabaibospicatabaibos
    Participant

    Hi,

    I'm trying to output location with only "latitude, longitude" but the zoom is always there.

    I'm using oxygen builder.

    Can you help please?

    Thank you,
    João Neves

    #26752
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thank you for reaching out.

    By default, the output of the map fields (Google Map or OSM) always includes the latitude, longitude, and zoom. If you want only to use the latitude and longitude, please follow this documentation https://docs.metabox.io/fields/map/#getting-field-value.

    #26756
    picatabaibospicatabaibos
    Participant

    Hi Long Nguyen,

    Thank you for your reply.

    There is a map functionality on Oxygen Builder where we can put lat, lng and display a map. But because the output of MetaBox location output the zoom I can't use the Oxygen Map functionality.

    Is there any way I can output just lat, lng on other variable or map element?

    Thank you,
    João Neves

    #26758
    picatabaibospicatabaibos
    Participant

    I'm trying to make something like ACF - https://wpdevdesign.com/how-to-display-acfs-google-map-field-via-oxygens-google-maps-element/

    I've been able to do it with ACF but I'm not understanding how to do it with Meta Box. Seems like $field_id is not referenced here - $location = rwmb_get_value( $field_id );

    Sorry for the noobs questions (I'm not a coder).

    I really appreciate your help.

    #26759
    picatabaibospicatabaibos
    Participant

    I've been able to make it work with a little help:

    function get_map_location() {
    $location = rwmb_get_value('mapa3');
    if ((!empty($location['latitude'])) && (!empty($location['longitude']))) {
    return $location['latitude'].','.$location['longitude'];
    }
    return NULL;
    }

    Thank you!!

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