directive: map

map

map(geo-fallback-center, init-event, <MapOption>, <MapEvent>)

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

Parameters:
Name Type Description
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

Source:
Requires:
  • module:Attr2Options
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>

Requires

  • module:Attr2Options

Methods

Initialize map and events

Parameters:
Name Type Description
scope $scope
element angular.element
attrs Hash
Source: