- This topic has 1 reply, 2 voices, and was last updated 1 year, 5 months ago by Matthew.
April 8, 2022 at 9:38 am #72769jjsotoParticipant
Is there a way to pre-filter markers by category when loading the map?
For example, If I have X categories and I only want to show markers belonging to one of them to a specific user, can I provide a link to the user that shows him a map with only the requested category?
If this is not possible, can I create one map for each category and only allow each one to load markers from one category, from the same database?
I appreciate your helpApril 8, 2022 at 3:26 pm #72779MatthewModerator
Thank you for getting in touch with us, we do appreciate your time.
This is achievable, however, not by the methods you have mentioned, but you are close.
We do have a ‘cat’ shortcode parameter that will filter the map based on the category ID specified. Thus you can create one map will all your markers with each of them assigned to their respective categories.
You may then create different pages that pertain to different categories. Here is a summarized example:
1. Create a map – has map ID of ‘1’.
2. Create a category called “Africa” – has category ID of ‘1’.
3. Create markers in your map and assign them to the “Africa” category.
4. Create a page called “African Markers”
5. Enter the map shortcode with the ‘cat’ parameter – [ wpgmza id=”1″ cat=”1″ ]
NOTE: the above example shortcode shouldn’t have the spaces after the first square bracket ([) and the before the last square bracket (]).
Once you have done, this you may share the link to this page to a user and they will see a map with all the markers assigned to the “Africa” category.
Should you like more information on this, please see our documentation for this here: https://www.wpgmaps.com/documentation/advanced-map-options/map-shortcode-parameters/#category_usage
Please do let me know if this helps?
- You must be logged in to reply to this topic.