Skip Navigation

[Resolved] Display on 1 map all locations of CPT

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

Problem: Map does not respond to custom search parameters

Solution: Closely follow the instructions for "Displaying a map with a list of markers, coming from a View" in the Display on Google Maps user guide

Relevant Documentation: https://toolset.com/documentation/user-guides/display-on-google-maps/

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 20 replies, has 2 voices.

Last updated by alexandreG-2 7 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#478561

I am trying to: display on 1 map, above a list of CPT entries, all the locations stored in this CPT

I have a custom parametric search that list all entries but there is 2 maps, one showing all my entries and another one lost on seas somewhere on the globe !!!

Live example at hidden link

Is it possible to have this map updated and resized automatically (zoom in) when one Developpements is selected, to fit the specific area relevant for the selected Développement ?

Thanks

#478911

Hello Alexandre, thank you for contacting Toolset support. I see that you are having some problems integrating a map that shows your custom post types. I will be happy to assist you with this today.

It is definitely possible to add a map that responds to a custom search filter. In your case, it appears that two maps have been added to your view or page, and this is causing problems. Let's try to get that resolved. First, make sure you have not included the map in your Terrains page. Edit this post or page and look for any map shortcodes here (wpv-map-render). Delete them if you find them.

In the Edit View screen (wp-admin > Toolset > Views, then click the view name), make sure that you have only included one map field. Check the Filter Editor, the Loop Output Editor, and the Filter and Loop Output Integration Editor. Only one wpv-map-render shortcode should be included on this page, and it should probably be placed in the Filter and Loop Output Integration Editor instead of the Loop Output Editor.

Under Custom Search Settings, choose "AJAX results update when visitors change any filter values." I believe this is already set in your case.

Then in the Loop Output Editor, make sure you have the wpv-map-marker shortcode inside the wpv-loop tag. It looks like you have something like this already.

In the Filter Editor, make sure your wpv-control select box is included inside the wpv-filter-controls shortcode.

Please let me know if these steps do not resolve your issue, and we can decide how to proceed.

#478988

Thanks Christian,

My first issue is now resolved, thanks to you.

But I have another request about maps integration, but I think I already have the answer. I want to validate my feeling.

Is it possible to have the map focus and zoom specifically when a specific "Développement" is selected ?

I suppose i would need to create another CPT which would be called "Dévelopement" as a parent for my actual Terrains CPT
Then I could specify a map for each Développement.

Then, I suppose ?, I could have the map fosu and zoom to that specific area ?
How should I do that ?

Thanks for your support

Alexandre

#479001

Alexandre, you shouldn't need to create the Développement custom post type. Zoom and focus are updated automatically when your filters change. This is the expected behavior. The Google Maps display documentation has a good example of using a map with a list of markers:

https://toolset.com/documentation/user-guides/display-on-google-maps/

Scroll down to the section called "Displaying a map with a list of markers, coming from a View." You will see an example where a map and map markers have been added to the Loop Output. When your output is set up this way, your map should zoom and refocus to display all the markers whenever your filter is changed.

Please let me know if I can be of further assistance with this.

#479019

Hi Christian,

Thanks again for your support,

My map is working correctly and accordingly to the documention link you provided.

But it doesn't focus on a specific "Développement" when I select it.
Furthermore, is it normal that the maps greys out when zoomed in or out ?

One suggestion that's not related. It would be nice to have the option to select the language in which we want Toolset to be in the admin. In my case, I work mostly with a french WP backend UI as most of my clients are french speaking. But having to work with a complex plugin as Toolset is with support et documentation in english and having all the UI in french does not help much.

Thanks again

#479327

Alexandre,

Regarding the language in your admin, there isn't a setting to force English for only Views screens in the admin area. You can temporarily switch your entire admin editor to English by going to your User Profile in wp-admin. If the English language is installed, you can select it and see English in all admin screens. This setting only applies to your user profile and can be reverted at any time.

When you select a specific "Développement" like "St-Apollinaire", the map should automatically re-center and zoom. It is not normal for the map to be grayed out when zooming, either. I noticed in the browser console the following error: "You have included the Google Maps API multiple times on this page. This may cause unexpected errors." So I suspect something else is going on.

Please try the following steps:

1. Temporarily activate a default theme like twentyseventeen, and reload the terrains page.
2. Temporarily disable any plugins not related to Toolset, and reload the terrains page.

Please let me know the results of these tests, and we can determine how to proceed.

#479393

Hi Christian,

I did what you suggested, that is, deactivating all plugins and switching to default theme. But it didn't change anything. I still have greyed out maps when zooming and no zoom to specific Developpements when selected.

Thanks for your support

#479412

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still a good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

#479460
terrains-view-map.png
terrains-view-loop.jpg
terrains-page.jpg

Hi Alexandre,

You are using separate views to display your map and the list. These should be combined in the same view, as described in the documentation I mentioned. I'm attaching some screen shots for you to reference. First, see terrains-page.jpg. There should be only one view in the section I have noted.

Next, see terrains-view-loop.jpg. You should add your map markers to this loop.

Finally, see terrains-view-map.png. You can place your map field at the top of this view so the map shows at the top, followed by your filter, followed by the list.

Please let me know how this works for you, and if you need additional assistance.

#479999

Hi Christian,

Thanks a lot. Your last post helped me get out of darkness !!! I'm still a debutant with Toolset.

I still have some issue with the generated maps. It still get greyed out sometimes when zooming in or out. Is there anything I should do to correct that ?

I have another issue. My client informed me that some "développements" are not yet on Google Maps. The streets and civic number are not yet specified by local authorities. Ouch !! They should've told me that earlier.

However, my client have PDFs or JPGs files of the "Développements" made by architects on which the future streets, lots and area specs are drawn.

I would like to display these sketches when a specific "Terrain" is selected, just below the Google maps. I'm not sure how to implement that ?

Should I create a new field in Terrains CPT for that specific files ? I suppose it would then be necessary to add it to each terrain of a same developpement. In tha scenario, will I be able to make this sketch display only once for all related Terrains ?

Do you have any other suggestions.

Thanks a lot.

#480301

Great, I'm glad you're feeling more confident with Toolset!

I see what you mean about the zoom. I am able to replicate the issue anytime I load the page without selecting any Développement. If I zoom or pan the map, it becomes gray. Once I have selected any Développement, the map begins behaving as expected. I believe the gray map issue is related to the browser console error I see on your page: "You have included the Google Maps API multiple times on this page. This may cause unexpected errors."

Typically this happens when your theme, or another plugin, is attempting to load conflicting Google Maps scripts in addition to those loaded by Toolset Maps. Now that you have your map markers implemented correctly, can you try disabling other plugins and activating a default theme temporarily? Then visit your terrains page without selecting any Développement. Try panning and zooming now.

For your second question, first I must mention that displaying a PDF in your page isn't really possible in basic HTML. You would have to display a link to that PDF. For simplicity, let's assume you want to display JPGs only. This is possible, but a bit more involved. I will describe the concept for you. First, create a new custom post type for your JPGs, let's call them DevPics. In the section "Taxonomies to be used with this Post Type", select the Développements taxonomy. This way whenever you upload new DevPics you can choose a Développement.

Next, add a custom field to your DevPics post type and name it something like 'dev-pic-image'. This field should be an image input, where you would upload your JPG when you create a new DevPic.

Then create a new View showing DevPics, filtered by taxonomy, based on the selected Développement. Add the dev-pic-image custom field to this view. Add this new View to your Liste des terrains View, outside of the wpv-loop.

Now, when you select a Développement like "St-Apollinaire" on your Terrains page, you will see both Terrains and DevPics associated with St-Apollinaire Développement.

#483222

OK
Thanks Christian,

I'M still struggling a bit with the zooming in and out of the generated Google Maps. I contacted the theme developers to address this issue.

Thanks for your support

#483226

Ooops,

I did something and nothing is displayed anymore !!!

At the recommandation of the theme developper, I did change the Google API and since, no more !!

Please help !!

#483714

Hi,

Are there any errors shown now in the browser console? What exactly did you change? Can you revert the changes you made for now to get your map showing again?

#483761
ss.png

I did change the API key. But since it didn't change anything of my issue. I did revert to old key.

Unfortunately, the host of my client do not have a backup service (?%#&$&#)

Attasched, you will find all browser console error, which I don't understand !!!

THanks for your support

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.