Skip to content

Commit 8ac30d7

Browse files
Merge branch 'feature-weather'
* feature-weather: added global weather overlays from NRL added METOSAT MPE data small tweaks renamed overlays to make them shorter added weather data overlays
2 parents ba9a868 + 3ec7bfe commit 8ac30d7

File tree

4 files changed

+211
-0
lines changed

4 files changed

+211
-0
lines changed

glyphs/icon-weather.svg

Lines changed: 74 additions & 0 deletions
Loading

index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
<li class="home"><i class="icon-habhub"></i></li>
4040
<li class="chasecar" style="display: none"><i class="icon-car"></i></li>
4141
<li class="settings"><i class="icon-settings"></i></li>
42+
<li class="weather">
43+
<svg width="100%" height="100%" viewbox="0 0 35 40" version="1.1">
44+
<path style="fill:#ffffff;" d="M 18.28125,5 C 17.665689,5.1577701 18.03897,6.072102 17.9375,6.6048171 17.961629,7.7933649 17.891319,9.0210305 17.96875,10.1875 18.260664,10.655295 18.988694,10.16755 19.495121,10.179003 19.915569,10.180314 20.482932,9.9817615 20.218593,9.5070668 19.685242,8.0689805 19.166647,6.5372411 18.625,5.15625 18.528924,5.0654291 18.420762,5.0014609 18.28125,5 z M 28.15625,6.78125 C 27.636383,7.0532274 27.291342,7.7650855 26.831767,8.2022559 26.183602,9.0036626 25.432231,9.7753304 24.84375,10.59375 24.760617,11.249334 25.657959,11.271078 26.078986,11.644576 26.390422,11.953835 26.933703,11.952146 27.000157,11.538317 27.50744,10.067568 28.117357,8.594139 28.5625,7.125 28.492656,6.9017107 28.410263,6.7690543 28.15625,6.78125 z M 9.5,10 C 9.0954231,10.135594 9.2373811,10.695886 9.5795967,10.908518 10.537018,12.015516 11.460558,13.256267 12.4375,14.28125 13.029751,14.410245 13.239648,13.580555 13.666521,13.22967 13.9948,13.00156 14.131018,12.482443 13.78125,12.375 12.489706,11.554805 11.012447,10.783392 9.71875,10 9.6458333,10 9.5729167,10 9.5,10 z M 20.84375,11.84375 C 18.371908,11.824599 15.919598,13.01633 14.4375,15 11.081301,15.152911 7.9058815,17.160924 6.28125,20.09375 2.2666586,20.646663 -0.69921244,24.862902 0.11714748,28.826804 0.69396943,32.528614 4.3500351,35.295394 8.0531848,35 13.498142,34.979277 18.945738,35.041925 24.389003,34.967703 28.012052,34.706771 30.775569,30.845122 29.836019,27.330847 29.833738,25.300645 26.765497,24.336816 28.355407,22.48894 29.815113,18.665861 27.745092,13.988203 23.952748,12.472903 22.972942,12.055889 21.908328,11.842683 20.84375,11.84375 z M 20.21875,13.59375 C 23.527165,13.23952 26.784739,15.868299 27.030581,19.205159 27.115191,20.410269 26.970056,22.322167 26.040039,22.926528 23.85825,22.779121 24.34015,19.916014 22.792045,18.711734 21.278161,16.832506 19.06924,15.524713 16.6875,15.125 17.664583,14.25896 18.917452,13.711132 20.21875,13.59375 z M 34.53125,14.5 C 32.976676,14.79175 31.359523,14.999412 29.84375,15.34375 29.432201,15.70465 29.988892,16.309044 30.057328,16.768486 30.153946,17.218356 30.409976,17.817605 30.892161,17.453583 32.226329,16.650798 33.669292,15.884461 34.9375,15.0625 35.138066,14.780605 34.838029,14.456276 34.53125,14.5 z M 15,16.75 C 18.527258,16.691328 21.880457,19.184293 22.875,22.5625 21.79535,22.747412 19.681154,23.400321 19.66679,24.380589 20.173956,24.71003 20.627331,25.845369 21.195407,25.029384 23.413999,23.416094 26.91018,24.431242 27.896354,26.999192 29.087621,29.561636 27.239462,32.866375 24.435283,33.198105 21.16923,33.314717 17.892696,33.218673 14.62245,33.25 11.957151,33.213512 9.2843705,33.327734 6.6243627,33.183689 3.2643734,32.772467 0.9055326,29.012617 2.003206,25.808244 2.6850371,23.482227 4.9843514,21.775323 7.40625,21.78125 8.6597695,18.794322 11.749593,16.71468 15,16.75 z M 30.46875,22.1875 C 30.056841,22.438736 30.028318,23.215643 29.779714,23.682554 29.505486,24.023058 29.684998,24.517691 30.15025,24.501295 31.642521,24.753547 33.129447,25.065901 34.625,25.28125 35.096754,25.222871 35.037983,24.560567 34.590363,24.47021 33.258254,23.721082 31.923603,22.888061 30.59375,22.1875 30.552083,22.1875 30.510417,22.1875 30.46875,22.1875 z" />
45+
</svg>
46+
</li>
4247
<li class="embed">
4348
<svg width="100%" height="100%" viewbox="0 0 35 40" version="1.1">
4449
<path style="fill:#ffffff;" d="m19.188,4.0378c-1.698,10.6-3.396,21.2-5.094,31.8,1.478,0.9,2.037-0.6,2.024-1.7,1.607-10.1,3.213-20.1,4.82-30.1h-1.75zm-6.469,5.3c-3.9064,3-7.8129,6-11.719,9v3.7c3.9045,3,7.8143,6,11.719,9v-3.9c-3.0949-2.3-6.1868-4.6-9.2815-7,3.0937-2.3,6.1875-4.6,9.2815-6.9v-3.9zm9.562,0v3.9c3.094,2.3,6.188,4.6,9.281,6.9-3.093,2.4-6.187,4.7-9.281,7v3.9c3.905-3,7.814-6,11.719-9v-3.7c-3.906-3-7.813-6-11.719-9z"/>
@@ -174,6 +179,17 @@ <h2><i class="icon-settings rfloat"></i>Settings</h2>
174179
</div>
175180
</div>
176181
</div>
182+
<div id="weatherbox" style="display: none" class="flatpage">
183+
<div class="slimContainer">
184+
<h2>Weather
185+
<svg width="35" height="40" viewbox="0 0 35 40" version="1.1" class="rfloat">
186+
<path style="fill:#666666;" d="M 18.28125,5 C 17.665689,5.1577701 18.03897,6.072102 17.9375,6.6048171 17.961629,7.7933649 17.891319,9.0210305 17.96875,10.1875 18.260664,10.655295 18.988694,10.16755 19.495121,10.179003 19.915569,10.180314 20.482932,9.9817615 20.218593,9.5070668 19.685242,8.0689805 19.166647,6.5372411 18.625,5.15625 18.528924,5.0654291 18.420762,5.0014609 18.28125,5 z M 28.15625,6.78125 C 27.636383,7.0532274 27.291342,7.7650855 26.831767,8.2022559 26.183602,9.0036626 25.432231,9.7753304 24.84375,10.59375 24.760617,11.249334 25.657959,11.271078 26.078986,11.644576 26.390422,11.953835 26.933703,11.952146 27.000157,11.538317 27.50744,10.067568 28.117357,8.594139 28.5625,7.125 28.492656,6.9017107 28.410263,6.7690543 28.15625,6.78125 z M 9.5,10 C 9.0954231,10.135594 9.2373811,10.695886 9.5795967,10.908518 10.537018,12.015516 11.460558,13.256267 12.4375,14.28125 13.029751,14.410245 13.239648,13.580555 13.666521,13.22967 13.9948,13.00156 14.131018,12.482443 13.78125,12.375 12.489706,11.554805 11.012447,10.783392 9.71875,10 9.6458333,10 9.5729167,10 9.5,10 z M 20.84375,11.84375 C 18.371908,11.824599 15.919598,13.01633 14.4375,15 11.081301,15.152911 7.9058815,17.160924 6.28125,20.09375 2.2666586,20.646663 -0.69921244,24.862902 0.11714748,28.826804 0.69396943,32.528614 4.3500351,35.295394 8.0531848,35 13.498142,34.979277 18.945738,35.041925 24.389003,34.967703 28.012052,34.706771 30.775569,30.845122 29.836019,27.330847 29.833738,25.300645 26.765497,24.336816 28.355407,22.48894 29.815113,18.665861 27.745092,13.988203 23.952748,12.472903 22.972942,12.055889 21.908328,11.842683 20.84375,11.84375 z M 20.21875,13.59375 C 23.527165,13.23952 26.784739,15.868299 27.030581,19.205159 27.115191,20.410269 26.970056,22.322167 26.040039,22.926528 23.85825,22.779121 24.34015,19.916014 22.792045,18.711734 21.278161,16.832506 19.06924,15.524713 16.6875,15.125 17.664583,14.25896 18.917452,13.711132 20.21875,13.59375 z M 34.53125,14.5 C 32.976676,14.79175 31.359523,14.999412 29.84375,15.34375 29.432201,15.70465 29.988892,16.309044 30.057328,16.768486 30.153946,17.218356 30.409976,17.817605 30.892161,17.453583 32.226329,16.650798 33.669292,15.884461 34.9375,15.0625 35.138066,14.780605 34.838029,14.456276 34.53125,14.5 z M 15,16.75 C 18.527258,16.691328 21.880457,19.184293 22.875,22.5625 21.79535,22.747412 19.681154,23.400321 19.66679,24.380589 20.173956,24.71003 20.627331,25.845369 21.195407,25.029384 23.413999,23.416094 26.91018,24.431242 27.896354,26.999192 29.087621,29.561636 27.239462,32.866375 24.435283,33.198105 21.16923,33.314717 17.892696,33.218673 14.62245,33.25 11.957151,33.213512 9.2843705,33.327734 6.6243627,33.183689 3.2643734,32.772467 0.9055326,29.012617 2.003206,25.808244 2.6850371,23.482227 4.9843514,21.775323 7.40625,21.78125 8.6597695,18.794322 11.749593,16.71468 15,16.75 z M 30.46875,22.1875 C 30.056841,22.438736 30.028318,23.215643 29.779714,23.682554 29.505486,24.023058 29.684998,24.517691 30.15025,24.501295 31.642521,24.753547 33.129447,25.065901 34.625,25.28125 35.096754,25.222871 35.037983,24.560567 34.590363,24.47021 33.258254,23.721082 31.923603,22.888061 30.59375,22.1875 30.552083,22.1875 30.510417,22.1875 30.46875,22.1875 z" />
187+
</svg>
188+
</h2>
189+
<hr>
190+
<p>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.</p>
191+
</div>
192+
</div>
177193
<div id="chasecarbox" style="display: none" class="flatpage">
178194
<div class="slimContainer">
179195
<h2>Chase car mode</h2>

js/app.js

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,4 +621,104 @@ $(window).ready(function() {
621621
// immediatelly check for position
622622
//positionUpdateHandle();
623623
}
624+
625+
// weather feature
626+
627+
// list of overlays
628+
var overlayList = [
629+
['Global', [
630+
['nrl-global-cloudtop','NRL Monterey Cloudtop'],
631+
['nrl-global-ir','NRL Monterey IR'],
632+
['nrl-global-vapor','NRL Monterey Vapor']
633+
]],
634+
['Europe/Africa', [
635+
['meteosat-Odeg-MPE', 'METEOSAT Precip. Estimate']
636+
]],
637+
['Indian Ocean', [
638+
['meteosat-iodc-MPE', 'METEOSAT IODC Precip. Est.']
639+
]],
640+
['North America', [
641+
['nexrad-n0q-900913', 'NEXRAD Base Reflectivity'],
642+
['goes-ir-4km-900913', 'GOES NA Infrared ~4km'],
643+
['goes-wv-4km-900913', 'GOES NA Water Vapor ~4km'],
644+
['goes-vis-1km-900913', 'GOES NA Visible ~1km'],
645+
['goes-east-ir-4km-900913', 'GOES East CONUS Infrared'],
646+
['goes-east-wv-4km-900913', 'GOES East CONUS Water Vapor'],
647+
['goes-east-vis-1km-900913', 'GOES East CONUS Visible'],
648+
['goes-west-ir-4km-900913', 'GOES West CONUS Infrared'],
649+
['goes-west-wv-4km-900913', 'GOES West CONUS Water Vapor'],
650+
['goes-west-vis-1km-900913', 'GOES West CONUS Visible'],
651+
['hawaii-vis-900913', 'GOES West Hawaii Visible'],
652+
['alaska-vis-900913', 'GOES West Alaska Visible'],
653+
['alaska-ir-900913', 'GOES West Alaska IR'],
654+
['alaska-wv-900913', 'GOES West Alaska Water Vapor'],
655+
['q2-n1p-900913', 'Q2 1 Hour Precipitation'],
656+
['q2-p24h-900913', 'Q2 24 Hour Precipitation'],
657+
['q2-p48h-900913', 'Q2 48 Hour Precipitation'],
658+
['q2-p72h-900913', 'Q2 72 Hour Precipitation'],
659+
['q2-hsr-900913', 'MRMS Hybrid-Scan Reflectivity Composite.']
660+
]]
661+
];
662+
663+
// generate the list of switches for each overlay
664+
var elm = $("#weatherbox .slimContainer");
665+
var j;
666+
for(j in overlayList) {
667+
var region = overlayList[j][0];
668+
var switches = overlayList[j][1];
669+
670+
elm.append("<h4>"+region+"</h4><hr>");
671+
672+
var i;
673+
for(i in switches) {
674+
var id = switches[i][0];
675+
var name = switches[i][1];
676+
677+
var html = '<div class="row option">'
678+
+ '<span><b>'+name+'</b></span>'
679+
+ '<div class="switch off" id="sw_weather_'+id+'">'
680+
+ '<span class="thumb"></span>'
681+
+ '<input type="checkbox" id="opt_weather_'+id+'">'
682+
+ '</div>'
683+
+ '</div>';
684+
685+
elm.append(html);
686+
}
687+
}
688+
689+
// the magic that makes the switches do things
690+
elm.find(".switch").click(function() {
691+
var e = $(this);
692+
var name = e.attr('id').replace('sw', 'opt');
693+
var id = name.replace("opt_weather_","");
694+
var on;
695+
696+
if(e.hasClass('on')) {
697+
e.removeClass('on').addClass('off');
698+
on = 0;
699+
} else {
700+
// only one overlay at a time
701+
$("#weatherbox .switch").removeClass('on').addClass('off');
702+
e.removeClass('off').addClass('on');
703+
on = 1;
704+
}
705+
706+
weatherImageOverlay.setMap(null);
707+
map.overlayMapTypes.setAt("0", null);
708+
709+
if(on) {
710+
if(id in weatherImageOverlayList) {
711+
var o = weatherImageOverlayList[id];
712+
var sw = new google.maps.LatLng(o[1][0][0], o[1][0][1]);
713+
var ne = new google.maps.LatLng(o[1][1][0], o[1][1][1]);
714+
var bounds = new google.maps.LatLngBounds(sw, ne);
715+
weatherImageOverlay = new google.maps.GroundOverlay(o[0], bounds, {opacity: 0.7});
716+
weatherImageOverlay.setMap(map);
717+
return;
718+
}
719+
720+
weatherOverlayId = id;
721+
map.overlayMapTypes.setAt("0", weatherOverlay);
722+
}
723+
});
624724
});

js/tracker.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,27 @@ var ls_pred = false;
4747

4848
var plot = null;
4949

50+
// weather
51+
var weatherOverlayId = "nexrad-n0q-900913";
52+
var weatherOverlay = new google.maps.ImageMapType({
53+
getTileUrl: function(tile, zoom) {
54+
return "http://mesonet.agron.iastate.edu/cache/tile.py/1.0.0/"+weatherOverlayId+"/" + zoom + "/" + tile.x + "/" + tile.y +".png";
55+
},
56+
tileSize: new google.maps.Size(256, 256),
57+
opacity:0.8,
58+
isPng: true
59+
});
60+
61+
var weatherImageOverlayList = {
62+
'nrl-global-cloudtop': ['http://www.nrlmry.navy.mil/archdat/global/stitched/cloudtop/LATEST.jpg', [[-76, -179.9999], [76, 179.75]]],
63+
'nrl-global-ir': ['http://www.nrlmry.navy.mil/archdat/global/stitched/ir/LATEST.jpg', [[-65, -179.9999], [65, 179.75]]],
64+
'nrl-global-vapor': ['http://www.nrlmry.navy.mil/archdat/global/stitched/vapor/LATEST.jpg', [[-65, -179.9999], [65, 179.75]]],
65+
'meteosat-Odeg-MPE': ['http://oiswww.eumetsat.int/IPPS/html/GE/MET0D/GE_MET0D_VP-MPE.png', [[-57.492200, -57.492200], [57.492200, 57.492200]]],
66+
'meteosat-iodc-MPE': ['http://oiswww.eumetsat.int/IPPS/html/GE/IODC/GE_IODC_VP-MPE.png', [[-59.7901, -2.7919], [59.7901, 116.7913]]]
67+
};
68+
69+
var weatherImageOverlay = new google.maps.GroundOverlay();
70+
5071
var offline = {
5172
get: function(key) {
5273
if(typeof localStorage == 'undefined') return null;

0 commit comments

Comments
 (0)