Navigation überspringen

[Gelöst] Use Views to set lat and long of a map marker shortcode

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem: I would like to place a map mark at a specific latitude and longitude. The value of that latitude should be defined by the results of a View. The longitude should be defined by the results of a different View. When I insert the View shortcode in the map marker shortcode, the marker doesn't show up correctly.

Solution: Instead of placing the View inside the lat or long attribute, move the entire marker shortcode inside the View.

This support ticket is created vor 6 Jahren, 2 Monaten. 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Pat vor 6 Jahren, 2 Monaten.

Assistiert von: Christian Cox.

Author
Artikel
#1144445

Pat

Hello,

I'm making some tests with Divi + Toolset and have an issue :
I have created a content template thanks to the Divi builder and in one text cell, I have inserted a Toolset Maps + Toolset Marker :

{!{wpv-map-render map_id="map-1" map_width="100%" map_height="300px" scrollwheel="off"}!}{!{/wpv-map-render}!}
{!{wpv-map-marker map_id='map-1' marker_id='marker-3' lat='{!{wpv-view name="latitude-dun-stage"}!}' lon='{!{wpv-view name="longitude-dun-stage"}!}'}!}{!{/wpv-map-marker}!}

The markers are defined by lat and long data which are given by a custom field. As it is term fields, I have created a Views to be able to retrieve the right data.

If I display these Views, that's working fine but when they are in the Toolset maps, then nothing is displayed (just a rectangular grey box with no other indication).

Is there a way to use Divi + Toolset maps defined thanks to lat + long custom fields?

Regards
Pat

#1144520

Hi Pat, the easiest solution is to move the wpv-map-marker shortcode into the loop of the taxonomy View. Or, you can modify the View output to remove all extra HTML markup and spaces. Then check "Disable the wrapping div around the View" in the View editor screen.

#1144803

Pat

Hi Christian,

Both solutions work well.
Many thanks for your quick answer
Regards
Pat