Hi there. I have a very strange problem.
Basically I am trying to do a local search for all local accounts that
have a particular name. I can plot the first marker but during the
local search near the bottom there is a problem. Basically if I
uncomment the "alert(localPoint);", the code will work. I can see the
respective points and they are plotted. But, if i comment out the
"alert(localPoint);",
I can't see the local points. Instead I get an error stating "this.Q
is null" with relation to this line of code from firebug -
"kl.prototype.ud=function(a,b){return thi...tion().fromLatLngToPixel
(a,b||this.Ag)};"can someone help me out? Any ideas? Thanks <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Google Maps JavaScript API</title> <script src="http://maps.google.com/maps? file=api&v=2&key=mykey*****" type="text/javascript"></script> <script src="http://www.google.com/uds/api? file=uds.js&v=1.0&key=mykey*****" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ function load() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); var localSearch = new GlocalSearch(); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); var geocoder = new GClientGeocoder(); var address = "MyStreet" + ", " + "MyCity" + ", " + "MyState"+"MyPostCode" + "," + "{!Account.BillingCountry}"; var localSearchString = "Company Name" + ", " + "Company City" + ", " + "Company Country"; var defaultPoint = geocoder.getLatLng( address, function(p) { if (!p) { alert(address + " not found"); } else { map.setCenter(p, 13); var marker = new GMarker(p); map.addOverlay(marker); marker.openInfoWindowHtml("<font>{!Account.Name}<br>{! Account.BillingStreet} <br>{!Account.BillingCity} {! Account.BillingState} {!Account.BillingPostalCode} <br>{! Account.BillingCountry}</font>"); } } ); //now perform the local search localSearch.setSearchCompleteCallback(null, function() { if(localSearch.results.length > 0) { for(var i=0; i<localSearch.results.length; i++) { var resultLat = localSearch.results[i].lat; var resultLng = localSearch.results[i].lng; var localPoint = new GLatLng(resultLat,resultLng); var resultMarker = new GMarker(localPoint); //alert(localPoint); map.addOverlay(resultMarker); } } }); localSearch.execute(localSearchString); } } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
