Implementation of MapController
Initialize a Google map within a <div>
tag with given options and register events
It accepts children directives; marker, shape, or marker-clusterer
It initialize map, children tags, then emits message as soon as the action is done The message emitted from this directive is; . mapInitialized
Restrict To: Element
Attributes:
Name | Type | Description |
---|---|---|
geo-callback |
Expression | if center is an address or current location, the expression is will be executed when geo-lookup is successful. e.g., geo-callback="showMyStoreInfo()" |
geo-fallback-center |
Array | The center of map incase geolocation failed. i.e. [0,0] |
init-event |
String | The name of event to initialize this map. If this option is given, the map won't be initialized until the event is received. To invoke the event, use $scope.$emit or $scope.$broacast. i.e. |
<MapOption> |
String | Any Google map options, https://developers.google.com/maps/documentation/javascript/reference?csw=1#MapOptions |
<MapEvent> |
String | Any Google map events, https://rawgit.com/allenhwkim/angularjs-google-maps/master/build/map_events.html |
Dependencies:
Example
Usage:
<map MAP_OPTIONS_OR_MAP_EVENTS ..>
... Any children directives
</map>
Example:
<map center="[40.74, -74.18]" on-click="doThat()">
</map>
<map geo-fallback-center="[40.74, -74.18]">
</map>
Methods
-
linkFunc(scope, element, attrs)
-
Initialize map and events
Parameters:
Name Type Description scope
$scope element
angular.element attrs
Hash