Thursday, May 19, 2011

Yahoo PlaceMaker and Maps Client

    My Google API Application

    google.load("search", "1");

    function OnLoad() {
      // Create a search control
      var searchControl = new;

//create LocalSearch object

//create a LocalSearch instance
function initialiseLocalSearch()
localSearch = new;

//we want lots of results (actually only 8)

//set the Local Search centre point (a geographic location)

//Set searchComplete as callback function when a search is
//complete. The localSearch object will hold results
localSearch.setSearchCompleteCallback(this, searchComplete, null);

//include teh required Google branding'branding');

function searchComplete() {
var result_element = document.getElementById("result-div");

//if we have at least 1 search results
if(localSearch.results && localSearch.results.length > 0)
//loop through the results
for(var i = 0; i < localSearch.results.length; i++)
var result = localSearch.results[i];

//a result element's html property contains a DOM tree
//make a complete copy of it to add to our page

var result_node = result.html.cloneNode(true);

//add the result to some element in our page



      // Add in a full set of searchers
      var localSearch = new;

      // Set the Local Search center point
      localSearch.setCenterPoint("Hamilton, New Zealand");

//remove the results of any previous queries

//carry out a searh for the given query string

      // Tell the searcher to draw itself and tell it where to attach

      // Execute an inital search



My Google API Application