Skip to content

Commit 57f2366

Browse files
committed
- (Bug Fix) Fixed an issue with the ground overlays not appearing on the map list view in the original 0.7.0 release
1 parent 2e409d0 commit 57f2366

File tree

7 files changed

+200
-8
lines changed

7 files changed

+200
-8
lines changed

resources/js/app.compiled.js

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10385,6 +10385,45 @@ function program46(depth0,data) {
1038510385
return "<span class=\"actions\"><a href=\"#\" class=\"edit\" data-property=\"circles\"><span data-icon=\"edit\"></span></a> <a href=\"#\" class=\"delete\" data-property=\"circles\"><span data-icon=\"trash\"></span></a></span>";
1038610386
}
1038710387

10388+
function program48(depth0,data) {
10389+
10390+
10391+
return "\n<p>There are no images on the map.</p>\n";
10392+
}
10393+
10394+
function program50(depth0,data) {
10395+
10396+
var buffer = "", stack1, helper, options;
10397+
buffer += "\n <li>";
10398+
stack1 = helpers['if'].call(depth0, (depth0 && depth0.deleted), {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
10399+
if(stack1 || stack1 === 0) { buffer += stack1; }
10400+
buffer += "<a href=\"#\" class=\"overlay-center\">";
10401+
stack1 = helpers['if'].call(depth0, (depth0 && depth0.title), {hash:{},inverse:self.noop,fn:self.programWithDepth(13, program13, data, depth0),data:data});
10402+
if(stack1 || stack1 === 0) { buffer += stack1; }
10403+
stack1 = (helper = helpers.not || (depth0 && depth0.not),options={hash:{},inverse:self.noop,fn:self.programWithDepth(51, program51, data, depth0),data:data},helper ? helper.call(depth0, (depth0 && depth0.title), options) : helperMissing.call(depth0, "not", (depth0 && depth0.title), options));
10404+
if(stack1 || stack1 === 0) { buffer += stack1; }
10405+
buffer += "</a>";
10406+
stack1 = helpers['if'].call(depth0, (depth0 && depth0.deleted), {hash:{},inverse:self.noop,fn:self.program(44, program44, data),data:data});
10407+
if(stack1 || stack1 === 0) { buffer += stack1; }
10408+
stack1 = (helper = helpers.not || (depth0 && depth0.not),options={hash:{},inverse:self.noop,fn:self.program(53, program53, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.deleted), options) : helperMissing.call(depth0, "not", (depth0 && depth0.deleted), options));
10409+
if(stack1 || stack1 === 0) { buffer += stack1; }
10410+
buffer += "</li>\n";
10411+
return buffer;
10412+
}
10413+
function program51(depth0,data,depth1) {
10414+
10415+
var buffer = "", stack1;
10416+
buffer += "Image "
10417+
+ escapeExpression(((stack1 = (depth1 && depth1.count)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
10418+
return buffer;
10419+
}
10420+
10421+
function program53(depth0,data) {
10422+
10423+
10424+
return "<span class=\"actions\"><a href=\"#\" class=\"edit\" data-property=\"groundOverlays\"><span data-icon=\"edit\"></span></a> <a href=\"#\" class=\"delete\" data-property=\"groundOverlays\"><span data-icon=\"trash\"></span></a></span>";
10425+
}
10426+
1038810427
buffer += "<h2>Markers</h2>\n\n<a href=\"#\" class=\"cancel oh-google-map-close\">&times; close</a>\n\n";
1038910428
stack1 = (helper = helpers.not || (depth0 && depth0.not),options={hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data},helper ? helper.call(depth0, ((stack1 = (depth0 && depth0.markers)),stack1 == null || stack1 === false ? stack1 : stack1.length), options) : helperMissing.call(depth0, "not", ((stack1 = (depth0 && depth0.markers)),stack1 == null || stack1 === false ? stack1 : stack1.length), options));
1039010429
if(stack1 || stack1 === 0) { buffer += stack1; }
@@ -10415,6 +10454,12 @@ function program46(depth0,data) {
1041510454
buffer += "\n\n<ol class=\"oh-google-map-ordered-list\">\n";
1041610455
stack1 = (helper = helpers.forEach || (depth0 && depth0.forEach),options={hash:{},inverse:self.noop,fn:self.program(41, program41, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.circles), options) : helperMissing.call(depth0, "forEach", (depth0 && depth0.circles), options));
1041710456
if(stack1 || stack1 === 0) { buffer += stack1; }
10457+
buffer += "\n</ol>\n\n<h2>Images</h2>\n\n";
10458+
stack1 = (helper = helpers.not || (depth0 && depth0.not),options={hash:{},inverse:self.noop,fn:self.program(48, program48, data),data:data},helper ? helper.call(depth0, ((stack1 = (depth0 && depth0.overlays)),stack1 == null || stack1 === false ? stack1 : stack1.length), options) : helperMissing.call(depth0, "not", ((stack1 = (depth0 && depth0.overlays)),stack1 == null || stack1 === false ? stack1 : stack1.length), options));
10459+
if(stack1 || stack1 === 0) { buffer += stack1; }
10460+
buffer += "\n\n<ol class=\"oh-google-map-ordered-list\">\n";
10461+
stack1 = (helper = helpers.forEach || (depth0 && depth0.forEach),options={hash:{},inverse:self.noop,fn:self.program(50, program50, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.overlays), options) : helperMissing.call(depth0, "forEach", (depth0 && depth0.overlays), options));
10462+
if(stack1 || stack1 === 0) { buffer += stack1; }
1041810463
buffer += "\n</ol>";
1041910464
return buffer;
1042010465
});
@@ -14490,7 +14535,8 @@ var GoogleMaps = {
1449014535
polygons: [],
1449114536
polylines: [],
1449214537
routes: [],
14493-
circles: []
14538+
circles: [],
14539+
overlays: []
1449414540
};
1449514541

1449614542
_.each(this.markers, function(marker) {
@@ -14513,6 +14559,10 @@ var GoogleMaps = {
1451314559
data.circles.push(circle.toJSON());
1451414560
});
1451514561

14562+
_.each(this.groundOverlays, function(overlay) {
14563+
data.overlays.push(overlay.toJSON());
14564+
});
14565+
1451614566
var view = new GoogleMaps.Views.MapList({
1451714567
map: this,
1451814568
model: new Backbone.Model(data)
@@ -14955,6 +15005,22 @@ var GoogleMaps = {
1495515005
e.preventDefault();
1495615006
});
1495715007

15008+
this.$el.find('.overlay-undo').click(function(e) {
15009+
var index = $(this).parent().index();
15010+
var overlay = t.map.groundOverlays[index];
15011+
15012+
overlay.set('deleted', false);
15013+
overlay.get('api').setMap(t.map.api);
15014+
15015+
t.model.get('groundOverlays')[index].deleted = false;
15016+
15017+
t.map.center();
15018+
t.map.updateHiddenField();
15019+
t.render();
15020+
15021+
e.preventDefault();
15022+
});
15023+
1495815024
this.$el.find('.marker-center').click(function(e) {
1495915025
var index = $(this).parent().index();
1496015026
var marker = t.map.markers[index];
@@ -15018,6 +15084,15 @@ var GoogleMaps = {
1501815084

1501915085
e.preventDefault();
1502015086
});
15087+
15088+
this.$el.find('.overlay-center').click(function(e) {
15089+
var index = $(this).parent().index();
15090+
var overlay = t.map.groundOverlays[index];
15091+
15092+
t.map.fitBounds(overlay.getBounds());
15093+
15094+
e.preventDefault();
15095+
});
1502115096
}
1502215097

1502315098
});

resources/js/app.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3478,7 +3478,8 @@ var GoogleMaps = {
34783478
polygons: [],
34793479
polylines: [],
34803480
routes: [],
3481-
circles: []
3481+
circles: [],
3482+
overlays: []
34823483
};
34833484

34843485
_.each(this.markers, function(marker) {
@@ -3501,6 +3502,10 @@ var GoogleMaps = {
35013502
data.circles.push(circle.toJSON());
35023503
});
35033504

3505+
_.each(this.groundOverlays, function(overlay) {
3506+
data.overlays.push(overlay.toJSON());
3507+
});
3508+
35043509
var view = new GoogleMaps.Views.MapList({
35053510
map: this,
35063511
model: new Backbone.Model(data)
@@ -3943,6 +3948,22 @@ var GoogleMaps = {
39433948
e.preventDefault();
39443949
});
39453950

3951+
this.$el.find('.overlay-undo').click(function(e) {
3952+
var index = $(this).parent().index();
3953+
var overlay = t.map.groundOverlays[index];
3954+
3955+
overlay.set('deleted', false);
3956+
overlay.get('api').setMap(t.map.api);
3957+
3958+
t.model.get('groundOverlays')[index].deleted = false;
3959+
3960+
t.map.center();
3961+
t.map.updateHiddenField();
3962+
t.render();
3963+
3964+
e.preventDefault();
3965+
});
3966+
39463967
this.$el.find('.marker-center').click(function(e) {
39473968
var index = $(this).parent().index();
39483969
var marker = t.map.markers[index];
@@ -4006,6 +4027,15 @@ var GoogleMaps = {
40064027

40074028
e.preventDefault();
40084029
});
4030+
4031+
this.$el.find('.overlay-center').click(function(e) {
4032+
var index = $(this).parent().index();
4033+
var overlay = t.map.groundOverlays[index];
4034+
4035+
t.map.fitBounds(overlay.getBounds());
4036+
4037+
e.preventDefault();
4038+
});
40094039
}
40104040

40114041
});

resources/js/app.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/app/templates/map-list.handlebars

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,16 @@
6060
{{#forEach circles}}
6161
<li>{{#if this.deleted}}<span class="oh-google-map-strike-out">{{/if}}<a href="#" class="circle-center">{{#if this.title}}{{../this.title}}{{/if}}{{#not this.title}}Circle {{../count}}{{/not}}</a>{{#if this.deleted}}</span> <a href="#" class="circle-undo oh-google-map-small-text">Undo Delete</a>{{/if}}{{#not this.deleted}}<span class="actions"><a href="#" class="edit" data-property="circles"><span data-icon="edit"></span></a> <a href="#" class="delete" data-property="circles"><span data-icon="trash"></span></a></span>{{/not}}</li>
6262
{{/forEach}}
63+
</ol>
64+
65+
<h2>Images</h2>
66+
67+
{{#not overlays.length}}
68+
<p>There are no images on the map.</p>
69+
{{/not}}
70+
71+
<ol class="oh-google-map-ordered-list">
72+
{{#forEach overlays}}
73+
<li>{{#if this.deleted}}<span class="oh-google-map-strike-out">{{/if}}<a href="#" class="overlay-center">{{#if this.title}}{{../this.title}}{{/if}}{{#not this.title}}Image {{../count}}{{/not}}</a>{{#if this.deleted}}</span> <a href="#" class="circle-undo oh-google-map-small-text">Undo Delete</a>{{/if}}{{#not this.deleted}}<span class="actions"><a href="#" class="edit" data-property="groundOverlays"><span data-icon="edit"></span></a> <a href="#" class="delete" data-property="groundOverlays"><span data-icon="trash"></span></a></span>{{/not}}</li>
74+
{{/forEach}}
6375
</ol>

resources/js/app/views/Map.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@
346346
polygons: [],
347347
polylines: [],
348348
routes: [],
349-
circles: []
349+
circles: [],
350+
overlays: []
350351
};
351352

352353
_.each(this.markers, function(marker) {
@@ -369,6 +370,10 @@
369370
data.circles.push(circle.toJSON());
370371
});
371372

373+
_.each(this.groundOverlays, function(overlay) {
374+
data.overlays.push(overlay.toJSON());
375+
});
376+
372377
var view = new GoogleMaps.Views.MapList({
373378
map: this,
374379
model: new Backbone.Model(data)

resources/js/app/views/MapList.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,22 @@
122122
e.preventDefault();
123123
});
124124

125+
this.$el.find('.overlay-undo').click(function(e) {
126+
var index = $(this).parent().index();
127+
var overlay = t.map.groundOverlays[index];
128+
129+
overlay.set('deleted', false);
130+
overlay.get('api').setMap(t.map.api);
131+
132+
t.model.get('groundOverlays')[index].deleted = false;
133+
134+
t.map.center();
135+
t.map.updateHiddenField();
136+
t.render();
137+
138+
e.preventDefault();
139+
});
140+
125141
this.$el.find('.marker-center').click(function(e) {
126142
var index = $(this).parent().index();
127143
var marker = t.map.markers[index];
@@ -185,6 +201,15 @@
185201

186202
e.preventDefault();
187203
});
204+
205+
this.$el.find('.overlay-center').click(function(e) {
206+
var index = $(this).parent().index();
207+
var overlay = t.map.groundOverlays[index];
208+
209+
t.map.fitBounds(overlay.getBounds());
210+
211+
e.preventDefault();
212+
});
188213
}
189214

190215
});

resources/js/templates.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,45 @@ function program46(depth0,data) {
631631
return "<span class=\"actions\"><a href=\"#\" class=\"edit\" data-property=\"circles\"><span data-icon=\"edit\"></span></a> <a href=\"#\" class=\"delete\" data-property=\"circles\"><span data-icon=\"trash\"></span></a></span>";
632632
}
633633

634+
function program48(depth0,data) {
635+
636+
637+
return "\n<p>There are no images on the map.</p>\n";
638+
}
639+
640+
function program50(depth0,data) {
641+
642+
var buffer = "", stack1, helper, options;
643+
buffer += "\n <li>";
644+
stack1 = helpers['if'].call(depth0, (depth0 && depth0.deleted), {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
645+
if(stack1 || stack1 === 0) { buffer += stack1; }
646+
buffer += "<a href=\"#\" class=\"overlay-center\">";
647+
stack1 = helpers['if'].call(depth0, (depth0 && depth0.title), {hash:{},inverse:self.noop,fn:self.programWithDepth(13, program13, data, depth0),data:data});
648+
if(stack1 || stack1 === 0) { buffer += stack1; }
649+
stack1 = (helper = helpers.not || (depth0 && depth0.not),options={hash:{},inverse:self.noop,fn:self.programWithDepth(51, program51, data, depth0),data:data},helper ? helper.call(depth0, (depth0 && depth0.title), options) : helperMissing.call(depth0, "not", (depth0 && depth0.title), options));
650+
if(stack1 || stack1 === 0) { buffer += stack1; }
651+
buffer += "</a>";
652+
stack1 = helpers['if'].call(depth0, (depth0 && depth0.deleted), {hash:{},inverse:self.noop,fn:self.program(44, program44, data),data:data});
653+
if(stack1 || stack1 === 0) { buffer += stack1; }
654+
stack1 = (helper = helpers.not || (depth0 && depth0.not),options={hash:{},inverse:self.noop,fn:self.program(53, program53, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.deleted), options) : helperMissing.call(depth0, "not", (depth0 && depth0.deleted), options));
655+
if(stack1 || stack1 === 0) { buffer += stack1; }
656+
buffer += "</li>\n";
657+
return buffer;
658+
}
659+
function program51(depth0,data,depth1) {
660+
661+
var buffer = "", stack1;
662+
buffer += "Image "
663+
+ escapeExpression(((stack1 = (depth1 && depth1.count)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
664+
return buffer;
665+
}
666+
667+
function program53(depth0,data) {
668+
669+
670+
return "<span class=\"actions\"><a href=\"#\" class=\"edit\" data-property=\"groundOverlays\"><span data-icon=\"edit\"></span></a> <a href=\"#\" class=\"delete\" data-property=\"groundOverlays\"><span data-icon=\"trash\"></span></a></span>";
671+
}
672+
634673
buffer += "<h2>Markers</h2>\n\n<a href=\"#\" class=\"cancel oh-google-map-close\">&times; close</a>\n\n";
635674
stack1 = (helper = helpers.not || (depth0 && depth0.not),options={hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data},helper ? helper.call(depth0, ((stack1 = (depth0 && depth0.markers)),stack1 == null || stack1 === false ? stack1 : stack1.length), options) : helperMissing.call(depth0, "not", ((stack1 = (depth0 && depth0.markers)),stack1 == null || stack1 === false ? stack1 : stack1.length), options));
636675
if(stack1 || stack1 === 0) { buffer += stack1; }
@@ -661,6 +700,12 @@ function program46(depth0,data) {
661700
buffer += "\n\n<ol class=\"oh-google-map-ordered-list\">\n";
662701
stack1 = (helper = helpers.forEach || (depth0 && depth0.forEach),options={hash:{},inverse:self.noop,fn:self.program(41, program41, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.circles), options) : helperMissing.call(depth0, "forEach", (depth0 && depth0.circles), options));
663702
if(stack1 || stack1 === 0) { buffer += stack1; }
703+
buffer += "\n</ol>\n\n<h2>Images</h2>\n\n";
704+
stack1 = (helper = helpers.not || (depth0 && depth0.not),options={hash:{},inverse:self.noop,fn:self.program(48, program48, data),data:data},helper ? helper.call(depth0, ((stack1 = (depth0 && depth0.overlays)),stack1 == null || stack1 === false ? stack1 : stack1.length), options) : helperMissing.call(depth0, "not", ((stack1 = (depth0 && depth0.overlays)),stack1 == null || stack1 === false ? stack1 : stack1.length), options));
705+
if(stack1 || stack1 === 0) { buffer += stack1; }
706+
buffer += "\n\n<ol class=\"oh-google-map-ordered-list\">\n";
707+
stack1 = (helper = helpers.forEach || (depth0 && depth0.forEach),options={hash:{},inverse:self.noop,fn:self.program(50, program50, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.overlays), options) : helperMissing.call(depth0, "forEach", (depth0 && depth0.overlays), options));
708+
if(stack1 || stack1 === 0) { buffer += stack1; }
664709
buffer += "\n</ol>";
665710
return buffer;
666711
});

0 commit comments

Comments
 (0)