[Solved] Javascript, populate the result of Google maps places API search results into Dropdown list box


Using the JAVASCRIPT + HTML code here:

add this in the body:

<div id="drop-container"></div> 

modify addResult()

var div = document.querySelector("#drop-container"),
frag = document.createDocumentFragment(),
select = document.createElement("select");

function addResult(result, i) {
    frag.appendChild(select);
    div.appendChild(frag);
    select.options.add( new Option(result.name,result.name));
    select.onclick = function() {
        google.maps.event.trigger(markers[i], 'click');
    };

    //...

};

0

solved Javascript, populate the result of Google maps places API search results into Dropdown list box