Skip Navigation

[Resolved] Creating a map with markers within a view

This support ticket is created 4 years, 4 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Shane 4 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#1742313

Is there an example of how to create a map showing custom markers inside a view I could take a look at.

Reading the documentation may work for some, however, I work quicker seeing an example.

Do I render the map inside or outside the view?

I've tried rendering the map inside the view (outside the loop) with markers inside the loop, however, nothing shows.

Many thanks.

#1742461

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Hayley,

Thank you for getting in touch.

Can you provide a screenshot of the Map shortcode in your view as well as the marker shortcode ?

Secondly if you are using our Toolset Blocks plugin this makes it much easier to setup your map on the page.

Have a look at this documentation below if you've not already seen it.
https://toolset.com/course-lesson/displaying-a-list-of-posts-on-a-map/

Thanks,
Shane

#1743485

Hi Shane,

Thank you for getting back to me.

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
[wpv-map-render map_id="map-39"]
		<wpv-loop>
       [wpv-map-render map_id="map-39"]   [wpv-map-marker map_id='map-39' marker_id='marker-38' marker_icon='//staticcaravanbuyer.com/wp-content/uploads/2020/08/MAP-MARKER-300x300.png' marker_field='wpcf-hh-park-url-hh'][/wpv-map-marker]
		</wpv-loop>
[/wpv-map-render]
	<!-- wpv-loop-end -->

	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

This was a test map that I tried to create.

However, nothing shows within this view.

I have selected the correct post type, 0 filter or sorting.

Any guidance would be appreciated.

Many Thanks

#1744627

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Hayley,

Thank you for providing me with the code for this.

I see some small issues with this code.

Can you try it like this.

[wpv-layout-start]
    [wpv-items-found]
    <!-- wpv-loop-start -->
[wpv-map-render map_id="map-39"]
        <wpv-loop>
[wpv-map-marker map_id='map-39' marker_id='marker-38' marker_icon='//staticcaravanbuyer.com/wp-content/uploads/2020/08/MAP-MARKER-300x300.png' marker_field='wpcf-hh-park-url-hh'][/wpv-map-marker]
        </wpv-loop>

    <!-- wpv-loop-end -->
 
    [/wpv-items-found]
    [wpv-no-items-found]
        <strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
    [/wpv-no-items-found]
[wpv-layout-end]

Please try this code above and let me know if it works. The Map render shortcode doesn't need a closing tag to function.

Thanks,
Shane