0

I've looked all around and can't seem to find a way to get these. Basically, I'm using angular-google-maps, and am setting markers with a <ui-gmap-markers> tag. I'd want to get all the markers currently visible on the map, for example if a user zooms in causing some markers not to be shown, they wouldn't get selected. This very likely requires me to get the current map bounds, and I haven't found a way of doing that yet. I don't seem to have full access to google maps api, so I can't just call map.getBounds() or anything like that.

Fissio
  • 3,748
  • 16
  • 31
  • I think you have to do that using the Google Maps API. Have you set up Angular Google Maps correctly? – not_a_bot Jul 24 '15 at 18:58
  • Yeh. I have `GoogleMapApi.then(function(maps) {});` in my controller - the `maps` parameter doesn't seem to have the current map though as far as I can see. – Fissio Jul 24 '15 at 20:12
  • Can you post an example that demonstrates your issue? – not_a_bot Jul 24 '15 at 22:52

1 Answers1

0

Found a way to get the map instance, and subsequently the map bounds, here: AngularJS Google Map directive map instance

Trying to access the map instance right after google maps is loaded with GoogleMapApi.then(function(maps) {}); isn't working for me though, it hasn't added the functions to the control object at that point yet I guess - luckily for my purposes I can just call the map function when a button in the UI is pressed so it's sure to have loaded at that point, and I'm able to get the bounds. Yay!

Community
  • 1
  • 1
Fissio
  • 3,748
  • 16
  • 31