Skip Navigation

[Resolved] some map pins not showing

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

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

Last updated by davidP-26 3 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#2190043

Hello,
I have a custom post type with Google maps functionality set up. Everything was working fine, then I imported posts using WP All import. All the data is now inside posts, but I have to enter Google maps addresses manually, because WP All import doesn't support Google Maps addresses.
The problem is when I enter maps data manually they show up correctly in the backend and on single post template, but pins don't show up on page that has displays all post using "Custom search filter". The filter correctly displays data but pins on the map don't work.
Please note that I deleted and reimported data several times. If I manually add a post and enter maps address, the pin shows up correctly (but only for new posts). Is it possible that there is something left in the database from the old posts that is messing up pins on the map?

Page with map and filter is hidden link, password to view is "podmornica".

#2190119

Shane
Supporter

Languages: English (English )

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

Hi David,

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 one for you ?

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

Thanks,
Shane

#2190149

Shane
Supporter

Languages: English (English )

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

Hi David,

I think the problem is that the posts don't have any address data. If you look at just a few sample posts that I took randomly you'll see that they dont have their address fields filled out.
hidden link
hidden link
hidden link

Thanks,
Shane

#2190161

Yes, not all have address data but many do. And they do not show up on the map with search, only on single post and in the backend.

These have the map data:
hidden link
hidden link
hidden link
hidden link
hidden link
hidden link
hidden link

Only this one is working correctly, which is new entry and wasn't deleted and re-added:
hidden link

#2190195

Shane
Supporter

Languages: English (English )

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

Hi David,

I understand but not all of these posts are currently being displayed on the first page or the initial load page of your view.

Only the following are
hidden link
hidden link
hidden link

The map will only display the address data for the posts that are currently being displayed by the view.

Thanks,
Shane

#2190199

Aha, I see now. How can I display all posts on the map? My client requires all entries to be shown on a map.

#2190907

Shane
Supporter

Languages: English (English )

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

Hi David,

This will be a bit tricky to achieve as you're going to need 2 separate maps and another view that is displaying all the posts. I would advise against this as it will introduce slow downs on the site given the number of posts that you have on the site.

As more items gets filled out with the address more markers will appear.

However if you truly want to do this then you will need to make use of the conditional blocks to hide one of the maps until the search is performed. I can provide a bit more details on how to do it but I would like to know if the client really wants to go forth with this approach.

Thanks,
Shane

#2190957

Yes, please provide details on how to do this. Now I don't know how to display more than 39 posts in a view, this is a limit in view options.
Thanks, David

#2193007

Shane
Supporter

Languages: English (English )

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

Hi David,

Thank you for your patience.

I went ahead and setup the demo for you.
hidden link

The only issue is that because you are using an AJAX refresh then the switching of the map won't work. It will only work when the page is fully refreshed.

This is because we are using a conditional block around the map to check whether the view has been interacted with.

Also the code to remove the page limit on the view is.

add_filter( 'wpv_filter_query', 'remove_view_post_limit',99,3 ); 
function remove_view_post_limit( $query_args,$view_settings,$view_id ) {
  
    if ( $view_id == 5566) {
        $query_args['posts_per_page'] = -1;
    }
    return $query_args;
}

Please note that there is a second hidden view on the page that is provided the data for the first map that is loaded.

Please let me know if this is ok.
Thanks,
Shane

#2194635

Thanks!

#2194901

Shane
Supporter

Languages: English (English )

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

Hi David,

If everything is ok then you can go ahead and mark this as resolved.

Thanks,
Shane

#2195575

My issue is resolved now. Thank you!