Custom Fields
Re-Envisioned
Support Meta Box Geolocation How to remove zoom level from Location output

  • Creator
    Topic
  • #26740
    Resolved picatabaibos
    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #26752
    Long 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
    picatabaibos
    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
    picatabaibos
    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
    picatabaibos
    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 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.