{"id":7838,"date":"2015-10-31T05:07:27","date_gmt":"2015-10-31T05:07:27","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/10\/31\/allenhwkim-angularjs-google-maps\/"},"modified":"2015-10-31T05:07:27","modified_gmt":"2015-10-31T05:07:27","slug":"allenhwkim-angularjs-google-maps","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/10\/31\/allenhwkim-angularjs-google-maps\/","title":{"rendered":"allenhwkim\/angularjs-google-maps"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/travis-ci.org\/allenhwkim\/angularjs-google-maps.png?branch=master\" \/><\/p>\n<p>Demo<br \/>\nDocumentation<br \/>\n<strong>Road Trip By StreetView<\/strong><\/p>\n<p>There is already one for this. However, I found myself doing totally different approach for this purpose than the existing one, such as;<\/p>\n<ol>\n<li><strong>Everything in tag and attributes.<\/strong><br \/>\nThus, basic users don\u2019t even have to know what Javascript is.<\/li>\n<li><strong>Expose all original Google Maps V3 api to the user.<\/strong><br \/>\nNo hiding, no wraping, or whatsoever. By doing so, programmers don\u2019t need to learn how to use this module. You only need to know Google Maps V3 API.<\/li>\n<\/ol>\n<p>There is a blog that introduces this module. The title of it is \u2019Google Map As The Simplest Way\u2019<\/p>\n<h2>To Get Started<\/h2>\n<p>For Bower users,<\/p>\n<p><code>$ bower install ngmap<\/code><\/p>\n<ol>\n<li>\n<p>Include <code>ng-map.min.js<\/code> as well as google maps.<\/p>\n<\/li>\n<li>\n<p>name angular app as ngMap, or add it as a dependency<\/p>\n<p><code>var myApp = angular.module('myApp', ['ngMap']);<\/code><\/p>\n<\/li>\n<\/ol>\n<p>After map is initialized, you will have one event and map instances<\/p>\n<p>Event:<\/p>\n<ul>\n<li>\n<p><code>mapInitialized<\/code> with parameter with map<\/p>\n<p>In case your map directive scope is different from your controller scope, use this event to get the map instance.<\/p>\n<pre>\napp.controller(\u2018parentParentController\u2019, function($scope) {\n$scope.$on(\u2018mapInitialized\u2019, function(event, map) {\nmap.setCenter( \u2026 )\n\u2026\n});\n});\n<\/pre>\n<\/li>\n<\/ul>\n<p>Instances:<\/p>\n<ul>\n<li><code>$scope.map<\/code><\/li>\n<li><code>$scope.map.markers<\/code><\/li>\n<li><code>$scope.map.shapes<\/code><\/li>\n<li>etc<\/li>\n<\/ul>\n<h2>Lazy Loading<\/h2>\n<p>Simply wrap the map tag with <code>map-lazy-load=\"http:\/\/maps.google.com\/maps\/api\/js\"<\/code>.<\/p>\n<pre><code>\n  \n\n<\/code><\/pre>\n<h2>Release Notes<\/h2>\n<p><strong>1.7.0<\/strong><\/p>\n<ul>\n<li>added <strong>directions<\/strong> directive Example<\/li>\n<li>added <strong>places-auto-complete<\/strong> for input tag. Example<\/li>\n<\/ul>\n<p><strong>1.6.0<\/strong><\/p>\n<p><strong>1.5.0<\/strong><\/p>\n<ul>\n<li>added <strong>geo-callback attribute<\/strong> for map, marker, shape, and info-window. Example<\/li>\n<\/ul>\n<p><strong>1.4.0<\/strong><\/p>\n<ul>\n<li>support lazy loading of maps js with directive, <strong>map-lazy-load<\/strong>, which does not require to <code>https:\/\/maps.google.com\/maps\/api\/js<\/code> Example<\/li>\n<\/ul>\n<p><strong>1.3.0<\/strong><\/p>\n<ul>\n<li>added <strong>drawing-manager<\/strong> directive. Thanks to Fangming Du Example<\/li>\n<\/ul>\n<p><strong>1.2.0<\/strong><\/p>\n<ul>\n<li>events with <code>controller as<\/code> syntax, thanks to Simon<\/li>\n<\/ul>\n<p><strong>1.1.0<\/strong><\/p>\n<ul>\n<li>marker directive can have icon attribute as JSON<\/li>\n<li>map with init-event attribute for initialization by an event<\/li>\n<\/ul>\n<p><strong>1.0.0 (covers all official google examples using directives).<\/strong><\/p>\n<ul>\n<li>\n<p>marker<\/p>\n<\/li>\n<li>\n<p>shapes<\/p>\n<ul>\n<li>circle<\/li>\n<li>polyline<\/li>\n<li>polygon<\/li>\n<li>rectangle<\/li>\n<li>image<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>layers<\/p>\n<ul>\n<li>traffic-layer<\/li>\n<li>transit-layer<\/li>\n<li>bicycling-layer<\/li>\n<li>dynamic-maps-engine-layer<\/li>\n<li>fusion-tables-layer<\/li>\n<li>heatmap-layer<\/li>\n<li>kml-layer<\/li>\n<li>maps-engine-layer<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>custom-control<\/p>\n<\/li>\n<li>\n<p>info-window<\/p>\n<\/li>\n<li>\n<p>map-data<\/p>\n<\/li>\n<li>\n<p>map-type<\/p>\n<\/li>\n<li>\n<p>overlay-map-type<\/p>\n<\/li>\n<\/ul>\n<h2>Directives<\/h2>\n<p>As defined on MapOptions, you can add any attributes, and events starting witn <code>on-<\/code>. Please note that event value must be a function.<\/p>\n<p>Example:<\/p>\n<pre><code>\n\n<\/code><\/pre>\n<p>i.e. &lt; zoom=\u201c11\u201d center=&#8221;[40.74, -74.18]&#8221;<\/p>\n<p>As defined on MarkerOptions, you can add any attributes, and events starting witn <code>on-<\/code>.<\/p>\n<pre><code>\n  \n\n<\/code><\/pre>\n<p>Polyline, Circle, Polygon, Rectangle, and Images<\/p>\n<pre><code> \n    \n    \n    \n    \n    \n \n<\/code><\/pre>\n<p>Example:<\/p>\n<pre><code>\n  \n    \n      \n    \n  \n\n<\/code><\/pre>\n<p>Example:<\/p>\n<pre><code>  \n    \n      Home1\n    \n  \n<\/code><\/pre>\n<p>Example:<\/p>\n<pre><code>  \n    \n  \n<\/code><\/pre>\n<h3>Layer Directives<\/h3>\n<pre><code>  \n    \n  \n<\/code><\/pre>\n<h4>(deprecated) and (deprecated)<\/h4>\n<pre><code>  \n    \n    \n  \n<\/code><\/pre>\n<pre><code>  \n    \n    \n  \n<\/code><\/pre>\n<pre><code>  \n    \n  \n<\/code><\/pre>\n<pre><code>  \n    \n    \n  \n<\/code><\/pre>\n<pre><code>  \n    \n  \n<\/code><\/pre>\n<pre><code>  \n    \n  \n<\/code><\/pre>\n<pre><code>  \n    \n    \n  \n<\/code><\/pre>\n<pre><code>  \n    \n  \n<\/code><\/pre>\n<h3>MapType Directives<\/h3>\n","protected":false},"excerpt":{"rendered":"<p>Demo Documentation Road Trip By StreetView There is already one for this. However, I found myself doing totally different approach for this purpose than the existing one, such as; Everything in tag and attributes. Thus, basic users don\u2019t even have to know what Javascript is. Expose all original Google Maps V3 api to the user. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7838","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7838","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7838"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7838\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7838"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7838"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}