View Single Post
  #1 (permalink)  
Old January 29th, 2009, 06:59 PM
pinetree pinetree is offline
Registered User
 
Join Date: Jan 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Google Map API Example question (cht 7, p203)

Hello Chris/Licinda
I study your book "Beginng Ajax.
I got stuck in chapter 7, p203 - Google Map API example.

My question is in JavaScript portion.
Below is the part.

function load(e)
{
if (GBrowserIsCompatible())
{
map = new GMap2(document.getElementById("map"));
geocoder = new GClientGeocoder();
placeMarkers(document.getElementById("address").va lue, e);

GDownloadUrl("data.xml", function(data, responseCode) {
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName("marker") ;

if (markers.length > 0)
{
point2 = new GLatLng(parseFloat(markers[0].getAttribute("lat")), parseFloat(markers[0].getAttribute("lng")));
map.setCenter(point2, 13);
}
else
{

geocoder.getLatLng("Paris", function(point){map.setCenter(point, 13)});
}
});
}
}

My question is in load function.
It has one argument but at the end, it refers to "point" (in red color) but it is not defined.
That is a part, which bugs me now.

I will appreciate if you can clarify me about this.
Reply With Quote