Skip Navigation

[Resolved] Cannot figure out how to reproduce your "listings on a map" page

This support ticket is created 3 years, 9 months 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.

This topic contains 4 replies, has 2 voices.

Last updated by rogerY 3 years, 9 months ago.

Assigned support staff: Waqar.

Author
Posts
#1172604
Edit Page ‹ CueCircle com — WordPress.jpg
Edit View ‹ CueCircle com — WordPress.jpg

Tell us what you are trying to do? reproduce your "listings on a map" page

That page's URL is: hidden link

I ve been trying different things but not working. What I dont get is that i cant pick the taxonomy "LOCATIONS" as the markers' input for the map. I am not sure what's wrong at all.

THanks and hope you are having a wonderful holiday.

Is there any documentation that you are following?

Is there a similar example that we can see? hidden link

What is the link to your site? hidden link

hidden link

#1172728

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Roger,

Thank you for contacting us and I'll be happy to assist.

From looking into your view, listings and location taxonomy, my understanding is that you'd like to use the attached location taxonomy's name as a source of marker location.

If that is correct, you'll need to replace the "marker_field" attribute with the "address" attribute in the "wpv-map-marker" shortcode.
( ref: https://toolset.com/documentation/user-guides/maps-shortcodes/#wpv-map-marker )

As a result, the opening shortcode line will change from:


[wpv-map-marker map_id='listings-on-map' marker_id="marker-[wpv-post-id]" marker_icon='https://ref.toolset.com/classifieds/files/2018/11/marker.png' marker_field='wpcf-advertiser-location']

To:


[wpv-map-marker map_id='listings-on-map' marker_id="marker-[wpv-post-id]" marker_icon='https://ref.toolset.com/classifieds/files/2018/11/marker.png' address='[wpv-post-taxonomy type="location" format="name"]']

Important notes:
1. This approach will work, only if each listing has only one location term attached and that term's name is a valid location address.

2. This approach will result in more calls to Google's location API since each time a marker will need to be generated, it will pass on the address, which won't be already geocoded and cached.

For better performance, it would be best to add an address field to either custom post type "Listings" or to taxonomy "Locations" and use that as a source of those markers. This way map will use already geocoded and cached information.

I hope this helps.

regards,
Waqar

#1173005

Thank you for the quick and informative response. I have deleted the "locations" from the taxonomy and added "game-location" (wpv-wpcf-game-location) under the "listings" field. But i am so confused as to keeping track of all the changes. now, the location in the search field is grayed out and the map is still not showing the listings. pls help!

#1173295

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Roger,

Thank you for sharing the update.

I've checked your page ( hidden link ) and noticed that it is using the view named "Listing Map - View".
( hidden link )

If you'll check this view's "Loop Editor" section ( screenshot: hidden link ), you'll see that it is not loading the content template for this view ("Loop item in Listing Map - View"), but instead calling a different content template "Loop item in Ads list – table" from a different view.
( hidden link )

This is the reason, why what you'll add in the content template section of this view ( screenshot: hidden link ) won't show and instead, what is in the other content template is showing ( screenshot: hidden link ).

The first step to fix this would be to update the following line in the "Loop Editor" to load the correct content template. You'll replace:


[wpv-post-body view_template="Loop item in Ads list – table"]

With:


[wpv-post-body view_template="Loop item in Listing Map - View"]

Once the view is showing the content from the correct content template, you can add any content in it including the one copied from the other content template.

To show the marker coming from the new address field, you can include the following shortcode in the content template:


[wpv-map-marker map_id='listing-map' marker_id='marker-[wpv-post-id]' marker_title='hovering over text' marker_field='wpcf-game-location']Popup content text[/wpv-map-marker]

Note: Feel free to adjust the "hovering over text" and the "Popup content text", as needed.

Once the content, map and the markers are working, you're welcome to open a new ticket about the search filters. As per our support policy ( https://toolset.com/toolset-support-policy/ ), only question/issue can be addressed, per ticket.

regards,
Waqar

#1174608

Thank you so much, it is working now!!!