File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/coffee/directives/api/models/parent Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -4928,7 +4928,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
49284928 if (angular.isDefined(this.scope.index)) {
49294929 found = false;
49304930 if (this.gMap.overlayMapTypes.getLength()) {
4931- return this.gMap.overlayMapTypes.forEach((function(_this) {
4931+ this.gMap.overlayMapTypes.forEach((function(_this) {
49324932 return function(mapType, index) {
49334933 var layerIndex;
49344934 if (!found) {
@@ -4940,6 +4940,9 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
49404940 }
49414941 };
49424942 })(this));
4943+ if (!found) {
4944+ return this.gMap.overlayMapTypes.push(this.mapType);
4945+ }
49434946 } else {
49444947 return this.gMap.overlayMapTypes.push(this.mapType);
49454948 }
Original file line number Diff line number Diff line change @@ -99,6 +99,11 @@ angular.module('uiGmapgoogle-maps.directives.api.models.parent')
9999 found = true
100100 @gMap .overlayMapTypes .insertAt index, @mapType
101101 return
102+
103+ # if still not found, it just means that no layer has been found with
104+ # a higher (or missing) index, so just added to the end
105+ if ! found
106+ @gMap .overlayMapTypes .push @mapType
102107 else
103108 @gMap .overlayMapTypes .push @mapType
104109 else
You can’t perform that action at this time.
0 commit comments