Page 4 of 4

Google Maps Api AutoComplete

Posted: Mon Jan 19, 2015 2:49 pm
by adam griffin

U can use $(#"component_id").val and in your mapping you can just get the Val from localstorage


Google Maps Api AutoComplete

Posted: Mon May 18, 2015 6:26 am
by shabeer

Hi,

I am trying to get the autosearch part using google places to work.

I copied the javascript code from http://jsfiddle.net/aartyukh/2LK9H/1/ and pasted it as a onPageShow run script.

I copied the html into my page.html file in web_resources.

I also have a input palette component named "autocomplete_form".

I am expecting autosearch suggestions to appear when I test it.

Am I missing something?


Google Maps Api AutoComplete

Posted: Tue May 26, 2015 2:10 am
by Yurii Orishchuk

Hi Shaberr,

Please follow this solution:

1 Open your app settings on "External resources" tab.

2 Take a look on "User-defined resources" part. There should be.

pre

http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places

/pre

3 If you can not find it - add it there. Details: http://prntscr.com/536jl3/direct

4 Remove previously autocomplete.

5 Add HTML component on the page.

6 Populate it with following HTML code. Details: http://prntscr.com/536jy7/direct

precode

<input id="location_input" type="text" onchange="console&#46;log(getLatLngFromAddress(this&#46;value));" name="location_input"class="input-prompt" placeholder="Specify where your event will happen&#46;">

<script>

function initialize() {
console&#46;log("google initialize");
var input = document&#46;getElementById('location_input');
var autocomplete = new google&#46;maps&#46;places&#46;Autocomplete(input);

Code: Select all

 google&#46;maps&#46;event&#46;addListener(autocomplete, 'place_changed', function() { 

     var place = autocomplete&#46;getPlace(); 

     var location = place&#46;geometry&#46;location; 

     alert(JSON&#46;stringify(location)) 
 }) 

}

google&#46;maps&#46;event&#46;addDomListener(window, 'load', initialize);

</script>

/code/pre

Regards.


Google Maps Api AutoComplete

Posted: Sat Oct 31, 2015 7:48 am
by Akash Chakrawarti

error occurs
a.getAttribute is not a function.. //a is textfield..


Google Maps Api AutoComplete

Posted: Sat Oct 31, 2015 10:55 am
by Evgene Karachevtsev

Hello Akach,

Could you please clarify your issue with more details?


Google Maps Api AutoComplete

Posted: Fri Jan 22, 2016 12:47 am
by Mark MB

Hi Yurii Orishchuk,
Worked like a charm! Thanks for the great support!


Google Maps Api AutoComplete

Posted: Thu Apr 06, 2017 11:08 pm
by Manasa Pochampally

Hey Akash , could you able to implement this autocomplete search for places ? I'm working on IONIC , if its working for , could you please share the code or screenshot of your application? it would be a great help !
Regards,
Manasa