angular-ui / angular-google-maps

AngularJS directives for the Google Maps Javascript API
http://angular-ui.github.io/angular-google-maps
2.52k stars 1.07k forks source link

ui-gmap-polyline fit does not exist (documentation wrong) #1458

Open flc opened 9 years ago

flc commented 9 years ago

Hi, first of all, thanks for all the fixes in the 2.1.6 release! I noticed that after upgrading to 2.1.6 the 'fit' funcionality of the ui-gmap-polyline directive stopped working as before (2.1.5). http://plnkr.co/edit/yQa5VFUB51dUtr3dslO6?p=preview If you change the version of angular-google-maps from 2.1.6 to 2.1.5 in the head section of the index.html you can see that 'fit' works.

nmccready commented 9 years ago

Anyway u could make a spec?

flc commented 9 years ago

To be honest, I don't really know at the moment how to write a proper test case for this. But I'll try to investigate If I got some spare time.

nmccready commented 9 years ago

I think this regression happened a long time ago, or fit never worked in the singular directive. So it could just be a documentation error. Because currently no models are tracked post rendering in a polyline .

As you can see here new Polyline is not saved. So there would need to be an array/object added to keep track of the polylines here to call fit upon.

nmccready commented 9 years ago

@flc started fixing this; I still need to do polygon, and I believe marker. Also I probably should add group watching (which is overkill).

nmccready commented 9 years ago

related to #449