Skip Navigation

[Resolved] Show marker for each View result on a map

This support ticket is created 3 years, 8 months 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 4 replies, has 2 voices.

Last updated by andyB-12 3 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#1733603

I would also need advice on how to implement a map that shows marks on all addresses that are entered in the custom field of a specific custom post type. I already set up the custom post type and the custom fields and created three example posts with addresses and they are also showing up in the results, but I wasnt able to create a map that shows those addresses on the map.

hidden link
hidden link

#1734351

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Screenshot 2020-08-11 at 13.15.33.png

You already have a page where you added a search View that outputs a list of results, yes?

In which case you need to add a Toolset Map block where you want the map to appear.

Then in the Map block settings in the sidebar, you specify that the markers should come from the View you already have on the page (see screenshot).

You'll need to have added the API key to the Maps settings at Toolset > Settings > Maps.

#1737557

Hey Nigel,
thanks for your response. I am not using the new block editor, but the legacy view editor and integrating the views via shortcode into my Divi layouts.

Does this change how to make the map work?

#1737653

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

OK, this is somewhat different, then.

The map and markers will be part of the View itself.

In the output section of the View you'll need to use the Fields and Views button to insert the shortcode to output a map (be sure to insert it outside of the loop, so the map is added only once; it could be just after the wpv-layout-start shortcode, for example, or after the wpv-items-found shortcode if you only want the map to appear when there are some results to show).

Then, within the wpv-loop tags you will need to again use the Fields and Views button and this time insert the shortcode for a map marker. (You can also add other fields here, e.g. the post title if you want to have a list of results appear as well as the map and markers.)

It should be fairly straightforward, following the GUI, but if you get stuck let me know.

#1745611

Thanks for your help. I added the map which works and I have added the marker code and was able to choose custom taxonomy "address" but somehow there is still no marker on the map.

EDIT:
I was able to setup the markers, but now it would be great to add a popup when clicking on the marker that shows the exact address and a link to calculate a route to that destination with google maps, ideally in a new tab

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.