Skip Navigation

[Resolved] Javascript error

This support ticket is created 6 years, 10 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 7 replies, has 2 voices.

Last updated by Beda 6 years, 9 months ago.

Assisted by: Beda.

Author
Posts
#610219

I am trying to: display a map with markers

Link to a page where the issue can be seen: hidden link

I expected to see: a map with a marker

Instead, I got: a Javascript error

#610338

The first issue is your Google Maps API Key.

I tested our own internal and with that, I see the map and the marker.
I cannot assist the creation of API Keys, as this is entirely on the Google API how and wether it works.

We have a document here that elaborates how to set it up correctly - but if at the point of the API things fail, we can do little, as we have no control over Google's API:
https://toolset.com/documentation/user-guides/display-on-google-maps/#api-key
https://toolset.com/documentation/user-guides/display-on-google-maps/creating-a-google-maps-api-key/

But, even with our API, despite the Map working fine, I still see the security notice about failure to load hidden link.

The Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'hidden link' is therefore not allowed access.

But this seems due to another error:
DeletedApiProjectMapError
hidden link

It seems your API is wrongly setup.
I suggest to recreate it.

#610489

Beda,

Thank you! I got the Google API worked out and I'm trying to display a list of markers on a map with the names of the dealers below it. I got the names appearing below the map but the map is just out in the ocean, it isn't accepting my request for a fixed location (8297 Blaikie Court, Sarasota, FL). I went back and checked: Distance center is set using URL parameter: because it was giving a long list of php errors...you will see if you check it. The map doesn't show any of the markers on it, I've gone through the documentation many times and tried different things but it is not clear how to get the markers to appear. Thank you in advance for your time.

Mr Smith

#611075

It does not work either anymore with our API on your site.

You mention PHP errors.

I need to debug this locally so I can run a debug tool on the site.

Please can you - if possible - provide me either of this:
- a Database Dump and a zipped up copy of the WordPress Install
- a copy of your site made with Duplicator (or any other duplicator plugin)
https://toolset.com/faq/provide-supporters-copy-site/

The second is faster.

Then, I can deploy this locally and fully debug the issue.
Please also mention if the URL to look for the issue is still the same, or where exactly I can find the PHP errors after what action.

Thank you for your collaboration, I will try to find a solution ASAP for you.

#611118
#611413

The Duplicator does not seem to have finished the build.
I receive only the snapshots folder and database but no contents, needed for this tests.

The URL above leads me to a login UR of hidden link.
This is a 404.

This used to work previously. What step am I missing?

Could you also zip up your WordPress FTP install folder, and send it to me?
This would allow me to complete the duplicator package.

#611458
#611808

This particular View used, as far I see, according the initially reported link dealer/sara-bay-marina/, is displayed thru a Layout, and applies a filter as:

Show posts within 10km radius of address/coordinates provided using mapcenter shortcode attribute.

When you insert a View Cell in Layouts you cannot pass a ShortCode attribute.

In this case you need to insert it with the ShortCode in a Visual Composer Cell for example:

[wpv-view name="dealers" mapcenter="30, 32"]

The problem is I tried to apply that, I even removed the original View cell on your Layout here:
wp-admin/admin.php?page=dd_layouts_edit&layout_id=1293&action=edit#

The front end still displays the old layout.

Can you please flush the cache, and stop both the server and plugins cache if any?

This above should then solve the issue at least for the error.

#613903

Beda,

Thank you, I had to go away for a few days. There is no caching plugin installed nor on the server. There must be a view or template or layout or filter that is incorrect. I have tried many combinations and can't get it to work.

What I'm trying to do should be straightforward, I am just not that familiar with Toolset and trying to follow the documentation is not exactly clear, believe me, I've been trying for several days many things. What I want to do is this:

1) Create custom post type of Dealers with their Name, Address, Phone, Image (this is done)
2) Display all of the Dealers on a map with Markers and a Search Dealers button and the list of Dealers under the map (this doesn't display properly)
3) When you hover on the Marker, show the Dealer Name, Address, Phone
4) When you click on the Marker, show the Dealer Post (Name, Address, Phone and Image)
5) I would like the default map to be the address I have put in the Layout (8297 Blaikie Court, Sarasota, Florida) (I don't know why you were trying the "Show posts within 10km radius of address/coordinates provided using mapcenter shortcode attribute", I don't want that.
If there is an extra or incorrect View or Template or Layout or Filter, can you just remove it or edit it? I think I"m like 95% there, there is just something missing.
The development site access is:
hidden link?
User: baracuda
Pass: cuda!07
Thank you so much in advance for your time.

#614811

I am not sure what is blocking on your install.
These issues do not happen locally or on other installs, hence I suspect either Theme/Plugin conflicts or the Server is also involved.

What I can surely tell is that the development site you shared presents several very slow queries, specially when it comes to AJAX, wether backend or front end.
And that can be due to the server.

As well something is

I took the liberty and have set up what you elaborate as your goal on the development site.
Instead of "Dealers" I created a new Post type "Toolset Dealers".
hidden link

Then I added 2 Fields (just one for the test- a phone number and an address field):
hidden link

Then I added 3 Dealers in the post type and filled all information.

Then I added a View, and queried that Post Type, and added a Map as output:
hidden link

After, I added this all to a Page:
hidden link

Initially it displayed the map in the ocean.
Then I applied our own API key and it displayed all the pins on the map as expected, with all the info as expected.

What was unusual during all this process is that it took 40 minutes.
Usually this takes 10 or less. And that was due to a long lag of server response I experience on the development site.
Loading a GUI as example (those pop ups) takes forever, and that is not expected.

What I can imagine happened with the existing View is that due to the lag in response, one clicks several times on several settings and items.
This then can corrupt the database settings.

I suggest to ask the Server Admin what causes the slowness on this site, as with Toolset also this is not producible.
I suspect there is some sort of error logging going on that slows down the site, or the server provides a very low bandwidth only.

The View I created seems to work fine.

Can you confirm?