Skip Navigation

[Resolved] Creating a Map with multiple locations

This thread is resolved. Here is a description of the problem and solution.

Problem:

on my website I have Areas, which are parent of Sectors.
Each Sector has one location.

Each Area page has a map displaying all the sectors on that Area.

I want to create a page listing all the Areas, with a general map showing all the Sector

Solution:

Yes, it is possible, it needs a nested view, for example:

https://toolset.com/forums/topic/creating-a-map-with-multiple-locations/#post-1145541

Relevant Documentation:

0% of people find this useful.

This support ticket is created 6 years 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 7 replies, has 2 voices.

Last updated by ivanT-7 5 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1145151

Hi there,

on my website I have Areas, which are parent of Sectors.
Each Sector has one location.

Each Area page has a map displaying all the sectors on that Area.
hidden link

I want to create a page listing all the Areas, with a general map showing all the Sectors.
hidden link

I am struggling trying to create such a map.

Could you help?

Thanks so much
Ivan

#1145541

Hi,

Yes, it is possible, it needs a nested view, for example:
1) Parent post view, query "Areas" posts, in the "Loop Editor" section, outside views loop <wpv-loop> ... </wpv-loop>, display the map shortcode, for example:
[wpv-map-render map_id="my-map" ...]

Within views loop, display Areas post information + below child post view

2) Child post view, query child "Sectors" posts, filter with:
post type relationship between "Areas" and "Sectors"
within views loop, display the marker shortcode, for example:
[wpv-map-marker map_id="my-map" marker_id="my-marker- [wpv-post-id]" ...]

More help:
https://toolset.com/documentation/user-guides/maps-shortcodes/

#1148505

Hi Luo,
unfortunately I have not been able to follow the instructions above. I have tried a few combinations but to no avail.
Could you please check the details below and let me know how I should do where I have put Question Marks? Thanks soooo much

Parent View
- Content Selection: Areas
- Query Filter: ????
- Loop Editor:
[wpv-map-render map_id="all-sectors"][/wpv-map-render]
<wpv-loop>
???? [wpv-child-view-id]
</wpv-loop>

Child View
- Content Selection: Sectors
- Query Filter: Post Relationship - Posts that are children of the Post where this View is shown.
- Loop Editor:
<wpv-loop>
[wpv-map-marker map_id="all-sectors" marker_id="my-marker-[ ???? ]" ...]
</wpv-loop>

#1148943

Please provide a test site with the same problem, also point out the problem page URL and view URL, I can setup a demo for you

#1150888

Thanks for the details, I can login your website, but the account you provided above is not an administrator, so I can not edit the views, for example:
hidden link
I get this error message:

You do not have sufficient permissions to access this admin page.

Reason: The user "Testing" doesn't have the "manage_options" capability that is required to access the "Toolset → Edit View" menu item.

You can setup the user "Testing" as an administrator, then update this thread again.

#1151171

Hi Luo,
Sorry for that. I have updated your profile Capabilities. Can now add, edit and delete all.
Ivan

#1151203

I have done below modifications in your website:
1) Edit the page
hidden link
Display the google map shortcode directly:
[wpv-map-render map_id="all-sectors" map_height="500px"][/wpv-map-render]

2) Edit the child view:
hidden link
in section "Loop Editor", display the map marker shortcode:

 [wpv-map-marker map_id='all-sectors-2' marker_id='marker-[wpv-post-id]' marker_field='wpcf-sector-location'][/wpv-map-marker]

Please test again, check if it is fixed, thanks

#1151213

My issue is resolved now. Thank you!