Show results on a Map

I am wondering if anyone has been able to or has an idea about how we could get the results of a loop to be put as markers on a google map.

We store address, what3words and GIS details for one of our custom post types.

In addition each of the posts has a field linking it to another ‘parent’ post in another custom post type

We have a loop that returns the list of associated records on the parent post page - but I was just thinking how cool it would be to show them on a map.

I would welcome any thoughts or ideas - I will continue to share my progress here as well

1 Like

I don’t have anything to suggest here but I’ll follow this with interest to see what you or others come up with. I assume a solution with the current version of L&L would require either a maps plugin that accepts shortcodes or a dive into PHP, both of which sound a bit messy given my skill level. It’s probably worth a shot to make a feature request describing how you’d want to use maps within L&L, maybe the dev team can find a versatile module to add into a future version of the plugin. Might be a long shot, but a cool one!

@Coops have you found a way to implement this? I’d be curious to hear your process when you do. I found a couple of map plugins that use shortcodes (like Simple Shortcode for GoogleMaps or WP Maps Pro) so with those you could create a template that displays wherever you need it to (like on your CPT page) and then within that template, you could write something like this if you’re using that first plugin I linked to:

<Shortcode pw_map address="{Field address}" key="YOUR API KEY" />

Hi @benjamin we have a part solution in place that is allowing us to display as per your comment above, we are working with the developer of Simple Shortcode for GoogleMaps to enhance it to allow us to display multiple posts on a single map identified in a loop output - hope to share an update in the next couple of weeks

1 Like