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

ng-show does not work with markers

Open michaelwsk opened this issue 12 years ago • 4 comments

I know it may be hard to implement, but I found out that ng-show does not currently work with markers. Is there a way to implement this feature?

michaelwsk avatar Jul 24 '14 00:07 michaelwsk

markers and shapes works with ng-repeat.

https://rawgit.com/allenhwkim/angularjs-google-maps/master/build/marker_with_ng_repeat.html

http://plnkr.co/edit/?p=preview

Please provide me your plnkr if yours does not work.

allenhwkim avatar Jul 24 '14 13:07 allenhwkim

I made a typo the first time I posted it. I meant ng-show.

http://plnkr.co/edit/flahlVtZaOrs4Uisj7uW?p=preview

michaelwsk avatar Jul 24 '14 15:07 michaelwsk

We need to follow Google Maps V3 API to show and hide markers, which is visible

https://developers.google.com/maps/documentation/javascript/reference#MarkerOptions

allenhwkim avatar Jul 25 '14 13:07 allenhwkim

Good point. Still, I suppose people may be interested in using ng-show anyway, but I think right now visible does the trick somewhat. Eventually, I would suggest some watchers on the attribute changes on the markers/infowindow etc.

michaelwsk avatar Jul 25 '14 21:07 michaelwsk