Google Maps problem - javascript

Well, I can't seem to "join the forum to post" on Google Maps itself, so I guess I'll ask here.
I recently noticed the following error that started happening on Google Maps Javascript API 3:
SCRIPT5007: 'undefined' is null or not an object main.js, line 17 character 197
This main.js file is the one used by Google Maps, not one on my own site.
The error seems to be caused by an undefined function being called, with the error happening here:
f.d[ac](f.b,c)
d[ac] is a function called apply, but f.d[ac] doesn't exist.
Anyone know how I can get it to work again? Or how to actually tell Google about the problem so they can do something about it?
Thanks.

Did you recently change from Google Maps JavaScript API v2 to v3? I had that error couple of times when using the v2 implementation of certain functions. But once again finding the source of your problem will be hard not having any code to take a look at.

Have you added a function to your own code called 'f'? That would cause this line to error.
function f(){
bla;
}

Related

How to properly use the sheets.spreadsheets.values.GET in the Google Sheets API?

So I'm a first year programming student with near 0 experience so please forgive me if I'm going at this the wrong way.
I'm building a website that will take an array of strings and display them as well as run some code relating to those strings. For this assignment, I have to use an API, so I wanted to use the google sheets API in order to achieve my idea. I understand that I need to use the command
sheets.spreadsheets.values.GET
to get my spreadsheet data as a JS array, which is perfect for what I want to do. Inside the Google dev console, I am able to test the command and receive my array, so I know that I have the API se t up correctly.
However when I go to my website, which has Jquery linked fyi, and I put in the get command into the console I get the error:
Uncaught SyntaxError: Unexpected identifier
This is weird to me since I'm just copy-pasting from the Dev console into the early version of my website this command:
GET https://sheets.googleapis.com/v4/spreadsheets/MY_Spread_Sheet_ID/values/Sheet1!A1%3AA200?valueRenderOption=FORMATTED_VALUE&key={ApiKeyCode}
I was under the impression that the console should have reported back the contents of my spreadsheet as an array, but instead I get the error.
At first I thought that I must have needed to link the google sheets API to my code like you would with JQuery but I can't find documentation on how to do that, so that might be my problem.
Sorry about my poor English skills.
Could you include your code in your post? FYI, the function spreadsheets.values.get() does not return directly a value, but instead it calls a callback function with the returned values.

map.js:56 Uncaught TypeError: this.l.keys is not a function - Google Maps

I came here searching some help if someone is having the same issue.
In my work, we have a web application that used Gmaps API version 3.34, but on may 15, this version was deleted for google and the maps stop working.
The app, takes automatically the new version 3.37, but the console throw the error:
map.js:56 Uncaught TypeError: this.l.keys is not a function
at _.ll.Ab (map.js:56)
at ou (map.js:43)
at map.js:44
Some info about the app:
The web app is old and uses JQuery v 1.9
The maps use the js Gmap3 V 5.1.1
I tied some variations but nothing works:
I used the Google Maps API versions 3.35, 3.36 and 3.37 with the same result.
I update the JQuery tolatest version, but the web app stop working!!
I update the Gmap3.js to latest version 7.2, but its structure and functions are different and doesn't work.
The console shows the error in the Gmap API line 56, at this point:
||a;g=this.C.ka;h=_.ua(this.l.keys());for(var
l=h.next();!l.done;l=h.next()){l=l.value;var
m=this.l.get(l),q=m.la,r=q.Y,v=new Bs(g,k,r),u=new
Bs(g,a,r),w=!this.J&&
The error is:
Uncaught TypeError: this.l.keys is not a function
I apreciate some help
Thx
I have the same issue, one workaround is to remove 'center' from Maps options.
The same error is thrown when you try to setCenter().
Edit* : Turns out i was naming a method Map() and javascript already has a Map() function.
Check your code if you're not doing the same or the includes in the page.

How to fix "this page can't load google maps correctly" error

I have run a website that is probably 10 years old at this point that has a map with custom points plotted on it. Recently I've noticed that this map says "For Development Purposes Only" and has an error alert: "This page can't load Google Maps correctly" and it says "Are you the owner of the website?"
I went through the process of setting up billing and generated an API key. But when I plug that key into the ONLY spot where there's an API key in the existing code, it fails with a "Oops! Something went wrong.
This page didn't load Google Maps correctly. See the JavaScript console for technical details."
This is the code difference:
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAYuhugTQ8HWA2RX4tkBQyIbvbe-f2nKDf2uCI5Rwpq3vfPBRkDwxy87YO1o-kJbvMl8dG_FNpRQ" type="text/javascript">
And the new version:
<script src="http://maps.google.com/maps?file=api&v=2&key=AIzaSyDLRgUHjuLTn7s629OxjVujuHOROcvB8" type="text/javascript">
After Googling and searching I found a bit of different syntax and thought perhaps that was the problem, so I tried that. It also failed:
<script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDLRgUHjuLTn7s629OxjVujuHOROcvB8" type="text/javascript">
(Note, I have altered these keys, they are not MY keys.)
I was hoping that the new API key would simply plug into the existing code and work, as I am not sure even where to start in the full code. Does anyone know if there are any glaring errors with this? Am I missing something obvious?
I know I haven't included the pages and pages of code, but that's because my impression was that an api-key is used once and the code should work whether it's key A or key B, as long as the key is correct.
Is my key perhaps not for use with Google Maps but some other key? Is there some additional "switch" to turn on for this to work?
Any help would be greatly appreciated. Thank you in advance.
In the hour or so since posting I believe I've answered my own question: AFTER making the API key, there's an additional step, probably obvious to any programmer but not to me at the time...you have to "Enable" the APIs for use with your site.
I did this here: https://console.developers.google.com

Wikitude SDK project derived from samples doesn't work

I've been modifying the sample projects Wikitude SDK provides, and I'm facing a problem: it seems like this code never works:
this.tracker = new AR.Tracker("/assets/magazine.wtc", {
onLoaded: this.worldLoaded
});
That is, the world never loads, so the function "worldLoaded" is never called.
I have no idea why the world doesn't load as the file is the original provided in the samples and it used to work.
The difference seems to be trivial, I only added a new member to the World variable that would define some additional parameteres.
The error I get is
Uncaught TypeError: Cannot read property 'apply' of undefined
ade.js:1AR.i.__executeFunctionByName ade.js:1AR.i.callAsync ade.js:1l
Any idea how to tackle this?
It seems as if you have the ADE activated, which is not necessary on a mobile device. In your HTML, please delete the line (your path to ade.js might differ slightly). This will make the error go away.
In addition, my suggestion is to also add an onError event to the tracker. In this case, you'll be notified when the tracker cannot be loaded (wrong location specified, invalid file etc), and you can react accordingly.

What causes Google Maps javascript exceptions?

I pretty consistently get GMaps API javascript exceptions that look like the following:
Ve.k is null or not an object (FF & IE)
b.k is null or not an object (FF & IE)
a is null (FF)
a.$e is undefined (FF)
Uncaught TypeError: Cannot read property 'k' of undefined (chrome)
Often the exception occurs during an eval of some expression in javascript in the bowels of the GMaps API
Almost anything can cause one of these to pop up, displaying an overlay on the map or a mouse click event for example.
I've been scouring my code for some time looking for offending overlays, and event handlers, but so far no relationship found. I've had this happen on a naked map with no overlays or handlers active.
Certain versions of the API will not crash on certain browsers, but it's hit and miss and I still have this sinking susspicion that something in the environment is giving GMaps a hard time (eg. maybe Facebook Connect, Google Analytics, my code...)
Does anyone have a handle on what causes these?
After spending quite a bit of time rolling back operations that affected the map 1 by 1, I finally got to the line(s) that caused this problem.
First, if I removed the call to setUIToDefault() the problem went away, this was unacceptable to me both because I wanted the default UI and that's a lame way to solve the problem. So many more map operations later I came to the GWT calls:
mapWidget.setHeight()
mapWidget.setWidth().
For those not familiar with GWT these two calls will ultimately translate to the following javascript template call:
element.style['height'] = height;
where 'element' in this case is the div that contains the map and height on the RHS of the expression is something like "690px".
That was all it took to derail the maps API.
The fix? Setting the size of the map div prior to instantiating the map.
You tell me, bug in the maps api or just a major feature lack? I'm going to check w/ the maps folks.
Just the perils of using a minified, obfuscated Javascript library I am afraid. There is no discrete group of errors that result in the exceptions you are seeing, but you can be sure that they are a result of a bug in your own code. I use Google maps pretty extensively and have regularly seen these types of errors. In 100% of cases, the bug was mine.
If you post (either here or in new questions) specific examples of pages that generate these errors, we can check them out and hopefully fix them.
I would have to guess it would be your code (not to say your a bad programmer) or another library interfering. I've been using the Google MAPS API happily for about 1 year now* and never had the first exception. The only time I've ever gotten an error message was when I was adding the balloon thingy.
*The website looks like crap but it was a high school project for my county fair and I couldn't use any server side stuff.
Edit: After reading your comment I'm wondering if you included a proper DOCTYPE? Check and see if you have it.

Categories

Resources