Thanks Rossko, >> Should I search location in google map api if not found in it then >> search in local search api? or >> Should go direct to local search api for location (lat,long..).
>As above, depends how you can categorise whatever it is you are >searching for. I have found another post on http://www.mail-archive.com/[email protected]/msg03412.html >Are LocalSearch results always different than results from Google Maps page? So I'm thinking that it would better I do search in google map api first if not found any result then go to google local search api. Following is my java script method , which is i'm calling on 'onBlur' of location input field //on blur of location input field function loadMap(key,dform,contextURL) { if (GBrowserIsCompatible()) { var oldlocation = dform.oldlocation.value; var location =dform.location.value; if(location == '' || !dform.displayGoogleMap.checked) { } else { map = new GMap2(document.getElementById("map_canvas")); //Create ajax request var ajaxRequest; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari ajaxRequest=new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 ajaxRequest=new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } //make asynchronous call ajaxRequest.open("GET", contextURL+"MyServlet? location="+location+"&googleMapApiKey="+key, true); //set up a callback function ajaxRequest.onreadystatechange=function() { if (ajaxRequest.readyState == 4) // look for readystate == complete { //get the response var jsonObject = eval('(' + ajaxRequest.responseText + ')'); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.addControl(new GScaleControl()); //update the center location of google map map.setCenter(new GLatLng(jsonObject.latitude, jsonObject.longitude), 13); //Simple Marker map.addOverlay(new GMarker(new GLatLng(jsonObject.latitude, jsonObject.longitude))); //map.setUIToDefault(); } } //send request ajaxRequest.send(null); } //End of else .... if(location == '' || ! dform.displayGoogleMap.checked) }//end of else ..if( location == '') }//End of loadMap() -shyam On Jul 10, 12:59 pm, Rossko <[email protected]> wrote: > > But when this way getting following message > > ---We are sorry but we don't have maps at this zoom level for this > > region Try Zooming out for a broader look. > > That's an unusual message to get from HTTP geocoding. There's no map > at all in your unwelcome code dump, so we can't see whats going on at > all. > > > What is the difference in finding location using google map api and > > local search api? each impact on performance ? > > If you need to find business or institute, which it seems you do, then > you won't find them using maps geocoder, as you've found out. > Both searches are conducted at Google's servers, I don't suppose you'd > measure any speed difference. > Of course by widening the search you may get more results. That may > add a little to the time spent sending you the results, and then > whatever processing you do on the results will be affected. > > > Should I search location in google map api if not found in it then > > search in local search api? or > > Should go direct to local search api for location (lat,long..). > > As above, depends how you can categorise whatever it is you are > searching for. > > cheers, Ross K --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
