Google Maps Javascript Error..

Associate
Joined
30 Dec 2005
Posts
415
I'm creating an api for this website, but have hit a hinderance when i've come to use google maps.

https://routehiker.escouts.net/api/text.php


In Firefox 1.5, this works fine, but shows an error in the Javascript console:
Error: Error in parsing value for property 'z-index'. Declaration dropped.
Source File: https://routehiker.escouts.net/api/text.php
Line: 0
Also, when you click on a marker and it brings up the text bubble, it shows this:
Error: The "coords" attribute of the <area shape="poly"> tag is not in the "x1,y1,x2,y2 ..." format.
Source File: https://routehiker.escouts.net/api/text.php
Line: 0
Source Code:
coords=""

In IE, it doesn't work at all and shows this error:
Line: 59 Char: 1 Error: Object Expected

Anyone got any ideas? I'm quite new to Javascript :(
 
Last edited:
try putting

<div id="map" style="width:500px; height:400px; margin-left:auto; margin-right:auto;"></div>

above the script bit, i`ve been fiddling with googe map scripting for a bit, and it`s blooming fragile!

i dont think the script for generateing the map needs to be in the head all the time, only the script for the api key
 
Diskbox said:
try putting

<div id="map" style="width:500px; height:400px; margin-left:auto; margin-right:auto;"></div>

above the script bit, i`ve been fiddling with googe map scripting for a bit, and it`s blooming fragile!

i dont think the script for generateing the map needs to be in the head all the time, only the script for the api key

I've hit a snag with that theory though. On document load, it runs the timer() function. This has to be located in the head, but is heavily associated with the google maps stuff, which as you say, would probably be better off in the body.

Aaah!
 
hmmm i use a mapload() function to get the map to load on body load.

<body onLoad="mapload()">



<script type="text/javascript">
//<![CDATA[
function mapload(){
function loadMap() {
var map = new GMap(document.getElementById("map"));
map.centerAndZoom(new GPoint(-0.701022434234619, 54.274033140348), 12);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
}
loadMap();
}
//]]>
</script>
 
The problem I have is that its an advanced animated map, which scrolls between the different points. It started off like yours, but developed into two different functions, one which has to be in the head :(
 
Back
Top Bottom