Open Street Maps: Exposing Latitude, Longitude, Zoom Level

Support MB Geolocation Open Street Maps: Exposing Latitude, Longitude, Zoom LevelResolved

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #23863
    MauroMauro
    Participant

    Hello Anh,
    Following up to this conversation from 2 years ago, I need to expose Lat, Lon and Zoom level from the OMS map so that content managers can fine tune this or paste the coordinates from a different source.

    https://support.metabox.io/topic/open-street-maps-binding-of-latitude-and-longitude-keeping-the-map-in-english/

    I tried with a similar code but it's not working.
    Can you help?

    array(
                    'type' => 'text',
                    'name' => 'Address',
                    'id'    => 'address',
                    'desc' => 'Use this field to autocomplete the address and add the coordinates automatically.',
                ),
                array(
                    'id' => 'location',
                    'type' => 'osm',
                    'name' => 'Location',
                    'address_field' => 'address',
                    'language' => 'en',
                    'desc' => 'You can click on "find address" below the map to update the pin location on the map. Fill the address field above to update the coordinates.',
                ),
                array(
                    'type' => 'text',
                    'name' => 'Latitude',
                    'id'    => 'latitude',
                    'binding' => 'lat' // lat,lng
                ),
                array(
                    'type' => 'text',
                    'name' => 'Longitude',
                    'id'    => 'longitude',
                    'binding' => 'lng' // lat,lng
                ),
    #24518
    Long NguyenLong Nguyen
    Moderator

    Hi Mauro,

    Please update the newest version of MB Geolocation v1.3.1 to make it works. Get the sample case here https://github.com/wpmetabox/meta-box-geolocation/blob/master/tests/osm.php.

    #27049
    UlysseUlysse
    Participant

    Hello,

    I try to do the same thing, but with the Metabox vuilder.
    My issue is, that I don't see how to autopopuluate country, city...

    If I take the example of this code:
    [
    'type' => 'text',
    'name' => 'Country',
    'id' => 'country',
    'address_field' => 'address6',

    I cannot do that in the metaboxbuilder? https://prnt.sc/1176ubw

    #27056
    Long NguyenLong Nguyen
    Moderator

    Hi Ulysse,

    Please take a look at my screen record to know how to use MB Geolocation with Builder https://share.getcloudapp.com/p9ub7Jln.

    Get more details on the documentation
    https://docs.metabox.io/extensions/meta-box-geolocation/#multiple-autocomplete-addresses
    https://docs.metabox.io/extensions/meta-box-builder/#custom-settings

    #27064
    UlysseUlysse
    Participant

    Thank you very much. It works.

    I was able to extract the country (country_agent) from the adress (adress_agent).

    For the same custom post, I have created a custom category that I called 'Location of the Agent".
    I would like to populate the category with the country_agent I exctracted from the adress_agent.

    I tried to do it with relationships but I failed. Is tere a way to do that?

    #27085
    Long NguyenLong Nguyen
    Moderator

    Hi,

    It is not possible. The extension only supports populating the data to the field type text as in the documentation https://docs.metabox.io/extensions/meta-box-geolocation/#adding-autocomplete-field.

    #27089
    UlysseUlysse
    Participant

    Hi,
    Thank you for your answer.

    Outside of Geolocation extension, is there a way to "transform" a text field into a category/tag?

    #27100
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I will inform the development team to explore the possibility. Thanks for your feedback.

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