Geometry library not working in IE [8]

150 views
Skip to first unread message

Kasper

unread,
Nov 18, 2011, 2:52:15 PM11/18/11
to google-map...@googlegroups.com
I'm using the geometry library on my website, but for some reason it's destroying the Google Maps maps...
In IE8 the webpage stops loading because it gets the following error:
Bericht: 'elementType' is leeg of geen object
Regel: 27
Teken: 68
Code: 0
URI: http://maps.gstatic.com/cat_js/intl/nl_nl/mapfiles/api-3/7/1/%7Bmain,geometry%7D.js

In FF and Safari the page loads fine...

I'm using this in my head:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=geometry&sensor=false"></script>

Why does this happen? What is going wrong?

I also checked with the W3C validator, and my website is valid:

This document was successfully checked as XHTML 1.0 Transitional!


Kasper

unread,
Nov 18, 2011, 3:01:13 PM11/18/11
to google-map...@googlegroups.com
Note, you can view the page here: http://bit.ly/w2eGDR

geoco...@gmail.com

unread,
Nov 18, 2011, 3:45:03 PM11/18/11
to Google Maps JavaScript API v3
On Nov 18, 12:01 pm, Kasper <kaspervandel...@gmail.com> wrote:
> Note, you can view the page here:http://bit.ly/w2eGDR

looks to me like you are including the API twice, once with the
library once without:


<script type="text/javascript" src="http://maps.googleapis.com/maps/

api/js?sensor=false"></script>


<script type="text/javascript" src="http://maps.googleapis.com/maps/

api/js?libraries=geometry&amp;sensor=false"></script>


-- Larry

Kasper

unread,
Dec 14, 2011, 6:52:31 PM12/14/11
to Google Maps JavaScript API v3
I can't believe I didn't get notified about this reply...
But yeah, I include it twice, because I need two different parts: the
main library and the geometry library?
Or would the first include all?

Also, when removing one of both, it still doesnt work... :(

Any suggestions?

Rossko

unread,
Dec 14, 2011, 9:49:14 PM12/14/11
to Google Maps JavaScript API v3
> Also, when removing one of both, it still doesnt work... :(

Your demo page is still loading the API twice
http://code.google.com/apis/maps/documentation/javascript/basics.html#Libraries
once will do

Kasper

unread,
Dec 15, 2011, 4:06:04 AM12/15/11
to Google Maps JavaScript API v3
Yes, but still, when I remove one of the two, the error is still
there...
And when I include the geometry library, does it automatically also
include the rest?

On Dec 15, 3:49 am, Rossko <ros...@culzean.clara.co.uk> wrote:
> > Also, when removing one of both, it still doesnt work... :(
>

> Your demo page is still loading the API twicehttp://code.google.com/apis/maps/documentation/javascript/basics.html...
> once will do

Andrew Leach

unread,
Dec 15, 2011, 4:53:07 AM12/15/11
to google-map...@googlegroups.com
On 15 December 2011 09:06, Kasper <kasperv...@gmail.com> wrote:
> Yes, but still, when I remove one of the two, the error is still
> there...
> And when I include the geometry library, does it automatically also
> include the rest?

The documentation isn't great.

You only need one line which looks generally like this:

<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?sensor=true"></script>

The part before the ? loads the API. Everything after the ? (apart
from sensor=something) is optional and varies the behaviour of the
API: you can include libraries, specify a particular version, specify
two kinds of localisation and a callback function for asynchronous
loading.

To include more than one library you use a comma-separated list. So
something like this is possible, which should be all together on one
line. This loads the API with all the specified options.

<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?sensor=false&v=3.5&libraries=geometry,places&region=GB&language=ja"></script>

Rossko

unread,
Dec 15, 2011, 5:13:50 AM12/15/11
to Google Maps JavaScript API v3
> Yes, but still, when I remove one of the two, the error is still
> there...

When you're ready, show us the page with that problem. There's no
point in us looking at a page that is something like the one you are
having trouble with, and which has some other already identified but
unfixed problem.

> And when I include the geometry library, does it automatically also
> include the rest?

Yes, the keyword is 'include'. One call to the maps API will load the
core API plus whatever libraries you request in its parameters.

Kasper

unread,
Dec 15, 2011, 11:02:04 AM12/15/11
to Google Maps JavaScript API v3
Ok, thanks! It would be indeed logical to also get the rest of the
API, but I wasn't completely sure.

Now, the page with only one left: http://bit.ly/umutPV

Rossko

unread,
Dec 15, 2011, 3:30:42 PM12/15/11
to Google Maps JavaScript API v3
> Now, the page with only one left:http://bit.ly/umutPV

Your included script
jquery.topzindex.min.js
is not accessible on your server

You have
<div id="map_canvas" style="width: 100%; height: 100%; ...
but the parent of this div (the <body>) has no specified size. 100%
of undefined is undefined.

Kasper

unread,
Dec 15, 2011, 4:01:59 PM12/15/11
to Google Maps JavaScript API v3
Hmm, weird that topzindex was still there. I must have forgotten to
remove it... I wasn't using its functions anymore though.
I also gave the body 100% width and height now, so that is fixed too.
Thanks for pointing out those errors.
Though, it still doesnt work in IE :(
Reply all
Reply to author
Forward
0 new messages