Sync the map view with the search bar "Near" option

This topic contains 8 replies, has 2 voices, and was last updated by  Guust 5 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #479332

    Luca
    Expired Member
    Post count: 23

    I have the following shortcodes on a page:

    [gd_map map_type=’directory’ width=100% height=400 search_filter=1 cat_filter=1 post_type_filter=1]
    [gd_category_description]
    [gd_search]

    It shows up fine, but the map displays the entire country. I’d like to know how to have the map zoom in to the corresponding location if someones searches “Near” their area.

    Thanks!

    #479346

    Guust
    Moderator
    Post count: 29970

    [gd_map map_type=”archive” width=100% height=400 zoom=0]

    The map you are using there is a location map, not a search or category map.

    Thanks

    #479365

    Luca
    Expired Member
    Post count: 23

    Thanks for the quick response! I just tried out the Archive type, but the drawback is that it’s only displaying the listings on the current page. It there a way to have a map of ALL the listings, and the most recent ones showing up as a list below the map, and a search bar that functions in sync with the map? An Archive type map that loads all existing listings?

    Cheers,
    Luca

    #479368

    Guust
    Moderator
    Post count: 29970

    Add all_posts=1
    Thanks

    #479374

    Luca
    Expired Member
    Post count: 23

    It’s set to [gd_map map_type=”archive” width=100% height=400 zoom=0 all_posts=1 cat_filter=1 search_filter=0]

    But although it’s reloading the map, it’s not “zooming in” on the correct region. It’s not the end of the world or super important, but it would just have been nice. PS – I took down the location based firewall for a little while. Here’s the link:
    https://plantswap.org/listing-search/?geodir_search=1&stype=gd_place&s=+&snear=ithaca%2C+ny&sgeo_lat=42.4439614&sgeo_lon=-76.50188070000002

    #479379

    Luca
    Expired Member
    Post count: 23

    …Nevermind, got it. I didn’t realize it was redirecting to the search page and applying the corresponding search page template, which I had not modified yet – until I re-read which URL I had just pasted for you (silly me) . All good now, THANK YOU SO MUCH!!!
    This was the original page I was starting the search from: https://plantswap.org/listings/

    #479380

    Guust
    Moderator
    Post count: 29970

    Try removing “cat_filter=1” and “search_filter=0”, those are only for location/directory maps.

    If we need to look at your settings, add your WP admin details in a private reply. Thanks

    #479384

    Luca
    Expired Member
    Post count: 23

    It’s okay, as per my last post it is now working as intended. I was using it as a directory page to display every listing on the site, but for some reason (exhaistion?) I didn’t realize that once you hit “search” it redirects you to a different page that relies on a different template, so modifications I was making to my site’s directory page template were not having the expected results in the search results (since that’s a different page). Once I modified the GD Search Page template as well, it worked as I wanted it to. Thank you again for your help!

    #479388

    Guust
    Moderator
    Post count: 29970

    You’re welcome 🙂

Viewing 9 posts - 1 through 9 (of 9 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket