huafu / ember-google-map

An Ember addon to include a google-map Ember friendly component in your apps.
http://huafu.github.io/#/ember?name=ember-google-map
MIT License
87 stars 34 forks source link

autoFitBounds not resizing and scrolling to marker position when setting markers dynamically #46

Closed blisst closed 9 years ago

blisst commented 9 years ago

Hello, I am setting a marker on the map dynamically via a location search bar.

The search bar gets latitude and longitude info and then sets a controller property:

// lat and lng provided by a search bar
controller.set('markers',Ember.A([{
    lat: lat,
    lng: lng,
}]));

I'm using the component as so:

{{google-map autoFitBounds=true markers=markers}}

I have checked that the google-map component is updating the markers correctly using the console using the view number of the component, (the ember-google-map is ember518 in my case):

Ember.View.views['ember518'].get('markers')  //returns correct values

It also displays the marker on the map correctly.

However, it does not automatically scroll and resize the map to fit the marker.

Am I missing something?

huafu commented 9 years ago

Yes, you are missing the alwaysAutoFitBounds=true, by default it fit bounds on load only ;-)