asennikov / ember-g-map

An ember-cli addon for integration with google maps
http://asennikov.github.io/ember-g-map/
MIT License
78 stars 62 forks source link

Deprecation warning originating from didInsertElement in g-map #65

Open hbrysiewicz opened 8 years ago

hbrysiewicz commented 8 years ago

Deprecation warning originating from ember-g-map because it's calling set inside didInsertElement hook.

screen shot 2016-07-19 at 5 55 03 pm screen shot 2016-07-19 at 5 57 03 pm screen shot 2016-07-19 at 5 57 11 pm

This is with version 0.0.20 of ember-g-map and 2.6.2 of ember-cli.

asennikov commented 8 years ago

As far as I remember, I haven't figured out a way to make it work without setting map on didInsertElement. init is too early, we need to wait for the element to appear first.

Maybe we can use something like Ember.run to set everything outside of didInsertElement execution. Needs someone to try.

Here's a bit more info - https://github.com/ember-cli/ember-cli/issues/6058

hbrysiewicz commented 8 years ago

I can take a stab at this. I think the map context should be abstracted into it's own service and this can be cleaned up a bit. I also saw the incorrect usage of this._super() and this._super(arguments) and such around so I can clean that up at the same time. Give me a few days.

asennikov commented 8 years ago

Sure, go ahead, keeping map in service can also help with exposing it (at least partly) to the host application. Sometimes people want to just call some method on the map itself.