Skip to content

Commit 4ff67a5

Browse files
committed
Version 1.10.0
1 parent 3a64ccb commit 4ff67a5

File tree

9 files changed

+46
-21
lines changed

9 files changed

+46
-21
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngmap",
3-
"version": "1.9.1",
3+
"version": "1.10.0",
44
"main": "./build/scripts/ng-map.js",
55
"homepage": "https://github.com/allenhwkim/angularjs-google-maps",
66
"authors": [

build/docs/MapController.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ <h5>Parameters:</h5>
381381
<dt>
382382

383383

384-
<a href="directives_map_controller.js.html#line91" class="name-link"><h4 class="name" id=".addObjects">addObjects<span class="signature">(objects)</span><span class="type-signature"></span></h4></a>
384+
<a href="directives_map_controller.js.html#line93" class="name-link"><h4 class="name" id=".addObjects">addObjects<span class="signature">(objects)</span><span class="type-signature"></span></h4></a>
385385

386386

387387

@@ -472,7 +472,7 @@ <h5>Parameters:</h5>
472472
<!-- commented out by Allen Kim
473473
<dt class="tag-source">Source:</dt>
474474
<dd class="tag-source"><ul class="dummy"><li>
475-
<a href="directives_map_controller.js.html">directives/map_controller.js</a>, <a href="directives_map_controller.js.html#line91">line 91</a>
475+
<a href="directives_map_controller.js.html">directives/map_controller.js</a>, <a href="directives_map_controller.js.html#line93">line 93</a>
476476
</li></ul></dd>
477477
-->
478478

@@ -505,7 +505,7 @@ <h5>Parameters:</h5>
505505
<dt>
506506

507507

508-
<a href="directives_map_controller.js.html#line71" class="name-link"><h4 class="name" id=".deleteObject">deleteObject<span class="signature">(objs, obj)</span><span class="type-signature"></span></h4></a>
508+
<a href="directives_map_controller.js.html#line72" class="name-link"><h4 class="name" id=".deleteObject">deleteObject<span class="signature">(objs, obj)</span><span class="type-signature"></span></h4></a>
509509

510510

511511

@@ -619,7 +619,7 @@ <h5>Parameters:</h5>
619619
<!-- commented out by Allen Kim
620620
<dt class="tag-source">Source:</dt>
621621
<dd class="tag-source"><ul class="dummy"><li>
622-
<a href="directives_map_controller.js.html">directives/map_controller.js</a>, <a href="directives_map_controller.js.html#line71">line 71</a>
622+
<a href="directives_map_controller.js.html">directives/map_controller.js</a>, <a href="directives_map_controller.js.html#line72">line 72</a>
623623
</li></ul></dd>
624624
-->
625625

@@ -652,7 +652,7 @@ <h5>Parameters:</h5>
652652
<dt>
653653

654654

655-
<a href="directives_map_controller.js.html#line114" class="name-link"><h4 class="name" id=".getGeoLocation">getGeoLocation<span class="signature">(string)</span><span class="type-signature"> &rarr; {Promise}</span></h4></a>
655+
<a href="directives_map_controller.js.html#line116" class="name-link"><h4 class="name" id=".getGeoLocation">getGeoLocation<span class="signature">(string)</span><span class="type-signature"> &rarr; {Promise}</span></h4></a>
656656

657657

658658

@@ -743,7 +743,7 @@ <h5>Parameters:</h5>
743743
<!-- commented out by Allen Kim
744744
<dt class="tag-source">Source:</dt>
745745
<dd class="tag-source"><ul class="dummy"><li>
746-
<a href="directives_map_controller.js.html">directives/map_controller.js</a>, <a href="directives_map_controller.js.html#line114">line 114</a>
746+
<a href="directives_map_controller.js.html">directives/map_controller.js</a>, <a href="directives_map_controller.js.html#line116">line 116</a>
747747
</li></ul></dd>
748748
-->
749749

@@ -801,7 +801,7 @@ <h5>Returns:</h5>
801801
<dt>
802802

803803

804-
<a href="directives_map_controller.js.html#line149" class="name-link"><h4 class="name" id=".observeAttrSetObj">observeAttrSetObj<span class="signature">(orgAttrs, attrs, obj)</span><span class="type-signature"></span></h4></a>
804+
<a href="directives_map_controller.js.html#line151" class="name-link"><h4 class="name" id=".observeAttrSetObj">observeAttrSetObj<span class="signature">(orgAttrs, attrs, obj)</span><span class="type-signature"></span></h4></a>
805805

806806

807807

@@ -938,7 +938,7 @@ <h5>Parameters:</h5>
938938
<!-- commented out by Allen Kim
939939
<dt class="tag-source">Source:</dt>
940940
<dd class="tag-source"><ul class="dummy"><li>
941-
<a href="directives_map_controller.js.html">directives/map_controller.js</a>, <a href="directives_map_controller.js.html#line149">line 149</a>
941+
<a href="directives_map_controller.js.html">directives/map_controller.js</a>, <a href="directives_map_controller.js.html#line151">line 151</a>
942942
</li></ul></dd>
943943
-->
944944

build/docs/directives_map.js.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,12 @@ <h1 class="page-title">Source: directives/map.js</h1>
197197
scope.map.scope = scope;
198198
google.maps.event.addListenerOnce(map, "idle", function() {
199199
scope.$emit('mapInitialized', map);
200-
if (attrs.zoomToIncludeMarkers) {
200+
if (attrs.zoomToIncludeMarkers == 'auto') {
201+
scope.$on('objectChanged', function(evt, msg) {
202+
console.log('objectChanged name', msg);
203+
msg[0] == 'markers' &amp;&amp; ctrl.zoomToIncludeMarkers();
204+
});
205+
}else if (attrs.zoomToIncludeMarkers) {
201206
console.log('zoomToIncludeMarkers');
202207
ctrl.zoomToIncludeMarkers();
203208
}

build/docs/directives_map_controller.js.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ <h1 class="page-title">Source: directives/map_controller.js</h1>
3737
* @property {Hash} markers collection of Markers initiated within `map` directive
3838
* @property {Hash} shapes collection of shapes initiated within `map` directive
3939
*/
40-
var MapController = function($q, NavigatorGeolocation, GeoCoder, Attr2Options) {
40+
var MapController = function($scope, $q, NavigatorGeolocation, GeoCoder, Attr2Options) {
4141
var parser = Attr2Options;
4242
var _this = this;
4343

@@ -89,6 +89,7 @@ <h1 class="page-title">Source: directives/map_controller.js</h1>
8989
if (obj.centered &amp;&amp; obj.position) {
9090
this.map.setCenter(obj.position);
9191
}
92+
$scope.$emit('objectChanged', [groupName, this.map[groupName]]);
9293
} else {
9394
obj.groupName = groupName;
9495
this._objects.push(obj);
@@ -112,6 +113,7 @@ <h1 class="page-title">Source: directives/map_controller.js</h1>
112113

113114
/* delete from map */
114115
obj.map &amp;&amp; obj.setMap &amp;&amp; obj.setMap(null);
116+
$scope.$emit('objectChanged', [groupName, this.map[groupName]]);
115117
}
116118
};
117119

@@ -204,7 +206,7 @@ <h1 class="page-title">Source: directives/map_controller.js</h1>
204206

205207
}; // MapController
206208

207-
MapController.$inject = ['$q', 'NavigatorGeolocation', 'GeoCoder', 'Attr2Options'];
209+
MapController.$inject = ['$scope', '$q', 'NavigatorGeolocation', 'GeoCoder', 'Attr2Options'];
208210
angular.module('ngMap').controller('MapController', MapController);
209211
})();
210212
</code></pre>

build/docs/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ <h2>To Get Started</h2><p>For Bower users, </p>
8787
<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>
8888
<pre class="prettyprint source"><code>&lt;div map-lazy-load=&quot;http://maps.google.com/maps/api/js&quot;>
8989
&lt;map center=&quot;41,-87&quot; zoom=&quot;3&quot;>&lt;/map>
90-
&lt;/div></code></pre><h2>Release Notes</h2><p><strong>1.7.0</strong></p>
90+
&lt;/div></code></pre><h2>Release Notes</h2><p><strong>1.9.0</strong></p>
91+
<ul>
92+
<li>Refactored directory structure</li>
93+
</ul>
94+
<p><strong>1.7.0</strong></p>
9195
<ul>
9296
<li>added <strong>directions</strong> directive
9397
<a href="https://rawgit.com/allenhwkim/angularjs-google-maps/master/testapp/directions.html">Example</a></li>

build/scripts/ng-map.debug.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,12 @@ angular.module('ngMap', []);
15571557
scope.map.scope = scope;
15581558
google.maps.event.addListenerOnce(map, "idle", function() {
15591559
scope.$emit('mapInitialized', map);
1560-
if (attrs.zoomToIncludeMarkers) {
1560+
if (attrs.zoomToIncludeMarkers == 'auto') {
1561+
scope.$on('objectChanged', function(evt, msg) {
1562+
console.log('objectChanged name', msg);
1563+
msg[0] == 'markers' && ctrl.zoomToIncludeMarkers();
1564+
});
1565+
}else if (attrs.zoomToIncludeMarkers) {
15611566
console.log('zoomToIncludeMarkers');
15621567
ctrl.zoomToIncludeMarkers();
15631568
}
@@ -1605,7 +1610,7 @@ angular.module('ngMap', []);
16051610
* @property {Hash} markers collection of Markers initiated within `map` directive
16061611
* @property {Hash} shapes collection of shapes initiated within `map` directive
16071612
*/
1608-
var MapController = function($q, NavigatorGeolocation, GeoCoder, Attr2Options) {
1613+
var MapController = function($scope, $q, NavigatorGeolocation, GeoCoder, Attr2Options) {
16091614
var parser = Attr2Options;
16101615
var _this = this;
16111616

@@ -1657,6 +1662,7 @@ angular.module('ngMap', []);
16571662
if (obj.centered && obj.position) {
16581663
this.map.setCenter(obj.position);
16591664
}
1665+
$scope.$emit('objectChanged', [groupName, this.map[groupName]]);
16601666
} else {
16611667
obj.groupName = groupName;
16621668
this._objects.push(obj);
@@ -1680,6 +1686,7 @@ angular.module('ngMap', []);
16801686

16811687
/* delete from map */
16821688
obj.map && obj.setMap && obj.setMap(null);
1689+
$scope.$emit('objectChanged', [groupName, this.map[groupName]]);
16831690
}
16841691
};
16851692

@@ -1772,7 +1779,7 @@ angular.module('ngMap', []);
17721779

17731780
}; // MapController
17741781

1775-
MapController.$inject = ['$q', 'NavigatorGeolocation', 'GeoCoder', 'Attr2Options'];
1782+
MapController.$inject = ['$scope', '$q', 'NavigatorGeolocation', 'GeoCoder', 'Attr2Options'];
17761783
angular.module('ngMap').controller('MapController', MapController);
17771784
})();
17781785

build/scripts/ng-map.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,12 @@ angular.module('ngMap', []);
15571557
scope.map.scope = scope;
15581558
google.maps.event.addListenerOnce(map, "idle", function() {
15591559
scope.$emit('mapInitialized', map);
1560-
if (attrs.zoomToIncludeMarkers) {
1560+
if (attrs.zoomToIncludeMarkers == 'auto') {
1561+
scope.$on('objectChanged', function(evt, msg) {
1562+
void 0;
1563+
msg[0] == 'markers' && ctrl.zoomToIncludeMarkers();
1564+
});
1565+
}else if (attrs.zoomToIncludeMarkers) {
15611566
void 0;
15621567
ctrl.zoomToIncludeMarkers();
15631568
}
@@ -1605,7 +1610,7 @@ angular.module('ngMap', []);
16051610
* @property {Hash} markers collection of Markers initiated within `map` directive
16061611
* @property {Hash} shapes collection of shapes initiated within `map` directive
16071612
*/
1608-
var MapController = function($q, NavigatorGeolocation, GeoCoder, Attr2Options) {
1613+
var MapController = function($scope, $q, NavigatorGeolocation, GeoCoder, Attr2Options) {
16091614
var parser = Attr2Options;
16101615
var _this = this;
16111616

@@ -1657,6 +1662,7 @@ angular.module('ngMap', []);
16571662
if (obj.centered && obj.position) {
16581663
this.map.setCenter(obj.position);
16591664
}
1665+
$scope.$emit('objectChanged', [groupName, this.map[groupName]]);
16601666
} else {
16611667
obj.groupName = groupName;
16621668
this._objects.push(obj);
@@ -1680,6 +1686,7 @@ angular.module('ngMap', []);
16801686

16811687
/* delete from map */
16821688
obj.map && obj.setMap && obj.setMap(null);
1689+
$scope.$emit('objectChanged', [groupName, this.map[groupName]]);
16831690
}
16841691
};
16851692

@@ -1772,7 +1779,7 @@ angular.module('ngMap', []);
17721779

17731780
}; // MapController
17741781

1775-
MapController.$inject = ['$q', 'NavigatorGeolocation', 'GeoCoder', 'Attr2Options'];
1782+
MapController.$inject = ['$scope', '$q', 'NavigatorGeolocation', 'GeoCoder', 'Attr2Options'];
17761783
angular.module('ngMap').controller('MapController', MapController);
17771784
})();
17781785

build/scripts/ng-map.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngmap",
3-
"version": "1.9.1",
3+
"version": "1.10.0",
44
"main": "build/scripts/ng-map.js",
55
"dependencies": {
66
"glob": "~4.0.2",

0 commit comments

Comments
 (0)