{"action":"created","issue":{"url":"https://api.github.com/repos/SebastianM/angular2-google-maps/issues/431","repository_url":"https://api.github.com/repos/SebastianM/angular2-google-maps","labels_url":"https://api.github.com/repos/SebastianM/angular2-google-maps/issues/431/labels{/name}","comments_url":"https://api.github.com/repos/SebastianM/angular2-google-maps/issues/431/comments","events_url":"https://api.github.com/repos/SebastianM/angular2-google-maps/issues/431/events","html_url":"https://github.com/SebastianM/angular2-google-maps/issues/431","id":160314319,"number":431,"title":"How to Support \"Google Place Autocomplete\" (with example)","user":{"login":"Pitouli","id":542778,"avatar_url":"https://avatars.githubusercontent.com/u/542778?v=3","gravatar_id":"","url":"https://api.github.com/users/Pitouli","html_url":"https://github.com/Pitouli","followers_url":"https://api.github.com/users/Pitouli/followers","following_url":"https://api.github.com/users/Pitouli/following{/other_user}","gists_url":"https://api.github.com/users/Pitouli/gists{/gist_id}","starred_url":"https://api.github.com/users/Pitouli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pitouli/subscriptions","organizations_url":"https://api.github.com/users/Pitouli/orgs","repos_url":"https://api.github.com/users/Pitouli/repos","events_url":"https://api.github.com/users/Pitouli/events{/privacy}","received_events_url":"https://api.github.com/users/Pitouli/received_events","type":"User","site_admin":false},"labels":[{"id":306150440,"url":"https://api.github.com/repos/SebastianM/angular2-google-maps/labels/type:%20discussion%20/%20question","name":"type: discussion / question","color":"006b75","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-06-15T00:26:21Z","updated_at":"2016-12-09T18:50:26Z","closed_at":"2016-06-21T19:04:00Z","body":"Having spent tens of hours to find how to support \"Autocomplete\", I share with you my solution (which is technically completely independent from the angular2-google-maps API at the moment, since I did not succeeded in reusing the LazyMapLoading 😛  ).\n\nHere is a plunker which shows how to:\nhttp://plnkr.co/edit/NtfCPol50mlwGoiB8UZu\n\nWhat I've done:\n1/ I'm loading the Google Maps API (with the \"places\" library) directly in the `index.html (line 28)`, so I have to use the \"no lazy load\" functionality in the `main.ts (line 135)`. _Note that in my personal implementation, I am not using \"Bootstrap\", but I declare the providers in the `@Component`_\n2/ I make a reference to the Google Map API (`main.ts line 19`)\n3/ I connect the Autocomplete in the ngOnInit (`main.ts lines 63 to 73`)\n\nTip : `main.ts line 63` I have a reference to the input field. Here, I simply used a \"`getElementByID()`\". In my real project, I needed to use a \"`querySelector()`\"... I precise in case you have issues selectionning the input filed...\n\nIMPROVEMENT (if someone know how to) : \nHow could we use the \"Lazy Loader\"? I do not know how to access the google reference after lazy loading. \n\nBUG?\nWhy when the location changed and that I change the latitude and longitude it's only taken into account if I click the map? You could put an alert (or simply read the console) and you will see that the modification of the values is not made after the click.\n=> I've updated the plunkr thanks to a solution provided by @cesargalindo\nhttps://gitter.im/SebastianM/angular2-google-maps?at=576197ff36c83a880205fd64\n\nPS: yeah, it's that easy. But it's my first Angular project, and I'm learning directly by doing. So simple tasks become quite difficult! 😆 \n"},"comment":{"url":"https://api.github.com/repos/SebastianM/angular2-google-maps/issues/comments/266090995","html_url":"https://github.com/SebastianM/angular2-google-maps/issues/431#issuecomment-266090995","issue_url":"https://api.github.com/repos/SebastianM/angular2-google-maps/issues/431","id":266090995,"user":{"login":"mLaird","id":3199599,"avatar_url":"https://avatars.githubusercontent.com/u/3199599?v=3","gravatar_id":"","url":"https://api.github.com/users/mLaird","html_url":"https://github.com/mLaird","followers_url":"https://api.github.com/users/mLaird/followers","following_url":"https://api.github.com/users/mLaird/following{/other_user}","gists_url":"https://api.github.com/users/mLaird/gists{/gist_id}","starred_url":"https://api.github.com/users/mLaird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mLaird/subscriptions","organizations_url":"https://api.github.com/users/mLaird/orgs","repos_url":"https://api.github.com/users/mLaird/repos","events_url":"https://api.github.com/users/mLaird/events{/privacy}","received_events_url":"https://api.github.com/users/mLaird/received_events","type":"User","site_admin":false},"created_at":"2016-12-09T18:50:26Z","updated_at":"2016-12-09T18:50:26Z","body":"@fernando-gl  I removed the Google Map link in index.html and the multiple load problem went away. Thanks very much.  You guys have built a slick map app."}}
{"actor":{"display_login":"mLaird"}}