Full-Featured Maps on sub-pages
This topic contains 12 replies, has 4 voices, and was last updated by Kiran 8 years, 2 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
December 28, 2016 at 8:14 pm #332297
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!
December 28, 2016 at 11:16 pm #332502A “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/#locationmapOne 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.December 28, 2016 at 11:31 pm #332551How 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)?
December 28, 2016 at 11:46 pm #332555Actually, 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.
December 28, 2016 at 11:59 pm #332557That will be available in the next version I think, at least as a shortcode.
https://wpgeodirectory.com/docs/core-shortcodes/#listingSee also https://wpgeodirectory.com/support/topic/map-marker-cluster-searchlisting-map/
December 29, 2016 at 2:15 pm #332888I 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.
December 29, 2016 at 3:46 pm #332934That’s not correct Adam, the 2 widget queries are still very different.
Thank you
December 29, 2016 at 3:55 pm #332937Okay 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.
December 29, 2016 at 3:58 pm #332938I asked to the developers to let us know how that should be handled.
They’ll let us know asap.
Thanks for your patienceDecember 29, 2016 at 5:45 pm #332993After 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?
January 16, 2017 at 9:55 pm #343828Is 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?
January 17, 2017 at 1:05 am #343907You 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.January 19, 2017 at 10:18 am #345585Hello,
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#L200We 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 -
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket