Support Forum
Support › Meta Box Geolocation › Open Street Maps: Exposing Latitude, Longitude, Zoom LevelResolved
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.
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
),
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.
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
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
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?
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.
Hi,
Thank you for your answer.
Outside of Geolocation extension, is there a way to "transform" a text field into a category/tag?
Hi,
I will inform the development team to explore the possibility. Thanks for your feedback.