Skip Navigation

[Resolved] Showing more than 50 pins on a map

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by Minesh 1 year, 7 months ago.

Assisted by: Minesh.

Author
Posts
#2584307
Screenshot 2023-03-31 111355.jpg

Tell us what you are trying to do?
We want to be able to display more than the 50 pins limit on a map (around 150 pins would be great).

Is there any documentation that you are following?
We couldn't find anything.

Is there a similar example that we can see?
In this example below, on the live site, we were able to setup the limit using a shortcode:
hidden link
[wpv-view name="condo-search-v9" limit="115"]
But this is using the old way of creating a view.

What is the link to your site?
hidden link
On the page above we can only have 50 map pins. We are using blocks for both the map and the view.
Also a screen capture attached from the page backend.

Thanks for your help!

#2585715

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Yes, so what if you restrict the number of items to display to 50 records as per the screenshot you shared, it should display the 50 pins on the map.

#2586179

Hello Minesh,

Sorry if I wasn't clear.
We want to display 150 pins on the map (much more than 50), how can we do that?

Many thanks!

#2586447

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

If you want to display 150 pins you should set your view's number of items to display limit to 150. Does that make sense?

I'm still not sure where exactly you got stuck and did you try to set 150 limit?

#2586955
Screenshot 2023-04-04 104951.jpg
Screenshot 2023-04-04 105111.jpg
Screenshot 2023-04-04 105230.jpg

Please see in the screen capture below: the map is based on a view, and the view limit is 50, the dropdown for limit goes from "no limit" to "50", which is the max value. We need 150.

#2587423

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You can use the view's filter hook "wpv_filter_query" in order to change the view's query argument on fly:
- https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

You can add the following code to "Custom Code" section offered by Toolset:
- https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/#adding-custom-php-code-using-toolset

function func_change_view_llimit_of_posts( $view_args, $view_settings, $view_id )  {
     
  if ( in_array( $view_id, array( 9999) ) ) {  
     
      $view_args['posts_per_page'] = 150;
  }
   
  return $view_args;
}
add_filter( 'wpv_filter_query', 'func_change_view_llimit_of_posts', 101, 3 )

Where:
- change 9999 with your original view ID.