adding google maps autocomplete search box into a project built with sproutecore framework

54 Views Asked by At

I'm new to sproutecore framework, I noticed that things works pretty different than building a web app on pure javascript with jquery (for example)

Hence, I didn't understand how can I insert and bind a google maps searchbox view into my web app (in pure js it was just including the google api script and instantiating an object. something like that : autocompleteDeparture = new google.maps.places.Autocomplete(departureField, options); )

1

There are 1 best solutions below

1
Topher Fangio On

You typically put any outside JS files in a frameworks directory and then you can use it just like you included it in a <script> tag.

That said, you will probably want to execute your Google Maps code inside of the SC.View's didAppendToDocument() method so that you are sure it is visible and the Google Maps code can properly bind to it.