index.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Index</title>
  6. <script src="scripts/prettify/prettify.js"> </script>
  7. <script src="scripts/prettify/lang-css.js"> </script>
  8. <!--[if lt IE 9]>
  9. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  10. <![endif]-->
  11. <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
  12. <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
  13. </head>
  14. <body>
  15. <div id="main">
  16. <h1 class="page-title">Index</h1>
  17. <h3> </h3>
  18. <section>
  19. <article><h1>GoogleMap AngularJS Directive</h1><p><a href="https://travis-ci.org/allenhwkim/angularjs-google-maps"><img src="https://travis-ci.org/allenhwkim/angularjs-google-maps.png?branch=master" alt="Build Status"></a></p>
  20. <p><strong>NOTE: 1.4.0 is released.</strong></p>
  21. <ul>
  22. <li>support lazy loading of maps js, which does not require to <code>http://maps.google.com/maps/api/js</code></li>
  23. </ul>
  24. <p><strong>NOTE: 1.2.0 is released.</strong></p>
  25. <ul>
  26. <li>events with <code>controller as</code> syntax, thanks to Simon</li>
  27. </ul>
  28. <p><strong>NOTE: 1.1.0 is released.</strong></p>
  29. <ul>
  30. <li>marker directive can have icon attribute as JSON</li>
  31. <li>map with init-event attribute for initialization by an event</li>
  32. </ul>
  33. <p><strong>NOTE: 1.0.0 is released.</strong><br> Now, it covers all official google examples using new directives. The new directives are;</p>
  34. <ul>
  35. <li>Layer Directives<br>traffic-layer, transit-layer, weather-layer, bicycling-layer, cloud-layer, dynamic-maps-engine-layer, fusion-tables-layer, heatmap-layer, kml-layer, maps-engine-layer
  36. custom-control</li>
  37. <li>info-window</li>
  38. <li>map-data</li>
  39. <li>map-type</li>
  40. <li>overlay-map-type</li>
  41. </ul>
  42. <p><a href="http://ngmap.github.io">Demo</a><br><a href="https://rawgithub.com/allenhwkim/angularjs-google-maps/master/build/docs/index.html">Documentation</a></p>
  43. <p>There is already <a href="https://github.com/nlaplante/angular-google-maps">one</a> for this. However, I found myself doing totally different approach for this purpose than the existing one, such as;</p>
  44. <ol>
  45. <li><strong>Everything in tag and attributes.</strong><br>Thus, basic users don't even have to know what Javascript is. </li>
  46. <li><strong>Expose all original Google Maps V3 api to the user.</strong><br>No hiding, no wraping, or whatsoever.
  47. By doing so, programmers don't need to learn how to use this module.
  48. You only need to know Google Maps V3 API.</li>
  49. </ol>
  50. <p>There is a blog that introduces this module. The title of it is '<a href="http://allenhwkim.tumblr.com/post/70986888283/google-map-as-the-simplest-way">Google Map As The Simplest Way</a>'</p>
  51. <h2>To Get Started</h2><p>For Bower users, </p>
  52. <p> <code>$ bower install ngmap</code></p>
  53. <ol>
  54. <li><p>Include <code>ng-map.min.js</code> as well as google maps.<br> <code>&lt;script src=&quot;http://maps.google.com/maps/api/js&quot;&gt;&lt;/script&gt;</code><br> <code>&lt;script src=&quot;http://rawgit.com/allenhwkim/angularjs-google-maps/master/build/scripts/ng-map.min.js&quot;&gt;&lt;/script&gt;</code></p>
  55. </li>
  56. <li><p>name angular app as ngMap, or add it as a dependency</p>
  57. <p><code>var myApp = angular.module('myApp', ['ngMap']);</code></p>
  58. </li>
  59. </ol>
  60. <p>After map is initialized, you will have one event and map instances</p>
  61. <p>Event:</p>
  62. <ul>
  63. <li><p><code>mapInitialized</code> with parameter with map</p>
  64. <p>In case your map directive scope is different from your controller scope,
  65. use this event to get the map instance.</p>
  66. <pre>
  67. app.controller('parentParentController', function($scope) {
  68. $scope.$on('mapInitialized', function(event, map) {
  69. map.setCenter( .... )
  70. ..
  71. });
  72. });
  73. </pre>
  74. </li>
  75. </ul>
  76. <p>Instances:</p>
  77. <ul>
  78. <li><code>$scope.map</code></li>
  79. <li><code>$scope.map.markers</code></li>
  80. <li><code>$scope.map.shapes</code></li>
  81. <li>etc</li>
  82. </ul>
  83. <h2>Lazy Loading</h2><p> Simply wrap the map tag with <code>map-lazy-load=&quot;http://maps.google.com/maps/api/js&quot;</code>.</p>
  84. <pre class="prettyprint source"><code>&lt;div map-lazy-load=&quot;http://maps.google.com/maps/api/js&quot;>
  85. &lt;map center=&quot;41,-87&quot; zoom=&quot;3&quot;>&lt;/map>
  86. &lt;/div></code></pre><h2>Directives</h2><h4>&lt;map .. &gt;</h4><p> As defined on <a href="https://developers.google.com/maps/documentation/javascript/reference#MapOptions">MapOptions</a>, you can add any attributes, and events starting witn <code>on-</code>. Please note that event value must be a function.</p>
  87. <p> Example: </p>
  88. <pre class="prettyprint source"><code>&lt;map zoom=&quot;11&quot;
  89. center=&quot;[40.74, -74.18]&quot;
  90. disable-default-u-i=&quot;true&quot;
  91. disable-double-click-zoom=&quot;true&quot;
  92. draggable=&quot;false&quot;
  93. draggable-cursor=&quot;help&quot;
  94. dragging-cursor=&quot;move&quot;
  95. keyboard-shortcuts=&quot;false&quot;
  96. max-zoom=&quot;12&quot;
  97. min-zoom=&quot;8&quot;
  98. tilt=&quot;45&quot;
  99. map-type-id=&quot;TERRAIN&quot;>
  100. &lt;/map></code></pre><p> i.e. &lt; zoom=&quot;11&quot; center=&quot;[40.74, -74.18]&quot;</p>
  101. <h4>&lt;marker .. &gt;</h4><p> As defined on <a href="https://developers.google.com/maps/documentation/javascript/reference#MarkerOptions">MarkerOptions</a>, you can add any attributes, and events starting witn <code>on-</code>.</p>
  102. <pre class="prettyprint source"><code>&lt;map center=&quot;[40.74, -74.18]&quot;>
  103. &lt;marker
  104. position=&quot;[40.76, -74.16]&quot;
  105. title=&quot;Hello Marker&quot;
  106. animation=&quot;Animation.BOUNCE&quot;
  107. draggable=&quot;true&quot;
  108. visible=&quot;true&quot;
  109. icon=&quot;beachflag.png&quot;>&lt;/marker>
  110. &lt;/map></code></pre><h4>&lt;shape .. &gt;</h4><p> Polyline, Circle, Polygon, Rectangle, and Images</p>
  111. <pre class="prettyprint source"><code> &lt;map zoom=&quot;11&quot; center=&quot;[40.74, -74.18]&quot;>
  112. &lt;shape id=&quot;polyline&quot; name=&quot;polyline&quot;
  113. geodesic=&quot;true&quot; stroke-color=&quot;#FF0000&quot; stroke-opacity=&quot;1.0&quot; stroke-weight=&quot;2&quot;
  114. path=&quot;[[40.74,-74.18],[40.64,-74.10],[40.54,-74.05],[40.44,-74]]&quot; >&lt;/shape>
  115. &lt;shape id=&quot;polygon&quot; name=&quot;polygon&quot;
  116. stroke-color=&quot;#FF0000&quot; stroke-opacity=&quot;1.0&quot; stroke-weight=&quot;2&quot;
  117. paths=&quot;[[40.74,-74.18],[40.64,-74.18],[40.84,-74.08],[40.74,-74.18]]&quot; >&lt;/shape>
  118. &lt;shape id=&quot;rectangle&quot; name=&quot;rectangle&quot; stroke-color='#FF0000'
  119. stroke-opacity=&quot;0.8&quot; stroke-weight=&quot;2&quot;
  120. bounds=&quot;[[40.74,-74.18], [40.78,-74.14]]&quot; editable=&quot;true&quot; >&lt;/shape>
  121. &lt;shape id=&quot;circle&quot; name=&quot;circle&quot; stroke-color='#FF0000'
  122. stroke-opacity=&quot;0.8&quot;stroke-weight=&quot;2&quot;
  123. center=&quot;[40.70,-74.14]&quot; radius=&quot;4000&quot; editable=&quot;true&quot; >&lt;/shape>
  124. &lt;shape id=&quot;image&quot; name=&quot;image&quot;
  125. url=&quot;https://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg&quot;
  126. bounds=&quot;[[40.71,-74.22],[40.77,-74.12]]&quot; opacity=&quot;0.7&quot; clickable=&quot;true&quot; >&lt;/shape>
  127. &lt;/map></code></pre><h4>&lt;info-window .. &gt;</h4><p>Example:</p>
  128. <pre class="prettyprint source"><code>&lt;map center=&quot;-25.363882,131.044922&quot; zoom=&quot;4&quot;>
  129. &lt;info-window id=&quot;bar&quot; position=&quot;-25.363882,131.044922&quot; visible=&quot;true&quot;>
  130. &lt;div ng-non-bindable>
  131. &lt;div id=&quot;siteNotice&quot;>&lt;/div>
  132. &lt;/div>
  133. &lt;/info-window>
  134. &lt;/map></code></pre><h4>&lt;custom-control .. &gt;</h4><p>Example:</p>
  135. <pre class="prettyprint source"><code> &lt;map center=&quot;41.850033, -87.6500523&quot; zoom=&quot;6&quot;>
  136. &lt;custom-control id=&quot;home&quot; position=&quot;TOP_RIGHT&quot; index=&quot;1&quot; on-click=&quot;click()&quot;>
  137. &lt;div style=&quot;background-color: black; color:#fff;cursor:pointer&quot;>Home1&lt;/div>
  138. &lt;/custom-control>
  139. &lt;/map></code></pre><h4>&lt;map-data .. &gt;</h4><p>Example:</p>
  140. <pre class="prettyprint source"><code> &lt;map zoom=&quot;4&quot; center=&quot;-28, 137.883&quot;>
  141. &lt;map-data
  142. load-geo-json=&quot;https://storage.googleapis.com/maps-devrel/google.json&quot;>&lt;/map-data>
  143. &lt;/map></code></pre><h3>Layer Directives</h3><h4>&lt;bicycling-layer .. &gt;</h4><pre class="prettyprint source"><code> &lt;map zoom=&quot;14&quot; center=&quot;42.3726399, -71.1096528&quot;>
  144. &lt;bicycling-layer>&lt;/bicycling-layer>
  145. &lt;/map></code></pre><h4>&lt;weather-layer .. &gt; (deprecated) and &lt;cloud-layer .. &gt; (deprecated)</h4><pre class="prettyprint source"><code> &lt;map zoom=&quot;6&quot; center=&quot;49.265984,-123.127491&quot;>
  146. &lt;weather-layer temperature-units=&quot;FAHRENHEIT&quot;>&lt;/weather-layer>
  147. &lt;cloud-layer>&lt;/cloud-layer>
  148. &lt;/map></code></pre><h4>&lt;fusion-tables-layer .. &gt;</h4><pre class="prettyprint source"><code> &lt;map zoom=&quot;11&quot; center=&quot;41.850033, -87.6500523&quot;>
  149. &lt;fusion-tables-layer query=&quot;{
  150. select: 'Geocodable address',
  151. from: '1mZ53Z70NsChnBMm-qEYmSDOvLXgrreLTkQUvvg'}&quot;>
  152. &lt;/fusion-tables-layer>
  153. &lt;/map></code></pre><h4>&lt;heatmap-layer .. &gt;</h4><pre class="prettyprint source"><code> &lt;map zoom=&quot;13&quot; center=&quot;37.774546, -122.433523&quot; map-type-id=&quot;SATELLITE&quot;>
  154. &lt;heatmap-layer id=&quot;foo&quot; data=&quot;taxiData&quot;>&lt;/heatmap>
  155. &lt;/map></code></pre><h4>&lt;maps-engine-layer .. &gt;</h4><pre class="prettyprint source"><code> &lt;map center=&quot;59.322506, 18.010025&quot; zoom=&quot;14&quot;>
  156. &lt;maps-engine-layer
  157. layer-id=&quot;06673056454046135537-08896501997766553811&quot;>
  158. &lt;/maps-engine-layer>
  159. &lt;/map></code></pre><h4>&lt;traffic-layer&gt;</h4><pre class="prettyprint source"><code> &lt;map zoom=&quot;13&quot; center=&quot;34.04924594193164, -118.24104309082031&quot;>
  160. &lt;traffic-layer>&lt;/traffic-layer>
  161. &lt;/map></code></pre><h4>&lt;transit-layer&gt;</h4><pre class="prettyprint source"><code> &lt;map zoom=&quot;13&quot; center=&quot;51.501904,-0.115871&quot;>
  162. &lt;transit-layer>&lt;/transit-layer>
  163. &lt;/map></code></pre><h4>&lt;dynamic-maps-engine-layer .. &gt;</h4><pre class="prettyprint source"><code> &lt;map center=&quot;59.322506, 18.010025&quot; zoom=&quot;14&quot;>
  164. &lt;dynamic-maps-engine-layer
  165. suppress-info-windows=&quot;true&quot;
  166. clickable=&quot;true&quot;
  167. on-mouseover=&quot;onMouseover()&quot;
  168. on-mouseout=&quot;onMouseout()&quot;
  169. layer-id=&quot;06673056454046135537-08896501997766553811&quot;>
  170. &lt;/dynamic-maps-engine-layer>
  171. &lt;/map></code></pre><h4>&lt;kml-layer .. &gt;</h4><pre class="prettyprint source"><code> &lt;map zoom=&quot;11&quot; center=&quot;41.875696,-87.624207&quot;>
  172. &lt;kml-layer url=&quot;http://gmaps-samples.googlecode.com/svn/trunk/ggeoxml/cta.kml&quot;>&lt;/kml-layer>
  173. &lt;/map></code></pre><h3>MapType Directives</h3><h4>&lt;map-type .. &gt;</h4><pre class="prettyprint source"><code> &lt;map zoom=&quot;10&quot; center=&quot;41.850033,-87.6500523&quot;
  174. &lt;map-type name=&quot;coordinate&quot; object=&quot;CoordMapType&quot;>
  175. &lt;/map-type>
  176. &lt;/map></code></pre><h4>&lt;overlay-map-type .. &gt;</h4><pre class="prettyprint source"><code> &lt;map zoom=&quot;10&quot; center=&quot;41.850033,-87.6500523&quot;>
  177. &lt;overlay-map-type object=&quot;CoordMapType&quot; index=&quot;0&quot;>
  178. &lt;/overlay-map-type>
  179. &lt;/map></code></pre><h2>Advanced Examples</h2><ul>
  180. <li><a href="https://rawgit.com/allenhwkim/angularjs-google-maps/master/testapp/marker-clusterer.html">Marker Clusterer</a></li>
  181. <li><a href="https://rawgit.com/allenhwkim/angularjs-google-maps/master/testapp/map_app.html">Starbucks World Wide</a></li>
  182. </ul>
  183. <h1>Contributors</h1><p>[Fangmingdu] (https://github.com/Fangmingdu) - Drawing Manager</p>
  184. <h1>license</h1><p><a href="https://github.com/allenhwkim/angularjs-google-maps/blob/master/LICENSE">MIT License</a></p></article>
  185. </section>
  186. </div>
  187. <nav>
  188. <h2><a href="index.html">Index</a></h2><h3>service</h3><ul><li><a href="Attr2Options.html">Attr2Options</a></li><li><a href="GeoCoder.html">GeoCoder</a></li><li><a href="NavigatorGeolocation.html">NavigatorGeolocation</a></li><li><a href="StreetView.html">StreetView</a></li></ul><h3>directive</h3><ul><li><a href="bicycling-layer.html">bicycling-layer</a></li><li><a href="cloud-layer.html">cloud-layer</a></li><li><a href="custom-control.html">custom-control</a></li><li><a href="drawing-manager.html">drawing-manager</a></li><li><a href="dynamic-maps-engine-layer.html">dynamic-maps-engine-layer</a></li><li><a href="fusion-tables-layer.html">fusion-tables-layer</a></li><li><a href="heatmap-layer.html">heatmap-layer</a></li><li><a href="info-window.html">info-window</a></li><li><a href="kml-layer.html">kml-layer</a></li><li><a href="lazy-load.html">lazy-load</a></li><li><a href="map.html">map</a></li><li><a href="map-data.html">map-data</a></li><li><a href="map-type.html">map-type</a></li><li><a href="MapController.html">MapController</a></li><li><a href="maps-engine-layer.html">maps-engine-layer</a></li><li><a href="marker.html">marker</a></li><li><a href="overlay-map-type.html">overlay-map-type</a></li><li><a href="shape.html">shape</a></li><li><a href="traffic-layer.html">traffic-layer</a></li><li><a href="transit-layer.html">transit-layer</a></li><li><a href="weather-layer.html">weather-layer</a></li></ul>
  189. </nav>
  190. <br clear="both">
  191. <footer>
  192. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a>
  193. and <a href="https://github.com/allenhwkim/angular-jsdoc">angular-jsdoc</a>
  194. </footer>
  195. <script> prettyPrint(); </script>
  196. <script src="scripts/linenumber.js"> </script>
  197. <script>
  198. var href=window.location.href.match(/\/([^\/]+$)/)[1];
  199. document.querySelector("nav a[href='"+href+"']").scrollIntoView(true);
  200. if (window.location.hash == "")
  201. document.querySelector("body").scrollIntoView(true);
  202. </script>
  203. </body>
  204. </html>