Full-Featured Maps on sub-pages

This topic contains 12 replies, has 4 voices, and was last updated by  Kiran 7 years, 4 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #332297

    Adam
    Expired Member
    Post count: 28

    I am building a tourism site for an entire state in the United States. I want to group locations into five custom groups: West, East, South, North West, and North East. Each group will have its own landing page with news, events, and attractions specific to the group. I would also like to include a full-size map on each group page. I want to filter the group-page maps to only contain items within the current group, and to hide items from the other groups. These “group” maps must also support a second level of filtering (using the category checkboxes, exactly like the home map). How might I achieve this?

    I have tried adding a custom “Group” field to the place posts. I can use the Advanced Search plugin to filter the groups, but the map on the results page is a simple, mini-map.

    I would like to have full, filterable maps for top-level category pages. For example, an Entertainment section (which contains the sub-categories Parks, Movie Theaters, Arcades, and so on).

    Thanks!

    #332502

    Guust
    Moderator
    Post count: 29970

    A “full, filterable maps” is only available for Location pages, it is the GD Gmap Home widget:
    https://wpgeodirectory.com/docs/widgets/#homepage
    https://wpgeodirectory.com/docs/core-shortcodes/#locationmap

    One solution is to create 5 custom post types [CPT] for east region.
    Then on /location/ visitors can change the region on the map by clicking on the ribbon on the bottom of the location map.

    /west/ would be a Listings page for the West CPT etc.
    It can only have the Listings map, but you can use the CPT categories widget to allow visitors to drill down into the “West” categories.
    The search bar would have a selector for each region, see https://wpgeodirectory.com/docs/gd-search/#cpt
    So from any page visitors can select West > Parks etc in the search bar.

    #332551

    Adam
    Expired Member
    Post count: 28

    How much would it cost to make a “Full Map” widget that is context-relevant? That is, it only shows markers for the current view (the current category / search results pages / etc)?

    #332555

    Adam
    Expired Member
    Post count: 28

    Actually, make that for the current set of listings. So, all the items in the currently selected category, or all the results in the current search, even if some of them are not on the current page due to pagination.

    #332557

    Guust
    Moderator
    Post count: 29970
    #332888

    Adam
    Expired Member
    Post count: 28

    I installed the Multi-Locations plugin, and I’m currently setting up the groups as custom “regions”. For example, “USA / State (West) / City”. I also found that the listings map plugin has the following lines of code:

    
    
    $map_args['enable_cat_filters'] = false;
    $map_args['enable_text_search'] = false;

    Changing these to true does what I want. I think it would make sense to merge the home and listings map widgets into a single widget. You’d only need to add the option to enable or disable filters under admin > appearance > widgets.

    #332934

    Paolo
    Site Admin
    Post count: 31206

    That’s not correct Adam, the 2 widget queries are still very different.

    Thank you

    #332937

    Adam
    Expired Member
    Post count: 28

    Okay Thanks. Any change you can add these options to the listing widget? Right now I’m using a custom extension of it, but I fear that core updates could break things in the future.

    #332938

    Paolo
    Site Admin
    Post count: 31206

    I asked to the developers to let us know how that should be handled.
    They’ll let us know asap.
    Thanks for your patience

    #332993

    Adam
    Expired Member
    Post count: 28

    After playing around with this a bit more, I realized that, while I have attained a filterable map on the region and category pages, the map only shows the ~15 paginated items for that view. I want to display all of the items for the current region or category, ignoring pagination.

    So ideally I need to place the Home Map widget on the listings page, but apply filters to it. Is there a Filter hook or Action hook that I can use to manually remove places from the home map widget? If not, would it be possible to add one?

    #343828

    Adam
    Expired Member
    Post count: 28

    Is there a Filter hook or Action hook that I can use to manually remove places from the home map widget? If not, would it be possible to add one?

    #343907

    Guust
    Moderator
    Post count: 29970

    You can’t use a Home map on a Listings page.
    In the next version of GD the Listings map will be able to show all listings in the CPT or category, regardless of the number of posts per page.
    I’ll get Kiran to confirm my understanding.

    #345585

    Kiran
    Moderator
    Post count: 7069

    Hello,

    It is not easy to home page map widget on listing pages.

    Here are some filters that may help you.
    Function that retrieving markers to show on home map – https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory-functions/map-functions/get_markers.php#L81
    You can you this action to modify query to filter markers on home map – https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory-functions/map-functions/get_markers.php#L200

    We have modified [gd_listing_map] shortcode, so it will have new parameter “category” to show listing within that category. This will be available in next release.
    [gd_listing_map] shortcode is usable in custom pages (non GD) pages.

    Let us know.

    Thanks,
    Kiran

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

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

Open Support Ticket