Skip Navigation

[Resolved] Default location map if there no results

This support ticket is created 2 years, 12 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
- 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 4 replies, has 2 voices.

Last updated by beheerm 2 years, 12 months ago.

Assisted by: Minesh.

Author
Posts
#2569973

When the filter on this page (hidden link) gives no results, the map above turns to Africa. What we want to do in this case, is to set an default location when the filter returns no matches. What are the options?

To reproduce this, you can enter 'Eibergen' in the searchform and set the distance on 10 kilometre.

#2570085

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

You can navigate to your view's "Loop Editor" section and with the "No items found" section you can add your desired default location using the marker shortcode.

#2570187

Thanks you for the fast reply.

The initial rendered map is done in a php file. See the code below. Given this, does your solution help?

function my_map()
{
    echo do_shortcode('[wpv-map-render map_id="map" map_height="30vh" marker_icon="/wp-content/themes/parent/images/map-pin.png"][/wpv-map-render]');
     
}
add_action('genesis_after_header', 'my_map');

genesis();

#2570199

Minesh
Supporter

Languages: English (English )

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

You will have to play with the markers added to your view. So as I requested please add a default marker you want to display with your view's "No items found" section.

#2570223

My issue is resolved now. Thank you!