Google Maps v3, custom control with textbox: can't perform input

Posted by Mike Sviridoff on Stack Overflow See other posts from Stack Overflow or by Mike Sviridoff
Published on 2010-03-16T19:17:44Z Indexed on 2010/03/16 19:21 UTC
Read the original article Hit count: 849

Hi,

I am trying to add a custom control to my google map (v3): want to have search box just near the other map controls. So I add a div with <input type="textbox"> on it, and it's being shown on the map. But the porblem is that the textbox is inaccessible: i can't type anything inside it, or even focus on it.

function SearchBox() {
    var searchTextBox = $('<input type="text" id="txtGeoSearch" />');

    var div = $('<div class="geoSearchBox"></div>')
        .append($('<span>Search:</span>'))
        .append(searchTextBox);

    return div.get(0);
}

// inside init()
geoMap.controls[google.maps.ControlPosition.TOP_LEFT].push(new SearchBox());

So what should I do to make my textbox behave like normal one?

© Stack Overflow or respective owner

Related posts about javascript-events

Related posts about google-maps-api-3