The LocalSearch class enables you to access Yahoo!'s extensive databases of local businesses and consumer ratings and locations and use its returned data to display POIs on your map.
Example
var localSearch:LocalSearch = new LocalSearch();
localSearch.addEventListener(LocalSearchEvent.SEARCH_SUCCESS, handleSearchSuccess);
localSearch.searchLocal("pizza", 8, _map.centerLatLon)
function handleSearchSuccess(event:LocalSearchEvent):void
{
// handle event
}
public function LocalSearch()
Creates a LocalSearch object
public function searchLocal(query:String, zoomLevel:int, latlon:LatLon, radius:Number = 2.8, begin:Number = 1, per_page:Number = 25, categoryFilter:String = null, ratingFilter:String = null):void
Sends a search request to the Yahoo! Local API
Parameters
| query:String — The search query.
|
| |
| zoomLevel:int — The specified zoom level to search on
|
| |
| latlon:LatLon — The center location to search from
|
| |
| radius:Number (default = 2.8) — The radius in miles from the center latlon point to search in.
|
| |
| begin:Number (default = 1) — A number which specifies the starting index.
|
| |
| per_page:Number (default = 25) — How many results to return on each page.
|
| |
| categoryFilter:String (default = null) — The category filter key used to filter search results
|
| |
| ratingFilter:String (default = null) — The rating filter key used to filter search results
|
Event object type: LocalSearchEvent
Dispatched only if the request failed, the XML did not parse or there was no results.
Event object type: LocalSearchEvent
Dispatched when the request was successful and there was at least one result.