Skip to content

Commit a5fdbd2

Browse files
small tweaks
* a few commends explaining the code * removed timestamp being added to tile files, their servers provide decent expiration headers, should work fine to get the latest
1 parent 5c14613 commit a5fdbd2

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ <h2>Weather
187187
</svg>
188188
</h2>
189189
<hr>
190-
<span>Here you can access various weather overlays. This an experimental feature.</span>
190+
<span>Here you can access various weather overlays. This an <b>experimental feature</b>. Mobile users be aware that this can quickly eat your data allowance.</span>
191191
<br />
192192
<br />
193193
</div>

js/app.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,8 @@ $(window).ready(function() {
623623
}
624624

625625
// weather feature
626+
627+
// north america overlays
626628
var overlayList = [
627629
['nexrad-n0q-900913', 'NEXRAD Base Reflectivity'],
628630
['goes-ir-4km-900913', 'GOES NA Infrared ~4km'],
@@ -645,8 +647,9 @@ $(window).ready(function() {
645647
['q2-hsr-900913', 'MRMS Hybrid-Scan Reflectivity Composite.'],
646648
];
647649

650+
// generate the list of switches for each overlay
648651
var elm = $("#weatherbox .slimContainer");
649-
elm.append("<h4>Americas</h4><hr>");
652+
elm.append("<h4>North America</h4><hr>");
650653

651654
var i;
652655
for(i in overlayList) {
@@ -664,6 +667,7 @@ $(window).ready(function() {
664667
elm.append(html);
665668
}
666669

670+
// the magic that makes the switches do things
667671
elm.find(".switch").click(function() {
668672
var e = $(this);
669673
var name = e.attr('id').replace('sw', 'opt');
@@ -674,6 +678,7 @@ $(window).ready(function() {
674678
e.removeClass('on').addClass('off');
675679
on = 0;
676680
} else {
681+
// only one overlay at a time
677682
$("#weatherbox .switch").removeClass('on').addClass('off');
678683
e.removeClass('off').addClass('on');
679684
on = 1;

js/tracker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var plot = null;
5151
var weatherOverlayId = "nexrad-n0q-900913";
5252
var weatherOverlay = new google.maps.ImageMapType({
5353
getTileUrl: function(tile, zoom) {
54-
return "http://mesonet.agron.iastate.edu/cache/tile.py/1.0.0/"+weatherOverlayId+"/" + zoom + "/" + tile.x + "/" + tile.y +".png?"+ (new Date()).getTime();
54+
return "http://mesonet.agron.iastate.edu/cache/tile.py/1.0.0/"+weatherOverlayId+"/" + zoom + "/" + tile.x + "/" + tile.y +".png";
5555
},
5656
tileSize: new google.maps.Size(256, 256),
5757
opacity:0.8,

0 commit comments

Comments
 (0)