Skip Navigation

[Resolved] Toolset Maps Accepts values ​​of the fields geo_latitude and geo_longitude

This thread is resolved. Here is a description of the problem and solution.

Problem:

I can set geodata (places) in the app. These values ​​will then appear in the uploaded post in the geo_latitude and geo_longitude fields. I would like the values ​​of these fields to be automatically taken from the Plugin Toolset Maps inserted in the post and displayed as a marker on the map.

Solution:

It is possible to setup the map marker with custom fields.

For example:

https://toolset.com/forums/topic/toolset-maps-accepts-values-%e2%80%8b%e2%80%8bof-the-fields-geo_latitude-and-geo_longitude/#post-1379591

Relevant Documentation:

https://toolset.com/documentation/user-guides/maps-shortcodes/#wpv-map-marker

This support ticket is created 5 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 7 replies, has 2 voices.

Last updated by frankW 5 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#1379345

Good day.
I partially upload posts with the Worpress app. I can set geodata (places) in the app. These values ​​will then appear in the uploaded post in the geo_latitude and geo_longitude fields. I would like the values ​​of these fields to be automatically taken from the Plugin Toolset Maps inserted in the post and displayed as a marker on the map. What do I have to do?

Thank you so much!

#1379591

Hello,

It is possible to setup the map marker with custom fields.

For example:

[wpv-map-marker map_id='map-0' marker_id='marker-[wpv-post-id]' lat='[wpv-post-field name="geo_latitude"]' lon='[wpv-post-field name="geo_latitude"]'][/wpv-map-marker]

See our document:
https://toolset.com/documentation/user-guides/maps-shortcodes/#wpv-map-marker
lat and lon. Optional, both default to empty. Another optional source of the marker location, allows to display a marker given its latitude and longitude coordinates. Both values need to be passed.
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-field
Output a custom field for the current post.

#1379597

Hello, thank you. Where do you need to insert the shordcode?

thanks

#1379645

You can follow our document to setup the Map + Marker shortcodes:
https://toolset.com/documentation/user-guides/display-on-google-maps/

For example, you can create a content template for single post, and insert the map and marker shortcode into content template.

#1380373

Hello, it works. I have another question. What do I have to do to prevent a map from being displayed if there are no values ​​in the geo_latitude and geo_longitude fields?

greetings

#1380515

You can use [wpv-conditional] shortcode to check if geo_latitude and geo_longitude fields are not empty, then display the marker shortcode, see our document:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/
Checking fields and other elements for Empty/Non-empty Values

#1381383

This too works. Many thanks for your help!

#1381385

This too works. Many thanks for your help!