Debug Google Maps API stack overflow in iOS Safari - javascript

I have a site at localgp.com that uses Google Maps API v3 on the search results page. (Follow one of the location links on the front page.) The problem is, on mobile safari (both iPhone and iPad), a javascript error occurs somewhere within the API, but it works just fine on all other browsers I'm interested in targetting including Safari on Mac and PC.
The offending javascript:
http://maps.gstatic.com/intl/en_us/mapfiles/api-3/5/11/main.js
Lines error occurs:
26, 28 and 27
Error message:
RangeError: Maximum call stack size exceeded.
My questions:
In the short term, might anyone know what's going on here and how it might be solved?
Longer term, how would I go about debugging javascript errors on mobile safari if at all possible?

It seems that if you use the 'bounds' option it causes this problem.
We discovered that when bounds was set to true, the google code was calling fitbound() over and over.
Im not sure if bounds will have a big impact on the map but it was in the tutorial so its a bit peculiar this hasn't been spotted before.
Hope that helps!

Related

OpenLayers 6 HeatMap - Uncaught Error: Cannot read property 'indexOf' of undefined

We have a an OpenLayers application based upon v6 which is blowing up with this error. It was working well yesterday, and today it is not. We're not finding where we broke something. The error is coming from some asynchronous event in the renderer (no obvious top-level function in the backtrace). Lots of single-letter function names in the ol libraries. We're needing some help figuring out where to go next.
http://www.nufosmatic.com/nufosmatic/html/frame.html
The "Ol6 Maps Heatmap" page...
Well, it turns out that Chrome went toxic. The page would render in Brave, Edge, and Firefox but not in Chrome. We closed all of our Chrome windows (Windows 10, Chrome Version 91.0.4472.124 (Official Build) (64-bit)) and then made certain that all of the background processes were dead and re-started the browser. Everything is working everywhere again.
The error was buried deep in the rendering logic in OL, and we were not going to be able to figure this out. Fortunately, we thought to try another browser just to see.

Get CPU Usage detail in browser [duplicate]

I noticed this today in my Chrome.
Google Meet is showing a chart of CPU usage in their "Troubleshooting" panel. I'm wondering if there's an existing API for this or is it a clever trick I'm not aware of.
I was curious about this as well when I saw the CPU Usage graph on the Troubleshooting page on the Google Meet's page. So googled a lot and I couldn't find any proper answer as to how it is being achieved apart from this link: https://developer.chrome.com/extensions/system_cpu#method-getInfo.
So, I went through the minified source code of the Google Meet's site and it turns out Google Meet is using this but not on their webpage directly, because it is for chrome extensions only, but through the Google Hangouts Extension which is present in Chrome, Brave and the new Microsoft Edge (Chromium-based).
The chrome extension is calling the chrome.system.cpu API to get the information about the processor, core count, temperatures, etc., and these details are being passed to the Google Meets page via window.postMessage API and Message Passing between Chrome Extension and a Webpage.
This is a neat little way to achieve this if you are the creator of the browser :P.
Most probably, they are using Chrome specific API since this will not work on other browsers.
The closest thing that I've found is https://developer.chrome.com/extensions/system_cpu#method-getInfo
Below is a screenshot from Firefox stating that this will work only on Chrome.

Google Maps Draw Route malfunction in Windows

tldr: recently, my use of the Google Maps JavaScript API v3 does not show routes or markers anymore. It works fine on my Debian-box, but not on any Windows computer I tried (ranging XP to Windows 8). Has there been a recent change in the API? Is my code buggy? see http://pastebin.com/ubRGPtDZ
Dear All,
in August 2014, I wrote a Qt program that at some stage shows Google Maps in a QWebView . Through JavaScript I was able to draw a route.
This program has been functioning fine, up to mid-December. On my Linux-box (Debian), it still works fine, but on every Windows computer I try, stops showing the route. Google Maps itself shows fine, but it stops showing any route, any marker, ...
Did anything change in Google Maps mid-December 2014? I checked the changelog of Javascript Maps API v3 , but I do not see any new mention after September 2014.
Should I check somewhere else?
Or is there any change in QWebView-behaviour on Windows-boxes since mid December? Is that even possible?
I still hold possible that my JavaScript tweaking is inadequate, so I will debug that code as well, but definitely baffles me that everything worked fine for over 4 months on Windows-computers, and still does on my Debian-Box. I have put it online at http://pastebin.com/ubRGPtDZ .
My apologies for any bad English, non-native speaker here.
Thank you all for any suggestion.
Wim
Found it! This was a very frustrating challenge, but it feels great now that it is solved. It took me days of browsing through any documentation possible, of pure trial-and-error, testing and doubting every aspect of my code or even configuration, all failed... But one more time I browsed the qt-project and found this post by lowsnr and Yuvalal.
In the words of lowsnr:
as part of the test that the Google code performs to determine
whether the browser is touch enabled, it checks the User Agent for
Chrome >= 5.0, so by changing the user agent to something like
‘Chrome/1.0’ the touch interface suppressed.
Apparently it is also needed for displaying the directions (*). So I wrapped up a new class called myWebPage and derived it from qWebPage:
class myWebPage : public QWebPage
{
virtual QString userAgentForUrl(const QUrl& url) const {
return "Chrome/1.0";
}
};
and before loading the HTML in the qWebView, I use setPage():
ui->setupUi(this);
ui->webView->setPage(new myWebPage());
ui->webView->setHtml("...");
Now it works like a charm :-)
--
(*) For me, the prove that the problem was not my JavaScript, is that I tried to simply load the same HTML script as used in the Google Maps code examples. In a QWebView, it works fine for my Linux-box, but refuses to show the directions on any Windows-compiled binary that I tried. Still, the code works fine if you load to a regular browser.
Conclusion: Google Maps does not necessary like QWebView.

PDF.js is randomly crashing the Google Chrome tab

My problem may seem a bit vague (it is to me too), but here is my attempted explanation of it.
A few months ago, I implemented PDF.js in my web application. It was really useful, and I am using it for interactions with my clients.
Suddenly, last week, my clients reported to me "Aw, Snap" messages in Google Chrome on their PCs when they try to launch PDF.js. I have an iMac and two PCs at home, so I decided to test this out.
When I used Google Chrome on my iMac to launch PDF.js, I found it worked fine.
When I used Google Chrome on my first PC to launch PDF.js, I found it worked fine.
When I used Google Chrome on my second PC to launch PDF.js, even though it previously worked, it kept crashing and showing me "Aw, Snap" messages.
This was weird. I tried removing all the extensions, clearing the cache, clearing the LocalStorage, but nothing seemed to fix the problem.
I then realised, after some communication with my clients, launching PDF.js in Safari, Torch, Opera or Firefox on any operating system worked perfectly fine.
Why would this happen? I am using the web viewer in PDF.js. I also tried with the basic hello world example, but that broke as well (which I now find really weird), so I suspect there's something wrong with the rendering engine.
I also tried including the compatibility.js file after building the source, but with no avail.
Is there any known bug which causes Google Chrome tabs to crash?
Yes, I got it now.
From https://github.com/mozilla/pdf.js/issues/4104, I found the answer (thanks Rob and PDF.js dev team!). Take a look yourself!
I'm only posting this here so that anyone who stumbles upon this post with a similar problem can be helped (as this error took me quite a while to figure out).
Unfortunately, this does not seem to be the case. We've tried the latest version of pdf.js from github, also tried Chrome 33 (stable) which should have their V8 fix included and it still crashes. Also, tried the pdf.js commit mentioned in github thread (4ce6cb8 - https://github.com/mozilla/pdf.js/commit/4ce6cb8b0fa9db948516b2b738fa1503cf0ef90e) - still crashes. Also tried latest Chrome Canary available on 19/03/2014 - crash is there.
We can provide the WinDbg memory dump if it's of any help.
PS: sorry, this should be the answer to Rob W thread right above but I cannot add it there due to 0 reputation.

Google Maps Gadget Not Working

I'm not sure of the specific day, but on our company site, the Google Maps Driving Directions Gadget no longer functions, i.e. it is no longer accepting input and autoexpanding the directions. This is the standard gadget found at http://maps.google.com/help/maps/gadgets/directions/. I was just curious if anyone else is experiencing this issue, or is there a known conflict with jQuery or any other popular scripts?
This seems to be an issue that is not only related to your site. We had the directions widget on a test server and it used to run fine. Last week I noticed it would not expand in IE and FF anymore, Chrome however is working fine.
I did some searching around on the net and there are other people having the same issues:
Google support page
Another Google support page
So this seems to be an issue with the Google code and we need to wait for them to fix it.

Categories

Resources