reuse of autosuggest module for bing map v8 RRS feed

  • Question

  • Hi,
    I need to use autosuggest module in two different places (input controls) on my page. Can I just load it once and then reset
    input and container. I'm calling now autosuggest function which loading module (without UI example) and I have onLoad which setup my input and container when say some specific button click. But I need also to do it for other input as well.
    can I do something like

     function onLoad() {
                    var options1 = { maxResults: 1 };
                    var options2 = { maxResults: 5 };
                    var manager1 = new Microsoft.Maps.AutosuggestManager(options1);
                    var manager2 = new Microsoft.Maps.AutosuggestManager(options2);
                    manager1.attachAutosuggest('#txt1', '#searchBoxContainer1', selectedSuggestion);
                    manager2.attachAutosuggest('#txt2', '#searchBoxContainer2', selectedSuggestion);


    • Edited by MarinaA Wednesday, September 14, 2016 8:16 PM
    Wednesday, September 14, 2016 8:02 PM