views:

38

answers:

1

Hello,

I have a simple page which makes two JQuery AJAX calls to get parameters and then it updates a google maps Lat and Lng,

For some reason after the two AJAX calls are made, the google map then seems to timeout and go Grey.

Anyone ever experienced this before or have any ideas as of why it would be doing this?

Thanks

A: 
    var pclat;
    var pclng;  
    var pc = document.forms[0]["postcode"].value;


    $.get("get_latlong.php", { cp: pc, cord: "Lat" }, function(data){
        alert("Lat: " + data);
        pclat = data;

    });



    $.get("get_latlong.php", { cp: pc, cord: "Lng" }, function(data){
        alert("Long: " + data);
        pclng = data;
    });


    updateMap(pclat, pclng);


 }



function updateMap(pclat, pclng){


    var postcodeLL = new google.maps.LatLng(pclat, pclng);
    map.panTo(postcodeLL);
    marker.setPosition(postcodeLL);
    marker.setMap(map);

}

Kyle
this should really be included in the question not as an answer.
corymathews