This repository was archived by the owner on Nov 30, 2018. It is now read-only.
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
4928
4928
if (angular.isDefined(this.scope.index)) {
4929
4929
found = false;
4930
4930
if (this.gMap.overlayMapTypes.getLength()) {
4931
- return this.gMap.overlayMapTypes.forEach((function(_this) {
4931
+ this.gMap.overlayMapTypes.forEach((function(_this) {
4932
4932
return function(mapType, index) {
4933
4933
var layerIndex;
4934
4934
if (!found) {
@@ -4940,6 +4940,9 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi
4940
4940
}
4941
4941
};
4942
4942
})(this));
4943
+ if (!found) {
4944
+ return this.gMap.overlayMapTypes.push(this.mapType);
4945
+ }
4943
4946
} else {
4944
4947
return this.gMap.overlayMapTypes.push(this.mapType);
4945
4948
}
Original file line number Diff line number Diff line change @@ -99,6 +99,11 @@ angular.module('uiGmapgoogle-maps.directives.api.models.parent')
99
99
found = true
100
100
@gMap .overlayMapTypes .insertAt index, @mapType
101
101
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
102
107
else
103
108
@gMap .overlayMapTypes .push @mapType
104
109
else
You can’t perform that action at this time.
0 commit comments