Skip Navigation

[Resolved] post / map view center on pin

This support ticket is created 3 years 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 5 replies, has 2 voices.

Last updated by jozsefG 2 years, 12 months ago.

Assisted by: Shane.

Author
Posts
#2227863

Hi
I cannot seem to center the map on a locations pin when clicking the link in the post grid item. I've already done this and I checked other posts on the forum too and it seems that it should work but there must be an error somewhere in my code. I use legacy views.
This is the page link: hidden link

#2227869

This is the map code:

[wpv-map-render map_id="map-playgrounds" map_height="530" cluster="on" spiderfy="on"][/wpv-map-render]

This is the view loop:

	<wpv-loop wrap="3" pad="true">
		[wpv-item index=1]
		<div class="row ">
			<div class="col-md-4">[wpv-post-body view_template="loop-item-in-playgorunds-grid-view"]</div>
          	[wpv-map-marker map_id="map-playgrounds" marker_id="marker-[wpv-post-id]" marker_title="[wpv-post-title]" marker_field="wpcf-map-location"][wpv-post-featured-image]<br>[wpv-post-link][/wpv-map-marker]
		[wpv-item index=other]
			<div class="col-md-4">[wpv-post-body view_template="loop-item-in-playgorunds-grid-view"]</div>
          	[wpv-map-marker map_id="map-playgrounds" marker_id="marker-[wpv-post-id]" marker_title="[wpv-post-title]" marker_field="wpcf-map-location"][wpv-post-featured-image]<br>[wpv-post-link][/wpv-map-marker]
		[wpv-item index=3]
			<div class="col-md-4">[wpv-post-body view_template="loop-item-in-playgorunds-grid-view"]</div>
          	[wpv-map-marker map_id="map-playgrounds" marker_id="marker-[wpv-post-id]" marker_title="[wpv-post-title]" marker_field="wpcf-map-location"][wpv-post-featured-image]<br>[wpv-post-link][/wpv-map-marker]
		</div>
		[wpv-item index=pad]
			<div class="col-md-4"></div>
		[wpv-item index=pad-last]
			<div class="col-md-4"></div>
		</div>
	</wpv-loop>

And this is the loop item template:

<article class="grid-item">
    <a href="[wpv-post-url]" class="entry-featured-image-url">
        [wpv-post-featured-image size="custom" width="330" height="220" crop="true"]
    </a>
    <div class="grid-item-info">
        <h4 class="item-title">[wpv-post-link]</h4>
        <div class="item-excerpt">[wpv-post-excerpt]<br>
          <a href="#" class="js-wpv-addon-maps-focus-map js-toolset-maps-hover-map-map-playgrounds-marker-marker-[wpv-post-id] js-toolset-maps-open-infowindow-map-map-playgrounds-marker-marker-[wpv-post-id]" data-map="map-playgrounds" data-marker="marker-[wpv-post-id]">[wpml-conditional lang="ro"]Arată pe hartă[/wpml-conditional][wpml-conditional lang="hu"]Mutasd a térképen[/wpml-conditional][wpml-conditional lang="en"]Show on map[/wpml-conditional]</a></div>
    </div>
</article>
#2228035

Shane
Supporter

Languages: English (English )

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

Hi Jozsef,

Thank you for getting in touch.

Would you mind allowing me to have admin access to the website so that I can have a more detailed look at this for you ?

Based on what I see in your code this should be working as intended.

I've enabled the private fields for your next response.

Thanks,
Shane

#2228969

Shane
Supporter

Languages: English (English )

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

Hi Joszef,

Thank you for the credentials.

I managed to take a look at this one for you and did a simple test to re-add the map outside of the elementor builder. What I found is that when the map is added directly to the view then the focus on marker button works. This means that there is some interference between elementor and the normal functions of our map.

My advice is that you should add the map shortcode to the view itself outside of the wpv-loop tags in order to retain the ability to focus on your markers.

Please let me know if this helps.
Thanks,
Shane

#2229759

Your solution works perfectly, thank you Shane!

#2229761

My issue is resolved now. Thank you!