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

How to get the created map object

Open JuanHB opened this issue 12 years ago • 3 comments

Hi, i'm leaving this question here because I wasn't able to find an answer in the docs or in other previous questions.

I want to draw one polygon in the loaded map, and to do so I need to get the google map object created when the directive is loaded. How can I do that? Get the created map object?

JuanHB avatar Nov 22 '14 18:11 JuanHB

Try looking at the first doc for google maps api. https://angular-ui.github.io/angular-google-maps/#!/api Notice how it says the promise returns the google.map object.

cthrax avatar Nov 22 '14 21:11 cthrax

Why do you need the map there is a polygon directive. Either way, you can get it via the control attribute and yes isReady promise.

nmccready avatar Nov 22 '14 21:11 nmccready

@cthrax yes, that was useful, thanks @nmccready unfortunately I've saw this feature only after creating my own, but I'll implement yours sollution, thanks for the reply

JuanHB avatar Nov 24 '14 10:11 JuanHB