Skip to content

Commit 4e760a9

Browse files
committed
Version 1.8.2
1 parent 7a0f18d commit 4e760a9

File tree

8 files changed

+169
-133
lines changed

8 files changed

+169
-133
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.8.1",
3+
"version": "1.8.2",
44
"main": "./build/scripts/ng-map.js",
55
"homepage": "https://github.com/allenhwkim/angularjs-google-maps",
66
"authors": [

build/docs/MapController.html

Lines changed: 6 additions & 6 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#line89" 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#line91" 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#line89">line 89</a>
475+
<a href="directives_map_controller.js.html">directives/map_controller.js</a>, <a href="directives_map_controller.js.html#line91">line 91</a>
476476
</li></ul></dd>
477477
-->
478478

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

654654

655-
<a href="directives_map_controller.js.html#line112" 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#line114" 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#line112">line 112</a>
746+
<a href="directives_map_controller.js.html">directives/map_controller.js</a>, <a href="directives_map_controller.js.html#line114">line 114</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#line147" 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#line149" 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#line147">line 147</a>
941+
<a href="directives_map_controller.js.html">directives/map_controller.js</a>, <a href="directives_map_controller.js.html#line149">line 149</a>
942942
</li></ul></dd>
943943
-->
944944

build/docs/directives_map-lazy-load.js.html

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -49,44 +49,54 @@ <h1 class="page-title">Source: directives/map-lazy-load.js</h1>
4949
*/
5050
(function() {
5151
'use strict';
52+
var $timeout, $compile, src, savedHtml;
53+
54+
var preLinkFunc = function(scope, element, attrs) {
55+
window.lazyLoadCallback = function() {
56+
console.log('script loaded,' + src);
57+
$timeout(function() { /* give some time to load */
58+
element.html(savedHtml);
59+
$compile(element.contents())(scope);
60+
}, 100);
61+
};
5262

53-
angular.module('ngMap').directive('mapLazyLoad', ['$compile', '$timeout', function($compile, $timeout) {
54-
'use strict';
55-
var directiveDefinitionObject = {
56-
compile: function(tElement, tAttrs) {
57-
(!tAttrs.mapLazyLoad) &amp;&amp; console.error('requires src with map-lazy-load');
58-
var savedHtml = tElement.html(), src = tAttrs.mapLazyLoad;
59-
/**
60-
* if already loaded, stop processing it
61-
*/
62-
if (document.querySelector('script[src="'+src+'?callback=lazyLoadCallback"]')) {
63-
return false;
64-
}
65-
66-
tElement.html(''); // will compile again after script is loaded
67-
return {
68-
pre: function(scope, element, attrs) {
69-
window.lazyLoadCallback = function() {
70-
console.log('script loaded,' + src);
71-
$timeout(function() { /* give some time to load */
72-
element.html(savedHtml);
73-
$compile(element.contents())(scope);
74-
}, 100);
75-
};
76-
if(window.google === undefined || window.google.maps === undefined) {
77-
var scriptEl = document.createElement('script');
78-
scriptEl.src = src + (src.indexOf('?') > -1 ? '&amp;' : '?') + 'callback=lazyLoadCallback';
79-
document.body.appendChild(scriptEl);
80-
} else {
81-
element.html(savedHtml);
82-
$compile(element.contents())(scope);
83-
}
84-
}
85-
};
86-
}
63+
if(window.google === undefined || window.google.maps === undefined) {
64+
var scriptEl = document.createElement('script');
65+
scriptEl.src = src + (src.indexOf('?') > -1 ? '&amp;' : '?') + 'callback=lazyLoadCallback';
66+
document.body.appendChild(scriptEl);
67+
} else {
68+
element.html(savedHtml);
69+
$compile(element.contents())(scope);
70+
}
71+
};
72+
73+
var compileFunc = function(tElement, tAttrs) {
74+
75+
(!tAttrs.mapLazyLoad) &amp;&amp; console.error('requires src with map-lazy-load');
76+
savedHtml = tElement.html();
77+
src = tAttrs.mapLazyLoad;
78+
79+
/**
80+
* if already loaded, stop processing it
81+
*/
82+
if (document.querySelector('script[src="'+src+'?callback=lazyLoadCallback"]')) {
83+
return false;
84+
}
85+
86+
tElement.html(''); // will compile again after script is loaded
87+
return {
88+
pre: preLinkFunc
8789
};
88-
return directiveDefinitionObject;
89-
}]);
90+
};
91+
92+
var mapLazyLoad = function(_$compile_, _$timeout_) {
93+
$compile = _$compile_, $timeout = _$timeout_;
94+
return {
95+
compile: compileFunc
96+
}
97+
};
98+
99+
angular.module('ngMap').directive('mapLazyLoad', mapLazyLoad);
90100
})();
91101
</code></pre>
92102
</article>

build/docs/directives_map_controller.js.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,15 @@ <h1 class="page-title">Source: directives/map_controller.js</h1>
104104
*/
105105
this.deleteObject = function(groupName, obj) {
106106
/* delete from group */
107-
var objs = obj.map[groupName];
108-
for (var name in objs) {
109-
objs[name] === obj &amp;&amp; (delete objs[name]);
110-
}
107+
if (obj.map) {
108+
var objs = obj.map[groupName];
109+
for (var name in objs) {
110+
objs[name] === obj &amp;&amp; (delete objs[name]);
111+
}
111112

112-
/* delete from map */
113-
obj.map &amp;&amp; obj.setMap &amp;&amp; obj.setMap(null);
113+
/* delete from map */
114+
obj.map &amp;&amp; obj.setMap &amp;&amp; obj.setMap(null);
115+
}
114116
};
115117

116118
/**

build/scripts/ng-map.debug.js

Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,44 +1284,54 @@ angular.module('ngMap', []);
12841284
*/
12851285
(function() {
12861286
'use strict';
1287+
var $timeout, $compile, src, savedHtml;
1288+
1289+
var preLinkFunc = function(scope, element, attrs) {
1290+
window.lazyLoadCallback = function() {
1291+
console.log('script loaded,' + src);
1292+
$timeout(function() { /* give some time to load */
1293+
element.html(savedHtml);
1294+
$compile(element.contents())(scope);
1295+
}, 100);
1296+
};
12871297

1288-
angular.module('ngMap').directive('mapLazyLoad', ['$compile', '$timeout', function($compile, $timeout) {
1289-
'use strict';
1290-
var directiveDefinitionObject = {
1291-
compile: function(tElement, tAttrs) {
1292-
(!tAttrs.mapLazyLoad) && console.error('requires src with map-lazy-load');
1293-
var savedHtml = tElement.html(), src = tAttrs.mapLazyLoad;
1294-
/**
1295-
* if already loaded, stop processing it
1296-
*/
1297-
if (document.querySelector('script[src="'+src+'?callback=lazyLoadCallback"]')) {
1298-
return false;
1299-
}
1298+
if(window.google === undefined || window.google.maps === undefined) {
1299+
var scriptEl = document.createElement('script');
1300+
scriptEl.src = src + (src.indexOf('?') > -1 ? '&' : '?') + 'callback=lazyLoadCallback';
1301+
document.body.appendChild(scriptEl);
1302+
} else {
1303+
element.html(savedHtml);
1304+
$compile(element.contents())(scope);
1305+
}
1306+
};
13001307

1301-
tElement.html(''); // will compile again after script is loaded
1302-
return {
1303-
pre: function(scope, element, attrs) {
1304-
window.lazyLoadCallback = function() {
1305-
console.log('script loaded,' + src);
1306-
$timeout(function() { /* give some time to load */
1307-
element.html(savedHtml);
1308-
$compile(element.contents())(scope);
1309-
}, 100);
1310-
};
1311-
if(window.google === undefined || window.google.maps === undefined) {
1312-
var scriptEl = document.createElement('script');
1313-
scriptEl.src = src + (src.indexOf('?') > -1 ? '&' : '?') + 'callback=lazyLoadCallback';
1314-
document.body.appendChild(scriptEl);
1315-
} else {
1316-
element.html(savedHtml);
1317-
$compile(element.contents())(scope);
1318-
}
1319-
}
1320-
};
1321-
}
1308+
var compileFunc = function(tElement, tAttrs) {
1309+
1310+
(!tAttrs.mapLazyLoad) && console.error('requires src with map-lazy-load');
1311+
savedHtml = tElement.html();
1312+
src = tAttrs.mapLazyLoad;
1313+
1314+
/**
1315+
* if already loaded, stop processing it
1316+
*/
1317+
if (document.querySelector('script[src="'+src+'?callback=lazyLoadCallback"]')) {
1318+
return false;
1319+
}
1320+
1321+
tElement.html(''); // will compile again after script is loaded
1322+
return {
1323+
pre: preLinkFunc
13221324
};
1323-
return directiveDefinitionObject;
1324-
}]);
1325+
};
1326+
1327+
var mapLazyLoad = function(_$compile_, _$timeout_) {
1328+
$compile = _$compile_, $timeout = _$timeout_;
1329+
return {
1330+
compile: compileFunc
1331+
}
1332+
};
1333+
1334+
angular.module('ngMap').directive('mapLazyLoad', mapLazyLoad);
13251335
})();
13261336

13271337
/**
@@ -1661,13 +1671,15 @@ angular.module('ngMap', []);
16611671
*/
16621672
this.deleteObject = function(groupName, obj) {
16631673
/* delete from group */
1664-
var objs = obj.map[groupName];
1665-
for (var name in objs) {
1666-
objs[name] === obj && (delete objs[name]);
1667-
}
1674+
if (obj.map) {
1675+
var objs = obj.map[groupName];
1676+
for (var name in objs) {
1677+
objs[name] === obj && (delete objs[name]);
1678+
}
16681679

1669-
/* delete from map */
1670-
obj.map && obj.setMap && obj.setMap(null);
1680+
/* delete from map */
1681+
obj.map && obj.setMap && obj.setMap(null);
1682+
}
16711683
};
16721684

16731685
/**

build/scripts/ng-map.js

Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,44 +1284,54 @@ angular.module('ngMap', []);
12841284
*/
12851285
(function() {
12861286
'use strict';
1287+
var $timeout, $compile, src, savedHtml;
12871288

1288-
angular.module('ngMap').directive('mapLazyLoad', ['$compile', '$timeout', function($compile, $timeout) {
1289-
'use strict';
1290-
var directiveDefinitionObject = {
1291-
compile: function(tElement, tAttrs) {
1292-
(!tAttrs.mapLazyLoad) && void 0;
1293-
var savedHtml = tElement.html(), src = tAttrs.mapLazyLoad;
1294-
/**
1295-
* if already loaded, stop processing it
1296-
*/
1297-
if (document.querySelector('script[src="'+src+'?callback=lazyLoadCallback"]')) {
1298-
return false;
1299-
}
1289+
var preLinkFunc = function(scope, element, attrs) {
1290+
window.lazyLoadCallback = function() {
1291+
void 0;
1292+
$timeout(function() { /* give some time to load */
1293+
element.html(savedHtml);
1294+
$compile(element.contents())(scope);
1295+
}, 100);
1296+
};
13001297

1301-
tElement.html(''); // will compile again after script is loaded
1302-
return {
1303-
pre: function(scope, element, attrs) {
1304-
window.lazyLoadCallback = function() {
1305-
void 0;
1306-
$timeout(function() { /* give some time to load */
1307-
element.html(savedHtml);
1308-
$compile(element.contents())(scope);
1309-
}, 100);
1310-
};
1311-
if(window.google === undefined || window.google.maps === undefined) {
1312-
var scriptEl = document.createElement('script');
1313-
scriptEl.src = src + (src.indexOf('?') > -1 ? '&' : '?') + 'callback=lazyLoadCallback';
1314-
document.body.appendChild(scriptEl);
1315-
} else {
1316-
element.html(savedHtml);
1317-
$compile(element.contents())(scope);
1318-
}
1319-
}
1320-
};
1321-
}
1298+
if(window.google === undefined || window.google.maps === undefined) {
1299+
var scriptEl = document.createElement('script');
1300+
scriptEl.src = src + (src.indexOf('?') > -1 ? '&' : '?') + 'callback=lazyLoadCallback';
1301+
document.body.appendChild(scriptEl);
1302+
} else {
1303+
element.html(savedHtml);
1304+
$compile(element.contents())(scope);
1305+
}
1306+
};
1307+
1308+
var compileFunc = function(tElement, tAttrs) {
1309+
1310+
(!tAttrs.mapLazyLoad) && void 0;
1311+
savedHtml = tElement.html();
1312+
src = tAttrs.mapLazyLoad;
1313+
1314+
/**
1315+
* if already loaded, stop processing it
1316+
*/
1317+
if (document.querySelector('script[src="'+src+'?callback=lazyLoadCallback"]')) {
1318+
return false;
1319+
}
1320+
1321+
tElement.html(''); // will compile again after script is loaded
1322+
return {
1323+
pre: preLinkFunc
13221324
};
1323-
return directiveDefinitionObject;
1324-
}]);
1325+
};
1326+
1327+
var mapLazyLoad = function(_$compile_, _$timeout_) {
1328+
$compile = _$compile_, $timeout = _$timeout_;
1329+
return {
1330+
compile: compileFunc
1331+
}
1332+
};
1333+
1334+
angular.module('ngMap').directive('mapLazyLoad', mapLazyLoad);
13251335
})();
13261336

13271337
/**
@@ -1661,13 +1671,15 @@ angular.module('ngMap', []);
16611671
*/
16621672
this.deleteObject = function(groupName, obj) {
16631673
/* delete from group */
1664-
var objs = obj.map[groupName];
1665-
for (var name in objs) {
1666-
objs[name] === obj && (delete objs[name]);
1667-
}
1674+
if (obj.map) {
1675+
var objs = obj.map[groupName];
1676+
for (var name in objs) {
1677+
objs[name] === obj && (delete objs[name]);
1678+
}
16681679

1669-
/* delete from map */
1670-
obj.map && obj.setMap && obj.setMap(null);
1680+
/* delete from map */
1681+
obj.map && obj.setMap && obj.setMap(null);
1682+
}
16711683
};
16721684

16731685
/**

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.

0 commit comments

Comments
 (0)