Skip Navigation

[Resolved] One map for each children with several markers

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

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)

Author
Posts
#613326
Map2.png

I have content types relationship as follow : trip > step > point of interest (POI)

I want to display a list of all steps of a trip. For each step i want a map with all the POIs of the step. I created a view with the following code :

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	[wpv-map-render map_id="map-step-[wpv-post-id]"]
		<wpv-loop>
          	[wpv-map-marker map_id="map-step-[wpv-post-id id="$step"]" marker_id="marker-[wpv-post-id]" marker_field="wpcf-address"][/wpv-map-marker]
		</wpv-loop>
	[/wpv-map-render]
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
	[/wpv-no-items-found]
[wpv-layout-end]

It displays a blank area in place of each map. But the html output seems correct :

<div id="js-wpv-addon-maps-render-map-step-24" style="width:100%; height:250px;" class="wpv-addon-maps-render js-wpv-addon-maps-render js-wpv-addon-maps-render-map-step-24" data-map="map-step-24" data-generalzoom="5" data-generalcenterlat="0" data-generalcenterlon="0" data-fitbounds="on" data-singlezoom="14" data-singlecenter="on" data-maptype="roadmap" data-showlayerinterests="false" data-markericon="" data-markericonhover="" data-draggable="on" data-scrollwheel="on" data-doubleclickzoom="on" data-maptypecontrol="on" data-fullscreencontrol="off" data-zoomcontrol="on" data-streetviewcontrol="on" data-backgroundcolor="" data-cluster="off" data-clustergridsize="60" data-clustermaxzoom="" data-clusterclickzoom="on" data-clusterminsize="2" data-stylejson="//localhost/wp_mytrip/wp-content/plugins/toolset-maps/resources/json/Standard.json" data-spiderfy="off">
		
          	<div style="display:none" class="wpv-addon-maps-marker js-wpv-addon-maps-marker js-wpv-addon-maps-marker-marker-28 js-wpv-addon-maps-markerfor-map-step-24" data-marker="marker-28" data-markertitle="Badlands KOA" data-markerfor="map-step-24" data-markerlat="43.6919171" data-markerlon="-101.9311588" data-markericon="" data-markericonhover=""></div>
		
          	<div style="display:none" class="wpv-addon-maps-marker js-wpv-addon-maps-marker js-wpv-addon-maps-marker-marker-26 js-wpv-addon-maps-markerfor-map-step-24" data-marker="marker-26" data-markertitle="Mount Rushmore" data-markerfor="map-step-24" data-markerlat="43.8791025" data-markerlon="-103.4590667" data-markericon="" data-markericonhover=""></div>
		
          	<div style="display:none" class="wpv-addon-maps-marker js-wpv-addon-maps-marker js-wpv-addon-maps-marker-marker-25 js-wpv-addon-maps-markerfor-map-step-24" data-marker="marker-25" data-markertitle="Wildlife Loop road" data-markerfor="map-step-24" data-markerlat="43.7459289" data-markerlon="-103.3594877" data-markericon="" data-markericonhover=""></div>
		
	</div>

My question : Is it possible to do this with toolset and how ?

#613532

Hi, let's test each individual component separately to see what's failing:

[wpv-layout-start]
    [wpv-items-found]
    <!-- wpv-loop-start -->
    Map ID passed into map shortcode: map-step-[wpv-post-id]<br />
    [wpv-map-render map_id="map-step-[wpv-post-id]"]
        <wpv-loop>
            Map ID passed into marker: map-step-[wpv-post-id id="$step"]<br />
            Marker ID passed into marker: marker-[wpv-post-id]<br />
            Marker field raw value: [wpv-post-field name="wpcf-address"]<br />
            [wpv-map-marker map_id="map-step-[wpv-post-id id="$step"]" marker_id="marker-[wpv-post-id]" marker_field="wpcf-address"][/wpv-map-marker]
        </wpv-loop>
    [/wpv-map-render]
    <!-- wpv-loop-end -->
    [/wpv-items-found]
    [wpv-no-items-found]
    [/wpv-no-items-found]
[wpv-layout-end]

Let me know the results and we can go from there.

#613628

It's strange. Now it is working.

I remove the "debug" code and it is working but I do not find the difference with my previous code ?

Now i have to combine this solution with the other you gave me for the custom icons.
Thanks

#613711

Strange - possibly a cache issue, but not sure. Feel free to reopen if the problem reappears.

The forum ‘Types Community Support’ is closed to new topics and replies.