angular-google-maps icon indicating copy to clipboard operation
angular-google-maps copied to clipboard

How do you implement the getMarkers() method on the <marker> directive

Open zellen opened this issue 11 years ago • 3 comments

How do you use the getMarkers() method to retrieve the collection of markers? I've tried to use var markers = $scope.map.markerscontrol.getGMarkers(); but it only returns the last item in the list.

Made a plunkr http://plnkr.co/edit/Tl60bVydDQ3jIXqG6nIc

I wanna use the markers to calculate the bounds and map center.

zellen avatar Oct 13 '15 07:10 zellen

getPlurals it was made universal back in 2.0 I think.

nmccready avatar Oct 13 '15 13:10 nmccready

Oh your using singlular marker; yeah so Plurals is not on that as it is not a plural directive. So getGMarkers seems to be not working right. I recommend not using ui-gmap-marker anyway infavor of ui-gmap-markers.

nmccready avatar Oct 13 '15 13:10 nmccready

Its a bug and it should be easy to fix; but is it worth it?

nmccready avatar Oct 13 '15 13:10 nmccready