Hmm. I see the problem. When you use the jsapi loader to load the  
LocalSearch control, it loads the new version, which is obfuscated and  
doesn't use the GSearchForm like the old one did. I guess that's what  
I get for assuming they would keep things similar. :)

Anyway, you can still get the search form by walking the dom, but  
there's no reliable way to programmatically access and execute the  
searcher.  Sorry!

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
http://jgeerdes.blogspot.com
http://jgeerdes.wordpress.com
[email protected]

Unless otherwise noted, any price quotes contained within this  
communication are given in US dollars.

If you're in the Des Moines, IA, area, check out Debra Heights  
Wesleyan Church!

And check out my blog, Adventures in Web Development, at 
http://jgeerdes.blogspot.com 
  !


On May 12, 2009, at 1:46 PM, Dennis G wrote:

>
> Hi Jeremy.
>
> Well, I took your advice and got this to the same state as the other.
> But, when I go to implement the ideas you had above with the lsc, it
> errors our lsc.execute is not a function and lsc.searchForm is
> undefined.  Here is the JS for the entire page - just drop it in to an
> HTM file.  Uncomment the lsc2 lines and you will see what I mean!
>
> Any other help would be awesome - getting close!
>
> dennis
>
> <!--
>  copyright (c) 2009 Google inc.
>
>  You are free to copy and use this sample.
>  License can be found here: 
> http://code.google.com/apis/ajaxsearch/faq/#license
> -->
>
> <!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 AJAX Search API Sample</title>
>    <style type="text/css" media="screen">
>      body {
>        font-family : arial, sans-serif;
>      }
>      #spacer { width : 10px; }
>      #mapWrapperCanvas {
>        width : 100%;
>        height : 380px;
>      }
>      #mapCanvas {
>        border : 1px solid #979797;
>        height : 380px;
>        width : 100%;
>      }
>      #resultsCanvas {
>        position : relative;
>        top : 15px;
>        left : 0px;
>        height : 348px;
>        width : 280px;
>      }
>      #mapSearch {
>        position: relative;
>        top : 0px;
>        left : 0px;
>      }
>      .mapcanvastable td {
>        padding : 0px;
>      }
>      .mapcanvastable {
>        border-width : 0px;
>        border-spacing : 0px;
>        border-collapse : collapse;
>        border : none;
>        padding : 0px;
>      }
>
>      /* canvas view css over-rides */
>      #mapCanvas .gels {
>        width : 280px;
>        background-color: #ddeeff;
>      }
>      #mapCanvas .gels-form {
>        background-color: #ddeeff;
>      }
>
>      #mapWrapperCanvas .gels-controls {
>        position : absolute;
>        bottom : -2px;
>        left : 0px;
>      }
>      #mapWrapperCanvas .gels-app,
>      #mapWrapperCanvas .gels-extresults-active {
>        border : none;
>      }
>      #mapWrapperCanvas .gels-list-item {
>        margin-bottom : 2px;
>      }
>      #mapWrapperCanvas .gels-list-wrapper {
>        padding-left : 0px;
>      }
>    </style>
>
>    <script src="http://www.google.com/jsapi?key=yourkeyhere";></
> script>
>    <script type="text/javascript">
>       google.load("maps", "2");
>       google.load("elements", "1", {
>          packages: ["localsearch"]
>       });
>
>       var map2 = null;
>
>       function initialize() {
>          var mapCanvas = document.getElementById("mapCanvas");
>          var resultsCanvas = document.getElementById
> ("resultsCanvas");
>
>          var map2 = new google.maps.Map2(mapCanvas);
>          //map2.setMapType(G_PHYSICAL_MAP);
>          //map2.removeMapType(G_HYBRID_MAP);
>          //map2.addMapType(G_PHYSICAL_MAP);
>          map2.addControl(new google.maps.MenuMapTypeControl());
>          map2.setCenter(new GLatLng(39.965488, -75.171579), 16); //
> philly
>
>
>          // Set where the results will appear
>          options = new Object();
>          options.resultList = resultsCanvas;
>          options.resultFormat = "multi-line1";
>          options.searchFormHint = "Banks, Gas Stations, etc.";
>          /*
>          options.adsOptions: {
>          client: "partner-google-maps-api",
>          channel: "41301183",
>          adsafe: "high",
>          language: "en"
>          };
>          */
>          var lsc2 = new google.elements.LocalSearch
> (options);
>          map2.addControl(lsc2, new GControlPosition
> (G_ANCHOR_TOP_LEFT, new GSize(-282, -2)));
>
>          //lsc2.searchForm.input.value = 'My Default Search Value';
>          //lsc2.execute('My Default Search Value');
>
>          geocoder = new GClientGeocoder();
>          var address = "2300 Fairmount Ave Philadelphia, PA 19130";
>
>          if (geocoder) {
>             geocoder.getLatLng(
>             address,
>             function(point) {
>                if (!point) {
>                   alert(address + " not found");
>                } else {
>                   map2.setCenter(point, 13);
>
>                   var blueIcon = new GIcon(G_DEFAULT_ICON);
>                   blueIcon.image = "/images/site/gmaps/blue-dot.png";
>                   blueIcon.iconAnchor = new GPoint(0, 0);
>                   blueIcon.infoWindowAnchor = new GPoint(6, 0);
>                   var locMarker = new GMarker(point, blueIcon);
>                   map2.addOverlay(locMarker);
>                   locMarker.openInfoWindowHtml(address);
>
>                   GEvent.addListener(locMarker, "click", function() {
>                     locMarker.openInfoWindowHtml(address);
>                   });
>
>
>                };
>             }
>            );
>          }
>
>       }
>
>       google.setOnLoadCallback(initialize);
>    </script>
>  </head>
>
>  <body style="font-family: Arial;border: 0 none;">
>    <div id="mapWrapperCanvas">
>      <table class="mapcanvastable" style="width:100%;">
>        <td style="width:280px">
>          <div id="mapSearch"></div>
>          <div id="resultsCanvas"></div>
>        </td>
>        <td>
>          <div id="mapCanvas"></div>
>
>        </td>
>      </table>
>    </div>
>  </body>
> </html>
>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" 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-AJAX-Search-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to