If I understand your question correctly, you want your users to search for a location and then display it on a map. If so, this can be done very easily using the Geocoding Services provided by the Google Maps JavaScript API . Consider the following example:
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title>Google Maps Geocoding Demo</title> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> </head> <body> <div id="map" style="width: 400px; height: 300px;"></div> <script type="text/javascript"> var address = 'London, UK'; var map = new google.maps.Map(document.getElementById('map'), { mapTypeId: google.maps.MapTypeId.TERRAIN, zoom: 6 }); var geocoder = new google.maps.Geocoder(); geocoder.geocode({ 'address': address }, function(results, status) { if(status == google.maps.GeocoderStatus.OK) { new google.maps.Marker({ position: results[0].geometry.location, map: map }); map.setCenter(results[0].geometry.location); } else { </script> </body> </html>
Screenshot:

You can simply replace the value of the address variable, which in this example is set to 'London, UK' , with the location that your users found.
source share