Skip to content Skip to sidebar Skip to footer

Angularjs Google Map Directive Map Instance

I'm using http://angular-google-maps.org/ it's nice angular google maps library. But i want use map instance which is loaded not in angularjs context by something like this: $scope

Solution 1:

In recently looking up ways to get the map instance from the example on the docs page, I came across this instead:

$scope.map.control.getGMap().

Make sure on your google-maps HTML markup, you have the options attribute set as control="map.control" and an empty object set in your $scope.map object.

$scope.map= { control : {}, ...other map options...};

That empty objects is filled when google map is initiated. I hope this helps and isn't too late.

Enjoy Angular!!!

Post a Comment for "Angularjs Google Map Directive Map Instance"