function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

How to use Google Places API with a search button?

Hello Guys  i am stuck in the google map while using it in VF page . I need to  locate the city along with the street adress on the google map and   draw radius when ever user click on  the search button . My Autocomplete textbox is working  . I need to add the seach functionality  on the seach button.
Here is my code:-
<script src=""></script>
<script type="text/javascript">
        var map;
function initializeField() {
var input = document.getElementById('page:frm:field');           
var autocomplete = new google.maps.places.Autocomplete(input); 
var mapOptions = {
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false,

center: new google.maps.LatLng(20.593684,78.962880)
map = new google.maps.Map(document.getElementById('MyMap'),
google.maps.event.addDomListener(window, 'load', initializeField);


 <input type="button" class="btn customBtn pull-right"  value="Search" />

Help me out
NagaNaga (Salesforce Developers) 
Dear Anurag,

I have found out a very similar code to this.

Please let me know if this helps

Best regards
Naga Kiran
@ Naga Kiran  thanx  a lot  but  my requirement is different  and the link what you send me is not working in my case. If possible can you help me out ?