Navigation überspringen

[Gelöst] Issues generating map with multiple markers

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:
Markers are not displaying on a map.

Solution:
The client was inserting the same map twice (using the wpv-map-render shortcode twice with the same id) onto the same page which broke its functionality.

This support ticket is created vor 6 Jahren, 5 Monaten. 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Dieses Thema enthält 7 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von ChuckGregory vor 6 Jahren, 5 Monaten.

Assistiert von: Nigel.

Author
Artikel
#1024303

I am trying to: Show a map at top of page, with a marker for each member in the displayed view

Link to a page where the issue can be seen: versteckter Link

I expected to see: A map with lots of markers, automatically centered on them

Instead, I got: A map with no markers, centered in middle of Atlantic Ocean

The view is here: versteckter Link
In the source code I noticed it created a map-directory-1, while the markers are added to map-directory. i have no idea why that happened.

#1069099

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

Hi Chuck

The first thing to check is that the Maps API is working correctly on your site.

Please go to the page Toolset > Settings > Maps and use the Check API button.

If it reports that it can connect okay then you may have an problem with how you have set up the Maps View, but let's check the connection first.

#1069184

It's definitely an issue with the view setup. The test works and the maps on the member pages work now that I got the proper setup from Christian. I appreciate you picking this ticket up since Christian won't be in till much later...

I tried to get the map to work outside the view, but could not get it to show at all. So I put it back in the view code... but for some reason a new map id was generated. I set it to map-directory, and that's the map that the markers are added to in the view; however in the source code I see map-directory-1 for the map itself and map-directory for the markers. I don't know how to reset the map id to make it work. If there's a way to get the map to show up at the top of the page where the view appears, that would be even better.

#1069208

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

Maybe I could take a look, let me set up a private reply to get credentials from you.

#1069282

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

Hi Chuck

I can't edit the template used in the maps View because it is locked, currently being edited by webmaster.

I'll try again a little later.

#1069297

Sorry about that. I've exited all editors... if I missed one somewhere please just take over editing. Thanks.

#1069317

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

Hi Chuck

I created a test View and test page to display a map to confirm it should be working okay, which it was, so I've deleted those.

I wondered if there were some issue with the map marker shortcode being inside the template that you designed with Divi. Because the markers are added to the map it doesn't matter where they are inserted as long as they are inserted within the wpv-loop tags, so I removed them from the Divi-designed template and inserted the marker shortcode directly inside the Loop Output section, after the opening wpv-loop tag.

It didn't help, but it didn't hurt, and is probably good to know.

Lastly I looked at the page where you insert the View itself, which is where I identified the problem.

You have inserted the map shortcode in the filter controls section of your View (so that it appears before the filters).

But you also inserted the same map shortcode directly in its own module before the module where you inserted the search filters, meaning you were trying to add the same map (i.e. with the same id) twice, which is what broke the expected display.

I deleted the module where you had inserted the map a second time and it looks like it is working fine now if you want to confirm.

#1069340

Great work, Nigel. I actually noticed it was fixed and then checked my email to see if you'd done something... it makes a lot of sense that inserting twice caused the wrong id issue. Thanks so much for straightening it out. I'm pretty good with toolset (I'm a toolset contractor) but I'm still learning about the maps.

Thanks again.