|
1 | 1 | 'use strict';
|
2 | 2 |
|
3 | 3 | /**
|
| 4 | + * @ngdoc directive |
| 5 | + * @name angulargm.directive:gmMap |
| 6 | + * @element ANY |
| 7 | + * |
| 8 | + * @description |
4 | 9 | * A directive for embedding google maps into your app.
|
5 | 10 | *
|
6 |
| - * Usage: |
7 |
| - * ```html |
8 |
| - * <gm-map gm-map-id="myMapId" |
9 |
| - * gm-center="myCenter" |
10 |
| - * gm-zoom="myZoom" |
11 |
| - * gm-bounds="myBounds" |
12 |
| - * gm-map-type-id="myMapTypeId" |
13 |
| - * gm-map-options="myMapOptions"> |
14 |
| - * </gm-map> |
15 |
| - * ``` |
| 11 | + * `gm-map-id` is required. The `gm-center`, `gm-zoom`, `gm-bounds`, and |
| 12 | + * `gm-map-type-id` variables do not have to exist in the current scope--they |
| 13 | + * will be created if necessary. All three have bi-directional association, |
| 14 | + * i.e. drag or zoom the map and they will update, update them and the map |
| 15 | + * will change. However, any initial state of these three variables will be |
| 16 | + * ignored. |
16 | 17 | *
|
17 |
| - * + `gm-map-id`: angular expression that evaluates to a unique string id for |
18 |
| - * the map, e.g. "'map_canvas'" or "myMapId" where myMapId is a variable in |
19 |
| - * the current scope. This allows you to have multiple maps/instances of the |
20 |
| - * directive. |
| 18 | + * If you need to get a handle on the google.maps.Map object, see |
| 19 | + * [angulargmContainer] |
21 | 20 | *
|
22 |
| - * + `gm-center`: name for a center variable in the current scope. The value |
23 |
| - * will be a google.maps.LatLng object. |
| 21 | + * @param {expression} gm-map-id angular expression that evaluates to a unique |
| 22 | + * string id for the map, e.g. `'map_canvas'` or `myMapId` where myMapId is a |
| 23 | + * variable in the current scope. This allows you to have multiple |
| 24 | + * maps/instances of the directive. |
24 | 25 | *
|
25 |
| - * + `gm-zoom`: name for a zoom variable in the current scope. Value will be |
26 |
| - * an integer. |
27 | 26 | *
|
28 |
| - * + `gm-bounds`: name for a bounds variable in the current scope. Value will |
29 |
| - * be a google.maps.LatLngBounds object. |
| 27 | + * @param {string} gm-center name for a center variable in the current scope. |
| 28 | + * The value will be a google.maps.LatLng object. |
30 | 29 | *
|
31 |
| - * + `gm-map-type-id`: name for a mapTypeId variable in the current scope. |
32 |
| - * Value will be a string. |
33 | 30 | *
|
34 |
| - * + `gm-map-options`: object in the current scope that is a |
35 |
| - * google.maps.MapOptions object. If unspecified, will use the values in |
36 |
| - * angulargmDefaults.mapOptions. [angulargmDefaults]{@link module:angulargmDefaults} |
37 |
| - * is a service, so it is both injectable and overrideable (using |
38 |
| - * $provide.decorator). |
| 31 | + * @param {string} gm-zoom name for a zoom variable in the current scope. |
| 32 | + * Value will be an integer. |
39 | 33 | *
|
40 |
| - * All attributes except `gm-map-options` are required. The `gm-center`, |
41 |
| - * `gm-zoom`, `gm-bounds`, and `gm-map-type-id` variables do not have to exist in |
42 |
| - * the current scope--they will be created if necessary. All three have |
43 |
| - * bi-directional association, i.e. drag or zoom the map and they will update, |
44 |
| - * update them and the map will change. However, any initial state of these |
45 |
| - * three variables will be ignored. |
46 | 34 | *
|
47 |
| - * If you need to get a handle on the google.maps.Map object, see |
48 |
| - * [angulargmContainer]{@link module:angulargmContainer} |
| 35 | + * @param {string} gm-bounds name for a bounds variable in the current scope. |
| 36 | + * Value will be a google.maps.LatLngBounds object. |
49 | 37 | *
|
50 |
| - * Events: |
51 | 38 | *
|
52 |
| - * + `gmMapResize`: google.maps.event.trigger(map, 'resize') To use: |
53 |
| - * `$scope.$broadcast('gmMapResize', 'myMapId')` |
| 39 | + * @param {string} gm-map-type-id name for a mapTypeId variable in the current |
| 40 | + * scope. Value will be a string. |
54 | 41 | *
|
55 |
| - * Parameters: |
56 | 42 | *
|
57 |
| - * + `mapId`: required. The id of your map. This is what you set |
58 |
| - * `gm-map-id` to. It is necessary because there may be multiple |
59 |
| - * instances of the `gmMap` directive. |
| 43 | + * @param {expression} gm-map-options object in the current scope that is a |
| 44 | + * google.maps.MapOptions object. If unspecified, will use the values in |
| 45 | + * angulargmDefaults.mapOptions. [angulargmDefaults] is a service, so it is |
| 46 | + * both injectable and overrideable (using $provide.decorator). |
60 | 47 | *
|
61 |
| - * @module gmMap |
62 | 48 | */
|
| 49 | + |
| 50 | +/** |
| 51 | + * @ngdoc event |
| 52 | + * @name angulargm.directive:gmMap#gmMapResize |
| 53 | + * @eventOf angulargm.directive:gmMap |
| 54 | + * @eventType listen on current gmMap scope |
| 55 | + * @param {string} mapId Required. The id of your map. |
| 56 | + * @example |
| 57 | + * ```js |
| 58 | + * $scope.$broadcast('gmMapResize', 'myMapId') |
| 59 | + * ``` |
| 60 | + */ |
| 61 | + |
63 | 62 | (function () {
|
64 | 63 | angular.module('AngularGM').
|
65 | 64 |
|
|
0 commit comments