Comment récupérer le query en utilisant localSearch

3 views
Skip to first unread message

ammouna24

unread,
May 25, 2009, 10:59:16 AM5/25/09
to Google AJAX APIs
Bonjour,

J'utilise Ajax api search et je trouve pas un moyen de récupérer la
requête ' query ' , comme dans le cas de search api en général .

Je joins el bout de code que j'ai essayé et qui marche pas

google.load("elements", "1", { packages : ["localsearch"] });
function searchStart(searcher, response,query) {
var searcher = document.getElementById('mapWrapperCanvas');
var queryDiv = document.createElement('div');
queryDiv.id = 'query';
document.body.appendChild(queryDiv);
alert("saisie"+query);
}

function initialize() {
var mapCanvas = document.getElementById("mapCanvas");
var resultsCanvas = document.getElementById("resultsCanvas");

var map2 = new google.maps.Map2(mapCanvas);

map2.addControl(new GMapTypeControl());
map2.setMapType(G_HYBRID_MAP);

map2.addControl(new GOverviewMapControl());

map2.addControl(new GScaleControl());
map2.addControl(new GLargeMapControl());

map2.enableScrollWheelZoom();
map2.setCenter(new google.maps.LatLng(36.8117,10.1761), 13);

var options={

resultList : resultsCanvas,
resultFormat : "multi-line1",
onSearchStartingCallback: searchStart,

};

Jeremy Geerdes

unread,
May 25, 2009, 11:16:53 PM5/25/09
to Google-AJAX...@googlegroups.com
Without seeing your complete code or, better yet, a link to the page
where you're trying to do this, it's tough to say what's going on,
especially considering that the LocalSearch control does not appear to
support a search starting callback such as the one that you're
looking. At least, I find no documentation on it, and I didn't see
anything when I looked through the code just now. Please provide a
link to your page or, if that is absolutely impossible, a link to a
pastebin of your complete code. Thanks.

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
jgee...@mchsi.com

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
!

dalila benachenhou

unread,
May 26, 2009, 9:58:00 AM5/26/09
to Google-AJAX...@googlegroups.com
Translation,

He is using Ajax API but he is enable to get the values from Query.
Here is part of the code.
Reply all
Reply to author
Forward
0 new messages