Skip Navigation

[Resolved] Problem to show markers on a map

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

Problem:
Map markers are not displaying in a View when layout is applied on the page where I have inserted this View. Whereas Map was added in the post body and displayed in layout using Post Content cell.

Solution:
Insert View cell or Map directly in the Layout template which is a better way, then markers should display properly.

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

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 8 replies, has 2 voices.

Last updated by joelleY 6 years, 8 months ago.

Assisted by: Noman.

Author
Posts
#563166

I am trying to:

Show a map with markers related to the "address" field from specific custom posts.

Link to a page where the issue can be seen:

hidden link

I expected to see:

A map with markers.

Instead, I got:

A default map with no markers. The same problem happens when I try to set a static Toolset map without using a view loop. The map doesn't show any marker. The view works since I can render a simple text list of addresses. It's just the map that seems to be somewhat buggy. I also read that some template can cause glitches to Toolset maps but even when I set wp to the default template, the problem remains. I tried to put a different api for the template's map api field, same api or nothng at all, the result is the same. I also tried to deactivate other plugins than Toolset's with also the same result. Also tried different apis, set with or without :
Google Maps Geocoding API
Google Maps JavaScript API
Google Places API Web Service

The toolset token is still the one set for my localhost version but I got the same problem on localhost.

This is the view code (I tried many different ways without luck) :

[wpv-layout-start]
	[wpv-items-found]

[wpv-map-render map_id="map-1"]

	<!-- wpv-loop-start -->
		<wpv-loop>
          [wpv-map-marker map_id="map-1" marker_id="marker-[wpv-post-id]" marker_field="wpcf-adresse-du-bien"][/wpv-map-marker]
		</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

The view's name is "Carte" and the custom posts with the address field is "Compte Propre" (btw the map is working on the address picker).

I have no clue.

It's a french wp install. Is it gonna be okay for you if you ever have to take a look in a french admin?

Best regards.

#563216

Noman
Supporter

Languages: English (English )

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

Hi Joelle,

Thank you for contacting Toolset support. I can see that you are using older version of Toolset plugins (Types, Views, CRED,etc) so please make sure to use latest version of Toolset plugins:
https://toolset.com/account/downloads/

Please let me know if this resolves the issue or not.

Thank you

#563304

Hello Noman,

Thank you for your help. Toolset plugins are now up do date 🙂

#563347

Noman
Supporter

Languages: English (English )

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

Hello Joelle,

I have thoroughly checked the issue in your and noticed Google Maps API error or warning in your website when checked with Chrome browser Console on the front-end. See attached screenshot.

Please generate new Google Maps API key and add again in your site >> Toolset >> Settings >> Maps >> Google Map API key

In the new API key setup, please make sure that you have NOT restricted the API key usage limit for your site URL or domain. This is an option in google api key setup that cause the blockage if the url is restricted.

Thanks

#563381
api01.jpg

I already tried many different api options/config and I still can't figure why it's not working.

I still get this error in the console "You have included the Google Maps API multiple times on this page. This may cause unexpected errors." The only place where the key has been set is in Toolset's settings.

The template has a Google map api field but this field is empty right now. Anyway, since the template has it's own (inactive) Google map system, could it be a problem ?

Console also shows "Google Maps API warning: InvalidKey" but it can't be.

I made another api for you and the problem remains. You can take a look at the screenshot. I got the 3 right API in a project linked to a key. I've never had such problems with maps and apis before. Also, the api is not restricted.

#563670

Noman
Supporter

Languages: English (English )

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

Hello Joelle,

I have thoroughly checked the issue in your site and below are my findings:

1. Google map errors and warnings in browser console are coming from your theme, I have changed the theme to Twenty Sixteen and there is no any error in browser console.

2. I have added the Carte view directly in Layout which is a better way, and marker is displaying properly, you can check here:
hidden link

Thanks

#564321

Thanks a lot Noman 🙂 It seems to be perfect. I'll remember your advice for all of my next projects. I'm gonna make some tests right now to be sure that everything is 100% fine and then, I'll change the status of the topic.

Regards

#564341

Noman
Supporter

Languages: English (English )

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

Yes, sure.

Have a great day,
Thank you

#564929

It's perfect 🙂

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