Очень полезная вещь, вовремя нашел. У себя сделал так:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var map;
var geocoder;
var marker;
//https://developers.google.com/maps/documentation/javascript/reference?hl=ru#MarkerOptions
function initialize() {
var center_map = new google.maps.LatLng(46.459856,30.731506);
var myOptions = {
zoom: 13,
//center: center_map,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
geocoder = new google.maps.Geocoder(); // геокодер
marker = new google.maps.Marker({ // маркер
visible: false,
map: map
});
}
function codeAddress(){
var address = document.getElementById('adr').value;
geocoder.geocode( { 'address':'Днепропетровск,'+address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
marker.setOptions({
visible: true,
title: address,
position: results[0].geometry.location
});
map.setZoom(17);
} else {
alert('Geocode was not successful for the following reason: ' + status);
}
});
}
</script>
<p>
<input type="text" id="adr" value="Коцюбинского 2/4" />
<input type="button" value="Geocode" onclick="codeAddress()">
</p>
<div id="map_canvas" style="width: 400px; height: 300px"></div>