Google maps does not have a complete widget for this. But it is easy to implement. In HTML, you can have a text box and a search button. (Instead, you can handle the Enter key in the text box).
<input type="text" id="search_address" value=""/> <button onclick="search();">Search</button>
In Javascript, you instantiate and use the geocoder:
var addressField = document.getElementById('search_address'); var geocoder = new google.maps.Geocoder(); function search() { geocoder.geocode( {'address': addressField.value}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var loc = results[0].geometry.location;
Jiri
source share