directive:ngmap.map source

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

Dependencies:
NameTypeDescription
Attr2Options

Converts html attributes to Google map options

$timeout

Angular window.setTimeout wrapper

$parse

Angular html parser

Attributes:
NameTypeDescription
geo-callback

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

The center of map incase geolocation failed. i.e. [0,0]

zoom-to-include-markers

If true, map boundary will be changed automatially to include all markers when initialized

default-style

When false, the default styling, display:block;height:300px, will be ignored.

init-event

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. <map init-event="init-map" ng-click="$emit('init-map')" center=... ></map>

<MapOption>

Any Google map options

<MapEvent>

Any Google map events

Example
Usage:
  <map MAP_OPTIONS_OR_MAP_EVENTS ..>
    ... Any children directives
  </map>
  <map center="[40.74, -74.18]" on-click="doThat()">
  </map>
  <map geo-fallback-center="[40.74, -74.18]" zoom-to-inlude-markers="true">
  </map>

Methods

linkFunc (scope, element, attrs, ctrl)

Initialize map and events

Parameters:
NameTypeDescription
scope

the scope of this element

element

element that this direcive is assigned to

attrs

attribute of this element

ctrl

map controller