You can geocoding this way:
GMaps.geocode({ address: $('#address').val(), callback: function(results, status){ if(status=='OK'){ var latlng = results[0].geometry.location; map.setCenter(latlng.lat(), latlng.lng()); map.addMarker({ lat: latlng.lat(), lng: latlng.lng() }); } } });
You can define either address
or lat
and lng
. Also, you must define callback
, which will use results
of geocoding and status
.