Last active
August 29, 2015 14:03
-
-
Save mtoonen/491fadaf0efb5318a4d5 to your computer and use it in GitHub Desktop.
Dynamisch zoeken
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
registerAtSearch: function() { | |
var searchComps = this.viewerController.getComponentsByClassName("viewer.components.Search"); | |
// Registreer bij 1 Search: kan fout gaan omdat namen veranderen | |
// this.viewerController.getComponentByName("print1"); | |
for (var i = 0; i < searchComps.length; i++) { | |
searchComps[i].addDynamicSearchEntry(this, this.callback); | |
} | |
}, | |
callback : function(term,searchRequestId){ | |
var result = { | |
type: "aap", | |
label: "Noot", | |
location:{ | |
minx:111490, maxx: 175001, miny: 437082, maxy: 481536 | |
} | |
}; | |
var returnValue = { | |
success : true, | |
errorMessage: "Oops, something went wrong here.", | |
results: [result], | |
searchRequestId: searchRequestId | |
}; | |
return returnValue; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myCallback : function(term,searchRequestId){ | |
var result = { | |
type: <String>, | |
label: <String>, | |
location:{ | |
minx:<double>, maxx: <double, miny: <double>, maxy: <double> | |
} | |
}; | |
var returnValue = { | |
success : <boolean>, | |
errorMessage: <String>,// only handler when success === false | |
results: <Array van Results>, | |
searchRequestId: searchRequestId | |
}; | |
return returnValue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment