Google maps api v3 LatLng conversion error -
i'm doing ajax call request position , move marker relative position is. problem latlng command returns (nan,nan) though variable "data" contains position. doing wrong here?
function marker() { $.get("ajax.php", { do: "getpos" }, function(data){ var latlng = new google.maps.latlng(data); alert(latlng); beachmarker.setposition(latlng); }); //settimeout( "marker()", 10000); }
as documentation says, latlng
constructor should have 2 parameters, both must numbers. ajax response can't of number type. string, should split , parse numbers passing latlng
constructor.
Comments
Post a Comment