|
|
 |
Re: FN-FORUM: Google Map - UK Post Code JS Error
date posted 20th February 2008 16:17
> I'll check it but I think it is specifically a JS error on the line wi=
th
> the Lat reference on line 57
Yes, you are referencing resultLat and resultLng on line 56. Neither of =
=
those variables are defined at that point in the code, so the map can't =
=
use them to set its centre.
Variables with the same name are declared in lines 19 and 20, but these =
=
are local to the function they're defined in. If you moved their =
definition into the global scope it might work.
> That kind of helps alot but doesn't make any sense as the Post Code is=
> hardcoded in the body with usePointFromPostcode so that is annoying.
>
As well as asking the function to be called there (where it seems to wor=
k =
OK) you are also adding the function mapLoad() as something to run when =
=
the body has finished loading. The mapLoad() function is where the bug i=
s. =
If you remove the following line you will probably avoid the bug:
addLoadEvent(mapLoad);
You could then also remove a large amount of unused code :)
HTH,
Anthony
-- =
www.fonant.com - Quality web sites
|
 |
|