Skip Navigation

[Resolved] Markers not appearing on map

This thread is resolved. Here is a description of the problem and solution.

Problem: Markers do not appear on my map. It appears that the map ID is being modified somehow.

Solution: In this case it appears to be a conflict with an outdated plugin. Updating All-in-One SEO Pack to the latest version solved the problem.

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

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
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)

This topic contains 9 replies, has 2 voices.

Last updated by Chris 5 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1310577

I am trying to:
Display posts on a map within a View.

Link to a page where the issue can be seen: hidden link (site is in privacy mode, so please use username "flywheel", password "yielding-event" to view).

I expected to see: A map showing locations of selected posts, together with a grid showing post details below

Instead, I got: Map is blank, but the correct posts show in the grid below.

The View has a loop which lists the posts, with a [wpv-map-marker] element for each. The markers have map_id="map-2", which corresponds to the map_id="map-2" in the [wpv-map-render] shortcode above:

[wpv-layout-start]
	[wpv-items-found]
<div class="google-maps parks-map-height">
[wpv-map-render map_id="map-2" cluster="on" cluster_grid_size="45" scrollwheel="off" marker_icon="/wp-content/uploads/2016/01/mps-google-marker.png" map_height="100%"]
</div>
 	<ul id="js-map-elements"> 
      <!-- wpv-loop-start -->
	<wpv-loop>
         [wpv-map-marker map_id="map-2" marker_id="marker-[wpv-post-id]" marker_title="[wpv-post-title]" lat="[types field='latitude'][/types]" lon="[types field='longitude'][/types]"][wpv-post-link][/wpv-map-marker]
         <div class="parks-third">
     <li><div class="mp-park-img"><a href="[wpv-post-url]">[wpv-post-featured-image size="parks-thumb" attr="class=park-pic"]</a></div><h4 class="mp-park-name">[wpv-post-link]</h4>
       <div class="mp-area">[wpv-post-taxonomy type="area" separator=", " format="text" show="name" order="asc"]</div>
       <div class="mp-park-desc">[wpv-post-excerpt length="60"]</div>
       <h5 class="goto"><a href="[wpv-post-url]">Go to park page "</a></h5>
         </li>
         </div>

	</wpv-loop>
	<!-- wpv-loop-end -->
</ul>
       
	[/wpv-items-found]
	[wpv-no-items-found]
		<div class="mp-no-parks">[wpml-string context="wpv-views"]<strong>Sorry, no parks matched your search</strong>[/wpml-string]</div>
	[/wpv-no-items-found]                                    
[wpv-layout-end]

However, when the page is rendered, the map_id has changed (data-map="map-2-1"), so the markers are no longer being displayed on the map:

<div id="wpv-view-layout-1094-TCPID13" class="js-wpv-view-layout js-wpv-layout-responsive js-wpv-view-layout-1094-TCPID13" data-viewnumber="1094-TCPID13" data-pagination="{"id":"1094","base_permalink":"/explore-parks/?wpv_view_count=1094-TCPID13&wpv_paged=WPV_PAGE_NUM","query":"normal","type":"disabled","effect":"fade","duration":"500","speed":5,"pause_on_hover":"disabled","stop_rollover":"false","cache_pages":"enabled","preload_images":"enabled","preload_pages":"enabled","preload_reach":"1","spinner":"builtin","spinner_image":"<em><u>hidden link</u></em>","callback_next":"","manage_history":"enabled","has_controls_in_form":"disabled","infinite_tolerance":"0","max_pages":0,"page":1,"loop":{"type":"","name":"","data":[],"id":0}}" data-permalink="/explore-parks/?wpv_view_count=1094-TCPID13">

	
<div class="google-maps parks-map-height">
<div id="js-wpv-addon-maps-render-map-2-1" style="width:100%; height:100%;" class="wpv-addon-maps-render js-wpv-addon-maps-render js-wpv-addon-maps-render-map-2-1" data-map="map-2-1" 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="/wp-content/uploads/2016/01/mps-google-marker.png" data-markericonhover="" data-draggable="on" data-scrollwheel="off" data-doubleclickzoom="on" data-maptypecontrol="on" data-fullscreencontrol="off" data-zoomcontrol="on" data-streetviewcontrol="on" data-backgroundcolor="" data-cluster="on" data-clustergridsize="45" data-clustermaxzoom="" data-clusterclickzoom="on" data-clusterminsize="2" data-stylejson="//mps2.flywheelsites.com/wp-content/plugins/toolset-maps/resources/json/Standard.json" data-spiderfy="off" data-streetview="off" data-markerid="" data-location="" data-lat="0" data-long="0" data-heading="" data-pitch=""></div>
</div>
 	<ul id="js-map-elements"> 
      
	
         <div style="display:none" class="wpv-addon-maps-marker js-wpv-addon-maps-marker js-wpv-addon-maps-marker-marker-8114-1 js-wpv-addon-maps-markerfor-map-2" data-marker="marker-8114-1" data-markertitle="Abbeyview Park, Dunfermline" data-markerfor="map-2" data-markerlat="56.066505" data-markerlon="-3.422373" data-markericon="" data-markericonhover="" data-streetview="no"><a href="<em><u>hidden link</u></em>">Abbeyview Park, Dunfermline</a></div>
         <div class="parks-third">
     <li><div class="mp-park-img"><a href="<em><u>hidden link</u></em>"><img width="235" height="150" src="<em><u>hidden link</u></em>" class="attachment-parks-thumb size-parks-thumb wp-post-image" alt="" /></a></div><h4 class="mp-park-name"><a href="<em><u>hidden link</u></em>">Abbeyview Park, Dunfermline</a></h4>
       <div class="mp-area">Fife</div>
       <div class="mp-park-desc"><p>Extensive, unusually shaped local park, Abbeyview Park is lo &#8230;</p>
</div>
       <h5 class="goto"><a href="<em><u>hidden link</u></em>">Go to park page "</a></h5>
         </li>
         </div>

... etc.

This View was rendering correctly until recently, so I wondered if the latest plugin updates could have caused this. However reverting to the previous versions of Maps, Views and Types doesn't solve the problem. Other maps on the site (eg on the home page hidden link) are working as expected.

I'd be glad if you could take a look at this for me. Can provide access to the site if required (this is a copy of the live site, so no problem to make changes.)

Many thanks,

Chris

#1310587

Hi,
For a quick fix, I changed the marker shortcodes to point to map ID map-2-1, and now they are appearing as expected. I also changed the map ID in the JS panel's cluster options, so the cluster options would be applied correctly.

I've seen other reports of similar issues when the site was edited using Elementor:
https://toolset.com/forums/topic/map-issues-using-elementor/
https://toolset.com/forums/topic/maps-suddenly-defaulting-to-africa/

I can't see that plugin on your site, but I'm curious to know if you have ever used Elementor on the site?

#1311021

Hi Christian,

OK thanks for looking into this for me.

Yes, I had already made that change to the map ID on the live site to get it working, but I hadn't thought to update the ID in the JS panel - will do that now.

No, we've never used Elementor on this particular site, so that's not relevant in this particular case.

Best wishes,

Chris

#1311385

Okay hmm, in that case I need to make a clone of the site because I wasn't able to resolve the issue by deactivating plugins and themes on the test site. I'll need to recreate the problem on my local environment so I can pass it along to my 2nd tier team. Let me know if that's okay and I'll get started.

#1314541

Hi Christian,

Sorry to be a while getting back to you on this. Yes, could you please go ahead and recreate the site locally and take it forward from there.

What do you need from me? Shall I make a Duplicator package for you to install? Or I can give you SFTP access to that particular site.

Thanks,

Chris

#1314671

I was able to create a Duplicator clone and I'm working on installing it locally now. I'll update you shortly.

#1314763

On my local copy, I was able to fix the problem by deactivating the All-in-One SEO Pack plugin, then reactivating it. On your site, I was able to fix the problem by deactivating the same plugin, but reactivating it caused the problem to reappear. So I'm a bit confused and I need to run some additional tests. For now, I have deactivated the plugin on your test site so you can see that the map ID has returned to map-2, when it was map-2-1 before, and reactivating the plugin makes the problem reappear.

#1315303

OK thanks for the update Christian.

- Chris

#1315567

Looks like the latest version of All-in-One SEO Pack doesn't cause the same problem. I've updated on the test site and now the map ID is correct as map-2 instead of map-2-1. Can you confirm?

#1315577

Great, thanks for looking into this Christian. Yes, it seems to be fixed with the latest update to All in One SEO Pack.

(Of course, on the live site, the map had broken again, since I had edited the ID in the view as a temporary fix. But all back to normal now.)

Thanks again for your help,

Chris