- searchControl.setSearchCompleteCallback(this, App.prototype.OnSearchComplete);
- searchControl.setSearchStartingCallback(this, App.prototype.OnSearchStarting);
- App.prototype.OnSearchComplete = function(sc, searcher) {
- // if we have local search results, put them on the map
- if ( searcher.results && searcher.results.length > 0) {
- for (var i = 0; i < searcher.results.length; i++) {
- var result = searcher.results[i];
- // if this is a local search result, then proceed...
- if (result.GsearchResultClass == GlocalSearch.RESULT_CLASS ) {
- ...
- App.prototype.OnSearchStarting = function(sc, searcher, query) {
- alert(\"The Query is: \" + query);
- ...
- //该片段来自于http://www.codesnippet.cn/detail/13112012318.html
来源: http://www.codesnippet.cn/detail/13112012318.html