SearchResultEvent RPC
Notifies that a search has been performed and the result is accessible through the event.
Description
Used to notify that the SearchRequest
has received a reply from server side search.
Parameters
(* means the parameter is required)
Name | Type | Description | Default value |
---|---|---|---|
\* success | Boolean | true if result was got successfully | |
\* requestParameters | Object | request parameters | |
\* result | Object | search result | |
options | Object | options sent in search request |
Event methods
getName()
Returns event name
getSuccess()
Returns true if result was got successfully
getResult()
Returns search result as JSON
getRequestParameters()
Returns request parameters as JSON
getOptions()
Returns optional flags sent in SearchRequest for this search
getParams()
Returns event parameters as an object:
{
success: getSuccess(),
result: getResult(),
requestParameters: getRequestParameters(),
options: getOptions()
};
RPC
Event occurs after a search request.
{
"success": true,
"result": {
"methods": [
{},
{},
{}
],
"totalCount": 4,
"locations": [
{
"id": 0,
"rank": 10,
"lon": "389828.281",
"village": "Vantaa",
"name": "Vantaa",
"zoomScale": 56650,
"type": "Kunta, kaupunki",
"lat": "6686279.347"
},
{
"id": 1,
"rank": 30,
"lon": "383183.648",
"village": "Hausjärvi",
"name": "Vantaa",
"zoomScale": 11300,
"type": "Kylä, kaupunginosa tai kulmakunta",
"lat": "6733424.84"
},
{
"id": 2,
"rank": 50,
"lon": "387139.034",
"village": "Helsinki",
"name": "Vantaa",
"zoomScale": 5650,
"type": "Virtavesi",
"lat": "6683063.213"
},
{
"id": 3,
"rank": 50,
"lon": "383746.169",
"village": "Nurmijärvi",
"name": "Vantaa",
"zoomScale": 2800,
"type": "Talo",
"lat": "6708499.96"
}
]
},
"requestParameters": "Vantaa",
"options": {}
}