[Google Maps API v2] Re: How to execute an initial search using Separate Results Canvas
I am just trying to use the code provide in the playground. Here is
the code
google.load("maps", "2");
google.load("elements", "1", {
packages : ["localsearch"]
});
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 google.maps.LatLng(34.431, -119.573), 13);
// Set where the results will appear
options = new Object();
options.resultList = resultsCanvas;
options.resultFormat = "multi-line1";
var lsc2 = new google.elements.LocalSearch(options);
map2.addControl(lsc2, new GControlPosition(G_ANCHOR_TOP_LEFT, new
GSize(-282, -2)));
}
google.setOnLoadCallback(initialize);
and I was wanting to add something to execute the search when the page
loads. Something like this.
// Execute an initial search
searchControl.execute('pizza');
}
But I cannot figure out how to.
Thanks,
--
You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home