[Résolu] Markers not showing when adding via Element > Toolset View
This support ticket is created Il y a 4 années et 10 mois. 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.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
I am trying to: display a map with markers of related posts
Link to a page where the issue can be seen:
I expected to see: markers
Instead, I got: map without markers
Steps:
1. add a toolset view with map + markers + posts+search+reset (contacts) in Elementor Pro
2. load page
3. what I see: a map without markers
4. click the reset button
5. map reloads and displays markers
Would you mind if I grabbed a copy of this site to test here locally ?
I'm checking on the site and whenever I add 2 of the same view to the page the map works. However I want to investigate the issue further because this should not be happening.
For instance:
- if I add an Elementor element to the page, save the page and view it, the markers are gone again
- if I change the ID of the map, save the page and view it, the markers are gone again
I just tested. Adding the view toe a POST works fine. But if you add it to a PAGE and then add an Elementor element, the markers disappear.
Based on the above I did some additional testing and I think I found where the issue starts. The markers disappear when you apply an Elementor page template to a page!
Go to Templates > Theme Builder > Single to view the templates applied to single pages. I have excluded one page that contains a map. This page works fine. You can add a Toolset View via Elementor elements, and the map works fine.
I've created an elementor page template and assigned it to this page and it still works. I've even added additional elementor widget elements and the issue was still not present.
You have created a different setup than I have. That is why you cannot recreate the issue.
You have created an Elementor template with a map, and applied that template to a page. The map should not be contained in the template, but in the page. So, when you exclude the template from being used on the page, the page still shows a map.
What I have done is create an Elementor page with a map, and applied a template to that page. This way, when you exclude the template from being used on that page, the map still shows on the page.
The issue still persists: if you apply an Elementor template to a page that contains a Toolset Map the markers do not show on the map.
Here are the steps I have taken to produce the issue:
1. Create a new WordPress page
2. Give it a title "My WordPress Page" and click 'Edit with Elementor'
3. In the Elementor editor: add the 'Toolset View' editor
4. In the 'View Selection' select 'Contacts With Map View'
5. Publish the page
6. View the page by clicking the 'View Page' button in the Elementor menu
7. Result: maps displays WITHOUT markers
8. Go to 'Dashboard > Templates > Theme Builder'
9. Select the 'Global Page Single' and click 'Edit with Elementor'
10. Now set the display conditions by clicking 'UPDATE > Display Conditions'
11. Click 'ADD CONDITION'
12. Exclude the page we just created: "My WordPress Page"
The following condition should now be added to this single page template:
EXCLUDE | Pages | My WordPress Page
13. Click 'SAVE AND CLOSE'
14. Now visit the page we created earlier and which now has no Elementor template applied to
15. Result: map displays WITH markers
I was able to replicate the issue following your steps on your site.
However following the same steps on my test site I was not able to at all. However the only difference really was that I was running types version 3.3.9
Could you update to this version so that i can try again. Another thing you can try is to setup a fresh installation of elementor, types and views to see if the problem can be replicated there.
I have recreated the website by:
1) dropping the database
2) removing all non relevant plugins and themes
4) updating plugins to most recent version
4) re-installing WordPress
The demo now runs on:
WordPress 5.3.2
Twenty Twenty theme
Elementor 2.8.4
Elementor Pro 2.8.3
Toolset Maps 2.0.1
Toolset Types 3.3.9
Toolset Views 3.0.2
I have created 1 Toolset View with a map based on a custom 'Contacts' post type with an address field.
I have created 3 pages:
1) default WordPress page with a Toolset View ==> markers show
2) default Elementor page with a Toolset View ==> markers show
3) default Elementor page with an Elementor single-page-template applied ==> markers do not show
Found the cause: incorrect map-id
The markers do not show because the map-id changes from
data-map="map-1"
to
data-map="map-1-1"
. Thus the view points to the wrong map ID to display the markers on.
I can even replicate this issue on page 3) when switching between edit and view mode:
- edit mode
data-map="map-1"
- view mode
data-map="map-1-1"
This is an issue that has been reported in the past (see below). Has a solution been found or in the works for this issue?