Google Maps Component - Data Binding


#1

Hello everyone !

I am using “ember-g-map” in order to use google map (addon : ember-g-map). I have no problem to add route or markers using the associated components when hard coding them on the ‘application.hbs’ file. But I struggle add markers component dynamically using {{each}} !

Inside the ‘application.js’ file, I request latitude and longitude of some cities with ‘Google Maps Geocoding API’ and add them in an array. Then, inside the ‘application.hbs’ file, I loop over the the array using {{each}} to create multiple markers. All of this work is calculated after I press the ‘pullMongoDBData’ button, so there is no markers when at the beginning.

So is there a way to do it ? I can’t get it to work as intended.

The two files : application.js : https://gist.github.com/anonymous/5e7fb5f134fe2b55cd8832e0ad4a41b9 application.hbs : https://gist.github.com/anonymous/969970607d99b16f097c0e63cef703e6

Thanks a lot by advance !