I am trying to position a clear button on the input to delete the text in Google Map V3.
CSS:
#searchclear {
//Doesn't matter what I put
}
General Javascript:
var input = /** @type {HTMLInputElement} */(
document.getElementById('pac-input'));
map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
var searchclear = /** @type {HTMLInputElement} */(
document.getElementById('searchclear'));
map.controls[google.maps.ControlPosition.TOP_LEFT].push(searchclear);
HTML:
<input id="pac-input" class="controls" type="text" placeholder="Search food, sites, places">
<span id="searchclear" class="glyphicon glyphicon-remove-circle" onclick="clearAllSearch()"></span>
I know it has to do with the TOP_LEFT on map.controls, but how do I go about changing it so I can actually use display:inline-block on the remove button?
If I remove the below line, the remove button will be placed outside of the map. map.controls[google.maps.ControlPosition.TOP_LEFT].push(searchclear);
I can use absolute positioning, but the remove button will scale and break when browser window shrinks or expand.
Any suggestions? I am trying to place the x inside the input, on the right most.