diff --git a/source/class/mobileedd/MoreLayers.js b/source/class/mobileedd/MoreLayers.js index 684b6e9..76af2e2 100644 --- a/source/class/mobileedd/MoreLayers.js +++ b/source/class/mobileedd/MoreLayers.js @@ -101,13 +101,14 @@ qx.Class.define("mobileedd.MoreLayers", { var me = this; Object.keys(me.layers).forEach(function(obj) { - try{ - if (bool) { - me.html[obj].setVisibility('visible'); - } else { - me.html[obj].setVisibility('excluded'); - } - }catch(e){ + try { + if (bool) { + me.html[obj].setVisibility('visible'); + } else { + me.html[obj].setVisibility('excluded'); + } + }catch (e) + { //not defined } }) diff --git a/source/class/mobileedd/Radar.js b/source/class/mobileedd/Radar.js index 33fbadd..5aa38a8 100644 --- a/source/class/mobileedd/Radar.js +++ b/source/class/mobileedd/Radar.js @@ -29,9 +29,8 @@ qx.Class.define("mobileedd.Radar", init : 5, apply : "changeFrames" }, - active: - { - init: true + active : { + init : true } }, construct : function() diff --git a/source/class/mobileedd/RadarPhase.js b/source/class/mobileedd/RadarPhase.js index 47ed85e..2f76402 100644 --- a/source/class/mobileedd/RadarPhase.js +++ b/source/class/mobileedd/RadarPhase.js @@ -29,9 +29,8 @@ qx.Class.define("mobileedd.RadarPhase", init : 5, apply : "changeFrames" }, - active: - { - init: false + active : { + init : false } }, construct : function() @@ -59,6 +58,7 @@ qx.Class.define("mobileedd.RadarPhase", }); // Set up the query timestamp request + // Need to use EDD's since UW's server doesn't serve the correct response type: text/json rather than application/json me.timesReq = new qx.io.request.Jsonp("http://preview.weather.gov/edd/resource/edd/universities/getUWVectorTimes.php?layer=nexrphase"); @@ -225,7 +225,7 @@ qx.Class.define("mobileedd.RadarPhase", Object.keys(me.radarPhaseLayers).sort().forEach(function(obj, index) { if (me.getSliderIndex() == index) { - me.timeMessage.setData(new moment.utc(obj,"YYYYMMDD.HHmmss").toDate()); + me.timeMessage.setData(new moment.utc(obj, "YYYYMMDD.HHmmss").toDate()); me.bus.dispatch(me.timeMessage); } }, this); @@ -244,12 +244,12 @@ qx.Class.define("mobileedd.RadarPhase", me.radarPhaseLayers[time] = new ol.layer.Tile( { name : "UW - " + time, - source : new ol.source.XYZ( - { - url : me.c.getSecure() + '//realearth.ssec.wisc.edu/proxy/image.php?products=nexrphase_' + time.replace('.','_') + '&x={x}&y={y}&z={z}' + source : new ol.source.XYZ( { + url : me.c.getSecure() + '//realearth.ssec.wisc.edu/proxy/image.php?products=nexrphase_' + time.replace('.', '_') + '&x={x}&y={y}&z={z}' }) }); me.map.addLayer(me.radarPhaseLayers[time]); + // me.radarPhaseLayers[time].setVisible(false); me.radarPhaseLayers[time].setOpacity(me.getOpacity()); diff --git a/source/class/mobileedd/page/Map.js b/source/class/mobileedd/page/Map.js index 5c723ab..0c70c72 100644 --- a/source/class/mobileedd/page/Map.js +++ b/source/class/mobileedd/page/Map.js @@ -86,8 +86,8 @@ qx.Class.define("mobileedd.page.Map", /** * Mapping Library * */ - me.setMapUri("resource/mobileedd/ol.js"); + //me.setMapUri("resource/mobileedd/ol-debug.js"); // Warning types @@ -378,8 +378,6 @@ qx.Class.define("mobileedd.page.Map", var me = this; this.base(arguments); this._loadMapLibrary(); - - // me.drawer me.drawer = new qx.ui.mobile.container.Drawer(); @@ -481,8 +479,7 @@ qx.Class.define("mobileedd.page.Map", me.radarContainer = new qx.ui.mobile.container.Composite(); me.radarContainer.setLayout(new qx.ui.mobile.layout.VBox()); - -// Precipitation Type + // Precipitation Type var radarPhaseComposite = new qx.ui.mobile.container.Composite(); radarPhaseComposite.setLayout(new qx.ui.mobile.layout.HBox()); me.phaseControl = new qx.ui.mobile.form.ToggleButton(false, "Yes", "No"); @@ -582,24 +579,26 @@ qx.Class.define("mobileedd.page.Map", }); me.radarLoopSlider.addListener("changeValue", function(e) { - var uwRadar = mobileedd.RadarPhase.getInstance(); - var radarMrms = mobileedd.Radar.getInstance(); - if(me.phaseControl.getValue()){ - if(radarMrms.getActive()){ - radarMrms.stop(true); + var uwRadar = mobileedd.RadarPhase.getInstance(); + var radarMrms = mobileedd.Radar.getInstance(); + + // Handle which source is active Radar precip or MRMS + if (me.phaseControl.getValue()) + { + if (radarMrms.getActive()) + { + radarMrms.stop(true); radarMrms.setActive(false); uwRadar.setActive(true); uwRadar.start(); me.radarLegendImage.setSource(me.c.getSecure() + "//realearth.ssec.wisc.edu/proxy/legend.php?products=nexrphase"); } - - - uwRadar.setSliderIndex(e.getData()); - - }else{ - if(uwRadar.getActive()){ - uwRadar.stop(true); + } else + { + if (uwRadar.getActive()) + { + uwRadar.stop(true); uwRadar.setActive(false); radarMrms.setActive(true); radarMrms.start(); @@ -607,9 +606,6 @@ qx.Class.define("mobileedd.page.Map", } radarMrms.setSliderIndex(e.getData()); } - - - }, this); radarLoopSliderComposite.add(me.radarLoopSlider, { flex : 1 @@ -1168,12 +1164,11 @@ qx.Class.define("mobileedd.page.Map", items.push('Cancel'); var model = new qx.data.Array(items); var menu = new qx.ui.mobile.dialog.Menu(model); - new qx.bom.Selector.query('li>div>div', menu.getContainerElement()).forEach(function(div, index2) - { - if (div.innerHTML.indexOf("Cancel") !== -1) { - qx.bom.element.Style.setCss(new qx.bom.Selector.query('li', menu.getContainerElement())[index2 / 2], 'color:blue;') - } - }) + new qx.bom.Selector.query('li>div>div', menu.getContainerElement()).forEach(function(div, index2) { + if (div.innerHTML.indexOf("Cancel") !== -1) { + qx.bom.element.Style.setCss(new qx.bom.Selector.query('li', menu.getContainerElement())[index2 / 2], 'color:blue;') + } + }) menu.show(); // Loop through More Layers layers to find which ones are selected then color the background green @@ -1211,12 +1206,11 @@ qx.Class.define("mobileedd.page.Map", subitems.push('Cancel'); var submodel = new qx.data.Array(subitems); var submenu = new qx.ui.mobile.dialog.Menu(submodel); - new qx.bom.Selector.query('li>div>div', submenu.getContainerElement()).forEach(function(div, index2) - { - if (div.innerHTML.indexOf("Cancel") !== -1) { - qx.bom.element.Style.setCss(new qx.bom.Selector.query('li', submenu.getContainerElement())[index2 / 2], 'color:blue;') - } - }) + new qx.bom.Selector.query('li>div>div', submenu.getContainerElement()).forEach(function(div, index2) { + if (div.innerHTML.indexOf("Cancel") !== -1) { + qx.bom.element.Style.setCss(new qx.bom.Selector.query('li', submenu.getContainerElement())[index2 / 2], 'color:blue;') + } + }) submenu.show(); // Loop through More Layers layers to find which ones are selected then color the background green @@ -1288,12 +1282,11 @@ qx.Class.define("mobileedd.page.Map", options.push('Cancel'); var model = new qx.data.Array(options); var menu = new qx.ui.mobile.dialog.Menu(model); - new qx.bom.Selector.query('li>div>div', menu.getContainerElement()).forEach(function(div, index2) - { - if (div.innerHTML.indexOf("Cancel") !== -1) { - qx.bom.element.Style.setCss(new qx.bom.Selector.query('li', menu.getContainerElement())[index2 / 2], 'color:blue;') - } - }) + new qx.bom.Selector.query('li>div>div', menu.getContainerElement()).forEach(function(div, index2) { + if (div.innerHTML.indexOf("Cancel") !== -1) { + qx.bom.element.Style.setCss(new qx.bom.Selector.query('li', menu.getContainerElement())[index2 / 2], 'color:blue;') + } + }) menu.show(); menu.addListener("changeSelection", function(evt) { @@ -1422,16 +1415,13 @@ qx.Class.define("mobileedd.page.Map", }, this); scrollContainer.add(showPopupButton); - - /** - * Feedback - * */ + /** + * Feedback + * */ var feedbackButton = new qx.ui.mobile.form.Button("Feedback", "resource/mobileedd/images/feedback.png"); - feedbackButton.addListener("tap", function(e) - { + feedbackButton.addListener("tap", function(e) { window.open('http://www.nws.noaa.gov/survey/nws-survey.php?code=EEDD', '_blank'); }, this); - scrollContainer.add(feedbackButton); /** @@ -1514,6 +1504,7 @@ qx.Class.define("mobileedd.page.Map", var me = this; me.loopControl.setValue(false); me.radarToggleButton.setValue(false); + // me.phaseControl.setValue(false); // me.longLoop.setValue(false); @@ -1584,7 +1575,7 @@ qx.Class.define("mobileedd.page.Map", url += '&r='; url += me.radarToggleButton.getValue() ? 'T' : 'F'; url += '&pc='; - url += me.phaseControl.getValue() ? 'T' :'F'; + url += me.phaseControl.getValue() ? 'T' : 'F'; // url += '&rll='; @@ -1708,7 +1699,6 @@ qx.Class.define("mobileedd.page.Map", me.loopControl.setValue(bool); var bool = me.getURLParameter('r') == "T" ? true : false; me.radarToggleButton.setValue(bool); - var bool = me.getURLParameter('pc') == "T" ? true : false; me.phaseControl.setValue(bool); @@ -2475,11 +2465,6 @@ qx.Class.define("mobileedd.page.Map", // Add state overlay //me.addStatesLayer(); - - - - - }.bind(this); req.open("GET", this.getMapUri()); req.send(); @@ -2865,12 +2850,11 @@ qx.Class.define("mobileedd.page.Map", items.push('Cancel'); var model = new qx.data.Array(items); var menu = new qx.ui.mobile.dialog.Menu(model); - new qx.bom.Selector.query('li>div>div', menu.getContainerElement()).forEach(function(div, index2) - { - if (div.innerHTML.indexOf("Cancel") !== -1) { - qx.bom.element.Style.setCss(new qx.bom.Selector.query('li', menu.getContainerElement())[index2 / 2], 'color:blue;') - } - }) + new qx.bom.Selector.query('li>div>div', menu.getContainerElement()).forEach(function(div, index2) { + if (div.innerHTML.indexOf("Cancel") !== -1) { + qx.bom.element.Style.setCss(new qx.bom.Selector.query('li', menu.getContainerElement())[index2 / 2], 'color:blue;') + } + }) menu.show(); menu.addListener("changeSelection", function(evt) { diff --git a/source/class/mobileedd/page/PageTravelHazards.js b/source/class/mobileedd/page/PageTravelHazards.js index 1ed479a..887c8ec 100644 --- a/source/class/mobileedd/page/PageTravelHazards.js +++ b/source/class/mobileedd/page/PageTravelHazards.js @@ -11,6 +11,7 @@ /*global qx*/ /*global ol*/ + /*global moment*/ /** @@ -34,11 +35,12 @@ qx.Class.define("mobileedd.page.PageTravelHazards", } // Putting these up here so they're not as annoying to the user to have to initialize the travel instance - // Origin + + // Origin this.__start = new qx.ui.mobile.form.TextField().set( { placeholder : "Type location or tap the map." }); - + // Destination this.__end = new qx.ui.mobile.form.TextField().set( { placeholder : "Type location or tap the map."