Skip Navigation

[Resolved] Page won't render if I add a Map

This support ticket is created 6 years 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
- 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)

This topic contains 28 replies, has 4 voices.

Last updated by Mario Hernandez 5 years, 12 months ago.

Assisted by: Nigel.

Author
Posts
#1154742

Hello! I am trying to add a map in my view, and sadly won't appear and the page won't render (it gets stuck).

The view is rendered in this page: hidden link
You can edit the view here: hidden link

I had to remove the map to allow the page to be shown, but please, I would ask you to try to add the map. You will see how it gets stuck.

Thank you ,

Mario

#1154923
Screen Shot 2018-11-28 at 4.28.55 PM.png

I think I see why the problem is sporadic. Sometimes the lat and long fields are rendered with a "," for the decimal, and other times with a "." If the fields are rendered with the "," this causes the map to fail. The "." causes the map to work correctly. See the attached screenshot - on the left shows the page markup when the map fails. On the right, the page markup when the map loads. I simply refreshed the page, so the markup on both sides should be identical. I'm not exactly sure why this would be happening, so I need to consult with my team. Any ideas on your end? My guess is it could be a character encoding issue, or a database collation issue. I'll update you when I have some additional information.

#1155342
Captura de pantalla 2018-11-29 a las 11.23.06.png

Thank you very much for your help Christian. We don't know where the problem is. The only thing we need to do is to display all the markers that are result of the search inside the view inside a Google Map.

We see in the Google API that there is a huge amount of requests from toolset (more than 24k). We have almost 1000 custom types, each one with its own address.

We see that toolset is continuously asking google for coordinates from the address string. We also see that inside the wp-options table, there is a toolset_maps_address_coordinates field where all the coordinates are stored.

How can we avoid the elevate number of requests from toolset to google?

Also, we continue with the problem of the display of the markers.

Thank you so much for your help.

Mario

#1155636

Please go here, then click the "Cartes" tab:
hidden link
You will see a button: Vérifier l'API

Click it, and tell me what you see. When I click it, I get "REQUEST_DENIED - API keys with referer restrictions cannot be used with this API."

Can you update your settings in the Google Maps API console, or use a different API key?

#1155667

Thank you Christian,

This afternoon our team restricted the api, but I have unlocked it again. You have now full access.

I see also that you have the web in french. I will change your language to english too.

Thanks for your support,

Mario

#1155714

Can you update to the latest versions of Toolset plugins? I tried but received an error message. Types 3.2 contains some fixes for object cache issues, and I would like to see if this helps. Maps 1.7 also includes some improvements.

#1156151

Thank you Christian,

I have updated permissions on plugins folder and updated the plugins.

Please, let me know what I can do to make this issue advance

thank you ,

Mario

#1156402
Captura de pantalla 2018-11-30 a las 16.53.52.png

In fact the problem is that the map doesn't render as it should render (you can see in the image that it renders a gray box).

Any light on why this could be happening? thank you very much

#1157217

Okay I'm not able to see anything obviously wrong here, and the database works fine on my local site. So there must be something else going on. Do you have any crons running on your server? What about must-use plugins or dropins? Any special settings in your wp-config.php file? It might be helpful for me to get FTP access.

#1158000

This page doesn't seem to have a problem for me. I've run over 20 searches with filters and pagination, and I have not seen a gray map appear yet.
hidden link
Sometimes the results are a bit slow (around 6-8 secs), but the map always updates. When I go to Toolset > Settings > Maps and load the cached data, the latitude and longitude caches are always shown with "." as the decimal, not ",". I can't replicate the problem here. So something is different about these two environments, because the site data and files are essentially identical.

#1158824

Your answer is absolutely correct. We are doing an investigation to know what happened.

The difference between both may be the web server. The one where the map is not displayed is nginx while the one that works fine is apache.

We have a custom machine in azure.

Christian, which are the specifications for toolset maps to work? Are there any special requirements? Php version, etc

By our part we will also investigate and write here what we found.

Thank you

Mario

#1158875

Interesting...I'm curious to know what you find out. The requirements for Toolset in general can be found here:
https://toolset.com/toolset-requirements/

There's nothing specific to Maps, other than requiring SSL for User location. There's nothing specific about Apache or nginx. My guess is it's some kind of locale setting on the server, but backend server configurations are beyond my level of experience.

#1159752
Captura de pantalla 2018-12-05 a las 14.16.53.jpg
Captura de pantalla 2018-12-05 a las 14.13.43.png

It's super strange.

Here Christian you can get the view with only one result: hidden link

This item called Sofrocay, shows nicely in the backend, as the attached photo shows.

We cannot imagine the cause of this.

In our clone, the map renders fine: hidden link

We have compared our server (that wont render the map) and the clone server:

OUR SERVER:

Web server:	nginx/1.10.3 (Linux desarrollo 64-bit #33~16.04.1-Ubuntu SMP Fri Nov 9 22:36:11 UTC 2018)
ABSPATH:	/var/www/sofrocay.com/html_public/
WP_CONTENT_DIR:	/var/www/sofrocay.com/html_public/wp-content
WP_PLUGIN_DIR:	/var/www/sofrocay.com/html_public/wp-content/plugins
Table prefix:	wp_
Peak memory usage:	22 MB
Current memory usage:	22 MB
Memory limit:	256M
PHP version:	7.0.32-0ubuntu0.16.04.1 - show PHP information (phpinfo)
MySQL version:	5.7.24-0ubuntu0.16.04.1
Curl version:	7.47.0 / SSL: OpenSSL/1.0.2g / libz: 1.2.8
OpenSSL version:	OpenSSL 1.0.2g 1 Mar 2016
MCrypt:	Yes
ZipArchive::addFile:	Yes
zip executable found:	Yes: /usr/bin/zip

CLONE SERVER:

Web server:	Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips (Linux v6xwhxhkvbk.c.updraftclone.com 3.10.0-862.14.4.el7 64-bit #1 SMP Wed Sep 26 15:12:11 UTC 2018)
ABSPATH:	/var/www/html/
WP_CONTENT_DIR:	/var/www/html/wp-content
WP_PLUGIN_DIR:	/var/www/html/wp-content/plugins
Table prefix:	wp_
Web-server disk space in use by UpdraftPlus:	32.5 MB refresh
Peak memory usage:	4 MB
Current memory usage:	4 MB
Memory limit:	300M
PHP version:	7.0.32 - show PHP information (phpinfo)
MySQL version:	10.2.19-MariaDB
Curl version:	7.29.0 / SSL: NSS/3.34 / libz: 1.2.7
OpenSSL version:	OpenSSL 1.0.2k-fips 26 Jan 2017
MCrypt:	No
ZipArchive::addFile:	Yes
zip executable found:	Yes: /usr/bin/zip
#1160032

This item called Sofrocay, shows nicely in the backend, as the attached photo shows.
On the backend the position is plotted real-time. On the front-end, the position tries to load from a cache in the database to prevent extra database calls. That's where the problem becomes evident.

Is it possible the locale settings are different on these servers? Configuration differences in locale or WPLANG would be important to note, if your environments use different wp-config files or other configuration files.

The memory difference is small, but if it's easy to bump up that value on the dev server then it's worth trying. Maybe there is a silent memory failure somewhere? I don't think the MySQL version is too low on the dev server. You could try bumping up the PHP version on the dev server as a test, just to see if it makes any difference. Then it's just a matter of going through the PHP ini settings and trying adjustments iteratively until you can pin something down. Caching and locale settings would be important to check. Our support policy is that we do not address server compatibility issues, so unfortunately I'm not able to troubleshoot this for you beyond explaining what I can see happening. https://toolset.com/toolset-support-policy/

#1160057

Thank you Christian, I am worried about the extension of this thread, but I have good news.

Don't ask me why, but without apparent reason, I have found a determining clue:

Suddenly, in the dev server, the page showed the markers in the map. I don't know why. Consequently I quickly grabbed the html source code of the page that worked fine, and then copied the URL of that page and refreshed the page in other window. As expected, it didn't show the markers at this second time.

I copied the html source code of that second page that don't show the markers, and compared with the one that showed the markers correctly, line by line.

And I found the clue. The page doesn't show the markers because the rendered position tags (longitude and latitude) are rendered with a comma separator instead of a point separator.

I have created a video for you to show you the difference in the code: hidden link

I can confirm you that the map doesn't work when comma is used as separator for data-markerlat and data-markerlon attributes inside the div of the marker.

For example:

DOES NOT SHOW MARKER

<div style="display:none" class="wpv-addon-maps-marker js-wpv-addon-maps-marker js-wpv-addon-maps-marker-marker-10000027 
js-wpv-addon-maps-markerfor-map-ts-test-2" data-marker="marker-10000027" data-markertitle="Ecole de Sophrologie Caycédienne d'Agen" 
data-markerfor="map-ts-test-2" data-markerlat="44,1934585" data-markerlon="0,6316555" data-markericon="" data-markericonhover="" 
data-streetview="no">
</div>

SHOWS MARKER CORRECTLY

<div style="display:none" class="wpv-addon-maps-marker js-wpv-addon-maps-marker js-wpv-addon-maps-marker-marker-10000027 
js-wpv-addon-maps-markerfor-map-ts-test-2" data-marker="marker-10000027" data-markertitle="Ecole de Sophrologie Caycédienne d'Agen" 
data-markerfor="map-ts-test-2" data-markerlat="44.1934585" data-markerlon="0.6316555" data-markericon="" data-markericonhover="" 
data-streetview="no">
</div>

Do you think why on earth data is shown with a comma instead of a point in our server?

We have no idea why it could be happening. I have done a research on the internet and have found a very interesting page where 8 years ago one person had the same issue (although being a drupal page, I suspect strongly that it has to do with our problem!): hidden link

Thanks, again, Christian,

Mario