Matt-Jensen / ember-cli-g-maps

Deprecated Google Maps Addon

Home Page:http://matt-jensen.github.io/ember-cli-g-maps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Map reference inside controller action

ewal opened this issue · comments

I'm trying to get a hold of the map reference inside a controller action after a marker has been added to the list. I'm using the auto complete component with the suggested method didUpdatePlace but I can't figure out to get a hold of the map... Help very much appreciated :)

It is possible to get a named Google maps via the gmap service. Here is an example using the service to refresh a map instance. You can use the service's selectMap method to request your map instance by name.

Please note this service will be deprecated in 1.0.0+ versions of this project.

Hey @Matt-Jensen, if the service will be deprecated on v 1.0.0+, what is/will be the recommended way to access the underlying map instance going forward?

@louim sorry what I should have said was the service will likely be removed. I'm going to have a beta release of version 1 for a round of feedback, but currently I expect it to be removed.

This is because I think that Google Maps are a view layer concern and should be made accessible on that basis. Here is some puedo code showing how I plan to make a google map instance accessible in version 1+.

{{#g-map as |map|}}
  {{g-map-marker map}}
  {{my-google-map-layer map}}
{{/g-map}}

Where map is an instance of an Ember.ObjectProxy with a raw Google Map instance available at map.content