From 280820834747847a9edcb3e524e65f830825938f Mon Sep 17 00:00:00 2001 From: Jeff Bliss Date: Fri, 23 Jul 2021 16:34:52 +0000 Subject: [PATCH 1/8] updated seldon in effort to fix broken share links. See commit 980ba834bf309f26e302df3e7039e689831f8050 in seldon for more info --- html/libs/seldon/js/init_openlayers.js | 15 ++++++++++++--- html/libs/seldon/seldon-min.js | 6 +++--- html/libs/seldon/seldon.js | 15 ++++++++++++--- libs/seldon | 2 +- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/html/libs/seldon/js/init_openlayers.js b/html/libs/seldon/js/init_openlayers.js index 8d9c6b3..1af6384 100644 --- a/html/libs/seldon/js/init_openlayers.js +++ b/html/libs/seldon/js/init_openlayers.js @@ -81,10 +81,19 @@ function initOpenLayers (baseLayerInfo, baseLayer, theme, themeOptions, initialE app.map.setLayerIndex(layer, 0); app.setTheme(theme, themeOptions); - var defaultZoom = 5 - app.map.setCenter(app.map.getCenter(), defaultZoom) + /*This block of code here feels a little hacky but I put this in here + to attempt to restore previous functionality of share links + initialExtent is equal to app.maxExtent if null and it shouldn't be null + for a share link.*/ + if (initialExtent != app.maxExtent) { + app.zoomToExtent(initialExtent); + } else { + var defaultZoom = 5; + app.map.setCenter(app.map.getCenter(), defaultZoom); + app.saveCurrentExtent(); + } + // End hacky block of code - app.saveCurrentExtent() app.map.events.register("mousemove", app.map, function (e) { var pixel = app.map.events.getMousePosition(e); var lonlat = app.map.getLonLatFromPixel(pixel); diff --git a/html/libs/seldon/seldon-min.js b/html/libs/seldon/seldon-min.js index ba7af5a..a5c5808 100644 --- a/html/libs/seldon/seldon-min.js +++ b/html/libs/seldon/seldon-min.js @@ -1,4 +1,4 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o"+'

'+el.description+"

"+"";$(dialogDiv).dialog({title:el.label||el.name,dialogClass:"tooltip-dialog "+dialogClass})}}}return MoreInfoButton}},{}],7:[function(require,module,exports){module.exports=function($){function addAccordionSection(accordionGroup,title){var sectionObj={title:title,titleElement:$("

"+title+"

"),contentElement:$("
"),sublists:[]};var $accordionGroup=$(accordionGroup);$accordionGroup.data("listAccordion").sections.push(sectionObj);$accordionGroup.append(sectionObj.titleElement).append(sectionObj.contentElement);$accordionGroup.accordion("refresh");return sectionObj}return addAccordionSection}},{}],8:[function(require,module,exports){module.exports=function($){function addAccordionSublists(g,items){$(g.contentElement).append(items)}return addAccordionSublists}},{}],9:[function(require,module,exports){module.exports=function($){function addAccordionSublistItems(s,items,theme,accGp){var collapsed=s.collapsible?"collapsed ":"";var contents=$('
');for(var i=0,l=items.length;i').append(items[i]))}var layer={name:name,contentElement:contents};s.items.push(layer);s.contentElement.append(layer.contentElement)}return addAccordionSublistItems}},{}],10:[function(require,module,exports){module.exports=function($){function addMaskToLegend(layer){var app=this;var maskName=layer.lid.substring(layer.lid.indexOf("MaskFor"),layer.lid.length);$("#lgd"+maskName).remove();layer.$legendItem=$(document.createElement("div")).attr("id","lgd"+maskName).prepend($(document.createElement("img")).attr("src",layer.legend)).prependTo($("#legend")).click(function(){app.setMaskByMask(false,maskName)})}return addMaskToLegend}},{}],11:[function(require,module,exports){module.exports=function($){var EventEmitter=window.EventEmitter;function App(){EventEmitter.call(this);this.map=undefined;this.tileManager=undefined;this.projection=undefined;this.gisServerType=undefined;this.useProxyScript=undefined;this.scalebar=undefined;this.zoomInTool=undefined;this.zoomOutTool=undefined;this.dragPanTool=undefined;this.id_markerLayer=undefined;this.maxExtent={left:-15e6,bottom:2e6,right:-6e6,top:7e6};this.baseLayers=[];this.accordionGroups=[];this.themes=[];this.maskParentLayers=[];this.masks=[];this.maskModifiers=[];this.defaultMasks=["MaskForForest"];this.radioButtonList=[];this.radioButtonLayers=[];this.dropdownBoxList=[];this.dropdownBoxLayers=[];this.currentBaseLayer=undefined;this.currentAccordionGroup=undefined;this.currentTheme=undefined;this.identifyTool=undefined;this.multigraphTool=undefined;this.markerTool=undefined;this.savedExtents=[];this.currentSavedExtentIndex=-1;this.saveCurrentExtent=require("./extent_save.js");this.zoomToExtent=require("./extent_zoom.js");this.zoomToPreviousExtent=require("./extent_zoom_previous.js");this.zoomToNextExtent=require("./extent_zoom_next.js");this.printSavedExtents=require("./extent_print.js");this.setBaseLayer=require("./set_base_layer.js")($);this.setAccordionGroup=require("./accordion_group_set.js");this.clearAccordionSections=require("./accordion_clear.js")($);this.addAccordionSection=require("./accordion_section_add.js")($);this.addAccordionSublists=require("./accordion_sublist_add.js")($);this.addAccordionSublistItems=require("./accordion_sublist_item_add.js")($);this.setTheme=require("./set_theme.js")($);this.shareUrl=require("./share_url.js")($);this.updateShareMapUrl=require("./update_share_url.js")($);this.launch=require("./launch.js")($);this.count=require("./count.js");this.addMaskToLegend=require("./add_mask_legend.js")($);this.setMaskByMask=require("./set_mask_by_mask.js")($);this.setMaskByLayer=require("./set_mask_by_layer.js")($);this.handleMaskModifier=require("./mask_modifier.js");this.handleMaskModifierGroup=require("./mask_modifier_group.js")($);this.parseConfig=require("./parse_config.js")($);this.initOpenLayers=require("./init_openlayers.js");this.setupCollapsibleSublists=require("./accordion_collapsible_sublist_setup.js")($);this.removeMaskFromLegend=function(layer){};OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.IMAGE_RELOAD_ATTEMPTS=3}EventEmitter.declare(App);return App}},{"./accordion_clear.js":1,"./accordion_collapsible_sublist_setup.js":2,"./accordion_group_set.js":4,"./accordion_section_add.js":7,"./accordion_sublist_add.js":8,"./accordion_sublist_item_add.js":9,"./add_mask_legend.js":10,"./count.js":15,"./extent_print.js":18,"./extent_save.js":19,"./extent_zoom.js":20,"./extent_zoom_next.js":21,"./extent_zoom_previous.js":22,"./init_openlayers.js":26,"./launch.js":27,"./mask_modifier.js":38,"./mask_modifier_group.js":39,"./parse_config.js":42,"./set_base_layer.js":47,"./set_mask_by_layer.js":49,"./set_mask_by_mask.js":50,"./set_theme.js":51,"./share_url.js":53,"./update_share_url.js":57}],12:[function(require,module,exports){function arrayContainsElement(array,element){var i;if(array===undefined){return false}for(i=0;iparam").each(function(i,param){var $param=$(param);if(param.hasAttribute("value")){obj[$param.attr("name")]=$param.attr("value")}else{obj[$param.attr("name")]=createArcGIS93RestParams($param)}});return obj}return createArcGIS93RestParams}},{}],17:[function(require,module,exports){module.exports=function(app,activeBtn){function deactivateActiveOpenLayersControls(){var controls,i;for(i=0;i=0;--i){e=this.savedExtents[i];html+=Mustache.render("{{{marker}}}{{{number}}}"+"left:{{{left}}}, bottom:{{{bottom}}}, right:{{{right}}}, top:{{{top}}}",{marker:i===this.currentSavedExtentIndex?"==>":"",number:i,left:e.left,bottom:e.bottom,right:e.right,top:e.top})}html+="";return html}module.exports=printSavedExtents},{}],19:[function(require,module,exports){var extentsAreEqual=require("./extents_equal.js");function saveCurrentExtent(){var newExtent=formatExtent(this.map.getExtent()),newSavedExtents=[],currentSavedExtent,i;if(this.currentSavedExtentIndex>=0){currentSavedExtent=this.savedExtents[this.currentSavedExtentIndex];if(extentsAreEqual(currentSavedExtent,newExtent)){return}}for(i=0;i<=this.currentSavedExtentIndex;++i){newSavedExtents.push(this.savedExtents[i])}this.savedExtents=newSavedExtents;this.savedExtents.push(newExtent);++this.currentSavedExtentIndex}function formatExtent(extent){return{left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top}}module.exports=saveCurrentExtent},{"./extents_equal.js":23}],20:[function(require,module,exports){function zoomToExtent(extent,save){if(save===undefined){save=true}var bounds=new OpenLayers.Bounds(extent.left,extent.bottom,extent.right,extent.top);this.map.zoomToExtent(bounds,true);if(save){this.saveCurrentExtent()}}module.exports=zoomToExtent},{}],21:[function(require,module,exports){function zoomToNextExtent(){if(this.currentSavedExtentIndex0){--this.currentSavedExtentIndex;this.zoomToExtent(this.savedExtents[this.currentSavedExtentIndex],false)}}module.exports=zoomToPreviousExtent},{}],23:[function(require,module,exports){function extentsAreEqual(e1,e2){var tolerance=.001;return Math.abs(e1.left-e2.left)<=tolerance&&Math.abs(e1.bottom-e2.bottom)<=tolerance&&Math.abs(e1.right-e2.right)<=tolerance&&Math.abs(e1.top-e2.top)<=tolerance}module.exports=extentsAreEqual},{}],24:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js"),stringContainsChar=require("./stringContainsChar.js");var getLegendStringFromPixelValue=require("./legend_config.js")($,app);function createIdentifyTool(){return new ClickTool(function(e){$("#identify_popup").remove();if(app.id_markerLayer){app.map.removeLayer(app.id_markerLayer)}var coords=app.map.getLonLatFromPixel(e.xy);var styleMap=new OpenLayers.StyleMap({pointRadius:4,fillColor:"yellow",fillOpacity:.75});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));app.id_markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:styleMap});app.id_markerLayer.addFeatures(feature);app.map.addLayer(app.id_markerLayer);var services=[],service,urlsrs;var layersAdded=[];var html='';$.each(app.map.layers,function(){var name,label;if(!this.isBaseLayer&&this.params&&(!("seldonLayer"in this)||String(this.seldonLayer.identify)!=="false")){name=this.params.LAYERS;if(String(name).match(/^\d+$/)){label=this.name}else{label=String(name).indexOf("MaskFor")!==-1?name.substring(0,name.indexOf("MaskFor")):name}if(layersAdded.indexOf(label)!==-1)return;layersAdded.push(label);services.push({url:this.url,srs:this.projection.projCode,name:name,label:label,proxyServerType:this.seldonLayer.proxyServerType});html=html+Mustache.render(""+''+''+''+"",{label:label})}});html=html+"
{{label}}:
";if(services.length===0){return}var popup=$(document.createElement("div"));popup.attr("id","identify_popup");popup.html(html);popup.dialog({width:600,height:300,resizable:true,title:"Identify Results",close:function(event,ui){app.map.removeLayer(app.id_markerLayer);app.id_markerLayer=undefined;$(this).remove()}});var i,l;for(i=0,l=services.length;i'+''+valueLabel.replace("_0","")+":  "+""+tableRow+""+""}$(newTableContents).insertAfter($group);if(!newTableContents)$group.find(".layer-results").text("N/A")},error:function(jqXHR,textStatus,errorThrown){}})}function createWMSGetFeatureInfoRequestURL(serviceUrl,layer,srs,x,y){var extent=app.map.getExtent();if(seldon.gisServerType==="ArcGIS"){extent=extent.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection(seldon.projection))}return Mustache.render(""+serviceUrl+"{{{c}}}LAYERS={{layer}}"+"&QUERY_LAYERS={{layer}}"+"&STYLES=,"+"&SERVICE=WMS"+"&VERSION=1.1.1"+"&REQUEST=GetFeatureInfo"+"&BBOX={{left}},{{bottom}},{{right}},{{top}}"+"&FEATURE_COUNT=100"+"&HEIGHT={{height}}"+"&WIDTH={{width}}"+"&FORMAT=image/png"+"&INFO_FORMAT=application/vnd.ogc.gml"+"&SRS={{srs}}"+"&X={{x}}"+"&Y={{y}}",{c:stringContainsChar(serviceUrl,"?")?"&":"?",layer:layer,height:app.map.size.h,width:app.map.size.w,left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top,srs:srs,x:x,y:y})}function getLayerResultsFromArcXML($xml,layerName,layerIDCount){var dataVals=[];try{var fields=$xml.find("FIELDS"),attributes=fields[layerIDCount].attributes,i;for(i=0;i=0||stringStartsWith(layerName,"EFETAC-NASA")||stringStartsWith(layerName,"RSAC-FHTET"))&&children[i].nodeName==="value_0"){value=value+sprintf(" (%.2f %%)",(parseFloat(value,10)-127)/128*100)}if((stringStartsWith(layerName.toUpperCase(),"NDMI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"NDVI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SWIR-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDVI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDMI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-SWIR-CURRENT"))&&children[i].nodeName==="value_0"){value=sprintf("%.0f %%",parseFloat(value,10)-128)}returnVals[i]=[children[i].nodeName,value]}}return returnVals}function stringStartsWith(string,prefix){return string.substring(0,prefix.length)===prefix}return createIdentifyTool}},{"./clicktool.js":14,"./legend_config.js":35,"./stringContainsChar.js":55}],25:[function(require,module,exports){module.exports=function(app){var ShareUrlInfo=require("./share.js");function init(config,projection,legendLookup,gisServerType,useProxyScript){var shareUrlInfo=ShareUrlInfo.parseUrl(window.location.toString());app.projection=projection;seldon.projection=projection;app.legendLookup=legendLookup;seldon.gisServerType=gisServerType;seldon.useProxyScript=useProxyScript;app.launch(config,shareUrlInfo);seldon.app=app}return init}},{"./share.js":52}],26:[function(require,module,exports){function initOpenLayers(baseLayerInfo,baseLayer,theme,themeOptions,initialExtent){var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets",{numZoomLevels:20})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings)}else if(baseLayer.type=="ArcGISCache"){var layer=new OpenLayers.Layer.ArcGISCache("AGSCache",baseLayer.url,{layerInfo:baseLayerInfo})}var maxExtentBounds;if(theme.xmax&&theme.xmin&&theme.ymax&&theme.ymin){maxExtentBounds=new OpenLayers.Bounds(theme.xmin,theme.ymin,theme.xmax,theme.ymax)}else{maxExtentBounds=new OpenLayers.Bounds(app.maxExtent.left,app.maxExtent.bottom,app.maxExtent.right,app.maxExtent.top)}if(initialExtent===undefined){initialExtent=app.maxExtent}app.tileManager=new OpenLayers.TileManager({cacheSize:12,moveDelay:750,zoomDelay:750});app.map=new OpenLayers.Map("map",{units:"m",tileManager:app.tileManager,center:[-10986902.689297,4856468.480035],controls:[new OpenLayers.Control.Navigation,new OpenLayers.Control.Attribution,app.zoomInTool,app.zoomOutTool,app.identifyTool,app.multigraphTool,app.markerTool],eventListeners:{moveend:function(){app.emit("extentchange")},zoomend:function(){app.emit("extentchange")}},projection:new OpenLayers.Projection(seldon.projection)});app.currentBaseLayer=baseLayer;app.emit("baselayerchange");app.map.addControl(new OpenLayers.Control.ScaleLine({bottomOutUnits:"mi"}));app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.setTheme(theme,themeOptions);var defaultZoom=5;app.map.setCenter(app.map.getCenter(),defaultZoom);app.saveCurrentExtent();app.map.events.register("mousemove",app.map,function(e){var pixel=app.map.events.getMousePosition(e);var lonlat=app.map.getLonLatFromPixel(pixel);lonlat=lonlat.transform(new OpenLayers.Projection("EPSG:3857"),new OpenLayers.Projection("EPSG:4326"));OpenLayers.Util.getElement("latLonTracker").innerHTML="Lat: "+sprintf("%.5f",lonlat.lat)+" Lon: "+sprintf("%.5f",lonlat.lon)+""});app.map.addControl(new OpenLayers.Control.PanZoomBar)}module.exports=initOpenLayers},{}],27:[function(require,module,exports){module.exports=function($){var createSplashScreen=require("./splash.js")($);var handle_search=require("./search.js")($);var ga_events=require("./set_google_analytics_events.js");var areasList=[];var activeBtn=[];function launch(configFile,shareUrlInfo){var deactivateActiveOpenLayersControls=require("./deactivate_controls.js")(this,activeBtn);var printMap=require("./print.js")($,this);var app=this;app.initialThemeLoad=true;var $configXML;$.ajax({url:configFile,dataType:"xml",success:function(configXML){$configXML=app.parseConfig(configXML,shareUrlInfo);ga_events($)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}});$("#btnTglLyrPick").click(function(){var $layerPickerDialog=$("#layerPickerDialog");if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close")}else{$layerPickerDialog.dialog("open")}});$("#layerPickerDialog").dialog({zIndex:10050,position:{my:"left top",at:"left+5 top+100"},autoOpen:true,hide:"fade",width:330});app.addListener("accordiongroupchange",function(){if(app.currentTheme){$("#layerPickerAccordion").accordion({active:app.currentTheme.getAccordionGroupIndex(app.currentAccordionGroup),collapsible:true,beforeActivate:function(event,ui){if(!app.initialThemeLoad){$("#layerPickerDialog").scrollTop(0)}},activate:function(event,ui){app.setupCollapsibleSublists(ui);if(app.initialThemeLoad){app.initialThemeLoad=false;$("#layerPickerDialog").scrollTop(755)}}})}});$("#btnTglMapTools").click(function(){var $mapToolsDialog=$("#mapToolsDialog");if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close")}else{$mapToolsDialog.dialog("open")}});$("#mapToolsDialog").dialog({zIndex:10050,position:{my:"right top",at:"right-5 top+100"},autoOpen:true,hide:"fade"});app.addListener("themechange",function(){app.updateShareMapUrl()});app.addListener("baselayerchange",function(){app.updateShareMapUrl()});app.addListener("accordiongroupchange",function(){app.updateShareMapUrl()});app.addListener("extentchange",function(){app.saveCurrentExtent();app.updateShareMapUrl()});var $mapToolsAccordion=$("#mapToolsAccordion"),accordionGroupIndexToOpen=0;$mapToolsAccordion.accordion({heightStyle:"content",collapsible:true});$mapToolsAccordion.find("div").each(function(i){if(this.id==="legend"){accordionGroupIndexToOpen=i;return false}return true});$mapToolsAccordion.accordion("option","active",accordionGroupIndexToOpen);$("#baseCombo").change(function(){var i=parseInt($(this).val(),10);app.setBaseLayer(app.baseLayers[i])});app.addListener("baselayerchange",function(){$("#baseCombo").val(app.currentBaseLayer.index)});$("#themeCombo").change(function(){var i=parseInt($(this).val(),10);app.setTheme(app.themes[i])});app.addListener("themechange",function(){$("#themeCombo").val(app.currentTheme.index)});$("#btnPan").click(function(){deactivateActiveOpenLayersControls();app.dragPanTool.activate()});$("#btnPrint").click(function(){if($configXML!==undefined){printMap($configXML)}else{console.log("Can't print yet; config file not yet parsed")}});$("#btnZoomIn").click(function(){deactivateActiveOpenLayersControls();app.zoomInTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomOut").click(function(){deactivateActiveOpenLayersControls();app.zoomOutTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomExtent").click(function(){app.zoomToExtent(app.maxExtent)});$("#btnID").click(function(){deactivateActiveOpenLayersControls();app.identifyTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnAbout").click(function(){var splashScreen=$("#splashScreenContainer");if(splashScreen.dialog("isOpen")){splashScreen.dialog("close")}else{splashScreen.dialog("open")}});$("#btnPrev").click(function(){app.zoomToPreviousExtent()});$("#btnNext").click(function(){app.zoomToNextExtent()});$("#btnMultiGraph").click(function(){deactivateActiveOpenLayersControls();app.multigraphTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnMarker").click(function(){deactivateActiveOpenLayersControls();app.markerTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});createSplashScreen();var $findArea=$("#findArea");$findArea.findArea();areasList=$findArea.findArea("getAreasList");$findArea.autocomplete({source:areasList});$findArea.keypress(function(e){if(e.which==13){var areaExtent=$findArea.findArea("getAreaExtent",$findArea.val(),areasList);app.zoomToExtent(areaExtent)}});$("#address_lookup").on("click",function(){var location=$("#address_field").val();handle_search(location,app)});$("#address_field").on("keypress",function(e){if(e.which===13){var location=$(this).val();handle_search(location,app)}});$(".mask-toggle").on("click",function(){if($(this).is(":checked")){app.setMaskByMask(true,this.value)}else{app.setMaskByMask(false,this.value)}});$("[data-mask-grouper='true']").on("change",function(){var disabled=$(this).is(":checked")?true:false;$("[data-mask-parent='"+this.value+"']").attr("disabled",disabled)});$(".mask-modifier").on("change",function(){var value=$(this).is(":checked")?this.value:"";var index=$(this).data("index");if($(this).data("maskGrouper")===true){app.handleMaskModifierGroup(this.value,$(this).is(":checked"))}app.handleMaskModifier(value,index)});$("textarea").focus(function(){var $this=$(this);$this.select();window.setTimeout(function(){$this.select()},1);function mouseUpHandler(){$this.off("mouseup",mouseUpHandler);return false}$this.mouseup(mouseUpHandler)});if($(window).width()<650){$("#mapToolsDialog").dialog("close");$("#layerPickerDialog").dialog("close")}if(window.addEventListener){window.addEventListener("orientationchange",function(){var $mapToolsDialog=$("#mapToolsDialog"),$layerPickerDialog=$("#layerPickerDialog");window.scroll(0,0);if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close").dialog("open")}if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close").dialog("open")}},false)}}return launch}},{"./deactivate_controls.js":17,"./print.js":43,"./search.js":45,"./set_google_analytics_events.js":48,"./splash.js":54}],28:[function(require,module,exports){module.exports=function($,app){var stringContainsChar=require("./stringContainsChar.js");function Layer(settings){EventEmitter.call(this);if(!settings){return}$.extend(true,this,settings);this.transparency=0;if(this.index==undefined){this.index=0}if(this.type==undefined){this.type="WMS"}this.createOpenLayersLayer=function(){if(this.openLayersLayer!==undefined){return this.openLayersLayer}var options={isBaseLayer:false,transitionEffect:"resize",buffer:0,singleTile:true,ratio:1};if(this.type==="WMTS"){var settings={name:this.name,url:this.url,layer:this.layers,style:this.style,matrixSet:this.srs,isBaseLayer:false,transitionEffect:"resize",format:"image/jpg",sphericalMercator:true};if(this.lid.indexOf("GLAM")>-1){$.extend(true,settings,{serverResolutions:[156543.033928041,78271.5169640205,39135.7584820102,19567.8792410051,9783.9396205026,4891.9698102513,2445.9849051256,1222.9924525628,611.4962262814,305.7481131407048],units:"m",tileOrigin:new OpenLayers.LonLat(-20037508.34,20037508.34)})}this.openLayersLayer=new OpenLayers.Layer.WMTS(settings)}else if(this.type==="XYZ"){this.openLayersLayer=new OpenLayers.Layer.XYZ(this.name,this.url,{isBaseLayer:false,projection:new OpenLayers.Projection(seldon.projection)})}else if(this.type==="ArcGIS93Rest"){this.openLayersLayer=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params.mosaicRule?$.extend(true,{},this.params,{mosaicRule:JSON.stringify(this.params.mosaicRule)}):this.params,options)}else{if(this.maxResolution){options.maxResolution=parseFloat(this.maxResolution)}var layer=this.layers+("mask"in this?app.maskModifiers.join(""):"");this.openLayersLayer=new OpenLayers.Layer.WMS(this.name,this.url,{projection:new OpenLayers.Projection(seldon.projection),units:"m",layers:layer,transparent:true},options)}var loadingimage=$('');$("#map").append(loadingimage);this.openLayersLayer.loadingimage=loadingimage;this.openLayersLayer.events.register("loadstart",this.openLayersLayer,function(){this.loadingimage.addClass("loading")});this.openLayersLayer.events.register("loadend",this.openLayersLayer,function(){this.loadingimage.removeClass("loading")});this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);this.openLayersLayer.seldonLayer=this;return this.openLayersLayer};this.activate=function(options){options=options||{};this.addToLegend();this.emit("activate");if(this.mask==="true"&&this.lid.indexOf("MaskFor")===-1){if(app.masks.length>0){app.setMaskByLayer(true,this)}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}var inMaskParentLayers=app.maskParentLayers.filter(function(layer){return this===layer},this).length;if(!inMaskParentLayers){app.maskParentLayers.push(this)}}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}vectorServices=["vlayers","fire","ads"];boundaryServices=["boundaries"];allVectorServices=vectorServices;Array.prototype.push.apply(allVectorServices,boundaryServices);var isVectorLayer=function(layer,serviceNames){return serviceNames.filter(function(serviceName){return layer.url&&layer.url.indexOf(serviceName+"?")>-1}).length};if(app.map.getNumLayers()>1){var lyrJustAdded=app.map.layers[app.map.getNumLayers()-1];if(!isVectorLayer(lyrJustAdded,allVectorServices)){for(var i=app.map.getNumLayers()-2;i>0;i--){var nextLayerDown=app.map.layers[i];if(!isVectorLayer(nextLayerDown,allVectorServices)){if(nextLayerDown.seldonLayer.index0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,vectorServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}for(var i=app.map.getNumLayers()-1;i>0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,boundaryServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}}app.updateShareMapUrl();app.map.updateSize()};this.deactivate=function(options){options=options||{};if(this.visible==="true"){app.map.removeLayer(this.openLayersLayer);this.visible="false"}if(!this.parentLayer){app.setMaskByLayer(false,this)}if(options.removeFromLegend){this.removeFromLegend()}if(options.removeFromParentMaskLayers){app.maskParentLayers=app.maskParentLayers.filter(function(layer){return layer.lid!==this.lid},this)}if(this.openLayersLayer&&this.openLayersLayer.loadingimage){this.openLayersLayer.loadingimage.removeClass("loading")}this.emit("deactivate")};this.addToLegend=function(){var that=this;var $legend=$("#legend");var lid=this.parentLayer?this.parentLayer.lid:this.lid;$(document.getElementById("lgd"+lid)).remove();this.$legendItem=$(document.createElement("div")).attr("id","lgd"+lid).prepend($(document.createElement("img")).attr("src",this.legend)).click(function(){that.deactivate();if(that.parentLayer){that.parentLayer.deactivate({removeFromParentMaskLayers:true})}that.removeFromLegend()});if(this.url.indexOf("vlayers")>-1){this.$legendItem.prependTo($legend)}else{this.$legendItem.appendTo($legend)}};this.removeFromLegend=function(){if(this.$legendItem)this.$legendItem.remove(); +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o"+'

'+el.description+"

"+"";$(dialogDiv).dialog({title:el.label||el.name,dialogClass:"tooltip-dialog "+dialogClass})}}}return MoreInfoButton}},{}],7:[function(require,module,exports){module.exports=function($){function addAccordionSection(accordionGroup,title){var sectionObj={title:title,titleElement:$("

"+title+"

"),contentElement:$("
"),sublists:[]};var $accordionGroup=$(accordionGroup);$accordionGroup.data("listAccordion").sections.push(sectionObj);$accordionGroup.append(sectionObj.titleElement).append(sectionObj.contentElement);$accordionGroup.accordion("refresh");return sectionObj}return addAccordionSection}},{}],8:[function(require,module,exports){module.exports=function($){function addAccordionSublists(g,items){$(g.contentElement).append(items)}return addAccordionSublists}},{}],9:[function(require,module,exports){module.exports=function($){function addAccordionSublistItems(s,items,theme,accGp){var collapsed=s.collapsible?"collapsed ":"";var contents=$('
');for(var i=0,l=items.length;i').append(items[i]))}var layer={name:name,contentElement:contents};s.items.push(layer);s.contentElement.append(layer.contentElement)}return addAccordionSublistItems}},{}],10:[function(require,module,exports){module.exports=function($){function addMaskToLegend(layer){var app=this;var maskName=layer.lid.substring(layer.lid.indexOf("MaskFor"),layer.lid.length);$("#lgd"+maskName).remove();layer.$legendItem=$(document.createElement("div")).attr("id","lgd"+maskName).prepend($(document.createElement("img")).attr("src",layer.legend)).prependTo($("#legend")).click(function(){app.setMaskByMask(false,maskName)})}return addMaskToLegend}},{}],11:[function(require,module,exports){module.exports=function($){var EventEmitter=window.EventEmitter;function App(){EventEmitter.call(this);this.map=undefined;this.tileManager=undefined;this.projection=undefined;this.gisServerType=undefined;this.useProxyScript=undefined;this.scalebar=undefined;this.zoomInTool=undefined;this.zoomOutTool=undefined;this.dragPanTool=undefined;this.id_markerLayer=undefined;this.maxExtent={left:-15e6,bottom:2e6,right:-6e6,top:7e6};this.baseLayers=[];this.accordionGroups=[];this.themes=[];this.maskParentLayers=[];this.masks=[];this.maskModifiers=[];this.defaultMasks=["MaskForForest"];this.radioButtonList=[];this.radioButtonLayers=[];this.dropdownBoxList=[];this.dropdownBoxLayers=[];this.currentBaseLayer=undefined;this.currentAccordionGroup=undefined;this.currentTheme=undefined;this.identifyTool=undefined;this.multigraphTool=undefined;this.markerTool=undefined;this.savedExtents=[];this.currentSavedExtentIndex=-1;this.saveCurrentExtent=require("./extent_save.js");this.zoomToExtent=require("./extent_zoom.js");this.zoomToPreviousExtent=require("./extent_zoom_previous.js");this.zoomToNextExtent=require("./extent_zoom_next.js");this.printSavedExtents=require("./extent_print.js");this.setBaseLayer=require("./set_base_layer.js")($);this.setAccordionGroup=require("./accordion_group_set.js");this.clearAccordionSections=require("./accordion_clear.js")($);this.addAccordionSection=require("./accordion_section_add.js")($);this.addAccordionSublists=require("./accordion_sublist_add.js")($);this.addAccordionSublistItems=require("./accordion_sublist_item_add.js")($);this.setTheme=require("./set_theme.js")($);this.shareUrl=require("./share_url.js")($);this.updateShareMapUrl=require("./update_share_url.js")($);this.launch=require("./launch.js")($);this.count=require("./count.js");this.addMaskToLegend=require("./add_mask_legend.js")($);this.setMaskByMask=require("./set_mask_by_mask.js")($);this.setMaskByLayer=require("./set_mask_by_layer.js")($);this.handleMaskModifier=require("./mask_modifier.js");this.handleMaskModifierGroup=require("./mask_modifier_group.js")($);this.parseConfig=require("./parse_config.js")($);this.initOpenLayers=require("./init_openlayers.js");this.setupCollapsibleSublists=require("./accordion_collapsible_sublist_setup.js")($);this.removeMaskFromLegend=function(layer){};OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.IMAGE_RELOAD_ATTEMPTS=3}EventEmitter.declare(App);return App}},{"./accordion_clear.js":1,"./accordion_collapsible_sublist_setup.js":2,"./accordion_group_set.js":4,"./accordion_section_add.js":7,"./accordion_sublist_add.js":8,"./accordion_sublist_item_add.js":9,"./add_mask_legend.js":10,"./count.js":15,"./extent_print.js":18,"./extent_save.js":19,"./extent_zoom.js":20,"./extent_zoom_next.js":21,"./extent_zoom_previous.js":22,"./init_openlayers.js":26,"./launch.js":27,"./mask_modifier.js":38,"./mask_modifier_group.js":39,"./parse_config.js":42,"./set_base_layer.js":47,"./set_mask_by_layer.js":49,"./set_mask_by_mask.js":50,"./set_theme.js":51,"./share_url.js":53,"./update_share_url.js":57}],12:[function(require,module,exports){function arrayContainsElement(array,element){var i;if(array===undefined){return false}for(i=0;iparam").each(function(i,param){var $param=$(param);if(param.hasAttribute("value")){obj[$param.attr("name")]=$param.attr("value")}else{obj[$param.attr("name")]=createArcGIS93RestParams($param)}});return obj}return createArcGIS93RestParams}},{}],17:[function(require,module,exports){module.exports=function(app,activeBtn){function deactivateActiveOpenLayersControls(){var controls,i;for(i=0;i=0;--i){e=this.savedExtents[i];html+=Mustache.render("{{{marker}}}{{{number}}}"+"left:{{{left}}}, bottom:{{{bottom}}}, right:{{{right}}}, top:{{{top}}}",{marker:i===this.currentSavedExtentIndex?"==>":"",number:i,left:e.left,bottom:e.bottom,right:e.right,top:e.top})}html+="";return html}module.exports=printSavedExtents},{}],19:[function(require,module,exports){var extentsAreEqual=require("./extents_equal.js");function saveCurrentExtent(){var newExtent=formatExtent(this.map.getExtent()),newSavedExtents=[],currentSavedExtent,i;if(this.currentSavedExtentIndex>=0){currentSavedExtent=this.savedExtents[this.currentSavedExtentIndex];if(extentsAreEqual(currentSavedExtent,newExtent)){return}}for(i=0;i<=this.currentSavedExtentIndex;++i){newSavedExtents.push(this.savedExtents[i])}this.savedExtents=newSavedExtents;this.savedExtents.push(newExtent);++this.currentSavedExtentIndex}function formatExtent(extent){return{left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top}}module.exports=saveCurrentExtent},{"./extents_equal.js":23}],20:[function(require,module,exports){function zoomToExtent(extent,save){if(save===undefined){save=true}var bounds=new OpenLayers.Bounds(extent.left,extent.bottom,extent.right,extent.top);this.map.zoomToExtent(bounds,true);if(save){this.saveCurrentExtent()}}module.exports=zoomToExtent},{}],21:[function(require,module,exports){function zoomToNextExtent(){if(this.currentSavedExtentIndex0){--this.currentSavedExtentIndex;this.zoomToExtent(this.savedExtents[this.currentSavedExtentIndex],false)}}module.exports=zoomToPreviousExtent},{}],23:[function(require,module,exports){function extentsAreEqual(e1,e2){var tolerance=.001;return Math.abs(e1.left-e2.left)<=tolerance&&Math.abs(e1.bottom-e2.bottom)<=tolerance&&Math.abs(e1.right-e2.right)<=tolerance&&Math.abs(e1.top-e2.top)<=tolerance}module.exports=extentsAreEqual},{}],24:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js"),stringContainsChar=require("./stringContainsChar.js");var getLegendStringFromPixelValue=require("./legend_config.js")($,app);function createIdentifyTool(){return new ClickTool(function(e){$("#identify_popup").remove();if(app.id_markerLayer){app.map.removeLayer(app.id_markerLayer)}var coords=app.map.getLonLatFromPixel(e.xy);var styleMap=new OpenLayers.StyleMap({pointRadius:4,fillColor:"yellow",fillOpacity:.75});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));app.id_markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:styleMap});app.id_markerLayer.addFeatures(feature);app.map.addLayer(app.id_markerLayer);var services=[],service,urlsrs;var layersAdded=[];var html='';$.each(app.map.layers,function(){var name,label;if(!this.isBaseLayer&&this.params&&(!("seldonLayer"in this)||String(this.seldonLayer.identify)!=="false")){name=this.params.LAYERS;if(String(name).match(/^\d+$/)){label=this.name}else{label=String(name).indexOf("MaskFor")!==-1?name.substring(0,name.indexOf("MaskFor")):name}if(layersAdded.indexOf(label)!==-1)return;layersAdded.push(label);services.push({url:this.url,srs:this.projection.projCode,name:name,label:label,proxyServerType:this.seldonLayer.proxyServerType});html=html+Mustache.render(""+''+''+''+"",{label:label})}});html=html+"
{{label}}:
";if(services.length===0){return}var popup=$(document.createElement("div"));popup.attr("id","identify_popup");popup.html(html);popup.dialog({width:600,height:300,resizable:true,title:"Identify Results",close:function(event,ui){app.map.removeLayer(app.id_markerLayer);app.id_markerLayer=undefined;$(this).remove()}});var i,l;for(i=0,l=services.length;i'+''+valueLabel.replace("_0","")+":  "+""+tableRow+""+""}$(newTableContents).insertAfter($group);if(!newTableContents)$group.find(".layer-results").text("N/A")},error:function(jqXHR,textStatus,errorThrown){}})}function createWMSGetFeatureInfoRequestURL(serviceUrl,layer,srs,x,y){var extent=app.map.getExtent();if(seldon.gisServerType==="ArcGIS"){extent=extent.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection(seldon.projection))}return Mustache.render(""+serviceUrl+"{{{c}}}LAYERS={{layer}}"+"&QUERY_LAYERS={{layer}}"+"&STYLES=,"+"&SERVICE=WMS"+"&VERSION=1.1.1"+"&REQUEST=GetFeatureInfo"+"&BBOX={{left}},{{bottom}},{{right}},{{top}}"+"&FEATURE_COUNT=100"+"&HEIGHT={{height}}"+"&WIDTH={{width}}"+"&FORMAT=image/png"+"&INFO_FORMAT=application/vnd.ogc.gml"+"&SRS={{srs}}"+"&X={{x}}"+"&Y={{y}}",{c:stringContainsChar(serviceUrl,"?")?"&":"?",layer:layer,height:app.map.size.h,width:app.map.size.w,left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top,srs:srs,x:x,y:y})}function getLayerResultsFromArcXML($xml,layerName,layerIDCount){var dataVals=[];try{var fields=$xml.find("FIELDS"),attributes=fields[layerIDCount].attributes,i;for(i=0;i=0||stringStartsWith(layerName,"EFETAC-NASA")||stringStartsWith(layerName,"RSAC-FHTET"))&&children[i].nodeName==="value_0"){value=value+sprintf(" (%.2f %%)",(parseFloat(value,10)-127)/128*100)}if((stringStartsWith(layerName.toUpperCase(),"NDMI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"NDVI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SWIR-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDVI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDMI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-SWIR-CURRENT"))&&children[i].nodeName==="value_0"){value=sprintf("%.0f %%",parseFloat(value,10)-128)}returnVals[i]=[children[i].nodeName,value]}}return returnVals}function stringStartsWith(string,prefix){return string.substring(0,prefix.length)===prefix}return createIdentifyTool}},{"./clicktool.js":14,"./legend_config.js":35,"./stringContainsChar.js":55}],25:[function(require,module,exports){module.exports=function(app){var ShareUrlInfo=require("./share.js");function init(config,projection,legendLookup,gisServerType,useProxyScript){var shareUrlInfo=ShareUrlInfo.parseUrl(window.location.toString());app.projection=projection;seldon.projection=projection;app.legendLookup=legendLookup;seldon.gisServerType=gisServerType;seldon.useProxyScript=useProxyScript;app.launch(config,shareUrlInfo);seldon.app=app}return init}},{"./share.js":52}],26:[function(require,module,exports){function initOpenLayers(baseLayerInfo,baseLayer,theme,themeOptions,initialExtent){var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets",{numZoomLevels:20})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings)}else if(baseLayer.type=="ArcGISCache"){var layer=new OpenLayers.Layer.ArcGISCache("AGSCache",baseLayer.url,{layerInfo:baseLayerInfo})}var maxExtentBounds;if(theme.xmax&&theme.xmin&&theme.ymax&&theme.ymin){maxExtentBounds=new OpenLayers.Bounds(theme.xmin,theme.ymin,theme.xmax,theme.ymax)}else{maxExtentBounds=new OpenLayers.Bounds(app.maxExtent.left,app.maxExtent.bottom,app.maxExtent.right,app.maxExtent.top)}if(initialExtent===undefined){initialExtent=app.maxExtent}app.tileManager=new OpenLayers.TileManager({cacheSize:12,moveDelay:750,zoomDelay:750});app.map=new OpenLayers.Map("map",{units:"m",tileManager:app.tileManager,center:[-10986902.689297,4856468.480035],controls:[new OpenLayers.Control.Navigation,new OpenLayers.Control.Attribution,app.zoomInTool,app.zoomOutTool,app.identifyTool,app.multigraphTool,app.markerTool],eventListeners:{moveend:function(){app.emit("extentchange")},zoomend:function(){app.emit("extentchange")}},projection:new OpenLayers.Projection(seldon.projection)});app.currentBaseLayer=baseLayer;app.emit("baselayerchange");app.map.addControl(new OpenLayers.Control.ScaleLine({bottomOutUnits:"mi"}));app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.setTheme(theme,themeOptions);if(initialExtent!=app.maxExtent){app.zoomToExtent(initialExtent)}else{var defaultZoom=5;app.map.setCenter(app.map.getCenter(),defaultZoom);app.saveCurrentExtent()}app.map.events.register("mousemove",app.map,function(e){var pixel=app.map.events.getMousePosition(e);var lonlat=app.map.getLonLatFromPixel(pixel);lonlat=lonlat.transform(new OpenLayers.Projection("EPSG:3857"),new OpenLayers.Projection("EPSG:4326"));OpenLayers.Util.getElement("latLonTracker").innerHTML="Lat: "+sprintf("%.5f",lonlat.lat)+" Lon: "+sprintf("%.5f",lonlat.lon)+""});app.map.addControl(new OpenLayers.Control.PanZoomBar)}module.exports=initOpenLayers},{}],27:[function(require,module,exports){module.exports=function($){var createSplashScreen=require("./splash.js")($);var handle_search=require("./search.js")($);var ga_events=require("./set_google_analytics_events.js");var areasList=[];var activeBtn=[];function launch(configFile,shareUrlInfo){var deactivateActiveOpenLayersControls=require("./deactivate_controls.js")(this,activeBtn);var printMap=require("./print.js")($,this);var app=this;app.initialThemeLoad=true;var $configXML;$.ajax({url:configFile,dataType:"xml",success:function(configXML){$configXML=app.parseConfig(configXML,shareUrlInfo);ga_events($)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}});$("#btnTglLyrPick").click(function(){var $layerPickerDialog=$("#layerPickerDialog");if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close")}else{$layerPickerDialog.dialog("open")}});$("#layerPickerDialog").dialog({zIndex:10050,position:{my:"left top",at:"left+5 top+100"},autoOpen:true,hide:"fade",width:330});app.addListener("accordiongroupchange",function(){if(app.currentTheme){$("#layerPickerAccordion").accordion({active:app.currentTheme.getAccordionGroupIndex(app.currentAccordionGroup),collapsible:true,beforeActivate:function(event,ui){if(!app.initialThemeLoad){$("#layerPickerDialog").scrollTop(0)}},activate:function(event,ui){app.setupCollapsibleSublists(ui);if(app.initialThemeLoad){app.initialThemeLoad=false;$("#layerPickerDialog").scrollTop(755)}}})}});$("#btnTglMapTools").click(function(){var $mapToolsDialog=$("#mapToolsDialog");if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close")}else{$mapToolsDialog.dialog("open")}});$("#mapToolsDialog").dialog({zIndex:10050,position:{my:"right top",at:"right-5 top+100"},autoOpen:true,hide:"fade"});app.addListener("themechange",function(){app.updateShareMapUrl()});app.addListener("baselayerchange",function(){app.updateShareMapUrl()});app.addListener("accordiongroupchange",function(){app.updateShareMapUrl()});app.addListener("extentchange",function(){app.saveCurrentExtent();app.updateShareMapUrl()});var $mapToolsAccordion=$("#mapToolsAccordion"),accordionGroupIndexToOpen=0;$mapToolsAccordion.accordion({heightStyle:"content",collapsible:true});$mapToolsAccordion.find("div").each(function(i){if(this.id==="legend"){accordionGroupIndexToOpen=i;return false}return true});$mapToolsAccordion.accordion("option","active",accordionGroupIndexToOpen);$("#baseCombo").change(function(){var i=parseInt($(this).val(),10);app.setBaseLayer(app.baseLayers[i])});app.addListener("baselayerchange",function(){$("#baseCombo").val(app.currentBaseLayer.index)});$("#themeCombo").change(function(){var i=parseInt($(this).val(),10);app.setTheme(app.themes[i])});app.addListener("themechange",function(){$("#themeCombo").val(app.currentTheme.index)});$("#btnPan").click(function(){deactivateActiveOpenLayersControls();app.dragPanTool.activate()});$("#btnPrint").click(function(){if($configXML!==undefined){printMap($configXML)}else{console.log("Can't print yet; config file not yet parsed")}});$("#btnZoomIn").click(function(){deactivateActiveOpenLayersControls();app.zoomInTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomOut").click(function(){deactivateActiveOpenLayersControls();app.zoomOutTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomExtent").click(function(){app.zoomToExtent(app.maxExtent)});$("#btnID").click(function(){deactivateActiveOpenLayersControls();app.identifyTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnAbout").click(function(){var splashScreen=$("#splashScreenContainer");if(splashScreen.dialog("isOpen")){splashScreen.dialog("close")}else{splashScreen.dialog("open")}});$("#btnPrev").click(function(){app.zoomToPreviousExtent()});$("#btnNext").click(function(){app.zoomToNextExtent()});$("#btnMultiGraph").click(function(){deactivateActiveOpenLayersControls();app.multigraphTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnMarker").click(function(){deactivateActiveOpenLayersControls();app.markerTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});createSplashScreen();var $findArea=$("#findArea");$findArea.findArea();areasList=$findArea.findArea("getAreasList");$findArea.autocomplete({source:areasList});$findArea.keypress(function(e){if(e.which==13){var areaExtent=$findArea.findArea("getAreaExtent",$findArea.val(),areasList);app.zoomToExtent(areaExtent)}});$("#address_lookup").on("click",function(){var location=$("#address_field").val();handle_search(location,app)});$("#address_field").on("keypress",function(e){if(e.which===13){var location=$(this).val();handle_search(location,app)}});$(".mask-toggle").on("click",function(){if($(this).is(":checked")){app.setMaskByMask(true,this.value)}else{app.setMaskByMask(false,this.value)}});$("[data-mask-grouper='true']").on("change",function(){var disabled=$(this).is(":checked")?true:false;$("[data-mask-parent='"+this.value+"']").attr("disabled",disabled)});$(".mask-modifier").on("change",function(){var value=$(this).is(":checked")?this.value:"";var index=$(this).data("index");if($(this).data("maskGrouper")===true){app.handleMaskModifierGroup(this.value,$(this).is(":checked"))}app.handleMaskModifier(value,index)});$("textarea").focus(function(){var $this=$(this);$this.select();window.setTimeout(function(){$this.select()},1);function mouseUpHandler(){$this.off("mouseup",mouseUpHandler);return false}$this.mouseup(mouseUpHandler)});if($(window).width()<650){$("#mapToolsDialog").dialog("close");$("#layerPickerDialog").dialog("close")}if(window.addEventListener){window.addEventListener("orientationchange",function(){var $mapToolsDialog=$("#mapToolsDialog"),$layerPickerDialog=$("#layerPickerDialog");window.scroll(0,0);if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close").dialog("open")}if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close").dialog("open")}},false)}}return launch}},{"./deactivate_controls.js":17,"./print.js":43,"./search.js":45,"./set_google_analytics_events.js":48,"./splash.js":54}],28:[function(require,module,exports){module.exports=function($,app){var stringContainsChar=require("./stringContainsChar.js");function Layer(settings){EventEmitter.call(this);if(!settings){return}$.extend(true,this,settings);this.transparency=0;if(this.index==undefined){this.index=0}if(this.type==undefined){this.type="WMS"}this.createOpenLayersLayer=function(){if(this.openLayersLayer!==undefined){return this.openLayersLayer}var options={isBaseLayer:false,transitionEffect:"resize",buffer:0,singleTile:true,ratio:1};if(this.type==="WMTS"){var settings={name:this.name,url:this.url,layer:this.layers,style:this.style,matrixSet:this.srs,isBaseLayer:false,transitionEffect:"resize",format:"image/jpg",sphericalMercator:true};if(this.lid.indexOf("GLAM")>-1){$.extend(true,settings,{serverResolutions:[156543.033928041,78271.5169640205,39135.7584820102,19567.8792410051,9783.9396205026,4891.9698102513,2445.9849051256,1222.9924525628,611.4962262814,305.7481131407048],units:"m",tileOrigin:new OpenLayers.LonLat(-20037508.34,20037508.34)})}this.openLayersLayer=new OpenLayers.Layer.WMTS(settings)}else if(this.type==="XYZ"){this.openLayersLayer=new OpenLayers.Layer.XYZ(this.name,this.url,{isBaseLayer:false,projection:new OpenLayers.Projection(seldon.projection)})}else if(this.type==="ArcGIS93Rest"){this.openLayersLayer=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params.mosaicRule?$.extend(true,{},this.params,{mosaicRule:JSON.stringify(this.params.mosaicRule)}):this.params,options)}else{if(this.maxResolution){options.maxResolution=parseFloat(this.maxResolution)}var layer=this.layers+("mask"in this?app.maskModifiers.join(""):"");this.openLayersLayer=new OpenLayers.Layer.WMS(this.name,this.url,{projection:new OpenLayers.Projection(seldon.projection),units:"m",layers:layer,transparent:true},options)}var loadingimage=$('');$("#map").append(loadingimage);this.openLayersLayer.loadingimage=loadingimage;this.openLayersLayer.events.register("loadstart",this.openLayersLayer,function(){this.loadingimage.addClass("loading")});this.openLayersLayer.events.register("loadend",this.openLayersLayer,function(){this.loadingimage.removeClass("loading")});this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);this.openLayersLayer.seldonLayer=this;return this.openLayersLayer};this.activate=function(options){options=options||{};this.addToLegend();this.emit("activate");if(this.mask==="true"&&this.lid.indexOf("MaskFor")===-1){if(app.masks.length>0){app.setMaskByLayer(true,this)}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}var inMaskParentLayers=app.maskParentLayers.filter(function(layer){return this===layer},this).length;if(!inMaskParentLayers){app.maskParentLayers.push(this)}}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}vectorServices=["vlayers","fire","ads"];boundaryServices=["boundaries"];allVectorServices=vectorServices;Array.prototype.push.apply(allVectorServices,boundaryServices);var isVectorLayer=function(layer,serviceNames){return serviceNames.filter(function(serviceName){return layer.url&&layer.url.indexOf(serviceName+"?")>-1}).length};if(app.map.getNumLayers()>1){var lyrJustAdded=app.map.layers[app.map.getNumLayers()-1];if(!isVectorLayer(lyrJustAdded,allVectorServices)){for(var i=app.map.getNumLayers()-2;i>0;i--){var nextLayerDown=app.map.layers[i];if(!isVectorLayer(nextLayerDown,allVectorServices)){if(nextLayerDown.seldonLayer.index0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,vectorServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}for(var i=app.map.getNumLayers()-1;i>0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,boundaryServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}}app.updateShareMapUrl();app.map.updateSize()};this.deactivate=function(options){options=options||{};if(this.visible==="true"){app.map.removeLayer(this.openLayersLayer);this.visible="false"}if(!this.parentLayer){app.setMaskByLayer(false,this)}if(options.removeFromLegend){this.removeFromLegend()}if(options.removeFromParentMaskLayers){app.maskParentLayers=app.maskParentLayers.filter(function(layer){return layer.lid!==this.lid},this)}if(this.openLayersLayer&&this.openLayersLayer.loadingimage){this.openLayersLayer.loadingimage.removeClass("loading")}this.emit("deactivate")};this.addToLegend=function(){var that=this;var $legend=$("#legend");var lid=this.parentLayer?this.parentLayer.lid:this.lid;$(document.getElementById("lgd"+lid)).remove();this.$legendItem=$(document.createElement("div")).attr("id","lgd"+lid).prepend($(document.createElement("img")).attr("src",this.legend)).click(function(){that.deactivate();if(that.parentLayer){that.parentLayer.deactivate({removeFromParentMaskLayers:true})}that.removeFromLegend()});if(this.url.indexOf("vlayers")>-1){this.$legendItem.prependTo($legend)}else{this.$legendItem.appendTo($legend)}};this.removeFromLegend=function(){ +if(this.$legendItem)this.$legendItem.remove()};this.setTransparency=function(transparency){if(this.openLayersLayer){this.openLayersLayer.setOpacity(1-parseFloat(transparency)/100)}this.transparency=transparency;try{this.emit({type:"transparency",value:this.transparency})}catch(err){var test=this.transparency;var errTxt=err.Message}if(app.map!==undefined){var currentLayer,openLayersLayer,lid;var i;for(i=app.map.getNumLayers()-2;i>0;i--){currentLayer=app.map.layers[i];openLayersLayer=currentLayer.seldonLayer.openLayersLayer;lid=currentLayer.seldonLayer.lid;if(stringContainsChar(currentLayer.name,"Mask")){if(openLayersLayer&&lid.substring(0,lid.indexOf("MaskFor"))===this.lid){openLayersLayer.setOpacity(1-parseFloat(transparency)/100);currentLayer.seldonLayer.transparency=transparency}}}}}}window.EventEmitter.declare(Layer);return Layer}},{"./stringContainsChar.js":55}],29:[function(require,module,exports){module.exports=function($){function createLayerToggleCheckbox(layer){var checkbox=document.createElement("input"),$checkbox;checkbox.type="checkbox";checkbox.id="chk"+layer.lid;checkbox.onclick=function(){if($(this).is(":checked")){layer.activate()}else{layer.deactivate({removeFromLegend:true,removeFromParentMaskLayers:true})}};$checkbox=$(checkbox);$checkbox.addClass(layer.lid);layer.addListener("activate",function(){$("input."+this.lid).attr("checked",true)});layer.addListener("deactivate",function(){$("input."+this.lid).attr("checked",false)});return checkbox}return createLayerToggleCheckbox}},{}],30:[function(require,module,exports){module.exports=function($){function createLayerPropertiesDialog(layer){var localTransparency=0;var $html=$(""+'
'+""+""+""+""+""+""+"
Transparency:"+'
'+"
"+'%'+"
"+"
");$html.find("input.transparency-text").val(layer.transparency);if(layer.transparency>0){localTransparency=layer.transparency;layer.setTransparency(localTransparency)}$html.find(".transparency-slider").slider({min:0,max:100,step:1,value:localTransparency,slide:function(event,ui){try{layer.setTransparency(ui.value)}catch(err){var errTxt=err.message}}});$html.find("input.transparency-text").change(function(){var $this=$(this),newValueFloat=parseFloat($this.val());if(isNaN(newValueFloat)||newValueFloat<0||newValueFloat>100){$this.val(layer.transparency);return}layer.setTransparency($this.val())});layer.addListener("transparency",function(e){$html.find("input.transparency-text").val(e.value)});$html.dialog({zIndex:10050,position:"left",autoOpen:true,hide:"explode",title:layer.name,width:"auto",close:function(){$(this).dialog("destroy");$html.remove();createLayerPropertiesDialog.$html[layer.lid]=undefined}});createLayerPropertiesDialog.$html[layer.lid]=$html}createLayerPropertiesDialog.$html={};return createLayerPropertiesDialog}},{}],31:[function(require,module,exports){module.exports=function($){var createLayerPropertiesDialog=require("./layer_dialog.js")($);function createLayerPropertiesIcon(layer){var img=document.createElement("img");img.id=layer.lid;img.src="icons/settings.png";img.className="layerPropertiesIcon";img.onclick=function(){createLayerPropertiesDialog(layer)};return img}return createLayerPropertiesIcon}},{"./layer_dialog.js":30}],32:[function(require,module,exports){module.exports=function($,app){var generalRadioHandler=require("./layer_radio_handler.js")($,app);function createLayerToggleRadioButton(layer,radioGroupName){var checkbox=document.createElement("input"),$checkbox;checkbox.type="radio";checkbox.name=radioGroupName;checkbox.id=layer.lid;if(layer.selectedInConfig){checkbox.checked=true}$checkbox=$(checkbox);$checkbox.change(radioHandler);layer.addListener("activate",function(){$checkbox.attr("checked",true)});layer.addListener("deactivate",function(){$checkbox.attr("checked",false)});return checkbox}function radioHandler(){generalRadioHandler(app)}return createLayerToggleRadioButton}},{"./layer_radio_handler.js":33}],33:[function(require,module,exports){module.exports=function($,app){var Layer=require("./layer.js")($,app);function radioHandler(app){var $selectedOption=$(app.dropdownBoxList[0]).find(":selected");if($selectedOption.text()==="select..."){clearRadioLayers(app,null);return}var selectLayer=app.dropdownBoxLayers[$selectedOption.val()];var wanted_lid=getActiveDropdownBoxRadioLID(app);var wanted_layer=undefined;var i;for(i=0;i0;i--){currLayer=app.map.layers[i].seldonLayer;for(j=0;j"+selectBoxLayers[i].name+"")}selectBox.insertAdjacentHTML("afterbegin","");$(selectBox).change(selectHandler);return selectBox}function selectHandler(){radioHandler(app)}return createLayerToggleDropdownBox}},{"./layer_radio_handler.js":33}],35:[function(require,module,exports){module.exports=function($,app){function isLayerInLegendConfig(layerId){return layerId in app.legendLookup}function getLegendStringFromPixelValue(layerId,pixelValue){var legendString="";if(isLayerInLegendConfig(layerId)){legendString=app.legendLookup[layerId][pixelValue];if(!legendString){console.error("No legend string set for pixel value",pixelValue,"for layer",layerId)}}return legendString}return getLegendStringFromPixelValue}},{}],36:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js");var saveAs=require("../libs/FileSaver/FileSaver.js").saveAs;var popupId="marker-dialog";var points=[];var pointStyleDefault={pointRadius:4,fillColor:"blue",fillOpacity:.75};var pointStyleHover={pointRadius:5,fillColor:"orange",fillOpacity:.75};var pointStyle=new OpenLayers.StyleMap(pointStyleDefault);function marker(){return new ClickTool(markerHandler)}function markerHandler(e){var coords=app.map.getLonLatFromPixel(e.xy);var lonlat=app.map.getLonLatFromPixel(e.xy);lonlat.transform(app.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));var markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:pointStyle});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));markerLayer.addFeatures(feature);app.map.addLayer(markerLayer);if(!$("#"+popupId).length){createPopup()}if($(".marker-points").length){createPointItem(lonlat,markerLayer)}points.push({lonlat:lonlat,layer:markerLayer});if(typeof ga!=="undefined"){ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Create New Point",eventLabel:lonlat.lon+", "+lonlat.lat})}}function createPointItem(coords,layer){var itemString="";itemString+='
';itemString+='
';itemString+=' Lat:';itemString+=' '+coords.lat+"";itemString+="
";itemString+='
';itemString+=' Lon:';itemString+=' '+coords.lon+"";itemString+="
";itemString+='
';itemString+=' Notes:';itemString+='
';itemString+="
";itemString+="
";var item=$(itemString);item.data("point",layer);item.on("mouseenter",handlePointHoverEnter).on("mouseleave",handlePointHoverLeave);$(".marker-points").append(item)}function handlePointHoverEnter(e){var point=$(this).data("point");point.style=pointStyleHover;point.redraw()}function handlePointHoverLeave(e){var point=$(this).data("point");point.style=pointStyleDefault;point.redraw()}function createPopup(){var popup=$('
');$("body").append(popup);$(".marker-button-download").click(exportFileHandler);$(".marker-button-clear").click(clearPointsHandler);popup.dialog({width:300,height:400,resizable:false,position:{my:"right top",at:"right-5 top+120"},title:"Mark areas of interest",close:function(event,ui){clearPointsHandler();$(this).remove()}})}function exportFileHandler(){var lat,lon,url,notes;var SEP="|";var i;var csvContent="sep="+SEP+"\n";csvContent+="lat"+SEP+"long"+SEP+"google maps link"+SEP+"notes\n";for(i=0;i=0){direction="N"}else if(type==="lat"&&value<0){direction="S"}else if(type==="lon"&&value>=0){direction="E"}else if(type==="lon"&&value<0){direction="W"}value=Math.abs(value);var degree=Math.floor(value);value=(value-degree)*60;var minute=Math.floor(value);var second=(value-minute)*60;return degree+"%C2%B0"+minute+"'"+second+"%22"+direction}function getNotes(index){if(typeof ga!=="undefined"){var label=$(".marker-point-item").eq(index).find(".marker-point-notes").val();ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Notes",eventLabel:label})}return $(".marker-point-item").eq(index).find(".marker-point-notes").val()}function clearPointsHandler(){var i;for(i=0;i')}else{popup.html('
')}popup.dialog({width:600,resizable:false,position:{my:"center+"+offset+" center+"+offset,at:"center",of:window},title:Mustache.render("MODIS NDVI for Lat: {{{lat}}} Lon: {{{lon}}}",{lat:sprintf("%.4f",lonlat.lat),lon:sprintf("%.4f",lonlat.lon)}),close:function(event,ui){app.map.removeLayer(markerLayer);$(this).remove()}});var seldonMultigraph=$("#seldonMultigraph"+app.graphCount+""),promise=seldonMultigraph.multigraph({mugl:muglPrefix+lonlat.lon+","+lonlat.lat,swf:"libs/seldon/libs/Multigraph.swf"});seldonMultigraph.multigraph("done",function(m){if(m){$(m.div()).parent().children(".multigraphLoader").remove()}})})}return createMultigraphTool}},{"./clicktool.js":14}],41:[function(require,module,exports){module.exports=function($){Array.prototype.remove=function(value){if(this.indexOf(value)!==-1){this.splice(this.indexOf(value),1);return true}else{return false}};OpenLayers.Map.prototype.getCurrentSize=function(){var size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=this.div.offsetWidth;size.h=this.div.offsetHeight}if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=parseInt(this.div.style.width,10);size.h=parseInt(this.div.style.height,10)}size.h=size.h-parseInt($(this.div).css("padding-top"),10)-parseInt($(this.div).css("padding-bottom"),10);return size};$.widget("ui.dialog",$.extend({},$.ui.dialog.prototype,{_moveToTop:function(arg){if(arg){if(arg.handleObj.type!="mousedown"){var moved=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;if(moved&&!silent){this._trigger("focus",event)}return moved}}}}))}},{}],42:[function(require,module,exports){module.exports=function($){var createArcGIS93RestParams=require("./create_arcgis_rest_params.js")($);var AccordionGroup=require("./accordion_group.js");var AccordionGroupSublist=require("./accordion_group_sublist.js");var BaseLayer=require("./baselayer.js");var Theme=require("./theme.js");function parseConfig(configXML,shareUrlInfo){var Layer=require("./layer.js")($,this);var createIdentifyTool=require("./identify.js")($,this);var createMultigraphTool=require("./multigraph.js")($,this);var marker=require("./marker.js")($,this);var app=this,$configXML=$(configXML),initialBaseLayer,initialTheme,shareUrlLayerAlpha={},themeOptions={},i,j,k,l,ll,lll;if(shareUrlInfo!==undefined){for(i=0,l=shareUrlInfo.layerLids.length;i0){app.maxExtent={left:parseFloat($extent.attr("xmin")),bottom:parseFloat($extent.attr("ymin")),right:parseFloat($extent.attr("xmax")),top:parseFloat($extent.attr("ymax"))}}var $baseCombo=$("#baseCombo"),$images=$configXML.find("images image"),$image,selected,baseLayer;for(i=0,l=$images.length;ionline.',mapName:"Layers",description:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including the terms of use, visit us online at http://goto.arcgisonline.com/maps/World_Street_Map",copyrightText:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012",layers:[{id:0,name:"World Street Map",parentLayerId:-1,defaultVisibility:true,subLayerIds:null,minScale:0,maxScale:0}],tables:[],spatialReference:{wkid:102100},singleFusedMapCache:true,tileInfo:{rows:256,cols:256,dpi:96,format:"JPEG",compressionQuality:90,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:0,resolution:156543.033928,scale:591657527.591555},{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176}]},initialExtent:{xmin:-28872328.0888923,ymin:-11237732.4896886,xmax:28872328.0888923,ymax:11237732.4896886,spatialReference:{wkid:102100}},fullExtent:{xmin:-20037507.0671618,ymin:-19971868.8804086,xmax:20037507.0671618,ymax:19971868.8804086,spatialReference:{wkid:102100}},units:"esriMeters",supportedImageFormatTypes:"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI,BMP",documentInfo:{Title:"World Street Map",Author:"Esri",Comments:"",Subject:"streets, highways, major roads, railways, water features, administrative boundaries, cities, parks, protected areas, landmarks ",Category:"transportation(Transportation Networks) ",Keywords:"World, Global, Europe, Japan, Hong Kong, North America, United States, Canada, Mexico, Southern Africa, Asia, South America, Australia, New Zealand, India, Argentina, Brazil, Chile, Venezuela, Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, Switzerland, Russia, Thailand, Turkey, 2012",Credits:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"},capabilities:"Map"};app.initOpenLayers(baseLayerInfo,initialBaseLayer,initialTheme,themeOptions,initialExtent);return $configXML}function displayError(message){}return parseConfig}},{"./accordion_group.js":3,"./accordion_group_sublist.js":5,"./baselayer.js":13,"./create_arcgis_rest_params.js":16,"./identify.js":24,"./layer.js":28,"./marker.js":36,"./multigraph.js":40,"./theme.js":56}],43:[function(require,module,exports){module.exports=function($,app){function printMap($configXML){var offsetX=parseInt(app.map.layerContainerDiv.style.left,10);var offsetY=parseInt(app.map.layerContainerDiv.style.top,10);var size=app.map.getSize();var tiles=[];var layer,tile,position;var i,j,k;for(i=0;i
');printPopup.dialog({resizable:false,height:75,title:"Creating Image for Print...",close:function(event,ui){$(this).remove()}});var service_url=$configXML.find("tools tool[name=Print]").attr("service_url");if(!service_url){service_url="http://"+window.location.hostname+window.location.pathname}service_url=service_url.replace(/\/$/,"");var service_name=$configXML.find("tools tool[name=Print]").attr("service_name");if(!service_name){service_name="cgi-bin/print.cgi"}var title=$configXML.find("tools tool[name=Print]").attr("title"); -};this.setTransparency=function(transparency){if(this.openLayersLayer){this.openLayersLayer.setOpacity(1-parseFloat(transparency)/100)}this.transparency=transparency;try{this.emit({type:"transparency",value:this.transparency})}catch(err){var test=this.transparency;var errTxt=err.Message}if(app.map!==undefined){var currentLayer,openLayersLayer,lid;var i;for(i=app.map.getNumLayers()-2;i>0;i--){currentLayer=app.map.layers[i];openLayersLayer=currentLayer.seldonLayer.openLayersLayer;lid=currentLayer.seldonLayer.lid;if(stringContainsChar(currentLayer.name,"Mask")){if(openLayersLayer&&lid.substring(0,lid.indexOf("MaskFor"))===this.lid){openLayersLayer.setOpacity(1-parseFloat(transparency)/100);currentLayer.seldonLayer.transparency=transparency}}}}}}window.EventEmitter.declare(Layer);return Layer}},{"./stringContainsChar.js":55}],29:[function(require,module,exports){module.exports=function($){function createLayerToggleCheckbox(layer){var checkbox=document.createElement("input"),$checkbox;checkbox.type="checkbox";checkbox.id="chk"+layer.lid;checkbox.onclick=function(){if($(this).is(":checked")){layer.activate()}else{layer.deactivate({removeFromLegend:true,removeFromParentMaskLayers:true})}};$checkbox=$(checkbox);$checkbox.addClass(layer.lid);layer.addListener("activate",function(){$("input."+this.lid).attr("checked",true)});layer.addListener("deactivate",function(){$("input."+this.lid).attr("checked",false)});return checkbox}return createLayerToggleCheckbox}},{}],30:[function(require,module,exports){module.exports=function($){function createLayerPropertiesDialog(layer){var localTransparency=0;var $html=$(""+'
'+""+""+""+""+""+""+"
Transparency:"+'
'+"
"+'%'+"
"+"
");$html.find("input.transparency-text").val(layer.transparency);if(layer.transparency>0){localTransparency=layer.transparency;layer.setTransparency(localTransparency)}$html.find(".transparency-slider").slider({min:0,max:100,step:1,value:localTransparency,slide:function(event,ui){try{layer.setTransparency(ui.value)}catch(err){var errTxt=err.message}}});$html.find("input.transparency-text").change(function(){var $this=$(this),newValueFloat=parseFloat($this.val());if(isNaN(newValueFloat)||newValueFloat<0||newValueFloat>100){$this.val(layer.transparency);return}layer.setTransparency($this.val())});layer.addListener("transparency",function(e){$html.find("input.transparency-text").val(e.value)});$html.dialog({zIndex:10050,position:"left",autoOpen:true,hide:"explode",title:layer.name,width:"auto",close:function(){$(this).dialog("destroy");$html.remove();createLayerPropertiesDialog.$html[layer.lid]=undefined}});createLayerPropertiesDialog.$html[layer.lid]=$html}createLayerPropertiesDialog.$html={};return createLayerPropertiesDialog}},{}],31:[function(require,module,exports){module.exports=function($){var createLayerPropertiesDialog=require("./layer_dialog.js")($);function createLayerPropertiesIcon(layer){var img=document.createElement("img");img.id=layer.lid;img.src="icons/settings.png";img.className="layerPropertiesIcon";img.onclick=function(){createLayerPropertiesDialog(layer)};return img}return createLayerPropertiesIcon}},{"./layer_dialog.js":30}],32:[function(require,module,exports){module.exports=function($,app){var generalRadioHandler=require("./layer_radio_handler.js")($,app);function createLayerToggleRadioButton(layer,radioGroupName){var checkbox=document.createElement("input"),$checkbox;checkbox.type="radio";checkbox.name=radioGroupName;checkbox.id=layer.lid;if(layer.selectedInConfig){checkbox.checked=true}$checkbox=$(checkbox);$checkbox.change(radioHandler);layer.addListener("activate",function(){$checkbox.attr("checked",true)});layer.addListener("deactivate",function(){$checkbox.attr("checked",false)});return checkbox}function radioHandler(){generalRadioHandler(app)}return createLayerToggleRadioButton}},{"./layer_radio_handler.js":33}],33:[function(require,module,exports){module.exports=function($,app){var Layer=require("./layer.js")($,app);function radioHandler(app){var $selectedOption=$(app.dropdownBoxList[0]).find(":selected");if($selectedOption.text()==="select..."){clearRadioLayers(app,null);return}var selectLayer=app.dropdownBoxLayers[$selectedOption.val()];var wanted_lid=getActiveDropdownBoxRadioLID(app);var wanted_layer=undefined;var i;for(i=0;i0;i--){currLayer=app.map.layers[i].seldonLayer;for(j=0;j"+selectBoxLayers[i].name+"")}selectBox.insertAdjacentHTML("afterbegin","");$(selectBox).change(selectHandler);return selectBox}function selectHandler(){radioHandler(app)}return createLayerToggleDropdownBox}},{"./layer_radio_handler.js":33}],35:[function(require,module,exports){module.exports=function($,app){function isLayerInLegendConfig(layerId){return layerId in app.legendLookup}function getLegendStringFromPixelValue(layerId,pixelValue){var legendString="";if(isLayerInLegendConfig(layerId)){legendString=app.legendLookup[layerId][pixelValue];if(!legendString){console.error("No legend string set for pixel value",pixelValue,"for layer",layerId)}}return legendString}return getLegendStringFromPixelValue}},{}],36:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js");var saveAs=require("../libs/FileSaver/FileSaver.js").saveAs;var popupId="marker-dialog";var points=[];var pointStyleDefault={pointRadius:4,fillColor:"blue",fillOpacity:.75};var pointStyleHover={pointRadius:5,fillColor:"orange",fillOpacity:.75};var pointStyle=new OpenLayers.StyleMap(pointStyleDefault);function marker(){return new ClickTool(markerHandler)}function markerHandler(e){var coords=app.map.getLonLatFromPixel(e.xy);var lonlat=app.map.getLonLatFromPixel(e.xy);lonlat.transform(app.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));var markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:pointStyle});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));markerLayer.addFeatures(feature);app.map.addLayer(markerLayer);if(!$("#"+popupId).length){createPopup()}if($(".marker-points").length){createPointItem(lonlat,markerLayer)}points.push({lonlat:lonlat,layer:markerLayer});if(typeof ga!=="undefined"){ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Create New Point",eventLabel:lonlat.lon+", "+lonlat.lat})}}function createPointItem(coords,layer){var itemString="";itemString+='
';itemString+='
';itemString+=' Lat:';itemString+=' '+coords.lat+"";itemString+="
";itemString+='
';itemString+=' Lon:';itemString+=' '+coords.lon+"";itemString+="
";itemString+='
';itemString+=' Notes:';itemString+='
';itemString+="
";itemString+="
";var item=$(itemString);item.data("point",layer);item.on("mouseenter",handlePointHoverEnter).on("mouseleave",handlePointHoverLeave);$(".marker-points").append(item)}function handlePointHoverEnter(e){var point=$(this).data("point");point.style=pointStyleHover;point.redraw()}function handlePointHoverLeave(e){var point=$(this).data("point");point.style=pointStyleDefault;point.redraw()}function createPopup(){var popup=$('
');$("body").append(popup);$(".marker-button-download").click(exportFileHandler);$(".marker-button-clear").click(clearPointsHandler);popup.dialog({width:300,height:400,resizable:false,position:{my:"right top",at:"right-5 top+120"},title:"Mark areas of interest",close:function(event,ui){clearPointsHandler();$(this).remove()}})}function exportFileHandler(){var lat,lon,url,notes;var SEP="|";var i;var csvContent="sep="+SEP+"\n";csvContent+="lat"+SEP+"long"+SEP+"google maps link"+SEP+"notes\n";for(i=0;i=0){direction="N"}else if(type==="lat"&&value<0){direction="S"}else if(type==="lon"&&value>=0){direction="E"}else if(type==="lon"&&value<0){direction="W"}value=Math.abs(value);var degree=Math.floor(value);value=(value-degree)*60;var minute=Math.floor(value);var second=(value-minute)*60;return degree+"%C2%B0"+minute+"'"+second+"%22"+direction}function getNotes(index){if(typeof ga!=="undefined"){var label=$(".marker-point-item").eq(index).find(".marker-point-notes").val();ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Notes",eventLabel:label})}return $(".marker-point-item").eq(index).find(".marker-point-notes").val()}function clearPointsHandler(){var i;for(i=0;i')}else{popup.html('
')}popup.dialog({width:600,resizable:false,position:{my:"center+"+offset+" center+"+offset,at:"center",of:window},title:Mustache.render("MODIS NDVI for Lat: {{{lat}}} Lon: {{{lon}}}",{lat:sprintf("%.4f",lonlat.lat),lon:sprintf("%.4f",lonlat.lon)}),close:function(event,ui){app.map.removeLayer(markerLayer);$(this).remove()}});var seldonMultigraph=$("#seldonMultigraph"+app.graphCount+""),promise=seldonMultigraph.multigraph({mugl:muglPrefix+lonlat.lon+","+lonlat.lat,swf:"libs/seldon/libs/Multigraph.swf"});seldonMultigraph.multigraph("done",function(m){if(m){$(m.div()).parent().children(".multigraphLoader").remove()}})})}return createMultigraphTool}},{"./clicktool.js":14}],41:[function(require,module,exports){module.exports=function($){Array.prototype.remove=function(value){if(this.indexOf(value)!==-1){this.splice(this.indexOf(value),1);return true}else{return false}};OpenLayers.Map.prototype.getCurrentSize=function(){var size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=this.div.offsetWidth;size.h=this.div.offsetHeight}if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=parseInt(this.div.style.width,10);size.h=parseInt(this.div.style.height,10)}size.h=size.h-parseInt($(this.div).css("padding-top"),10)-parseInt($(this.div).css("padding-bottom"),10);return size};$.widget("ui.dialog",$.extend({},$.ui.dialog.prototype,{_moveToTop:function(arg){if(arg){if(arg.handleObj.type!="mousedown"){var moved=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;if(moved&&!silent){this._trigger("focus",event)}return moved}}}}))}},{}],42:[function(require,module,exports){module.exports=function($){var createArcGIS93RestParams=require("./create_arcgis_rest_params.js")($);var AccordionGroup=require("./accordion_group.js");var AccordionGroupSublist=require("./accordion_group_sublist.js");var BaseLayer=require("./baselayer.js");var Theme=require("./theme.js");function parseConfig(configXML,shareUrlInfo){var Layer=require("./layer.js")($,this);var createIdentifyTool=require("./identify.js")($,this);var createMultigraphTool=require("./multigraph.js")($,this);var marker=require("./marker.js")($,this);var app=this,$configXML=$(configXML),initialBaseLayer,initialTheme,shareUrlLayerAlpha={},themeOptions={},i,j,k,l,ll,lll;if(shareUrlInfo!==undefined){for(i=0,l=shareUrlInfo.layerLids.length;i0){app.maxExtent={left:parseFloat($extent.attr("xmin")),bottom:parseFloat($extent.attr("ymin")),right:parseFloat($extent.attr("xmax")),top:parseFloat($extent.attr("ymax"))}}var $baseCombo=$("#baseCombo"),$images=$configXML.find("images image"),$image,selected,baseLayer;for(i=0,l=$images.length;ionline.',mapName:"Layers",description:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including the terms of use, visit us online at http://goto.arcgisonline.com/maps/World_Street_Map",copyrightText:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012",layers:[{id:0,name:"World Street Map",parentLayerId:-1,defaultVisibility:true,subLayerIds:null,minScale:0,maxScale:0}],tables:[],spatialReference:{wkid:102100},singleFusedMapCache:true,tileInfo:{rows:256,cols:256,dpi:96,format:"JPEG",compressionQuality:90,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:0,resolution:156543.033928,scale:591657527.591555},{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176}]},initialExtent:{xmin:-28872328.0888923,ymin:-11237732.4896886,xmax:28872328.0888923,ymax:11237732.4896886,spatialReference:{wkid:102100}},fullExtent:{xmin:-20037507.0671618,ymin:-19971868.8804086,xmax:20037507.0671618,ymax:19971868.8804086,spatialReference:{wkid:102100}},units:"esriMeters",supportedImageFormatTypes:"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI,BMP",documentInfo:{Title:"World Street Map",Author:"Esri",Comments:"",Subject:"streets, highways, major roads, railways, water features, administrative boundaries, cities, parks, protected areas, landmarks ",Category:"transportation(Transportation Networks) ",Keywords:"World, Global, Europe, Japan, Hong Kong, North America, United States, Canada, Mexico, Southern Africa, Asia, South America, Australia, New Zealand, India, Argentina, Brazil, Chile, Venezuela, Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, Switzerland, Russia, Thailand, Turkey, 2012",Credits:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"},capabilities:"Map"};app.initOpenLayers(baseLayerInfo,initialBaseLayer,initialTheme,themeOptions,initialExtent);return $configXML}function displayError(message){}return parseConfig}},{"./accordion_group.js":3,"./accordion_group_sublist.js":5,"./baselayer.js":13,"./create_arcgis_rest_params.js":16,"./identify.js":24,"./layer.js":28,"./marker.js":36,"./multigraph.js":40,"./theme.js":56}],43:[function(require,module,exports){module.exports=function($,app){function printMap($configXML){var offsetX=parseInt(app.map.layerContainerDiv.style.left,10);var offsetY=parseInt(app.map.layerContainerDiv.style.top,10);var size=app.map.getSize();var tiles=[];var layer,tile,position;var i,j,k;for(i=0;i
');printPopup.dialog({resizable:false,height:75,title:"Creating Image for Print...",close:function(event,ui){$(this).remove()}});var service_url=$configXML.find("tools tool[name=Print]").attr("service_url");if(!service_url){service_url="http://"+window.location.hostname+window.location.pathname}service_url=service_url.replace(/\/$/,"");var service_name=$configXML.find("tools tool[name=Print]").attr("service_name");if(!service_name){service_name="cgi-bin/print.cgi"}var title=$configXML.find("tools tool[name=Print]").attr("title");if(!title){ -title="U.S Forest Change Assessment Viewer"}$.ajax({url:service_url+"/"+service_name,type:"POST",data:OpenLayers.Util.getParameterString({width:size.w,height:size.h,tiles:tiles_json,legends:legends_json,title:title}),headers:{"Content-Type":"application/x-www-form-urlencoded"},success:function(data,status,jqxhr){data=data.replace(/\s+/,"");var href=service_url+"/cgi-bin/printed_map.jpg";if(data){href=service_url+"/"+data}$("#printMapLoader").html('
print image result
');printPopup.dialog("option","title","Print Image Created!")},error:function(jqxhr,status,err){$("#printMapLoader").html("
An error happended.
");printPopup.dialog("option","title","NO Print Image Created!")}})}return printMap}},{}],44:[function(require,module,exports){function RepeatingOperation(op,yieldEveryIteration){var count=0;var instance=this;this.step=function(args){if(++count>=yieldEveryIteration){count=0;setTimeout(function(){op(args)},1,[]);return}op(args)}}module.exports=RepeatingOperation},{}],45:[function(require,module,exports){module.exports=function($){function handle_search(location,app){var rest_endpoint="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text="+location+"&f=json";$.getJSON(rest_endpoint,function(data){var locations=data["locations"][0];if(locations===undefined){return}var extent=locations["extent"];var bounds=new OpenLayers.Bounds(extent.xmin,extent.ymin,extent.xmax,extent.ymax).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));app.zoomToExtent(bounds,true)})}return handle_search}},{}],46:[function(require,module,exports){(function($){"use strict";require("./overrides.js")($);var seldon={App:require("./app.js")($)};var app=new seldon.App;seldon.init=require("./init.js")(app);window.seldon=seldon})(jQuery)},{"./app.js":11,"./init.js":25,"./overrides.js":41}],47:[function(require,module,exports){module.exports=function($){function setBaseLayer(baseLayer){var resolutions=[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,.5971642833948135];var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets");handleBaseLayer(app,layer,baseLayer)}else if(baseLayer.type=="ArcGISCache"){$.ajax({url:baseLayer.url+"?f=json&pretty=true",dataType:"jsonp",success:function(layerInfo){var options={layerInfo:layerInfo};if(baseLayer.numZoomLevels){options.numZoomLevels=baseLayer.numZoomLevels;if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);options.serverResolutions=serverResolutions;options.resolutions=resolutions}}var layer=new OpenLayers.Layer.ArcGISCache(baseLayer.name,baseLayer.url,options);handleBaseLayer(app,layer,baseLayer)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet,sphericalMercator:true};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings);handleBaseLayer(app,layer,baseLayer)}}function handleBaseLayer(app,layer,baseLayer){app.map.removeLayer(app.map.layers[0]);app.currentBaseLayer=baseLayer;app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.emit("baselayerchange")}return setBaseLayer}},{}],48:[function(require,module,exports){function ga_events($){var eventAdded=false;try{$.ga.trackEvent;eventAdded=true}catch(err){eventAdded=false}if(typeof ga!=="undefined"){if(eventAdded){seldon.app.map.events.register("moveend",seldon.app.map,function(){var newMapExtent=seldon.app.map.getExtent();$.ga.trackEvent({category:"Map Extent",action:"Change",label:newMapExtent.toString(),nonInteractive:true})});$(".shareMapUrl").click(function(event){$.ga.trackEvent({category:"Share Map URL",action:"Click",label:$(".shareMapUrl").val()})});$("#mapTheme #themeCombo").change(function(event){$.ga.trackEvent({category:"Map Theme",action:"Change",label:$("#mapTheme #themeCombo option:selected").text()})});$("#txtFindArea input#address_field").keyup(function(event){if(event.which===13){$.ga.trackEvent({category:"Find Area",action:"Search Enter",label:$(this).val()})}});$("#txtFindArea #address_lookup img").click(function(event){$.ga.trackEvent({category:"Find Area",action:"Search Button",label:$("#txtFindArea input#address_field").val()})});$("#mapBase #baseCombo").change(function(event){$.ga.trackEvent({category:"Base Map",action:"Change",label:$("#mapBase #baseCombo option:selected").text()})});$(".header-bar .header-bar img.icon").gaTrackEvent({category:"Nav Bar",action:"click",useLabel:true,labelAttribute:"title",useEvent:true,event:"click"});$("#mapToolsDialog label[for^='chk']").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#mapToolsDialog input").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("#layerPickerDialog label[for^='chk']").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#layerPickerDialog input").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("h3.ui-accordion-header").gaTrackEvent({category:"Base Layer",action:"Toggle Accordion",useLabel:true,label:function(){return $(this).text()},useEvent:true,event:"click"});$("#marker-dialog .marker-button-wrapper .marker-button-download").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Download Points"})});$("#marker-dialog .marker-button-wrapper .marker-button-clear").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Clear Points"})});$("#marker-dialog .marker-point-label .marker-point-coords-label").focusout(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Notes",label:$(this).val()})});$("img[src$='slider.png']").mouseup(function(event){$.ga.trackEvent({category:"OpenLayers Buttons",action:"Slide",label:"Zoom Slider"})});$(".olButton").click(function(event){var eleId=$(this).attr("id");switch(true){case eleId.indexOf("ZoombarOpenLayers_Map")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Bar"});break;case eleId.indexOf("panleft")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan Left"});break;case eleId.indexOf("panright")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan right"});break;case eleId.indexOf("panup")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan up"});break;case eleId.indexOf("pandown")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan down"});break;case eleId.indexOf("zoomin")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom in"});break;case eleId.indexOf("zoomout")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Out"});break;default:}})}}}module.exports=ga_events},{}],49:[function(require,module,exports){module.exports=function($){function setMaskByLayer(toggle,parentLayer){var Layer=require("./layer.js")($,this);var app=this;var maskLayer,maskName,cleanMaskName;var m,ml,mld;if(toggle){for(m=0;m0;i--){var currLayer=app.map.layers[i];for(var j=0;j0||sublist.break?"":" empty";var collapsibleClass=sublist.collapsible?" collapsible":"";var collapseHeaderIcon=sublist.collapsible?'':"";var sublistObj={heading:sublist.label,items:[],collapsible:sublist.collapsible,contentElement:$('
'+'
'+collapseHeaderIcon+"

"+sublist.label+"

"+"
"+"
")};if(sublist.description){var sublistInfoButton=new MoreInfoButton(sublist);sublistObj.contentElement.children(".sublist-header").append(sublistInfoButton.element)}g.sublists.push(sublistObj);sublistItems.push(sublistObj.contentElement);var sublistLayerItems=[];for(var k=0,l=sublist.layers.length;k=0){name=this.substring(0,i);value=this.substring(i+1)}else{name=this;value=undefined}vars[name]=value});info.themeName=vars.theme;info.accordionGroupGid=vars.accgp;info.baseLayerName=vars.basemap;if(vars.extent){var extentCoords=vars.extent.split(",");info.extent={left:extentCoords[0],bottom:extentCoords[1],right:extentCoords[2],top:extentCoords[3]}}if(vars.layers){$.each(vars.layers.split(","),function(){info.layerLids.push(this)})}if(vars.mask){$.each(vars.mask.split(","),function(){info.layerMask.push(this)})}if(vars.modifiers){$.each(vars.modifiers.split(","),function(){info.maskModifiers.push(this)})}if(vars.alphas){$.each(vars.alphas.split(","),function(){info.layerAlphas.push(this)})}if(info.themeName&&info.baseLayerName){return info}return undefined};ShareUrlInfo.prototype.urlArgs=function(){return Mustache.render(""+"theme={{{theme}}}"+"&layers={{{layers}}}"+"&mask={{{mask}}}"+"{{{modifiers}}}"+"&alphas={{{alphas}}}"+"&accgp={{{accgp}}}"+"&basemap={{{basemap}}}"+"&extent={{{extent.left}}},{{{extent.bottom}}},{{{extent.right}}},{{{extent.top}}}",{theme:this.themeName,layers:this.layerLids.join(","),mask:this.layerMask.join(","),modifiers:this.maskModifiers.length>0?"&modifiers="+this.maskModifiers.join(","):"",alphas:this.layerAlphas.join(","),accgp:this.accordionGroupGid,basemap:this.baseLayerName,extent:this.extent})};module.exports=ShareUrlInfo},{}],53:[function(require,module,exports){module.exports=function($){var stringContainsChar=require("./stringContainsChar.js");var ShareUrlInfo=require("./share.js");function shareUrl(){if(!this.currentTheme){return undefined}if(!this.currentAccordionGroup){return undefined}if(!this.currentBaseLayer){return undefined}var extent=this.map.getExtent(),layerLids=[],layerAlphas=[],layerMask=[],url;if(!extent){return undefined}$.each(this.map.layers,function(){var op,lid,test;if(!this.isBaseLayer){if(this.opacity===1){op="1"}else if(this.opacity===0){op="0"}else{op=sprintf("%.2f",this.opacity)}if(stringContainsChar(this.name,"MaskFor")){lid=this.seldonLayer.lid;test=lid.substring(lid.indexOf("MaskFor"),lid.length).replace("MaskFor","");if(layerMask.indexOf(test)===-1){layerMask.push(test)}test=this.name.substring(0,this.name.indexOf("MaskFor"));if(layerLids.indexOf(test)===-1){layerLids.push(test);layerAlphas.push(op)}}else{if(this.seldonLayer){layerLids.push(this.seldonLayer.lid);layerAlphas.push(op)}}}});if(this.hasOwnProperty("maskModifiers")){var modifiers=this.maskModifiers.filter(function(val){return val!==""})}url=window.location.toString();url=url.replace(/\?.*$/,"");url=url.replace(/\/$/,"");url=url.replace("#","");return url+"?"+new ShareUrlInfo({themeName:this.currentTheme.name,layerLids:layerLids,layerMask:layerMask,maskModifiers:modifiers,layerAlphas:layerAlphas,accordionGroupGid:this.currentAccordionGroup.gid,baseLayerName:this.currentBaseLayer.name,extent:extent}).urlArgs()}return shareUrl}},{"./share.js":52,"./stringContainsChar.js":55}],54:[function(require,module,exports){module.exports=function($){function createSplashScreen(){var $document=$(document),windowWidth=Math.round($document.width()/2);$("#splashScreenContent").load("splashScreen.html");$("#splashScreenContainer").dialog({autoOpen:false,zIndex:10051,maxHeight:$document.height(),width:windowWidth,minWidth:300,dialogClass:"splashScreenStyle",hide:"explode"})}return createSplashScreen}},{}],55:[function(require,module,exports){function stringContainsChar(string,c){return string.indexOf(c)>=0}module.exports=stringContainsChar},{}],56:[function(require,module,exports){function Theme(settings){this.accordionGroups=[];if(!settings){return}this.name=settings.name;this.label=settings.label;this.index=settings.index;this.zoom=settings.zoom;this.xmin=settings.xmin;this.ymin=settings.ymin;this.xmax=settings.xmax;this.ymax=settings.ymax;this.getAccordionGroupIndex=function(accordionGroup){var i;for(i=0;iprint image result');printPopup.dialog("option","title","Print Image Created!")},error:function(jqxhr,status,err){$("#printMapLoader").html("
An error happended.
");printPopup.dialog("option","title","NO Print Image Created!")}})}return printMap}},{}],44:[function(require,module,exports){function RepeatingOperation(op,yieldEveryIteration){var count=0;var instance=this;this.step=function(args){if(++count>=yieldEveryIteration){count=0;setTimeout(function(){op(args)},1,[]);return}op(args)}}module.exports=RepeatingOperation},{}],45:[function(require,module,exports){module.exports=function($){function handle_search(location,app){var rest_endpoint="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text="+location+"&f=json";$.getJSON(rest_endpoint,function(data){var locations=data["locations"][0];if(locations===undefined){return}var extent=locations["extent"];var bounds=new OpenLayers.Bounds(extent.xmin,extent.ymin,extent.xmax,extent.ymax).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));app.zoomToExtent(bounds,true)})}return handle_search}},{}],46:[function(require,module,exports){(function($){"use strict";require("./overrides.js")($);var seldon={App:require("./app.js")($)};var app=new seldon.App;seldon.init=require("./init.js")(app);window.seldon=seldon})(jQuery)},{"./app.js":11,"./init.js":25,"./overrides.js":41}],47:[function(require,module,exports){module.exports=function($){function setBaseLayer(baseLayer){var resolutions=[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,.5971642833948135];var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets");handleBaseLayer(app,layer,baseLayer)}else if(baseLayer.type=="ArcGISCache"){$.ajax({url:baseLayer.url+"?f=json&pretty=true",dataType:"jsonp",success:function(layerInfo){var options={layerInfo:layerInfo};if(baseLayer.numZoomLevels){options.numZoomLevels=baseLayer.numZoomLevels;if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);options.serverResolutions=serverResolutions;options.resolutions=resolutions}}var layer=new OpenLayers.Layer.ArcGISCache(baseLayer.name,baseLayer.url,options);handleBaseLayer(app,layer,baseLayer)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet,sphericalMercator:true};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings);handleBaseLayer(app,layer,baseLayer)}}function handleBaseLayer(app,layer,baseLayer){app.map.removeLayer(app.map.layers[0]);app.currentBaseLayer=baseLayer;app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.emit("baselayerchange")}return setBaseLayer}},{}],48:[function(require,module,exports){function ga_events($){var eventAdded=false;try{$.ga.trackEvent;eventAdded=true}catch(err){eventAdded=false}if(typeof ga!=="undefined"){if(eventAdded){seldon.app.map.events.register("moveend",seldon.app.map,function(){var newMapExtent=seldon.app.map.getExtent();$.ga.trackEvent({category:"Map Extent",action:"Change",label:newMapExtent.toString(),nonInteractive:true})});$(".shareMapUrl").click(function(event){$.ga.trackEvent({category:"Share Map URL",action:"Click",label:$(".shareMapUrl").val()})});$("#mapTheme #themeCombo").change(function(event){$.ga.trackEvent({category:"Map Theme",action:"Change",label:$("#mapTheme #themeCombo option:selected").text()})});$("#txtFindArea input#address_field").keyup(function(event){if(event.which===13){$.ga.trackEvent({category:"Find Area",action:"Search Enter",label:$(this).val()})}});$("#txtFindArea #address_lookup img").click(function(event){$.ga.trackEvent({category:"Find Area",action:"Search Button",label:$("#txtFindArea input#address_field").val()})});$("#mapBase #baseCombo").change(function(event){$.ga.trackEvent({category:"Base Map",action:"Change",label:$("#mapBase #baseCombo option:selected").text()})});$(".header-bar .header-bar img.icon").gaTrackEvent({category:"Nav Bar",action:"click",useLabel:true,labelAttribute:"title",useEvent:true,event:"click"});$("#mapToolsDialog label[for^='chk']").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#mapToolsDialog input").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("#layerPickerDialog label[for^='chk']").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#layerPickerDialog input").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("h3.ui-accordion-header").gaTrackEvent({category:"Base Layer",action:"Toggle Accordion",useLabel:true,label:function(){return $(this).text()},useEvent:true,event:"click"});$("#marker-dialog .marker-button-wrapper .marker-button-download").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Download Points"})});$("#marker-dialog .marker-button-wrapper .marker-button-clear").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Clear Points"})});$("#marker-dialog .marker-point-label .marker-point-coords-label").focusout(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Notes",label:$(this).val()})});$("img[src$='slider.png']").mouseup(function(event){$.ga.trackEvent({category:"OpenLayers Buttons",action:"Slide",label:"Zoom Slider"})});$(".olButton").click(function(event){var eleId=$(this).attr("id");switch(true){case eleId.indexOf("ZoombarOpenLayers_Map")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Bar"});break;case eleId.indexOf("panleft")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan Left"});break;case eleId.indexOf("panright")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan right"});break;case eleId.indexOf("panup")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan up"});break;case eleId.indexOf("pandown")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan down"});break;case eleId.indexOf("zoomin")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom in"});break;case eleId.indexOf("zoomout")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Out"});break;default:}})}}}module.exports=ga_events},{}],49:[function(require,module,exports){module.exports=function($){function setMaskByLayer(toggle,parentLayer){var Layer=require("./layer.js")($,this);var app=this;var maskLayer,maskName,cleanMaskName;var m,ml,mld;if(toggle){for(m=0;m0;i--){var currLayer=app.map.layers[i];for(var j=0;j0||sublist.break?"":" empty";var collapsibleClass=sublist.collapsible?" collapsible":"";var collapseHeaderIcon=sublist.collapsible?'':"";var sublistObj={heading:sublist.label,items:[],collapsible:sublist.collapsible,contentElement:$('
'+'
'+collapseHeaderIcon+"

"+sublist.label+"

"+"
"+"
")};if(sublist.description){var sublistInfoButton=new MoreInfoButton(sublist);sublistObj.contentElement.children(".sublist-header").append(sublistInfoButton.element)}g.sublists.push(sublistObj);sublistItems.push(sublistObj.contentElement);var sublistLayerItems=[];for(var k=0,l=sublist.layers.length;k=0){name=this.substring(0,i);value=this.substring(i+1)}else{name=this;value=undefined}vars[name]=value});info.themeName=vars.theme;info.accordionGroupGid=vars.accgp;info.baseLayerName=vars.basemap;if(vars.extent){var extentCoords=vars.extent.split(",");info.extent={left:extentCoords[0],bottom:extentCoords[1],right:extentCoords[2],top:extentCoords[3]}}if(vars.layers){$.each(vars.layers.split(","),function(){info.layerLids.push(this)})}if(vars.mask){$.each(vars.mask.split(","),function(){info.layerMask.push(this)})}if(vars.modifiers){$.each(vars.modifiers.split(","),function(){info.maskModifiers.push(this)})}if(vars.alphas){$.each(vars.alphas.split(","),function(){info.layerAlphas.push(this)})}if(info.themeName&&info.baseLayerName){return info}return undefined};ShareUrlInfo.prototype.urlArgs=function(){return Mustache.render(""+"theme={{{theme}}}"+"&layers={{{layers}}}"+"&mask={{{mask}}}"+"{{{modifiers}}}"+"&alphas={{{alphas}}}"+"&accgp={{{accgp}}}"+"&basemap={{{basemap}}}"+"&extent={{{extent.left}}},{{{extent.bottom}}},{{{extent.right}}},{{{extent.top}}}",{theme:this.themeName,layers:this.layerLids.join(","),mask:this.layerMask.join(","),modifiers:this.maskModifiers.length>0?"&modifiers="+this.maskModifiers.join(","):"",alphas:this.layerAlphas.join(","),accgp:this.accordionGroupGid,basemap:this.baseLayerName,extent:this.extent})};module.exports=ShareUrlInfo},{}],53:[function(require,module,exports){module.exports=function($){var stringContainsChar=require("./stringContainsChar.js");var ShareUrlInfo=require("./share.js");function shareUrl(){if(!this.currentTheme){return undefined}if(!this.currentAccordionGroup){return undefined}if(!this.currentBaseLayer){return undefined}var extent=this.map.getExtent(),layerLids=[],layerAlphas=[],layerMask=[],url;if(!extent){return undefined}$.each(this.map.layers,function(){var op,lid,test;if(!this.isBaseLayer){if(this.opacity===1){op="1"}else if(this.opacity===0){op="0"}else{op=sprintf("%.2f",this.opacity)}if(stringContainsChar(this.name,"MaskFor")){lid=this.seldonLayer.lid;test=lid.substring(lid.indexOf("MaskFor"),lid.length).replace("MaskFor","");if(layerMask.indexOf(test)===-1){layerMask.push(test)}test=this.name.substring(0,this.name.indexOf("MaskFor"));if(layerLids.indexOf(test)===-1){layerLids.push(test);layerAlphas.push(op)}}else{if(this.seldonLayer){layerLids.push(this.seldonLayer.lid);layerAlphas.push(op)}}}});if(this.hasOwnProperty("maskModifiers")){var modifiers=this.maskModifiers.filter(function(val){return val!==""})}url=window.location.toString();url=url.replace(/\?.*$/,"");url=url.replace(/\/$/,"");url=url.replace("#","");return url+"?"+new ShareUrlInfo({themeName:this.currentTheme.name,layerLids:layerLids,layerMask:layerMask,maskModifiers:modifiers,layerAlphas:layerAlphas,accordionGroupGid:this.currentAccordionGroup.gid,baseLayerName:this.currentBaseLayer.name,extent:extent}).urlArgs()}return shareUrl}},{"./share.js":52,"./stringContainsChar.js":55}],54:[function(require,module,exports){module.exports=function($){function createSplashScreen(){var $document=$(document),windowWidth=Math.round($document.width()/2);$("#splashScreenContent").load("splashScreen.html");$("#splashScreenContainer").dialog({autoOpen:false,zIndex:10051,maxHeight:$document.height(),width:windowWidth,minWidth:300,dialogClass:"splashScreenStyle",hide:"explode"})}return createSplashScreen}},{}],55:[function(require,module,exports){function stringContainsChar(string,c){return string.indexOf(c)>=0}module.exports=stringContainsChar},{}],56:[function(require,module,exports){function Theme(settings){this.accordionGroups=[];if(!settings){return}this.name=settings.name;this.label=settings.label;this.index=settings.index;this.zoom=settings.zoom;this.xmin=settings.xmin;this.ymin=settings.ymin;this.xmax=settings.xmax;this.ymax=settings.ymax;this.getAccordionGroupIndex=function(accordionGroup){var i;for(i=0;i Date: Fri, 6 Aug 2021 18:39:05 +0000 Subject: [PATCH 2/8] Fix globe icon (seldon) --- html/libs/seldon/js/init_openlayers.js | 15 ++------------- html/libs/seldon/seldon-min.js | 6 +++--- html/libs/seldon/seldon.js | 15 ++------------- libs/seldon | 2 +- 4 files changed, 8 insertions(+), 30 deletions(-) diff --git a/html/libs/seldon/js/init_openlayers.js b/html/libs/seldon/js/init_openlayers.js index 1af6384..f9e662f 100644 --- a/html/libs/seldon/js/init_openlayers.js +++ b/html/libs/seldon/js/init_openlayers.js @@ -54,7 +54,6 @@ function initOpenLayers (baseLayerInfo, baseLayer, theme, themeOptions, initialE app.map = new OpenLayers.Map('map', { units: 'm', tileManager: app.tileManager, - center: [-10986902.689297,4856468.480035], controls: [ new OpenLayers.Control.Navigation(), new OpenLayers.Control.Attribution(), @@ -81,18 +80,8 @@ function initOpenLayers (baseLayerInfo, baseLayer, theme, themeOptions, initialE app.map.setLayerIndex(layer, 0); app.setTheme(theme, themeOptions); - /*This block of code here feels a little hacky but I put this in here - to attempt to restore previous functionality of share links - initialExtent is equal to app.maxExtent if null and it shouldn't be null - for a share link.*/ - if (initialExtent != app.maxExtent) { - app.zoomToExtent(initialExtent); - } else { - var defaultZoom = 5; - app.map.setCenter(app.map.getCenter(), defaultZoom); - app.saveCurrentExtent(); - } - // End hacky block of code + app.zoomToExtent(initialExtent); + app.saveCurrentExtent(); app.map.events.register("mousemove", app.map, function (e) { var pixel = app.map.events.getMousePosition(e); diff --git a/html/libs/seldon/seldon-min.js b/html/libs/seldon/seldon-min.js index a5c5808..eb08ee3 100644 --- a/html/libs/seldon/seldon-min.js +++ b/html/libs/seldon/seldon-min.js @@ -1,4 +1,4 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o"+'

'+el.description+"

"+"";$(dialogDiv).dialog({title:el.label||el.name,dialogClass:"tooltip-dialog "+dialogClass})}}}return MoreInfoButton}},{}],7:[function(require,module,exports){module.exports=function($){function addAccordionSection(accordionGroup,title){var sectionObj={title:title,titleElement:$("

"+title+"

"),contentElement:$("
"),sublists:[]};var $accordionGroup=$(accordionGroup);$accordionGroup.data("listAccordion").sections.push(sectionObj);$accordionGroup.append(sectionObj.titleElement).append(sectionObj.contentElement);$accordionGroup.accordion("refresh");return sectionObj}return addAccordionSection}},{}],8:[function(require,module,exports){module.exports=function($){function addAccordionSublists(g,items){$(g.contentElement).append(items)}return addAccordionSublists}},{}],9:[function(require,module,exports){module.exports=function($){function addAccordionSublistItems(s,items,theme,accGp){var collapsed=s.collapsible?"collapsed ":"";var contents=$('
');for(var i=0,l=items.length;i').append(items[i]))}var layer={name:name,contentElement:contents};s.items.push(layer);s.contentElement.append(layer.contentElement)}return addAccordionSublistItems}},{}],10:[function(require,module,exports){module.exports=function($){function addMaskToLegend(layer){var app=this;var maskName=layer.lid.substring(layer.lid.indexOf("MaskFor"),layer.lid.length);$("#lgd"+maskName).remove();layer.$legendItem=$(document.createElement("div")).attr("id","lgd"+maskName).prepend($(document.createElement("img")).attr("src",layer.legend)).prependTo($("#legend")).click(function(){app.setMaskByMask(false,maskName)})}return addMaskToLegend}},{}],11:[function(require,module,exports){module.exports=function($){var EventEmitter=window.EventEmitter;function App(){EventEmitter.call(this);this.map=undefined;this.tileManager=undefined;this.projection=undefined;this.gisServerType=undefined;this.useProxyScript=undefined;this.scalebar=undefined;this.zoomInTool=undefined;this.zoomOutTool=undefined;this.dragPanTool=undefined;this.id_markerLayer=undefined;this.maxExtent={left:-15e6,bottom:2e6,right:-6e6,top:7e6};this.baseLayers=[];this.accordionGroups=[];this.themes=[];this.maskParentLayers=[];this.masks=[];this.maskModifiers=[];this.defaultMasks=["MaskForForest"];this.radioButtonList=[];this.radioButtonLayers=[];this.dropdownBoxList=[];this.dropdownBoxLayers=[];this.currentBaseLayer=undefined;this.currentAccordionGroup=undefined;this.currentTheme=undefined;this.identifyTool=undefined;this.multigraphTool=undefined;this.markerTool=undefined;this.savedExtents=[];this.currentSavedExtentIndex=-1;this.saveCurrentExtent=require("./extent_save.js");this.zoomToExtent=require("./extent_zoom.js");this.zoomToPreviousExtent=require("./extent_zoom_previous.js");this.zoomToNextExtent=require("./extent_zoom_next.js");this.printSavedExtents=require("./extent_print.js");this.setBaseLayer=require("./set_base_layer.js")($);this.setAccordionGroup=require("./accordion_group_set.js");this.clearAccordionSections=require("./accordion_clear.js")($);this.addAccordionSection=require("./accordion_section_add.js")($);this.addAccordionSublists=require("./accordion_sublist_add.js")($);this.addAccordionSublistItems=require("./accordion_sublist_item_add.js")($);this.setTheme=require("./set_theme.js")($);this.shareUrl=require("./share_url.js")($);this.updateShareMapUrl=require("./update_share_url.js")($);this.launch=require("./launch.js")($);this.count=require("./count.js");this.addMaskToLegend=require("./add_mask_legend.js")($);this.setMaskByMask=require("./set_mask_by_mask.js")($);this.setMaskByLayer=require("./set_mask_by_layer.js")($);this.handleMaskModifier=require("./mask_modifier.js");this.handleMaskModifierGroup=require("./mask_modifier_group.js")($);this.parseConfig=require("./parse_config.js")($);this.initOpenLayers=require("./init_openlayers.js");this.setupCollapsibleSublists=require("./accordion_collapsible_sublist_setup.js")($);this.removeMaskFromLegend=function(layer){};OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.IMAGE_RELOAD_ATTEMPTS=3}EventEmitter.declare(App);return App}},{"./accordion_clear.js":1,"./accordion_collapsible_sublist_setup.js":2,"./accordion_group_set.js":4,"./accordion_section_add.js":7,"./accordion_sublist_add.js":8,"./accordion_sublist_item_add.js":9,"./add_mask_legend.js":10,"./count.js":15,"./extent_print.js":18,"./extent_save.js":19,"./extent_zoom.js":20,"./extent_zoom_next.js":21,"./extent_zoom_previous.js":22,"./init_openlayers.js":26,"./launch.js":27,"./mask_modifier.js":38,"./mask_modifier_group.js":39,"./parse_config.js":42,"./set_base_layer.js":47,"./set_mask_by_layer.js":49,"./set_mask_by_mask.js":50,"./set_theme.js":51,"./share_url.js":53,"./update_share_url.js":57}],12:[function(require,module,exports){function arrayContainsElement(array,element){var i;if(array===undefined){return false}for(i=0;iparam").each(function(i,param){var $param=$(param);if(param.hasAttribute("value")){obj[$param.attr("name")]=$param.attr("value")}else{obj[$param.attr("name")]=createArcGIS93RestParams($param)}});return obj}return createArcGIS93RestParams}},{}],17:[function(require,module,exports){module.exports=function(app,activeBtn){function deactivateActiveOpenLayersControls(){var controls,i;for(i=0;i=0;--i){e=this.savedExtents[i];html+=Mustache.render("{{{marker}}}{{{number}}}"+"left:{{{left}}}, bottom:{{{bottom}}}, right:{{{right}}}, top:{{{top}}}",{marker:i===this.currentSavedExtentIndex?"==>":"",number:i,left:e.left,bottom:e.bottom,right:e.right,top:e.top})}html+="";return html}module.exports=printSavedExtents},{}],19:[function(require,module,exports){var extentsAreEqual=require("./extents_equal.js");function saveCurrentExtent(){var newExtent=formatExtent(this.map.getExtent()),newSavedExtents=[],currentSavedExtent,i;if(this.currentSavedExtentIndex>=0){currentSavedExtent=this.savedExtents[this.currentSavedExtentIndex];if(extentsAreEqual(currentSavedExtent,newExtent)){return}}for(i=0;i<=this.currentSavedExtentIndex;++i){newSavedExtents.push(this.savedExtents[i])}this.savedExtents=newSavedExtents;this.savedExtents.push(newExtent);++this.currentSavedExtentIndex}function formatExtent(extent){return{left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top}}module.exports=saveCurrentExtent},{"./extents_equal.js":23}],20:[function(require,module,exports){function zoomToExtent(extent,save){if(save===undefined){save=true}var bounds=new OpenLayers.Bounds(extent.left,extent.bottom,extent.right,extent.top);this.map.zoomToExtent(bounds,true);if(save){this.saveCurrentExtent()}}module.exports=zoomToExtent},{}],21:[function(require,module,exports){function zoomToNextExtent(){if(this.currentSavedExtentIndex0){--this.currentSavedExtentIndex;this.zoomToExtent(this.savedExtents[this.currentSavedExtentIndex],false)}}module.exports=zoomToPreviousExtent},{}],23:[function(require,module,exports){function extentsAreEqual(e1,e2){var tolerance=.001;return Math.abs(e1.left-e2.left)<=tolerance&&Math.abs(e1.bottom-e2.bottom)<=tolerance&&Math.abs(e1.right-e2.right)<=tolerance&&Math.abs(e1.top-e2.top)<=tolerance}module.exports=extentsAreEqual},{}],24:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js"),stringContainsChar=require("./stringContainsChar.js");var getLegendStringFromPixelValue=require("./legend_config.js")($,app);function createIdentifyTool(){return new ClickTool(function(e){$("#identify_popup").remove();if(app.id_markerLayer){app.map.removeLayer(app.id_markerLayer)}var coords=app.map.getLonLatFromPixel(e.xy);var styleMap=new OpenLayers.StyleMap({pointRadius:4,fillColor:"yellow",fillOpacity:.75});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));app.id_markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:styleMap});app.id_markerLayer.addFeatures(feature);app.map.addLayer(app.id_markerLayer);var services=[],service,urlsrs;var layersAdded=[];var html='';$.each(app.map.layers,function(){var name,label;if(!this.isBaseLayer&&this.params&&(!("seldonLayer"in this)||String(this.seldonLayer.identify)!=="false")){name=this.params.LAYERS;if(String(name).match(/^\d+$/)){label=this.name}else{label=String(name).indexOf("MaskFor")!==-1?name.substring(0,name.indexOf("MaskFor")):name}if(layersAdded.indexOf(label)!==-1)return;layersAdded.push(label);services.push({url:this.url,srs:this.projection.projCode,name:name,label:label,proxyServerType:this.seldonLayer.proxyServerType});html=html+Mustache.render(""+''+''+''+"",{label:label})}});html=html+"
{{label}}:
";if(services.length===0){return}var popup=$(document.createElement("div"));popup.attr("id","identify_popup");popup.html(html);popup.dialog({width:600,height:300,resizable:true,title:"Identify Results",close:function(event,ui){app.map.removeLayer(app.id_markerLayer);app.id_markerLayer=undefined;$(this).remove()}});var i,l;for(i=0,l=services.length;i'+''+valueLabel.replace("_0","")+":  "+""+tableRow+""+""}$(newTableContents).insertAfter($group);if(!newTableContents)$group.find(".layer-results").text("N/A")},error:function(jqXHR,textStatus,errorThrown){}})}function createWMSGetFeatureInfoRequestURL(serviceUrl,layer,srs,x,y){var extent=app.map.getExtent();if(seldon.gisServerType==="ArcGIS"){extent=extent.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection(seldon.projection))}return Mustache.render(""+serviceUrl+"{{{c}}}LAYERS={{layer}}"+"&QUERY_LAYERS={{layer}}"+"&STYLES=,"+"&SERVICE=WMS"+"&VERSION=1.1.1"+"&REQUEST=GetFeatureInfo"+"&BBOX={{left}},{{bottom}},{{right}},{{top}}"+"&FEATURE_COUNT=100"+"&HEIGHT={{height}}"+"&WIDTH={{width}}"+"&FORMAT=image/png"+"&INFO_FORMAT=application/vnd.ogc.gml"+"&SRS={{srs}}"+"&X={{x}}"+"&Y={{y}}",{c:stringContainsChar(serviceUrl,"?")?"&":"?",layer:layer,height:app.map.size.h,width:app.map.size.w,left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top,srs:srs,x:x,y:y})}function getLayerResultsFromArcXML($xml,layerName,layerIDCount){var dataVals=[];try{var fields=$xml.find("FIELDS"),attributes=fields[layerIDCount].attributes,i;for(i=0;i=0||stringStartsWith(layerName,"EFETAC-NASA")||stringStartsWith(layerName,"RSAC-FHTET"))&&children[i].nodeName==="value_0"){value=value+sprintf(" (%.2f %%)",(parseFloat(value,10)-127)/128*100)}if((stringStartsWith(layerName.toUpperCase(),"NDMI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"NDVI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SWIR-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDVI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDMI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-SWIR-CURRENT"))&&children[i].nodeName==="value_0"){value=sprintf("%.0f %%",parseFloat(value,10)-128)}returnVals[i]=[children[i].nodeName,value]}}return returnVals}function stringStartsWith(string,prefix){return string.substring(0,prefix.length)===prefix}return createIdentifyTool}},{"./clicktool.js":14,"./legend_config.js":35,"./stringContainsChar.js":55}],25:[function(require,module,exports){module.exports=function(app){var ShareUrlInfo=require("./share.js");function init(config,projection,legendLookup,gisServerType,useProxyScript){var shareUrlInfo=ShareUrlInfo.parseUrl(window.location.toString());app.projection=projection;seldon.projection=projection;app.legendLookup=legendLookup;seldon.gisServerType=gisServerType;seldon.useProxyScript=useProxyScript;app.launch(config,shareUrlInfo);seldon.app=app}return init}},{"./share.js":52}],26:[function(require,module,exports){function initOpenLayers(baseLayerInfo,baseLayer,theme,themeOptions,initialExtent){var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets",{numZoomLevels:20})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings)}else if(baseLayer.type=="ArcGISCache"){var layer=new OpenLayers.Layer.ArcGISCache("AGSCache",baseLayer.url,{layerInfo:baseLayerInfo})}var maxExtentBounds;if(theme.xmax&&theme.xmin&&theme.ymax&&theme.ymin){maxExtentBounds=new OpenLayers.Bounds(theme.xmin,theme.ymin,theme.xmax,theme.ymax)}else{maxExtentBounds=new OpenLayers.Bounds(app.maxExtent.left,app.maxExtent.bottom,app.maxExtent.right,app.maxExtent.top)}if(initialExtent===undefined){initialExtent=app.maxExtent}app.tileManager=new OpenLayers.TileManager({cacheSize:12,moveDelay:750,zoomDelay:750});app.map=new OpenLayers.Map("map",{units:"m",tileManager:app.tileManager,center:[-10986902.689297,4856468.480035],controls:[new OpenLayers.Control.Navigation,new OpenLayers.Control.Attribution,app.zoomInTool,app.zoomOutTool,app.identifyTool,app.multigraphTool,app.markerTool],eventListeners:{moveend:function(){app.emit("extentchange")},zoomend:function(){app.emit("extentchange")}},projection:new OpenLayers.Projection(seldon.projection)});app.currentBaseLayer=baseLayer;app.emit("baselayerchange");app.map.addControl(new OpenLayers.Control.ScaleLine({bottomOutUnits:"mi"}));app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.setTheme(theme,themeOptions);if(initialExtent!=app.maxExtent){app.zoomToExtent(initialExtent)}else{var defaultZoom=5;app.map.setCenter(app.map.getCenter(),defaultZoom);app.saveCurrentExtent()}app.map.events.register("mousemove",app.map,function(e){var pixel=app.map.events.getMousePosition(e);var lonlat=app.map.getLonLatFromPixel(pixel);lonlat=lonlat.transform(new OpenLayers.Projection("EPSG:3857"),new OpenLayers.Projection("EPSG:4326"));OpenLayers.Util.getElement("latLonTracker").innerHTML="Lat: "+sprintf("%.5f",lonlat.lat)+" Lon: "+sprintf("%.5f",lonlat.lon)+""});app.map.addControl(new OpenLayers.Control.PanZoomBar)}module.exports=initOpenLayers},{}],27:[function(require,module,exports){module.exports=function($){var createSplashScreen=require("./splash.js")($);var handle_search=require("./search.js")($);var ga_events=require("./set_google_analytics_events.js");var areasList=[];var activeBtn=[];function launch(configFile,shareUrlInfo){var deactivateActiveOpenLayersControls=require("./deactivate_controls.js")(this,activeBtn);var printMap=require("./print.js")($,this);var app=this;app.initialThemeLoad=true;var $configXML;$.ajax({url:configFile,dataType:"xml",success:function(configXML){$configXML=app.parseConfig(configXML,shareUrlInfo);ga_events($)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}});$("#btnTglLyrPick").click(function(){var $layerPickerDialog=$("#layerPickerDialog");if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close")}else{$layerPickerDialog.dialog("open")}});$("#layerPickerDialog").dialog({zIndex:10050,position:{my:"left top",at:"left+5 top+100"},autoOpen:true,hide:"fade",width:330});app.addListener("accordiongroupchange",function(){if(app.currentTheme){$("#layerPickerAccordion").accordion({active:app.currentTheme.getAccordionGroupIndex(app.currentAccordionGroup),collapsible:true,beforeActivate:function(event,ui){if(!app.initialThemeLoad){$("#layerPickerDialog").scrollTop(0)}},activate:function(event,ui){app.setupCollapsibleSublists(ui);if(app.initialThemeLoad){app.initialThemeLoad=false;$("#layerPickerDialog").scrollTop(755)}}})}});$("#btnTglMapTools").click(function(){var $mapToolsDialog=$("#mapToolsDialog");if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close")}else{$mapToolsDialog.dialog("open")}});$("#mapToolsDialog").dialog({zIndex:10050,position:{my:"right top",at:"right-5 top+100"},autoOpen:true,hide:"fade"});app.addListener("themechange",function(){app.updateShareMapUrl()});app.addListener("baselayerchange",function(){app.updateShareMapUrl()});app.addListener("accordiongroupchange",function(){app.updateShareMapUrl()});app.addListener("extentchange",function(){app.saveCurrentExtent();app.updateShareMapUrl()});var $mapToolsAccordion=$("#mapToolsAccordion"),accordionGroupIndexToOpen=0;$mapToolsAccordion.accordion({heightStyle:"content",collapsible:true});$mapToolsAccordion.find("div").each(function(i){if(this.id==="legend"){accordionGroupIndexToOpen=i;return false}return true});$mapToolsAccordion.accordion("option","active",accordionGroupIndexToOpen);$("#baseCombo").change(function(){var i=parseInt($(this).val(),10);app.setBaseLayer(app.baseLayers[i])});app.addListener("baselayerchange",function(){$("#baseCombo").val(app.currentBaseLayer.index)});$("#themeCombo").change(function(){var i=parseInt($(this).val(),10);app.setTheme(app.themes[i])});app.addListener("themechange",function(){$("#themeCombo").val(app.currentTheme.index)});$("#btnPan").click(function(){deactivateActiveOpenLayersControls();app.dragPanTool.activate()});$("#btnPrint").click(function(){if($configXML!==undefined){printMap($configXML)}else{console.log("Can't print yet; config file not yet parsed")}});$("#btnZoomIn").click(function(){deactivateActiveOpenLayersControls();app.zoomInTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomOut").click(function(){deactivateActiveOpenLayersControls();app.zoomOutTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomExtent").click(function(){app.zoomToExtent(app.maxExtent)});$("#btnID").click(function(){deactivateActiveOpenLayersControls();app.identifyTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnAbout").click(function(){var splashScreen=$("#splashScreenContainer");if(splashScreen.dialog("isOpen")){splashScreen.dialog("close")}else{splashScreen.dialog("open")}});$("#btnPrev").click(function(){app.zoomToPreviousExtent()});$("#btnNext").click(function(){app.zoomToNextExtent()});$("#btnMultiGraph").click(function(){deactivateActiveOpenLayersControls();app.multigraphTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnMarker").click(function(){deactivateActiveOpenLayersControls();app.markerTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});createSplashScreen();var $findArea=$("#findArea");$findArea.findArea();areasList=$findArea.findArea("getAreasList");$findArea.autocomplete({source:areasList});$findArea.keypress(function(e){if(e.which==13){var areaExtent=$findArea.findArea("getAreaExtent",$findArea.val(),areasList);app.zoomToExtent(areaExtent)}});$("#address_lookup").on("click",function(){var location=$("#address_field").val();handle_search(location,app)});$("#address_field").on("keypress",function(e){if(e.which===13){var location=$(this).val();handle_search(location,app)}});$(".mask-toggle").on("click",function(){if($(this).is(":checked")){app.setMaskByMask(true,this.value)}else{app.setMaskByMask(false,this.value)}});$("[data-mask-grouper='true']").on("change",function(){var disabled=$(this).is(":checked")?true:false;$("[data-mask-parent='"+this.value+"']").attr("disabled",disabled)});$(".mask-modifier").on("change",function(){var value=$(this).is(":checked")?this.value:"";var index=$(this).data("index");if($(this).data("maskGrouper")===true){app.handleMaskModifierGroup(this.value,$(this).is(":checked"))}app.handleMaskModifier(value,index)});$("textarea").focus(function(){var $this=$(this);$this.select();window.setTimeout(function(){$this.select()},1);function mouseUpHandler(){$this.off("mouseup",mouseUpHandler);return false}$this.mouseup(mouseUpHandler)});if($(window).width()<650){$("#mapToolsDialog").dialog("close");$("#layerPickerDialog").dialog("close")}if(window.addEventListener){window.addEventListener("orientationchange",function(){var $mapToolsDialog=$("#mapToolsDialog"),$layerPickerDialog=$("#layerPickerDialog");window.scroll(0,0);if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close").dialog("open")}if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close").dialog("open")}},false)}}return launch}},{"./deactivate_controls.js":17,"./print.js":43,"./search.js":45,"./set_google_analytics_events.js":48,"./splash.js":54}],28:[function(require,module,exports){module.exports=function($,app){var stringContainsChar=require("./stringContainsChar.js");function Layer(settings){EventEmitter.call(this);if(!settings){return}$.extend(true,this,settings);this.transparency=0;if(this.index==undefined){this.index=0}if(this.type==undefined){this.type="WMS"}this.createOpenLayersLayer=function(){if(this.openLayersLayer!==undefined){return this.openLayersLayer}var options={isBaseLayer:false,transitionEffect:"resize",buffer:0,singleTile:true,ratio:1};if(this.type==="WMTS"){var settings={name:this.name,url:this.url,layer:this.layers,style:this.style,matrixSet:this.srs,isBaseLayer:false,transitionEffect:"resize",format:"image/jpg",sphericalMercator:true};if(this.lid.indexOf("GLAM")>-1){$.extend(true,settings,{serverResolutions:[156543.033928041,78271.5169640205,39135.7584820102,19567.8792410051,9783.9396205026,4891.9698102513,2445.9849051256,1222.9924525628,611.4962262814,305.7481131407048],units:"m",tileOrigin:new OpenLayers.LonLat(-20037508.34,20037508.34)})}this.openLayersLayer=new OpenLayers.Layer.WMTS(settings)}else if(this.type==="XYZ"){this.openLayersLayer=new OpenLayers.Layer.XYZ(this.name,this.url,{isBaseLayer:false,projection:new OpenLayers.Projection(seldon.projection)})}else if(this.type==="ArcGIS93Rest"){this.openLayersLayer=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params.mosaicRule?$.extend(true,{},this.params,{mosaicRule:JSON.stringify(this.params.mosaicRule)}):this.params,options)}else{if(this.maxResolution){options.maxResolution=parseFloat(this.maxResolution)}var layer=this.layers+("mask"in this?app.maskModifiers.join(""):"");this.openLayersLayer=new OpenLayers.Layer.WMS(this.name,this.url,{projection:new OpenLayers.Projection(seldon.projection),units:"m",layers:layer,transparent:true},options)}var loadingimage=$('');$("#map").append(loadingimage);this.openLayersLayer.loadingimage=loadingimage;this.openLayersLayer.events.register("loadstart",this.openLayersLayer,function(){this.loadingimage.addClass("loading")});this.openLayersLayer.events.register("loadend",this.openLayersLayer,function(){this.loadingimage.removeClass("loading")});this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);this.openLayersLayer.seldonLayer=this;return this.openLayersLayer};this.activate=function(options){options=options||{};this.addToLegend();this.emit("activate");if(this.mask==="true"&&this.lid.indexOf("MaskFor")===-1){if(app.masks.length>0){app.setMaskByLayer(true,this)}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}var inMaskParentLayers=app.maskParentLayers.filter(function(layer){return this===layer},this).length;if(!inMaskParentLayers){app.maskParentLayers.push(this)}}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}vectorServices=["vlayers","fire","ads"];boundaryServices=["boundaries"];allVectorServices=vectorServices;Array.prototype.push.apply(allVectorServices,boundaryServices);var isVectorLayer=function(layer,serviceNames){return serviceNames.filter(function(serviceName){return layer.url&&layer.url.indexOf(serviceName+"?")>-1}).length};if(app.map.getNumLayers()>1){var lyrJustAdded=app.map.layers[app.map.getNumLayers()-1];if(!isVectorLayer(lyrJustAdded,allVectorServices)){for(var i=app.map.getNumLayers()-2;i>0;i--){var nextLayerDown=app.map.layers[i];if(!isVectorLayer(nextLayerDown,allVectorServices)){if(nextLayerDown.seldonLayer.index0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,vectorServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}for(var i=app.map.getNumLayers()-1;i>0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,boundaryServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}}app.updateShareMapUrl();app.map.updateSize()};this.deactivate=function(options){options=options||{};if(this.visible==="true"){app.map.removeLayer(this.openLayersLayer);this.visible="false"}if(!this.parentLayer){app.setMaskByLayer(false,this)}if(options.removeFromLegend){this.removeFromLegend()}if(options.removeFromParentMaskLayers){app.maskParentLayers=app.maskParentLayers.filter(function(layer){return layer.lid!==this.lid},this)}if(this.openLayersLayer&&this.openLayersLayer.loadingimage){this.openLayersLayer.loadingimage.removeClass("loading")}this.emit("deactivate")};this.addToLegend=function(){var that=this;var $legend=$("#legend");var lid=this.parentLayer?this.parentLayer.lid:this.lid;$(document.getElementById("lgd"+lid)).remove();this.$legendItem=$(document.createElement("div")).attr("id","lgd"+lid).prepend($(document.createElement("img")).attr("src",this.legend)).click(function(){that.deactivate();if(that.parentLayer){that.parentLayer.deactivate({removeFromParentMaskLayers:true})}that.removeFromLegend()});if(this.url.indexOf("vlayers")>-1){this.$legendItem.prependTo($legend)}else{this.$legendItem.appendTo($legend)}};this.removeFromLegend=function(){ -if(this.$legendItem)this.$legendItem.remove()};this.setTransparency=function(transparency){if(this.openLayersLayer){this.openLayersLayer.setOpacity(1-parseFloat(transparency)/100)}this.transparency=transparency;try{this.emit({type:"transparency",value:this.transparency})}catch(err){var test=this.transparency;var errTxt=err.Message}if(app.map!==undefined){var currentLayer,openLayersLayer,lid;var i;for(i=app.map.getNumLayers()-2;i>0;i--){currentLayer=app.map.layers[i];openLayersLayer=currentLayer.seldonLayer.openLayersLayer;lid=currentLayer.seldonLayer.lid;if(stringContainsChar(currentLayer.name,"Mask")){if(openLayersLayer&&lid.substring(0,lid.indexOf("MaskFor"))===this.lid){openLayersLayer.setOpacity(1-parseFloat(transparency)/100);currentLayer.seldonLayer.transparency=transparency}}}}}}window.EventEmitter.declare(Layer);return Layer}},{"./stringContainsChar.js":55}],29:[function(require,module,exports){module.exports=function($){function createLayerToggleCheckbox(layer){var checkbox=document.createElement("input"),$checkbox;checkbox.type="checkbox";checkbox.id="chk"+layer.lid;checkbox.onclick=function(){if($(this).is(":checked")){layer.activate()}else{layer.deactivate({removeFromLegend:true,removeFromParentMaskLayers:true})}};$checkbox=$(checkbox);$checkbox.addClass(layer.lid);layer.addListener("activate",function(){$("input."+this.lid).attr("checked",true)});layer.addListener("deactivate",function(){$("input."+this.lid).attr("checked",false)});return checkbox}return createLayerToggleCheckbox}},{}],30:[function(require,module,exports){module.exports=function($){function createLayerPropertiesDialog(layer){var localTransparency=0;var $html=$(""+'
'+""+""+""+""+""+""+"
Transparency:"+'
'+"
"+'%'+"
"+"
");$html.find("input.transparency-text").val(layer.transparency);if(layer.transparency>0){localTransparency=layer.transparency;layer.setTransparency(localTransparency)}$html.find(".transparency-slider").slider({min:0,max:100,step:1,value:localTransparency,slide:function(event,ui){try{layer.setTransparency(ui.value)}catch(err){var errTxt=err.message}}});$html.find("input.transparency-text").change(function(){var $this=$(this),newValueFloat=parseFloat($this.val());if(isNaN(newValueFloat)||newValueFloat<0||newValueFloat>100){$this.val(layer.transparency);return}layer.setTransparency($this.val())});layer.addListener("transparency",function(e){$html.find("input.transparency-text").val(e.value)});$html.dialog({zIndex:10050,position:"left",autoOpen:true,hide:"explode",title:layer.name,width:"auto",close:function(){$(this).dialog("destroy");$html.remove();createLayerPropertiesDialog.$html[layer.lid]=undefined}});createLayerPropertiesDialog.$html[layer.lid]=$html}createLayerPropertiesDialog.$html={};return createLayerPropertiesDialog}},{}],31:[function(require,module,exports){module.exports=function($){var createLayerPropertiesDialog=require("./layer_dialog.js")($);function createLayerPropertiesIcon(layer){var img=document.createElement("img");img.id=layer.lid;img.src="icons/settings.png";img.className="layerPropertiesIcon";img.onclick=function(){createLayerPropertiesDialog(layer)};return img}return createLayerPropertiesIcon}},{"./layer_dialog.js":30}],32:[function(require,module,exports){module.exports=function($,app){var generalRadioHandler=require("./layer_radio_handler.js")($,app);function createLayerToggleRadioButton(layer,radioGroupName){var checkbox=document.createElement("input"),$checkbox;checkbox.type="radio";checkbox.name=radioGroupName;checkbox.id=layer.lid;if(layer.selectedInConfig){checkbox.checked=true}$checkbox=$(checkbox);$checkbox.change(radioHandler);layer.addListener("activate",function(){$checkbox.attr("checked",true)});layer.addListener("deactivate",function(){$checkbox.attr("checked",false)});return checkbox}function radioHandler(){generalRadioHandler(app)}return createLayerToggleRadioButton}},{"./layer_radio_handler.js":33}],33:[function(require,module,exports){module.exports=function($,app){var Layer=require("./layer.js")($,app);function radioHandler(app){var $selectedOption=$(app.dropdownBoxList[0]).find(":selected");if($selectedOption.text()==="select..."){clearRadioLayers(app,null);return}var selectLayer=app.dropdownBoxLayers[$selectedOption.val()];var wanted_lid=getActiveDropdownBoxRadioLID(app);var wanted_layer=undefined;var i;for(i=0;i0;i--){currLayer=app.map.layers[i].seldonLayer;for(j=0;j"+selectBoxLayers[i].name+"")}selectBox.insertAdjacentHTML("afterbegin","");$(selectBox).change(selectHandler);return selectBox}function selectHandler(){radioHandler(app)}return createLayerToggleDropdownBox}},{"./layer_radio_handler.js":33}],35:[function(require,module,exports){module.exports=function($,app){function isLayerInLegendConfig(layerId){return layerId in app.legendLookup}function getLegendStringFromPixelValue(layerId,pixelValue){var legendString="";if(isLayerInLegendConfig(layerId)){legendString=app.legendLookup[layerId][pixelValue];if(!legendString){console.error("No legend string set for pixel value",pixelValue,"for layer",layerId)}}return legendString}return getLegendStringFromPixelValue}},{}],36:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js");var saveAs=require("../libs/FileSaver/FileSaver.js").saveAs;var popupId="marker-dialog";var points=[];var pointStyleDefault={pointRadius:4,fillColor:"blue",fillOpacity:.75};var pointStyleHover={pointRadius:5,fillColor:"orange",fillOpacity:.75};var pointStyle=new OpenLayers.StyleMap(pointStyleDefault);function marker(){return new ClickTool(markerHandler)}function markerHandler(e){var coords=app.map.getLonLatFromPixel(e.xy);var lonlat=app.map.getLonLatFromPixel(e.xy);lonlat.transform(app.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));var markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:pointStyle});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));markerLayer.addFeatures(feature);app.map.addLayer(markerLayer);if(!$("#"+popupId).length){createPopup()}if($(".marker-points").length){createPointItem(lonlat,markerLayer)}points.push({lonlat:lonlat,layer:markerLayer});if(typeof ga!=="undefined"){ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Create New Point",eventLabel:lonlat.lon+", "+lonlat.lat})}}function createPointItem(coords,layer){var itemString="";itemString+='
';itemString+='
';itemString+=' Lat:';itemString+=' '+coords.lat+"";itemString+="
";itemString+='
';itemString+=' Lon:';itemString+=' '+coords.lon+"";itemString+="
";itemString+='
';itemString+=' Notes:';itemString+='
';itemString+="
";itemString+="
";var item=$(itemString);item.data("point",layer);item.on("mouseenter",handlePointHoverEnter).on("mouseleave",handlePointHoverLeave);$(".marker-points").append(item)}function handlePointHoverEnter(e){var point=$(this).data("point");point.style=pointStyleHover;point.redraw()}function handlePointHoverLeave(e){var point=$(this).data("point");point.style=pointStyleDefault;point.redraw()}function createPopup(){var popup=$('
');$("body").append(popup);$(".marker-button-download").click(exportFileHandler);$(".marker-button-clear").click(clearPointsHandler);popup.dialog({width:300,height:400,resizable:false,position:{my:"right top",at:"right-5 top+120"},title:"Mark areas of interest",close:function(event,ui){clearPointsHandler();$(this).remove()}})}function exportFileHandler(){var lat,lon,url,notes;var SEP="|";var i;var csvContent="sep="+SEP+"\n";csvContent+="lat"+SEP+"long"+SEP+"google maps link"+SEP+"notes\n";for(i=0;i=0){direction="N"}else if(type==="lat"&&value<0){direction="S"}else if(type==="lon"&&value>=0){direction="E"}else if(type==="lon"&&value<0){direction="W"}value=Math.abs(value);var degree=Math.floor(value);value=(value-degree)*60;var minute=Math.floor(value);var second=(value-minute)*60;return degree+"%C2%B0"+minute+"'"+second+"%22"+direction}function getNotes(index){if(typeof ga!=="undefined"){var label=$(".marker-point-item").eq(index).find(".marker-point-notes").val();ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Notes",eventLabel:label})}return $(".marker-point-item").eq(index).find(".marker-point-notes").val()}function clearPointsHandler(){var i;for(i=0;i')}else{popup.html('
')}popup.dialog({width:600,resizable:false,position:{my:"center+"+offset+" center+"+offset,at:"center",of:window},title:Mustache.render("MODIS NDVI for Lat: {{{lat}}} Lon: {{{lon}}}",{lat:sprintf("%.4f",lonlat.lat),lon:sprintf("%.4f",lonlat.lon)}),close:function(event,ui){app.map.removeLayer(markerLayer);$(this).remove()}});var seldonMultigraph=$("#seldonMultigraph"+app.graphCount+""),promise=seldonMultigraph.multigraph({mugl:muglPrefix+lonlat.lon+","+lonlat.lat,swf:"libs/seldon/libs/Multigraph.swf"});seldonMultigraph.multigraph("done",function(m){if(m){$(m.div()).parent().children(".multigraphLoader").remove()}})})}return createMultigraphTool}},{"./clicktool.js":14}],41:[function(require,module,exports){module.exports=function($){Array.prototype.remove=function(value){if(this.indexOf(value)!==-1){this.splice(this.indexOf(value),1);return true}else{return false}};OpenLayers.Map.prototype.getCurrentSize=function(){var size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=this.div.offsetWidth;size.h=this.div.offsetHeight}if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=parseInt(this.div.style.width,10);size.h=parseInt(this.div.style.height,10)}size.h=size.h-parseInt($(this.div).css("padding-top"),10)-parseInt($(this.div).css("padding-bottom"),10);return size};$.widget("ui.dialog",$.extend({},$.ui.dialog.prototype,{_moveToTop:function(arg){if(arg){if(arg.handleObj.type!="mousedown"){var moved=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;if(moved&&!silent){this._trigger("focus",event)}return moved}}}}))}},{}],42:[function(require,module,exports){module.exports=function($){var createArcGIS93RestParams=require("./create_arcgis_rest_params.js")($);var AccordionGroup=require("./accordion_group.js");var AccordionGroupSublist=require("./accordion_group_sublist.js");var BaseLayer=require("./baselayer.js");var Theme=require("./theme.js");function parseConfig(configXML,shareUrlInfo){var Layer=require("./layer.js")($,this);var createIdentifyTool=require("./identify.js")($,this);var createMultigraphTool=require("./multigraph.js")($,this);var marker=require("./marker.js")($,this);var app=this,$configXML=$(configXML),initialBaseLayer,initialTheme,shareUrlLayerAlpha={},themeOptions={},i,j,k,l,ll,lll;if(shareUrlInfo!==undefined){for(i=0,l=shareUrlInfo.layerLids.length;i0){app.maxExtent={left:parseFloat($extent.attr("xmin")),bottom:parseFloat($extent.attr("ymin")),right:parseFloat($extent.attr("xmax")),top:parseFloat($extent.attr("ymax"))}}var $baseCombo=$("#baseCombo"),$images=$configXML.find("images image"),$image,selected,baseLayer;for(i=0,l=$images.length;ionline.',mapName:"Layers",description:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including the terms of use, visit us online at http://goto.arcgisonline.com/maps/World_Street_Map",copyrightText:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012",layers:[{id:0,name:"World Street Map",parentLayerId:-1,defaultVisibility:true,subLayerIds:null,minScale:0,maxScale:0}],tables:[],spatialReference:{wkid:102100},singleFusedMapCache:true,tileInfo:{rows:256,cols:256,dpi:96,format:"JPEG",compressionQuality:90,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:0,resolution:156543.033928,scale:591657527.591555},{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176}]},initialExtent:{xmin:-28872328.0888923,ymin:-11237732.4896886,xmax:28872328.0888923,ymax:11237732.4896886,spatialReference:{wkid:102100}},fullExtent:{xmin:-20037507.0671618,ymin:-19971868.8804086,xmax:20037507.0671618,ymax:19971868.8804086,spatialReference:{wkid:102100}},units:"esriMeters",supportedImageFormatTypes:"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI,BMP",documentInfo:{Title:"World Street Map",Author:"Esri",Comments:"",Subject:"streets, highways, major roads, railways, water features, administrative boundaries, cities, parks, protected areas, landmarks ",Category:"transportation(Transportation Networks) ",Keywords:"World, Global, Europe, Japan, Hong Kong, North America, United States, Canada, Mexico, Southern Africa, Asia, South America, Australia, New Zealand, India, Argentina, Brazil, Chile, Venezuela, Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, Switzerland, Russia, Thailand, Turkey, 2012",Credits:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"},capabilities:"Map"};app.initOpenLayers(baseLayerInfo,initialBaseLayer,initialTheme,themeOptions,initialExtent);return $configXML}function displayError(message){}return parseConfig}},{"./accordion_group.js":3,"./accordion_group_sublist.js":5,"./baselayer.js":13,"./create_arcgis_rest_params.js":16,"./identify.js":24,"./layer.js":28,"./marker.js":36,"./multigraph.js":40,"./theme.js":56}],43:[function(require,module,exports){module.exports=function($,app){function printMap($configXML){var offsetX=parseInt(app.map.layerContainerDiv.style.left,10);var offsetY=parseInt(app.map.layerContainerDiv.style.top,10);var size=app.map.getSize();var tiles=[];var layer,tile,position;var i,j,k;for(i=0;i
');printPopup.dialog({resizable:false,height:75,title:"Creating Image for Print...",close:function(event,ui){$(this).remove()}});var service_url=$configXML.find("tools tool[name=Print]").attr("service_url");if(!service_url){service_url="http://"+window.location.hostname+window.location.pathname}service_url=service_url.replace(/\/$/,"");var service_name=$configXML.find("tools tool[name=Print]").attr("service_name");if(!service_name){service_name="cgi-bin/print.cgi"}var title=$configXML.find("tools tool[name=Print]").attr("title"); +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o"+'

'+el.description+"

"+"";$(dialogDiv).dialog({title:el.label||el.name,dialogClass:"tooltip-dialog "+dialogClass})}}}return MoreInfoButton}},{}],7:[function(require,module,exports){module.exports=function($){function addAccordionSection(accordionGroup,title){var sectionObj={title:title,titleElement:$("

"+title+"

"),contentElement:$("
"),sublists:[]};var $accordionGroup=$(accordionGroup);$accordionGroup.data("listAccordion").sections.push(sectionObj);$accordionGroup.append(sectionObj.titleElement).append(sectionObj.contentElement);$accordionGroup.accordion("refresh");return sectionObj}return addAccordionSection}},{}],8:[function(require,module,exports){module.exports=function($){function addAccordionSublists(g,items){$(g.contentElement).append(items)}return addAccordionSublists}},{}],9:[function(require,module,exports){module.exports=function($){function addAccordionSublistItems(s,items,theme,accGp){var collapsed=s.collapsible?"collapsed ":"";var contents=$('
');for(var i=0,l=items.length;i').append(items[i]))}var layer={name:name,contentElement:contents};s.items.push(layer);s.contentElement.append(layer.contentElement)}return addAccordionSublistItems}},{}],10:[function(require,module,exports){module.exports=function($){function addMaskToLegend(layer){var app=this;var maskName=layer.lid.substring(layer.lid.indexOf("MaskFor"),layer.lid.length);$("#lgd"+maskName).remove();layer.$legendItem=$(document.createElement("div")).attr("id","lgd"+maskName).prepend($(document.createElement("img")).attr("src",layer.legend)).prependTo($("#legend")).click(function(){app.setMaskByMask(false,maskName)})}return addMaskToLegend}},{}],11:[function(require,module,exports){module.exports=function($){var EventEmitter=window.EventEmitter;function App(){EventEmitter.call(this);this.map=undefined;this.tileManager=undefined;this.projection=undefined;this.gisServerType=undefined;this.useProxyScript=undefined;this.scalebar=undefined;this.zoomInTool=undefined;this.zoomOutTool=undefined;this.dragPanTool=undefined;this.id_markerLayer=undefined;this.maxExtent={left:-15e6,bottom:2e6,right:-6e6,top:7e6};this.baseLayers=[];this.accordionGroups=[];this.themes=[];this.maskParentLayers=[];this.masks=[];this.maskModifiers=[];this.defaultMasks=["MaskForForest"];this.radioButtonList=[];this.radioButtonLayers=[];this.dropdownBoxList=[];this.dropdownBoxLayers=[];this.currentBaseLayer=undefined;this.currentAccordionGroup=undefined;this.currentTheme=undefined;this.identifyTool=undefined;this.multigraphTool=undefined;this.markerTool=undefined;this.savedExtents=[];this.currentSavedExtentIndex=-1;this.saveCurrentExtent=require("./extent_save.js");this.zoomToExtent=require("./extent_zoom.js");this.zoomToPreviousExtent=require("./extent_zoom_previous.js");this.zoomToNextExtent=require("./extent_zoom_next.js");this.printSavedExtents=require("./extent_print.js");this.setBaseLayer=require("./set_base_layer.js")($);this.setAccordionGroup=require("./accordion_group_set.js");this.clearAccordionSections=require("./accordion_clear.js")($);this.addAccordionSection=require("./accordion_section_add.js")($);this.addAccordionSublists=require("./accordion_sublist_add.js")($);this.addAccordionSublistItems=require("./accordion_sublist_item_add.js")($);this.setTheme=require("./set_theme.js")($);this.shareUrl=require("./share_url.js")($);this.updateShareMapUrl=require("./update_share_url.js")($);this.launch=require("./launch.js")($);this.count=require("./count.js");this.addMaskToLegend=require("./add_mask_legend.js")($);this.setMaskByMask=require("./set_mask_by_mask.js")($);this.setMaskByLayer=require("./set_mask_by_layer.js")($);this.handleMaskModifier=require("./mask_modifier.js");this.handleMaskModifierGroup=require("./mask_modifier_group.js")($);this.parseConfig=require("./parse_config.js")($);this.initOpenLayers=require("./init_openlayers.js");this.setupCollapsibleSublists=require("./accordion_collapsible_sublist_setup.js")($);this.removeMaskFromLegend=function(layer){};OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.IMAGE_RELOAD_ATTEMPTS=3}EventEmitter.declare(App);return App}},{"./accordion_clear.js":1,"./accordion_collapsible_sublist_setup.js":2,"./accordion_group_set.js":4,"./accordion_section_add.js":7,"./accordion_sublist_add.js":8,"./accordion_sublist_item_add.js":9,"./add_mask_legend.js":10,"./count.js":15,"./extent_print.js":18,"./extent_save.js":19,"./extent_zoom.js":20,"./extent_zoom_next.js":21,"./extent_zoom_previous.js":22,"./init_openlayers.js":26,"./launch.js":27,"./mask_modifier.js":38,"./mask_modifier_group.js":39,"./parse_config.js":42,"./set_base_layer.js":47,"./set_mask_by_layer.js":49,"./set_mask_by_mask.js":50,"./set_theme.js":51,"./share_url.js":53,"./update_share_url.js":57}],12:[function(require,module,exports){function arrayContainsElement(array,element){var i;if(array===undefined){return false}for(i=0;iparam").each(function(i,param){var $param=$(param);if(param.hasAttribute("value")){obj[$param.attr("name")]=$param.attr("value")}else{obj[$param.attr("name")]=createArcGIS93RestParams($param)}});return obj}return createArcGIS93RestParams}},{}],17:[function(require,module,exports){module.exports=function(app,activeBtn){function deactivateActiveOpenLayersControls(){var controls,i;for(i=0;i=0;--i){e=this.savedExtents[i];html+=Mustache.render("{{{marker}}}{{{number}}}"+"left:{{{left}}}, bottom:{{{bottom}}}, right:{{{right}}}, top:{{{top}}}",{marker:i===this.currentSavedExtentIndex?"==>":"",number:i,left:e.left,bottom:e.bottom,right:e.right,top:e.top})}html+="";return html}module.exports=printSavedExtents},{}],19:[function(require,module,exports){var extentsAreEqual=require("./extents_equal.js");function saveCurrentExtent(){var newExtent=formatExtent(this.map.getExtent()),newSavedExtents=[],currentSavedExtent,i;if(this.currentSavedExtentIndex>=0){currentSavedExtent=this.savedExtents[this.currentSavedExtentIndex];if(extentsAreEqual(currentSavedExtent,newExtent)){return}}for(i=0;i<=this.currentSavedExtentIndex;++i){newSavedExtents.push(this.savedExtents[i])}this.savedExtents=newSavedExtents;this.savedExtents.push(newExtent);++this.currentSavedExtentIndex}function formatExtent(extent){return{left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top}}module.exports=saveCurrentExtent},{"./extents_equal.js":23}],20:[function(require,module,exports){function zoomToExtent(extent,save){if(save===undefined){save=true}var bounds=new OpenLayers.Bounds(extent.left,extent.bottom,extent.right,extent.top);this.map.zoomToExtent(bounds,true);if(save){this.saveCurrentExtent()}}module.exports=zoomToExtent},{}],21:[function(require,module,exports){function zoomToNextExtent(){if(this.currentSavedExtentIndex0){--this.currentSavedExtentIndex;this.zoomToExtent(this.savedExtents[this.currentSavedExtentIndex],false)}}module.exports=zoomToPreviousExtent},{}],23:[function(require,module,exports){function extentsAreEqual(e1,e2){var tolerance=.001;return Math.abs(e1.left-e2.left)<=tolerance&&Math.abs(e1.bottom-e2.bottom)<=tolerance&&Math.abs(e1.right-e2.right)<=tolerance&&Math.abs(e1.top-e2.top)<=tolerance}module.exports=extentsAreEqual},{}],24:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js"),stringContainsChar=require("./stringContainsChar.js");var getLegendStringFromPixelValue=require("./legend_config.js")($,app);function createIdentifyTool(){return new ClickTool(function(e){$("#identify_popup").remove();if(app.id_markerLayer){app.map.removeLayer(app.id_markerLayer)}var coords=app.map.getLonLatFromPixel(e.xy);var styleMap=new OpenLayers.StyleMap({pointRadius:4,fillColor:"yellow",fillOpacity:.75});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));app.id_markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:styleMap});app.id_markerLayer.addFeatures(feature);app.map.addLayer(app.id_markerLayer);var services=[],service,urlsrs;var layersAdded=[];var html='';$.each(app.map.layers,function(){var name,label;if(!this.isBaseLayer&&this.params&&(!("seldonLayer"in this)||String(this.seldonLayer.identify)!=="false")){name=this.params.LAYERS;if(String(name).match(/^\d+$/)){label=this.name}else{label=String(name).indexOf("MaskFor")!==-1?name.substring(0,name.indexOf("MaskFor")):name}if(layersAdded.indexOf(label)!==-1)return;layersAdded.push(label);services.push({url:this.url,srs:this.projection.projCode,name:name,label:label,proxyServerType:this.seldonLayer.proxyServerType});html=html+Mustache.render(""+''+''+''+"",{label:label})}});html=html+"
{{label}}:
";if(services.length===0){return}var popup=$(document.createElement("div"));popup.attr("id","identify_popup");popup.html(html);popup.dialog({width:600,height:300,resizable:true,title:"Identify Results",close:function(event,ui){app.map.removeLayer(app.id_markerLayer);app.id_markerLayer=undefined;$(this).remove()}});var i,l;for(i=0,l=services.length;i'+''+valueLabel.replace("_0","")+":  "+""+tableRow+""+""}$(newTableContents).insertAfter($group);if(!newTableContents)$group.find(".layer-results").text("N/A")},error:function(jqXHR,textStatus,errorThrown){}})}function createWMSGetFeatureInfoRequestURL(serviceUrl,layer,srs,x,y){var extent=app.map.getExtent();if(seldon.gisServerType==="ArcGIS"){extent=extent.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection(seldon.projection))}return Mustache.render(""+serviceUrl+"{{{c}}}LAYERS={{layer}}"+"&QUERY_LAYERS={{layer}}"+"&STYLES=,"+"&SERVICE=WMS"+"&VERSION=1.1.1"+"&REQUEST=GetFeatureInfo"+"&BBOX={{left}},{{bottom}},{{right}},{{top}}"+"&FEATURE_COUNT=100"+"&HEIGHT={{height}}"+"&WIDTH={{width}}"+"&FORMAT=image/png"+"&INFO_FORMAT=application/vnd.ogc.gml"+"&SRS={{srs}}"+"&X={{x}}"+"&Y={{y}}",{c:stringContainsChar(serviceUrl,"?")?"&":"?",layer:layer,height:app.map.size.h,width:app.map.size.w,left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top,srs:srs,x:x,y:y})}function getLayerResultsFromArcXML($xml,layerName,layerIDCount){var dataVals=[];try{var fields=$xml.find("FIELDS"),attributes=fields[layerIDCount].attributes,i;for(i=0;i=0||stringStartsWith(layerName,"EFETAC-NASA")||stringStartsWith(layerName,"RSAC-FHTET"))&&children[i].nodeName==="value_0"){value=value+sprintf(" (%.2f %%)",(parseFloat(value,10)-127)/128*100)}if((stringStartsWith(layerName.toUpperCase(),"NDMI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"NDVI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SWIR-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDVI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDMI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-SWIR-CURRENT"))&&children[i].nodeName==="value_0"){value=sprintf("%.0f %%",parseFloat(value,10)-128)}returnVals[i]=[children[i].nodeName,value]}}return returnVals}function stringStartsWith(string,prefix){return string.substring(0,prefix.length)===prefix}return createIdentifyTool}},{"./clicktool.js":14,"./legend_config.js":35,"./stringContainsChar.js":55}],25:[function(require,module,exports){module.exports=function(app){var ShareUrlInfo=require("./share.js");function init(config,projection,legendLookup,gisServerType,useProxyScript){var shareUrlInfo=ShareUrlInfo.parseUrl(window.location.toString());app.projection=projection;seldon.projection=projection;app.legendLookup=legendLookup;seldon.gisServerType=gisServerType;seldon.useProxyScript=useProxyScript;app.launch(config,shareUrlInfo);seldon.app=app}return init}},{"./share.js":52}],26:[function(require,module,exports){function initOpenLayers(baseLayerInfo,baseLayer,theme,themeOptions,initialExtent){var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets",{numZoomLevels:20})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings)}else if(baseLayer.type=="ArcGISCache"){var layer=new OpenLayers.Layer.ArcGISCache("AGSCache",baseLayer.url,{layerInfo:baseLayerInfo})}var maxExtentBounds;if(theme.xmax&&theme.xmin&&theme.ymax&&theme.ymin){maxExtentBounds=new OpenLayers.Bounds(theme.xmin,theme.ymin,theme.xmax,theme.ymax)}else{maxExtentBounds=new OpenLayers.Bounds(app.maxExtent.left,app.maxExtent.bottom,app.maxExtent.right,app.maxExtent.top)}if(initialExtent===undefined){initialExtent=app.maxExtent}app.tileManager=new OpenLayers.TileManager({cacheSize:12,moveDelay:750,zoomDelay:750});app.map=new OpenLayers.Map("map",{units:"m",tileManager:app.tileManager,controls:[new OpenLayers.Control.Navigation,new OpenLayers.Control.Attribution,app.zoomInTool,app.zoomOutTool,app.identifyTool,app.multigraphTool,app.markerTool],eventListeners:{moveend:function(){app.emit("extentchange")},zoomend:function(){app.emit("extentchange")}},projection:new OpenLayers.Projection(seldon.projection)});app.currentBaseLayer=baseLayer;app.emit("baselayerchange");app.map.addControl(new OpenLayers.Control.ScaleLine({bottomOutUnits:"mi"}));app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.setTheme(theme,themeOptions);app.zoomToExtent(initialExtent);app.saveCurrentExtent();app.map.events.register("mousemove",app.map,function(e){var pixel=app.map.events.getMousePosition(e);var lonlat=app.map.getLonLatFromPixel(pixel);lonlat=lonlat.transform(new OpenLayers.Projection("EPSG:3857"),new OpenLayers.Projection("EPSG:4326"));OpenLayers.Util.getElement("latLonTracker").innerHTML="Lat: "+sprintf("%.5f",lonlat.lat)+" Lon: "+sprintf("%.5f",lonlat.lon)+""});app.map.addControl(new OpenLayers.Control.PanZoomBar)}module.exports=initOpenLayers},{}],27:[function(require,module,exports){module.exports=function($){var createSplashScreen=require("./splash.js")($);var handle_search=require("./search.js")($);var ga_events=require("./set_google_analytics_events.js");var areasList=[];var activeBtn=[];function launch(configFile,shareUrlInfo){var deactivateActiveOpenLayersControls=require("./deactivate_controls.js")(this,activeBtn);var printMap=require("./print.js")($,this);var app=this;app.initialThemeLoad=true;var $configXML;$.ajax({url:configFile,dataType:"xml",success:function(configXML){$configXML=app.parseConfig(configXML,shareUrlInfo);ga_events($)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}});$("#btnTglLyrPick").click(function(){var $layerPickerDialog=$("#layerPickerDialog");if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close")}else{$layerPickerDialog.dialog("open")}});$("#layerPickerDialog").dialog({zIndex:10050,position:{my:"left top",at:"left+5 top+100"},autoOpen:true,hide:"fade",width:330});app.addListener("accordiongroupchange",function(){if(app.currentTheme){$("#layerPickerAccordion").accordion({active:app.currentTheme.getAccordionGroupIndex(app.currentAccordionGroup),collapsible:true,beforeActivate:function(event,ui){if(!app.initialThemeLoad){$("#layerPickerDialog").scrollTop(0)}},activate:function(event,ui){app.setupCollapsibleSublists(ui);if(app.initialThemeLoad){app.initialThemeLoad=false;$("#layerPickerDialog").scrollTop(755)}}})}});$("#btnTglMapTools").click(function(){var $mapToolsDialog=$("#mapToolsDialog");if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close")}else{$mapToolsDialog.dialog("open")}});$("#mapToolsDialog").dialog({zIndex:10050,position:{my:"right top",at:"right-5 top+100"},autoOpen:true,hide:"fade"});app.addListener("themechange",function(){app.updateShareMapUrl()});app.addListener("baselayerchange",function(){app.updateShareMapUrl()});app.addListener("accordiongroupchange",function(){app.updateShareMapUrl()});app.addListener("extentchange",function(){app.saveCurrentExtent();app.updateShareMapUrl()});var $mapToolsAccordion=$("#mapToolsAccordion"),accordionGroupIndexToOpen=0;$mapToolsAccordion.accordion({heightStyle:"content",collapsible:true});$mapToolsAccordion.find("div").each(function(i){if(this.id==="legend"){accordionGroupIndexToOpen=i;return false}return true});$mapToolsAccordion.accordion("option","active",accordionGroupIndexToOpen);$("#baseCombo").change(function(){var i=parseInt($(this).val(),10);app.setBaseLayer(app.baseLayers[i])});app.addListener("baselayerchange",function(){$("#baseCombo").val(app.currentBaseLayer.index)});$("#themeCombo").change(function(){var i=parseInt($(this).val(),10);app.setTheme(app.themes[i])});app.addListener("themechange",function(){$("#themeCombo").val(app.currentTheme.index)});$("#btnPan").click(function(){deactivateActiveOpenLayersControls();app.dragPanTool.activate()});$("#btnPrint").click(function(){if($configXML!==undefined){printMap($configXML)}else{console.log("Can't print yet; config file not yet parsed")}});$("#btnZoomIn").click(function(){deactivateActiveOpenLayersControls();app.zoomInTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomOut").click(function(){deactivateActiveOpenLayersControls();app.zoomOutTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomExtent").click(function(){app.zoomToExtent(app.maxExtent)});$("#btnID").click(function(){deactivateActiveOpenLayersControls();app.identifyTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnAbout").click(function(){var splashScreen=$("#splashScreenContainer");if(splashScreen.dialog("isOpen")){splashScreen.dialog("close")}else{splashScreen.dialog("open")}});$("#btnPrev").click(function(){app.zoomToPreviousExtent()});$("#btnNext").click(function(){app.zoomToNextExtent()});$("#btnMultiGraph").click(function(){deactivateActiveOpenLayersControls();app.multigraphTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnMarker").click(function(){deactivateActiveOpenLayersControls();app.markerTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});createSplashScreen();var $findArea=$("#findArea");$findArea.findArea();areasList=$findArea.findArea("getAreasList");$findArea.autocomplete({source:areasList});$findArea.keypress(function(e){if(e.which==13){var areaExtent=$findArea.findArea("getAreaExtent",$findArea.val(),areasList);app.zoomToExtent(areaExtent)}});$("#address_lookup").on("click",function(){var location=$("#address_field").val();handle_search(location,app)});$("#address_field").on("keypress",function(e){if(e.which===13){var location=$(this).val();handle_search(location,app)}});$(".mask-toggle").on("click",function(){if($(this).is(":checked")){app.setMaskByMask(true,this.value)}else{app.setMaskByMask(false,this.value)}});$("[data-mask-grouper='true']").on("change",function(){var disabled=$(this).is(":checked")?true:false;$("[data-mask-parent='"+this.value+"']").attr("disabled",disabled)});$(".mask-modifier").on("change",function(){var value=$(this).is(":checked")?this.value:"";var index=$(this).data("index");if($(this).data("maskGrouper")===true){app.handleMaskModifierGroup(this.value,$(this).is(":checked"))}app.handleMaskModifier(value,index)});$("textarea").focus(function(){var $this=$(this);$this.select();window.setTimeout(function(){$this.select()},1);function mouseUpHandler(){$this.off("mouseup",mouseUpHandler);return false}$this.mouseup(mouseUpHandler)});if($(window).width()<650){$("#mapToolsDialog").dialog("close");$("#layerPickerDialog").dialog("close")}if(window.addEventListener){window.addEventListener("orientationchange",function(){var $mapToolsDialog=$("#mapToolsDialog"),$layerPickerDialog=$("#layerPickerDialog");window.scroll(0,0);if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close").dialog("open")}if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close").dialog("open")}},false)}}return launch}},{"./deactivate_controls.js":17,"./print.js":43,"./search.js":45,"./set_google_analytics_events.js":48,"./splash.js":54}],28:[function(require,module,exports){module.exports=function($,app){var stringContainsChar=require("./stringContainsChar.js");function Layer(settings){EventEmitter.call(this);if(!settings){return}$.extend(true,this,settings);this.transparency=0;if(this.index==undefined){this.index=0}if(this.type==undefined){this.type="WMS"}this.createOpenLayersLayer=function(){if(this.openLayersLayer!==undefined){return this.openLayersLayer}var options={isBaseLayer:false,transitionEffect:"resize",buffer:0,singleTile:true,ratio:1};if(this.type==="WMTS"){var settings={name:this.name,url:this.url,layer:this.layers,style:this.style,matrixSet:this.srs,isBaseLayer:false,transitionEffect:"resize",format:"image/jpg",sphericalMercator:true};if(this.lid.indexOf("GLAM")>-1){$.extend(true,settings,{serverResolutions:[156543.033928041,78271.5169640205,39135.7584820102,19567.8792410051,9783.9396205026,4891.9698102513,2445.9849051256,1222.9924525628,611.4962262814,305.7481131407048],units:"m",tileOrigin:new OpenLayers.LonLat(-20037508.34,20037508.34)})}this.openLayersLayer=new OpenLayers.Layer.WMTS(settings)}else if(this.type==="XYZ"){this.openLayersLayer=new OpenLayers.Layer.XYZ(this.name,this.url,{isBaseLayer:false,projection:new OpenLayers.Projection(seldon.projection)})}else if(this.type==="ArcGIS93Rest"){this.openLayersLayer=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params.mosaicRule?$.extend(true,{},this.params,{mosaicRule:JSON.stringify(this.params.mosaicRule)}):this.params,options)}else{if(this.maxResolution){options.maxResolution=parseFloat(this.maxResolution)}var layer=this.layers+("mask"in this?app.maskModifiers.join(""):"");this.openLayersLayer=new OpenLayers.Layer.WMS(this.name,this.url,{projection:new OpenLayers.Projection(seldon.projection),units:"m",layers:layer,transparent:true},options)}var loadingimage=$('');$("#map").append(loadingimage);this.openLayersLayer.loadingimage=loadingimage;this.openLayersLayer.events.register("loadstart",this.openLayersLayer,function(){this.loadingimage.addClass("loading")});this.openLayersLayer.events.register("loadend",this.openLayersLayer,function(){this.loadingimage.removeClass("loading")});this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);this.openLayersLayer.seldonLayer=this;return this.openLayersLayer};this.activate=function(options){options=options||{};this.addToLegend();this.emit("activate");if(this.mask==="true"&&this.lid.indexOf("MaskFor")===-1){if(app.masks.length>0){app.setMaskByLayer(true,this)}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}var inMaskParentLayers=app.maskParentLayers.filter(function(layer){return this===layer},this).length;if(!inMaskParentLayers){app.maskParentLayers.push(this)}}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}vectorServices=["vlayers","fire","ads"];boundaryServices=["boundaries"];allVectorServices=vectorServices;Array.prototype.push.apply(allVectorServices,boundaryServices);var isVectorLayer=function(layer,serviceNames){return serviceNames.filter(function(serviceName){return layer.url&&layer.url.indexOf(serviceName+"?")>-1}).length};if(app.map.getNumLayers()>1){var lyrJustAdded=app.map.layers[app.map.getNumLayers()-1];if(!isVectorLayer(lyrJustAdded,allVectorServices)){for(var i=app.map.getNumLayers()-2;i>0;i--){var nextLayerDown=app.map.layers[i];if(!isVectorLayer(nextLayerDown,allVectorServices)){if(nextLayerDown.seldonLayer.index0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,vectorServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}for(var i=app.map.getNumLayers()-1;i>0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,boundaryServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}}app.updateShareMapUrl();app.map.updateSize()};this.deactivate=function(options){options=options||{};if(this.visible==="true"){app.map.removeLayer(this.openLayersLayer);this.visible="false"}if(!this.parentLayer){app.setMaskByLayer(false,this)}if(options.removeFromLegend){this.removeFromLegend()}if(options.removeFromParentMaskLayers){app.maskParentLayers=app.maskParentLayers.filter(function(layer){return layer.lid!==this.lid},this)}if(this.openLayersLayer&&this.openLayersLayer.loadingimage){this.openLayersLayer.loadingimage.removeClass("loading")}this.emit("deactivate")};this.addToLegend=function(){var that=this;var $legend=$("#legend");var lid=this.parentLayer?this.parentLayer.lid:this.lid;$(document.getElementById("lgd"+lid)).remove();this.$legendItem=$(document.createElement("div")).attr("id","lgd"+lid).prepend($(document.createElement("img")).attr("src",this.legend)).click(function(){that.deactivate();if(that.parentLayer){that.parentLayer.deactivate({removeFromParentMaskLayers:true})}that.removeFromLegend()});if(this.url.indexOf("vlayers")>-1){this.$legendItem.prependTo($legend)}else{this.$legendItem.appendTo($legend)}};this.removeFromLegend=function(){if(this.$legendItem)this.$legendItem.remove()};this.setTransparency=function(transparency){if(this.openLayersLayer){this.openLayersLayer.setOpacity(1-parseFloat(transparency)/100); -if(!title){title="U.S Forest Change Assessment Viewer"}$.ajax({url:service_url+"/"+service_name,type:"POST",data:OpenLayers.Util.getParameterString({width:size.w,height:size.h,tiles:tiles_json,legends:legends_json,title:title}),headers:{"Content-Type":"application/x-www-form-urlencoded"},success:function(data,status,jqxhr){data=data.replace(/\s+/,"");var href=service_url+"/cgi-bin/printed_map.jpg";if(data){href=service_url+"/"+data}$("#printMapLoader").html('
print image result
');printPopup.dialog("option","title","Print Image Created!")},error:function(jqxhr,status,err){$("#printMapLoader").html("
An error happended.
");printPopup.dialog("option","title","NO Print Image Created!")}})}return printMap}},{}],44:[function(require,module,exports){function RepeatingOperation(op,yieldEveryIteration){var count=0;var instance=this;this.step=function(args){if(++count>=yieldEveryIteration){count=0;setTimeout(function(){op(args)},1,[]);return}op(args)}}module.exports=RepeatingOperation},{}],45:[function(require,module,exports){module.exports=function($){function handle_search(location,app){var rest_endpoint="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text="+location+"&f=json";$.getJSON(rest_endpoint,function(data){var locations=data["locations"][0];if(locations===undefined){return}var extent=locations["extent"];var bounds=new OpenLayers.Bounds(extent.xmin,extent.ymin,extent.xmax,extent.ymax).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));app.zoomToExtent(bounds,true)})}return handle_search}},{}],46:[function(require,module,exports){(function($){"use strict";require("./overrides.js")($);var seldon={App:require("./app.js")($)};var app=new seldon.App;seldon.init=require("./init.js")(app);window.seldon=seldon})(jQuery)},{"./app.js":11,"./init.js":25,"./overrides.js":41}],47:[function(require,module,exports){module.exports=function($){function setBaseLayer(baseLayer){var resolutions=[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,.5971642833948135];var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets");handleBaseLayer(app,layer,baseLayer)}else if(baseLayer.type=="ArcGISCache"){$.ajax({url:baseLayer.url+"?f=json&pretty=true",dataType:"jsonp",success:function(layerInfo){var options={layerInfo:layerInfo};if(baseLayer.numZoomLevels){options.numZoomLevels=baseLayer.numZoomLevels;if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);options.serverResolutions=serverResolutions;options.resolutions=resolutions}}var layer=new OpenLayers.Layer.ArcGISCache(baseLayer.name,baseLayer.url,options);handleBaseLayer(app,layer,baseLayer)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet,sphericalMercator:true};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings);handleBaseLayer(app,layer,baseLayer)}}function handleBaseLayer(app,layer,baseLayer){app.map.removeLayer(app.map.layers[0]);app.currentBaseLayer=baseLayer;app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.emit("baselayerchange")}return setBaseLayer}},{}],48:[function(require,module,exports){function ga_events($){var eventAdded=false;try{$.ga.trackEvent;eventAdded=true}catch(err){eventAdded=false}if(typeof ga!=="undefined"){if(eventAdded){seldon.app.map.events.register("moveend",seldon.app.map,function(){var newMapExtent=seldon.app.map.getExtent();$.ga.trackEvent({category:"Map Extent",action:"Change",label:newMapExtent.toString(),nonInteractive:true})});$(".shareMapUrl").click(function(event){$.ga.trackEvent({category:"Share Map URL",action:"Click",label:$(".shareMapUrl").val()})});$("#mapTheme #themeCombo").change(function(event){$.ga.trackEvent({category:"Map Theme",action:"Change",label:$("#mapTheme #themeCombo option:selected").text()})});$("#txtFindArea input#address_field").keyup(function(event){if(event.which===13){$.ga.trackEvent({category:"Find Area",action:"Search Enter",label:$(this).val()})}});$("#txtFindArea #address_lookup img").click(function(event){$.ga.trackEvent({category:"Find Area",action:"Search Button",label:$("#txtFindArea input#address_field").val()})});$("#mapBase #baseCombo").change(function(event){$.ga.trackEvent({category:"Base Map",action:"Change",label:$("#mapBase #baseCombo option:selected").text()})});$(".header-bar .header-bar img.icon").gaTrackEvent({category:"Nav Bar",action:"click",useLabel:true,labelAttribute:"title",useEvent:true,event:"click"});$("#mapToolsDialog label[for^='chk']").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#mapToolsDialog input").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("#layerPickerDialog label[for^='chk']").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#layerPickerDialog input").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("h3.ui-accordion-header").gaTrackEvent({category:"Base Layer",action:"Toggle Accordion",useLabel:true,label:function(){return $(this).text()},useEvent:true,event:"click"});$("#marker-dialog .marker-button-wrapper .marker-button-download").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Download Points"})});$("#marker-dialog .marker-button-wrapper .marker-button-clear").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Clear Points"})});$("#marker-dialog .marker-point-label .marker-point-coords-label").focusout(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Notes",label:$(this).val()})});$("img[src$='slider.png']").mouseup(function(event){$.ga.trackEvent({category:"OpenLayers Buttons",action:"Slide",label:"Zoom Slider"})});$(".olButton").click(function(event){var eleId=$(this).attr("id");switch(true){case eleId.indexOf("ZoombarOpenLayers_Map")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Bar"});break;case eleId.indexOf("panleft")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan Left"});break;case eleId.indexOf("panright")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan right"});break;case eleId.indexOf("panup")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan up"});break;case eleId.indexOf("pandown")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan down"});break;case eleId.indexOf("zoomin")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom in"});break;case eleId.indexOf("zoomout")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Out"});break;default:}})}}}module.exports=ga_events},{}],49:[function(require,module,exports){module.exports=function($){function setMaskByLayer(toggle,parentLayer){var Layer=require("./layer.js")($,this);var app=this;var maskLayer,maskName,cleanMaskName;var m,ml,mld;if(toggle){for(m=0;m0;i--){var currLayer=app.map.layers[i];for(var j=0;j0||sublist.break?"":" empty";var collapsibleClass=sublist.collapsible?" collapsible":"";var collapseHeaderIcon=sublist.collapsible?'':"";var sublistObj={heading:sublist.label,items:[],collapsible:sublist.collapsible,contentElement:$('
'+'
'+collapseHeaderIcon+"

"+sublist.label+"

"+"
"+"
")};if(sublist.description){var sublistInfoButton=new MoreInfoButton(sublist);sublistObj.contentElement.children(".sublist-header").append(sublistInfoButton.element)}g.sublists.push(sublistObj);sublistItems.push(sublistObj.contentElement);var sublistLayerItems=[];for(var k=0,l=sublist.layers.length;k=0){name=this.substring(0,i);value=this.substring(i+1)}else{name=this;value=undefined}vars[name]=value});info.themeName=vars.theme;info.accordionGroupGid=vars.accgp;info.baseLayerName=vars.basemap;if(vars.extent){var extentCoords=vars.extent.split(",");info.extent={left:extentCoords[0],bottom:extentCoords[1],right:extentCoords[2],top:extentCoords[3]}}if(vars.layers){$.each(vars.layers.split(","),function(){info.layerLids.push(this)})}if(vars.mask){$.each(vars.mask.split(","),function(){info.layerMask.push(this)})}if(vars.modifiers){$.each(vars.modifiers.split(","),function(){info.maskModifiers.push(this)})}if(vars.alphas){$.each(vars.alphas.split(","),function(){info.layerAlphas.push(this)})}if(info.themeName&&info.baseLayerName){return info}return undefined};ShareUrlInfo.prototype.urlArgs=function(){return Mustache.render(""+"theme={{{theme}}}"+"&layers={{{layers}}}"+"&mask={{{mask}}}"+"{{{modifiers}}}"+"&alphas={{{alphas}}}"+"&accgp={{{accgp}}}"+"&basemap={{{basemap}}}"+"&extent={{{extent.left}}},{{{extent.bottom}}},{{{extent.right}}},{{{extent.top}}}",{theme:this.themeName,layers:this.layerLids.join(","),mask:this.layerMask.join(","),modifiers:this.maskModifiers.length>0?"&modifiers="+this.maskModifiers.join(","):"",alphas:this.layerAlphas.join(","),accgp:this.accordionGroupGid,basemap:this.baseLayerName,extent:this.extent})};module.exports=ShareUrlInfo},{}],53:[function(require,module,exports){module.exports=function($){var stringContainsChar=require("./stringContainsChar.js");var ShareUrlInfo=require("./share.js");function shareUrl(){if(!this.currentTheme){return undefined}if(!this.currentAccordionGroup){return undefined}if(!this.currentBaseLayer){return undefined}var extent=this.map.getExtent(),layerLids=[],layerAlphas=[],layerMask=[],url;if(!extent){return undefined}$.each(this.map.layers,function(){var op,lid,test;if(!this.isBaseLayer){if(this.opacity===1){op="1"}else if(this.opacity===0){op="0"}else{op=sprintf("%.2f",this.opacity)}if(stringContainsChar(this.name,"MaskFor")){lid=this.seldonLayer.lid;test=lid.substring(lid.indexOf("MaskFor"),lid.length).replace("MaskFor","");if(layerMask.indexOf(test)===-1){layerMask.push(test)}test=this.name.substring(0,this.name.indexOf("MaskFor"));if(layerLids.indexOf(test)===-1){layerLids.push(test);layerAlphas.push(op)}}else{if(this.seldonLayer){layerLids.push(this.seldonLayer.lid);layerAlphas.push(op)}}}});if(this.hasOwnProperty("maskModifiers")){var modifiers=this.maskModifiers.filter(function(val){return val!==""})}url=window.location.toString();url=url.replace(/\?.*$/,"");url=url.replace(/\/$/,"");url=url.replace("#","");return url+"?"+new ShareUrlInfo({themeName:this.currentTheme.name,layerLids:layerLids,layerMask:layerMask,maskModifiers:modifiers,layerAlphas:layerAlphas,accordionGroupGid:this.currentAccordionGroup.gid,baseLayerName:this.currentBaseLayer.name,extent:extent}).urlArgs()}return shareUrl}},{"./share.js":52,"./stringContainsChar.js":55}],54:[function(require,module,exports){module.exports=function($){function createSplashScreen(){var $document=$(document),windowWidth=Math.round($document.width()/2);$("#splashScreenContent").load("splashScreen.html");$("#splashScreenContainer").dialog({autoOpen:false,zIndex:10051,maxHeight:$document.height(),width:windowWidth,minWidth:300,dialogClass:"splashScreenStyle",hide:"explode"})}return createSplashScreen}},{}],55:[function(require,module,exports){function stringContainsChar(string,c){return string.indexOf(c)>=0}module.exports=stringContainsChar},{}],56:[function(require,module,exports){function Theme(settings){this.accordionGroups=[];if(!settings){return}this.name=settings.name;this.label=settings.label;this.index=settings.index;this.zoom=settings.zoom;this.xmin=settings.xmin;this.ymin=settings.ymin;this.xmax=settings.xmax;this.ymax=settings.ymax;this.getAccordionGroupIndex=function(accordionGroup){var i;for(i=0;i0;i--){currentLayer=app.map.layers[i];openLayersLayer=currentLayer.seldonLayer.openLayersLayer;lid=currentLayer.seldonLayer.lid;if(stringContainsChar(currentLayer.name,"Mask")){if(openLayersLayer&&lid.substring(0,lid.indexOf("MaskFor"))===this.lid){openLayersLayer.setOpacity(1-parseFloat(transparency)/100);currentLayer.seldonLayer.transparency=transparency}}}}}}window.EventEmitter.declare(Layer);return Layer}},{"./stringContainsChar.js":55}],29:[function(require,module,exports){module.exports=function($){function createLayerToggleCheckbox(layer){var checkbox=document.createElement("input"),$checkbox;checkbox.type="checkbox";checkbox.id="chk"+layer.lid;checkbox.onclick=function(){if($(this).is(":checked")){layer.activate()}else{layer.deactivate({removeFromLegend:true,removeFromParentMaskLayers:true})}};$checkbox=$(checkbox);$checkbox.addClass(layer.lid);layer.addListener("activate",function(){$("input."+this.lid).attr("checked",true)});layer.addListener("deactivate",function(){$("input."+this.lid).attr("checked",false)});return checkbox}return createLayerToggleCheckbox}},{}],30:[function(require,module,exports){module.exports=function($){function createLayerPropertiesDialog(layer){var localTransparency=0;var $html=$(""+'
'+""+""+""+""+""+""+"
Transparency:"+'
'+"
"+'%'+"
"+"
");$html.find("input.transparency-text").val(layer.transparency);if(layer.transparency>0){localTransparency=layer.transparency;layer.setTransparency(localTransparency)}$html.find(".transparency-slider").slider({min:0,max:100,step:1,value:localTransparency,slide:function(event,ui){try{layer.setTransparency(ui.value)}catch(err){var errTxt=err.message}}});$html.find("input.transparency-text").change(function(){var $this=$(this),newValueFloat=parseFloat($this.val());if(isNaN(newValueFloat)||newValueFloat<0||newValueFloat>100){$this.val(layer.transparency);return}layer.setTransparency($this.val())});layer.addListener("transparency",function(e){$html.find("input.transparency-text").val(e.value)});$html.dialog({zIndex:10050,position:"left",autoOpen:true,hide:"explode",title:layer.name,width:"auto",close:function(){$(this).dialog("destroy");$html.remove();createLayerPropertiesDialog.$html[layer.lid]=undefined}});createLayerPropertiesDialog.$html[layer.lid]=$html}createLayerPropertiesDialog.$html={};return createLayerPropertiesDialog}},{}],31:[function(require,module,exports){module.exports=function($){var createLayerPropertiesDialog=require("./layer_dialog.js")($);function createLayerPropertiesIcon(layer){var img=document.createElement("img");img.id=layer.lid;img.src="icons/settings.png";img.className="layerPropertiesIcon";img.onclick=function(){createLayerPropertiesDialog(layer)};return img}return createLayerPropertiesIcon}},{"./layer_dialog.js":30}],32:[function(require,module,exports){module.exports=function($,app){var generalRadioHandler=require("./layer_radio_handler.js")($,app);function createLayerToggleRadioButton(layer,radioGroupName){var checkbox=document.createElement("input"),$checkbox;checkbox.type="radio";checkbox.name=radioGroupName;checkbox.id=layer.lid;if(layer.selectedInConfig){checkbox.checked=true}$checkbox=$(checkbox);$checkbox.change(radioHandler);layer.addListener("activate",function(){$checkbox.attr("checked",true)});layer.addListener("deactivate",function(){$checkbox.attr("checked",false)});return checkbox}function radioHandler(){generalRadioHandler(app)}return createLayerToggleRadioButton}},{"./layer_radio_handler.js":33}],33:[function(require,module,exports){module.exports=function($,app){var Layer=require("./layer.js")($,app);function radioHandler(app){var $selectedOption=$(app.dropdownBoxList[0]).find(":selected");if($selectedOption.text()==="select..."){clearRadioLayers(app,null);return}var selectLayer=app.dropdownBoxLayers[$selectedOption.val()];var wanted_lid=getActiveDropdownBoxRadioLID(app);var wanted_layer=undefined;var i;for(i=0;i0;i--){currLayer=app.map.layers[i].seldonLayer;for(j=0;j"+selectBoxLayers[i].name+"")}selectBox.insertAdjacentHTML("afterbegin","");$(selectBox).change(selectHandler);return selectBox}function selectHandler(){radioHandler(app)}return createLayerToggleDropdownBox}},{"./layer_radio_handler.js":33}],35:[function(require,module,exports){module.exports=function($,app){function isLayerInLegendConfig(layerId){return layerId in app.legendLookup}function getLegendStringFromPixelValue(layerId,pixelValue){var legendString="";if(isLayerInLegendConfig(layerId)){legendString=app.legendLookup[layerId][pixelValue];if(!legendString){console.error("No legend string set for pixel value",pixelValue,"for layer",layerId)}}return legendString}return getLegendStringFromPixelValue}},{}],36:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js");var saveAs=require("../libs/FileSaver/FileSaver.js").saveAs;var popupId="marker-dialog";var points=[];var pointStyleDefault={pointRadius:4,fillColor:"blue",fillOpacity:.75};var pointStyleHover={pointRadius:5,fillColor:"orange",fillOpacity:.75};var pointStyle=new OpenLayers.StyleMap(pointStyleDefault);function marker(){return new ClickTool(markerHandler)}function markerHandler(e){var coords=app.map.getLonLatFromPixel(e.xy);var lonlat=app.map.getLonLatFromPixel(e.xy);lonlat.transform(app.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));var markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:pointStyle});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));markerLayer.addFeatures(feature);app.map.addLayer(markerLayer);if(!$("#"+popupId).length){createPopup()}if($(".marker-points").length){createPointItem(lonlat,markerLayer)}points.push({lonlat:lonlat,layer:markerLayer});if(typeof ga!=="undefined"){ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Create New Point",eventLabel:lonlat.lon+", "+lonlat.lat})}}function createPointItem(coords,layer){var itemString="";itemString+='
';itemString+='
';itemString+=' Lat:';itemString+=' '+coords.lat+"";itemString+="
";itemString+='
';itemString+=' Lon:';itemString+=' '+coords.lon+"";itemString+="
";itemString+='
';itemString+=' Notes:';itemString+='
';itemString+="
";itemString+="
";var item=$(itemString);item.data("point",layer);item.on("mouseenter",handlePointHoverEnter).on("mouseleave",handlePointHoverLeave);$(".marker-points").append(item)}function handlePointHoverEnter(e){var point=$(this).data("point");point.style=pointStyleHover;point.redraw()}function handlePointHoverLeave(e){var point=$(this).data("point");point.style=pointStyleDefault;point.redraw()}function createPopup(){var popup=$('
');$("body").append(popup);$(".marker-button-download").click(exportFileHandler);$(".marker-button-clear").click(clearPointsHandler);popup.dialog({width:300,height:400,resizable:false,position:{my:"right top",at:"right-5 top+120"},title:"Mark areas of interest",close:function(event,ui){clearPointsHandler();$(this).remove()}})}function exportFileHandler(){var lat,lon,url,notes;var SEP="|";var i;var csvContent="sep="+SEP+"\n";csvContent+="lat"+SEP+"long"+SEP+"google maps link"+SEP+"notes\n";for(i=0;i=0){direction="N"}else if(type==="lat"&&value<0){direction="S"}else if(type==="lon"&&value>=0){direction="E"}else if(type==="lon"&&value<0){direction="W"}value=Math.abs(value);var degree=Math.floor(value);value=(value-degree)*60;var minute=Math.floor(value);var second=(value-minute)*60;return degree+"%C2%B0"+minute+"'"+second+"%22"+direction}function getNotes(index){if(typeof ga!=="undefined"){var label=$(".marker-point-item").eq(index).find(".marker-point-notes").val();ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Notes",eventLabel:label})}return $(".marker-point-item").eq(index).find(".marker-point-notes").val()}function clearPointsHandler(){var i;for(i=0;i')}else{popup.html('
')}popup.dialog({width:600,resizable:false,position:{my:"center+"+offset+" center+"+offset,at:"center",of:window},title:Mustache.render("MODIS NDVI for Lat: {{{lat}}} Lon: {{{lon}}}",{lat:sprintf("%.4f",lonlat.lat),lon:sprintf("%.4f",lonlat.lon)}),close:function(event,ui){app.map.removeLayer(markerLayer);$(this).remove()}});var seldonMultigraph=$("#seldonMultigraph"+app.graphCount+""),promise=seldonMultigraph.multigraph({mugl:muglPrefix+lonlat.lon+","+lonlat.lat,swf:"libs/seldon/libs/Multigraph.swf"});seldonMultigraph.multigraph("done",function(m){if(m){$(m.div()).parent().children(".multigraphLoader").remove()}})})}return createMultigraphTool}},{"./clicktool.js":14}],41:[function(require,module,exports){module.exports=function($){Array.prototype.remove=function(value){if(this.indexOf(value)!==-1){this.splice(this.indexOf(value),1);return true}else{return false}};OpenLayers.Map.prototype.getCurrentSize=function(){var size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=this.div.offsetWidth;size.h=this.div.offsetHeight}if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=parseInt(this.div.style.width,10);size.h=parseInt(this.div.style.height,10)}size.h=size.h-parseInt($(this.div).css("padding-top"),10)-parseInt($(this.div).css("padding-bottom"),10);return size};$.widget("ui.dialog",$.extend({},$.ui.dialog.prototype,{_moveToTop:function(arg){if(arg){if(arg.handleObj.type!="mousedown"){var moved=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;if(moved&&!silent){this._trigger("focus",event)}return moved}}}}))}},{}],42:[function(require,module,exports){module.exports=function($){var createArcGIS93RestParams=require("./create_arcgis_rest_params.js")($);var AccordionGroup=require("./accordion_group.js");var AccordionGroupSublist=require("./accordion_group_sublist.js");var BaseLayer=require("./baselayer.js");var Theme=require("./theme.js");function parseConfig(configXML,shareUrlInfo){var Layer=require("./layer.js")($,this);var createIdentifyTool=require("./identify.js")($,this);var createMultigraphTool=require("./multigraph.js")($,this);var marker=require("./marker.js")($,this);var app=this,$configXML=$(configXML),initialBaseLayer,initialTheme,shareUrlLayerAlpha={},themeOptions={},i,j,k,l,ll,lll;if(shareUrlInfo!==undefined){for(i=0,l=shareUrlInfo.layerLids.length;i0){app.maxExtent={left:parseFloat($extent.attr("xmin")),bottom:parseFloat($extent.attr("ymin")),right:parseFloat($extent.attr("xmax")),top:parseFloat($extent.attr("ymax"))}}var $baseCombo=$("#baseCombo"),$images=$configXML.find("images image"),$image,selected,baseLayer;for(i=0,l=$images.length;ionline.',mapName:"Layers",description:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including the terms of use, visit us online at http://goto.arcgisonline.com/maps/World_Street_Map",copyrightText:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012",layers:[{id:0,name:"World Street Map",parentLayerId:-1,defaultVisibility:true,subLayerIds:null,minScale:0,maxScale:0}],tables:[],spatialReference:{wkid:102100},singleFusedMapCache:true,tileInfo:{rows:256,cols:256,dpi:96,format:"JPEG",compressionQuality:90,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:0,resolution:156543.033928,scale:591657527.591555},{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176}]},initialExtent:{xmin:-28872328.0888923,ymin:-11237732.4896886,xmax:28872328.0888923,ymax:11237732.4896886,spatialReference:{wkid:102100}},fullExtent:{xmin:-20037507.0671618,ymin:-19971868.8804086,xmax:20037507.0671618,ymax:19971868.8804086,spatialReference:{wkid:102100}},units:"esriMeters",supportedImageFormatTypes:"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI,BMP",documentInfo:{Title:"World Street Map",Author:"Esri",Comments:"",Subject:"streets, highways, major roads, railways, water features, administrative boundaries, cities, parks, protected areas, landmarks ",Category:"transportation(Transportation Networks) ",Keywords:"World, Global, Europe, Japan, Hong Kong, North America, United States, Canada, Mexico, Southern Africa, Asia, South America, Australia, New Zealand, India, Argentina, Brazil, Chile, Venezuela, Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, Switzerland, Russia, Thailand, Turkey, 2012",Credits:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"},capabilities:"Map"};app.initOpenLayers(baseLayerInfo,initialBaseLayer,initialTheme,themeOptions,initialExtent);return $configXML}function displayError(message){}return parseConfig}},{"./accordion_group.js":3,"./accordion_group_sublist.js":5,"./baselayer.js":13,"./create_arcgis_rest_params.js":16,"./identify.js":24,"./layer.js":28,"./marker.js":36,"./multigraph.js":40,"./theme.js":56}],43:[function(require,module,exports){module.exports=function($,app){function printMap($configXML){var offsetX=parseInt(app.map.layerContainerDiv.style.left,10);var offsetY=parseInt(app.map.layerContainerDiv.style.top,10);var size=app.map.getSize();var tiles=[];var layer,tile,position;var i,j,k;for(i=0;i
');printPopup.dialog({resizable:false,height:75,title:"Creating Image for Print...",close:function(event,ui){$(this).remove()}});var service_url=$configXML.find("tools tool[name=Print]").attr("service_url");if(!service_url){service_url="http://"+window.location.hostname+window.location.pathname}service_url=service_url.replace(/\/$/,"");var service_name=$configXML.find("tools tool[name=Print]").attr("service_name");if(!service_name){service_name="cgi-bin/print.cgi"}var title=$configXML.find("tools tool[name=Print]").attr("title");if(!title){title="U.S Forest Change Assessment Viewer"}$.ajax({url:service_url+"/"+service_name,type:"POST",data:OpenLayers.Util.getParameterString({ +width:size.w,height:size.h,tiles:tiles_json,legends:legends_json,title:title}),headers:{"Content-Type":"application/x-www-form-urlencoded"},success:function(data,status,jqxhr){data=data.replace(/\s+/,"");var href=service_url+"/cgi-bin/printed_map.jpg";if(data){href=service_url+"/"+data}$("#printMapLoader").html('
print image result
');printPopup.dialog("option","title","Print Image Created!")},error:function(jqxhr,status,err){$("#printMapLoader").html("
An error happended.
");printPopup.dialog("option","title","NO Print Image Created!")}})}return printMap}},{}],44:[function(require,module,exports){function RepeatingOperation(op,yieldEveryIteration){var count=0;var instance=this;this.step=function(args){if(++count>=yieldEveryIteration){count=0;setTimeout(function(){op(args)},1,[]);return}op(args)}}module.exports=RepeatingOperation},{}],45:[function(require,module,exports){module.exports=function($){function handle_search(location,app){var rest_endpoint="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text="+location+"&f=json";$.getJSON(rest_endpoint,function(data){var locations=data["locations"][0];if(locations===undefined){return}var extent=locations["extent"];var bounds=new OpenLayers.Bounds(extent.xmin,extent.ymin,extent.xmax,extent.ymax).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));app.zoomToExtent(bounds,true)})}return handle_search}},{}],46:[function(require,module,exports){(function($){"use strict";require("./overrides.js")($);var seldon={App:require("./app.js")($)};var app=new seldon.App;seldon.init=require("./init.js")(app);window.seldon=seldon})(jQuery)},{"./app.js":11,"./init.js":25,"./overrides.js":41}],47:[function(require,module,exports){module.exports=function($){function setBaseLayer(baseLayer){var resolutions=[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,.5971642833948135];var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets");handleBaseLayer(app,layer,baseLayer)}else if(baseLayer.type=="ArcGISCache"){$.ajax({url:baseLayer.url+"?f=json&pretty=true",dataType:"jsonp",success:function(layerInfo){var options={layerInfo:layerInfo};if(baseLayer.numZoomLevels){options.numZoomLevels=baseLayer.numZoomLevels;if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);options.serverResolutions=serverResolutions;options.resolutions=resolutions}}var layer=new OpenLayers.Layer.ArcGISCache(baseLayer.name,baseLayer.url,options);handleBaseLayer(app,layer,baseLayer)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet,sphericalMercator:true};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings);handleBaseLayer(app,layer,baseLayer)}}function handleBaseLayer(app,layer,baseLayer){app.map.removeLayer(app.map.layers[0]);app.currentBaseLayer=baseLayer;app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.emit("baselayerchange")}return setBaseLayer}},{}],48:[function(require,module,exports){function ga_events($){var eventAdded=false;try{$.ga.trackEvent;eventAdded=true}catch(err){eventAdded=false}if(typeof ga!=="undefined"){if(eventAdded){seldon.app.map.events.register("moveend",seldon.app.map,function(){var newMapExtent=seldon.app.map.getExtent();$.ga.trackEvent({category:"Map Extent",action:"Change",label:newMapExtent.toString(),nonInteractive:true})});$(".shareMapUrl").click(function(event){$.ga.trackEvent({category:"Share Map URL",action:"Click",label:$(".shareMapUrl").val()})});$("#mapTheme #themeCombo").change(function(event){$.ga.trackEvent({category:"Map Theme",action:"Change",label:$("#mapTheme #themeCombo option:selected").text()})});$("#txtFindArea input#address_field").keyup(function(event){if(event.which===13){$.ga.trackEvent({category:"Find Area",action:"Search Enter",label:$(this).val()})}});$("#txtFindArea #address_lookup img").click(function(event){$.ga.trackEvent({category:"Find Area",action:"Search Button",label:$("#txtFindArea input#address_field").val()})});$("#mapBase #baseCombo").change(function(event){$.ga.trackEvent({category:"Base Map",action:"Change",label:$("#mapBase #baseCombo option:selected").text()})});$(".header-bar .header-bar img.icon").gaTrackEvent({category:"Nav Bar",action:"click",useLabel:true,labelAttribute:"title",useEvent:true,event:"click"});$("#mapToolsDialog label[for^='chk']").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#mapToolsDialog input").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("#layerPickerDialog label[for^='chk']").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#layerPickerDialog input").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("h3.ui-accordion-header").gaTrackEvent({category:"Base Layer",action:"Toggle Accordion",useLabel:true,label:function(){return $(this).text()},useEvent:true,event:"click"});$("#marker-dialog .marker-button-wrapper .marker-button-download").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Download Points"})});$("#marker-dialog .marker-button-wrapper .marker-button-clear").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Clear Points"})});$("#marker-dialog .marker-point-label .marker-point-coords-label").focusout(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Notes",label:$(this).val()})});$("img[src$='slider.png']").mouseup(function(event){$.ga.trackEvent({category:"OpenLayers Buttons",action:"Slide",label:"Zoom Slider"})});$(".olButton").click(function(event){var eleId=$(this).attr("id");switch(true){case eleId.indexOf("ZoombarOpenLayers_Map")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Bar"});break;case eleId.indexOf("panleft")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan Left"});break;case eleId.indexOf("panright")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan right"});break;case eleId.indexOf("panup")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan up"});break;case eleId.indexOf("pandown")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan down"});break;case eleId.indexOf("zoomin")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom in"});break;case eleId.indexOf("zoomout")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Out"});break;default:}})}}}module.exports=ga_events},{}],49:[function(require,module,exports){module.exports=function($){function setMaskByLayer(toggle,parentLayer){var Layer=require("./layer.js")($,this);var app=this;var maskLayer,maskName,cleanMaskName;var m,ml,mld;if(toggle){for(m=0;m0;i--){var currLayer=app.map.layers[i];for(var j=0;j0||sublist.break?"":" empty";var collapsibleClass=sublist.collapsible?" collapsible":"";var collapseHeaderIcon=sublist.collapsible?'':"";var sublistObj={heading:sublist.label,items:[],collapsible:sublist.collapsible,contentElement:$('
'+'
'+collapseHeaderIcon+"

"+sublist.label+"

"+"
"+"
")};if(sublist.description){var sublistInfoButton=new MoreInfoButton(sublist);sublistObj.contentElement.children(".sublist-header").append(sublistInfoButton.element)}g.sublists.push(sublistObj);sublistItems.push(sublistObj.contentElement);var sublistLayerItems=[];for(var k=0,l=sublist.layers.length;k=0){name=this.substring(0,i);value=this.substring(i+1)}else{name=this;value=undefined}vars[name]=value});info.themeName=vars.theme;info.accordionGroupGid=vars.accgp;info.baseLayerName=vars.basemap;if(vars.extent){var extentCoords=vars.extent.split(",");info.extent={left:extentCoords[0],bottom:extentCoords[1],right:extentCoords[2],top:extentCoords[3]}}if(vars.layers){$.each(vars.layers.split(","),function(){info.layerLids.push(this)})}if(vars.mask){$.each(vars.mask.split(","),function(){info.layerMask.push(this)})}if(vars.modifiers){$.each(vars.modifiers.split(","),function(){info.maskModifiers.push(this)})}if(vars.alphas){$.each(vars.alphas.split(","),function(){info.layerAlphas.push(this)})}if(info.themeName&&info.baseLayerName){return info}return undefined};ShareUrlInfo.prototype.urlArgs=function(){return Mustache.render(""+"theme={{{theme}}}"+"&layers={{{layers}}}"+"&mask={{{mask}}}"+"{{{modifiers}}}"+"&alphas={{{alphas}}}"+"&accgp={{{accgp}}}"+"&basemap={{{basemap}}}"+"&extent={{{extent.left}}},{{{extent.bottom}}},{{{extent.right}}},{{{extent.top}}}",{theme:this.themeName,layers:this.layerLids.join(","),mask:this.layerMask.join(","),modifiers:this.maskModifiers.length>0?"&modifiers="+this.maskModifiers.join(","):"",alphas:this.layerAlphas.join(","),accgp:this.accordionGroupGid,basemap:this.baseLayerName,extent:this.extent})};module.exports=ShareUrlInfo},{}],53:[function(require,module,exports){module.exports=function($){var stringContainsChar=require("./stringContainsChar.js");var ShareUrlInfo=require("./share.js");function shareUrl(){if(!this.currentTheme){return undefined}if(!this.currentAccordionGroup){return undefined}if(!this.currentBaseLayer){return undefined}var extent=this.map.getExtent(),layerLids=[],layerAlphas=[],layerMask=[],url;if(!extent){return undefined}$.each(this.map.layers,function(){var op,lid,test;if(!this.isBaseLayer){if(this.opacity===1){op="1"}else if(this.opacity===0){op="0"}else{op=sprintf("%.2f",this.opacity)}if(stringContainsChar(this.name,"MaskFor")){lid=this.seldonLayer.lid;test=lid.substring(lid.indexOf("MaskFor"),lid.length).replace("MaskFor","");if(layerMask.indexOf(test)===-1){layerMask.push(test)}test=this.name.substring(0,this.name.indexOf("MaskFor"));if(layerLids.indexOf(test)===-1){layerLids.push(test);layerAlphas.push(op)}}else{if(this.seldonLayer){layerLids.push(this.seldonLayer.lid);layerAlphas.push(op)}}}});if(this.hasOwnProperty("maskModifiers")){var modifiers=this.maskModifiers.filter(function(val){return val!==""})}url=window.location.toString();url=url.replace(/\?.*$/,"");url=url.replace(/\/$/,"");url=url.replace("#","");return url+"?"+new ShareUrlInfo({themeName:this.currentTheme.name,layerLids:layerLids,layerMask:layerMask,maskModifiers:modifiers,layerAlphas:layerAlphas,accordionGroupGid:this.currentAccordionGroup.gid,baseLayerName:this.currentBaseLayer.name,extent:extent}).urlArgs()}return shareUrl}},{"./share.js":52,"./stringContainsChar.js":55}],54:[function(require,module,exports){module.exports=function($){function createSplashScreen(){var $document=$(document),windowWidth=Math.round($document.width()/2);$("#splashScreenContent").load("splashScreen.html");$("#splashScreenContainer").dialog({autoOpen:false,zIndex:10051,maxHeight:$document.height(),width:windowWidth,minWidth:300,dialogClass:"splashScreenStyle",hide:"explode"})}return createSplashScreen}},{}],55:[function(require,module,exports){function stringContainsChar(string,c){return string.indexOf(c)>=0}module.exports=stringContainsChar},{}],56:[function(require,module,exports){function Theme(settings){this.accordionGroups=[];if(!settings){return}this.name=settings.name;this.label=settings.label;this.index=settings.index;this.zoom=settings.zoom;this.xmin=settings.xmin;this.ymin=settings.ymin;this.xmax=settings.xmax;this.ymax=settings.ymax;this.getAccordionGroupIndex=function(accordionGroup){var i;for(i=0;i Date: Fri, 6 Aug 2021 18:41:26 +0000 Subject: [PATCH 3/8] Runs do-build --- html/libs/seldon/seldon-min.js | 4 ---- libs/seldon | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/html/libs/seldon/seldon-min.js b/html/libs/seldon/seldon-min.js index eb08ee3..e69de29 100644 --- a/html/libs/seldon/seldon-min.js +++ b/html/libs/seldon/seldon-min.js @@ -1,4 +0,0 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o"+'

'+el.description+"

"+"";$(dialogDiv).dialog({title:el.label||el.name,dialogClass:"tooltip-dialog "+dialogClass})}}}return MoreInfoButton}},{}],7:[function(require,module,exports){module.exports=function($){function addAccordionSection(accordionGroup,title){var sectionObj={title:title,titleElement:$("

"+title+"

"),contentElement:$("
"),sublists:[]};var $accordionGroup=$(accordionGroup);$accordionGroup.data("listAccordion").sections.push(sectionObj);$accordionGroup.append(sectionObj.titleElement).append(sectionObj.contentElement);$accordionGroup.accordion("refresh");return sectionObj}return addAccordionSection}},{}],8:[function(require,module,exports){module.exports=function($){function addAccordionSublists(g,items){$(g.contentElement).append(items)}return addAccordionSublists}},{}],9:[function(require,module,exports){module.exports=function($){function addAccordionSublistItems(s,items,theme,accGp){var collapsed=s.collapsible?"collapsed ":"";var contents=$('
');for(var i=0,l=items.length;i').append(items[i]))}var layer={name:name,contentElement:contents};s.items.push(layer);s.contentElement.append(layer.contentElement)}return addAccordionSublistItems}},{}],10:[function(require,module,exports){module.exports=function($){function addMaskToLegend(layer){var app=this;var maskName=layer.lid.substring(layer.lid.indexOf("MaskFor"),layer.lid.length);$("#lgd"+maskName).remove();layer.$legendItem=$(document.createElement("div")).attr("id","lgd"+maskName).prepend($(document.createElement("img")).attr("src",layer.legend)).prependTo($("#legend")).click(function(){app.setMaskByMask(false,maskName)})}return addMaskToLegend}},{}],11:[function(require,module,exports){module.exports=function($){var EventEmitter=window.EventEmitter;function App(){EventEmitter.call(this);this.map=undefined;this.tileManager=undefined;this.projection=undefined;this.gisServerType=undefined;this.useProxyScript=undefined;this.scalebar=undefined;this.zoomInTool=undefined;this.zoomOutTool=undefined;this.dragPanTool=undefined;this.id_markerLayer=undefined;this.maxExtent={left:-15e6,bottom:2e6,right:-6e6,top:7e6};this.baseLayers=[];this.accordionGroups=[];this.themes=[];this.maskParentLayers=[];this.masks=[];this.maskModifiers=[];this.defaultMasks=["MaskForForest"];this.radioButtonList=[];this.radioButtonLayers=[];this.dropdownBoxList=[];this.dropdownBoxLayers=[];this.currentBaseLayer=undefined;this.currentAccordionGroup=undefined;this.currentTheme=undefined;this.identifyTool=undefined;this.multigraphTool=undefined;this.markerTool=undefined;this.savedExtents=[];this.currentSavedExtentIndex=-1;this.saveCurrentExtent=require("./extent_save.js");this.zoomToExtent=require("./extent_zoom.js");this.zoomToPreviousExtent=require("./extent_zoom_previous.js");this.zoomToNextExtent=require("./extent_zoom_next.js");this.printSavedExtents=require("./extent_print.js");this.setBaseLayer=require("./set_base_layer.js")($);this.setAccordionGroup=require("./accordion_group_set.js");this.clearAccordionSections=require("./accordion_clear.js")($);this.addAccordionSection=require("./accordion_section_add.js")($);this.addAccordionSublists=require("./accordion_sublist_add.js")($);this.addAccordionSublistItems=require("./accordion_sublist_item_add.js")($);this.setTheme=require("./set_theme.js")($);this.shareUrl=require("./share_url.js")($);this.updateShareMapUrl=require("./update_share_url.js")($);this.launch=require("./launch.js")($);this.count=require("./count.js");this.addMaskToLegend=require("./add_mask_legend.js")($);this.setMaskByMask=require("./set_mask_by_mask.js")($);this.setMaskByLayer=require("./set_mask_by_layer.js")($);this.handleMaskModifier=require("./mask_modifier.js");this.handleMaskModifierGroup=require("./mask_modifier_group.js")($);this.parseConfig=require("./parse_config.js")($);this.initOpenLayers=require("./init_openlayers.js");this.setupCollapsibleSublists=require("./accordion_collapsible_sublist_setup.js")($);this.removeMaskFromLegend=function(layer){};OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.IMAGE_RELOAD_ATTEMPTS=3}EventEmitter.declare(App);return App}},{"./accordion_clear.js":1,"./accordion_collapsible_sublist_setup.js":2,"./accordion_group_set.js":4,"./accordion_section_add.js":7,"./accordion_sublist_add.js":8,"./accordion_sublist_item_add.js":9,"./add_mask_legend.js":10,"./count.js":15,"./extent_print.js":18,"./extent_save.js":19,"./extent_zoom.js":20,"./extent_zoom_next.js":21,"./extent_zoom_previous.js":22,"./init_openlayers.js":26,"./launch.js":27,"./mask_modifier.js":38,"./mask_modifier_group.js":39,"./parse_config.js":42,"./set_base_layer.js":47,"./set_mask_by_layer.js":49,"./set_mask_by_mask.js":50,"./set_theme.js":51,"./share_url.js":53,"./update_share_url.js":57}],12:[function(require,module,exports){function arrayContainsElement(array,element){var i;if(array===undefined){return false}for(i=0;iparam").each(function(i,param){var $param=$(param);if(param.hasAttribute("value")){obj[$param.attr("name")]=$param.attr("value")}else{obj[$param.attr("name")]=createArcGIS93RestParams($param)}});return obj}return createArcGIS93RestParams}},{}],17:[function(require,module,exports){module.exports=function(app,activeBtn){function deactivateActiveOpenLayersControls(){var controls,i;for(i=0;i=0;--i){e=this.savedExtents[i];html+=Mustache.render("{{{marker}}}{{{number}}}"+"left:{{{left}}}, bottom:{{{bottom}}}, right:{{{right}}}, top:{{{top}}}",{marker:i===this.currentSavedExtentIndex?"==>":"",number:i,left:e.left,bottom:e.bottom,right:e.right,top:e.top})}html+="";return html}module.exports=printSavedExtents},{}],19:[function(require,module,exports){var extentsAreEqual=require("./extents_equal.js");function saveCurrentExtent(){var newExtent=formatExtent(this.map.getExtent()),newSavedExtents=[],currentSavedExtent,i;if(this.currentSavedExtentIndex>=0){currentSavedExtent=this.savedExtents[this.currentSavedExtentIndex];if(extentsAreEqual(currentSavedExtent,newExtent)){return}}for(i=0;i<=this.currentSavedExtentIndex;++i){newSavedExtents.push(this.savedExtents[i])}this.savedExtents=newSavedExtents;this.savedExtents.push(newExtent);++this.currentSavedExtentIndex}function formatExtent(extent){return{left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top}}module.exports=saveCurrentExtent},{"./extents_equal.js":23}],20:[function(require,module,exports){function zoomToExtent(extent,save){if(save===undefined){save=true}var bounds=new OpenLayers.Bounds(extent.left,extent.bottom,extent.right,extent.top);this.map.zoomToExtent(bounds,true);if(save){this.saveCurrentExtent()}}module.exports=zoomToExtent},{}],21:[function(require,module,exports){function zoomToNextExtent(){if(this.currentSavedExtentIndex0){--this.currentSavedExtentIndex;this.zoomToExtent(this.savedExtents[this.currentSavedExtentIndex],false)}}module.exports=zoomToPreviousExtent},{}],23:[function(require,module,exports){function extentsAreEqual(e1,e2){var tolerance=.001;return Math.abs(e1.left-e2.left)<=tolerance&&Math.abs(e1.bottom-e2.bottom)<=tolerance&&Math.abs(e1.right-e2.right)<=tolerance&&Math.abs(e1.top-e2.top)<=tolerance}module.exports=extentsAreEqual},{}],24:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js"),stringContainsChar=require("./stringContainsChar.js");var getLegendStringFromPixelValue=require("./legend_config.js")($,app);function createIdentifyTool(){return new ClickTool(function(e){$("#identify_popup").remove();if(app.id_markerLayer){app.map.removeLayer(app.id_markerLayer)}var coords=app.map.getLonLatFromPixel(e.xy);var styleMap=new OpenLayers.StyleMap({pointRadius:4,fillColor:"yellow",fillOpacity:.75});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));app.id_markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:styleMap});app.id_markerLayer.addFeatures(feature);app.map.addLayer(app.id_markerLayer);var services=[],service,urlsrs;var layersAdded=[];var html='';$.each(app.map.layers,function(){var name,label;if(!this.isBaseLayer&&this.params&&(!("seldonLayer"in this)||String(this.seldonLayer.identify)!=="false")){name=this.params.LAYERS;if(String(name).match(/^\d+$/)){label=this.name}else{label=String(name).indexOf("MaskFor")!==-1?name.substring(0,name.indexOf("MaskFor")):name}if(layersAdded.indexOf(label)!==-1)return;layersAdded.push(label);services.push({url:this.url,srs:this.projection.projCode,name:name,label:label,proxyServerType:this.seldonLayer.proxyServerType});html=html+Mustache.render(""+''+''+''+"",{label:label})}});html=html+"
{{label}}:
";if(services.length===0){return}var popup=$(document.createElement("div"));popup.attr("id","identify_popup");popup.html(html);popup.dialog({width:600,height:300,resizable:true,title:"Identify Results",close:function(event,ui){app.map.removeLayer(app.id_markerLayer);app.id_markerLayer=undefined;$(this).remove()}});var i,l;for(i=0,l=services.length;i'+''+valueLabel.replace("_0","")+":  "+""+tableRow+""+""}$(newTableContents).insertAfter($group);if(!newTableContents)$group.find(".layer-results").text("N/A")},error:function(jqXHR,textStatus,errorThrown){}})}function createWMSGetFeatureInfoRequestURL(serviceUrl,layer,srs,x,y){var extent=app.map.getExtent();if(seldon.gisServerType==="ArcGIS"){extent=extent.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection(seldon.projection))}return Mustache.render(""+serviceUrl+"{{{c}}}LAYERS={{layer}}"+"&QUERY_LAYERS={{layer}}"+"&STYLES=,"+"&SERVICE=WMS"+"&VERSION=1.1.1"+"&REQUEST=GetFeatureInfo"+"&BBOX={{left}},{{bottom}},{{right}},{{top}}"+"&FEATURE_COUNT=100"+"&HEIGHT={{height}}"+"&WIDTH={{width}}"+"&FORMAT=image/png"+"&INFO_FORMAT=application/vnd.ogc.gml"+"&SRS={{srs}}"+"&X={{x}}"+"&Y={{y}}",{c:stringContainsChar(serviceUrl,"?")?"&":"?",layer:layer,height:app.map.size.h,width:app.map.size.w,left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top,srs:srs,x:x,y:y})}function getLayerResultsFromArcXML($xml,layerName,layerIDCount){var dataVals=[];try{var fields=$xml.find("FIELDS"),attributes=fields[layerIDCount].attributes,i;for(i=0;i=0||stringStartsWith(layerName,"EFETAC-NASA")||stringStartsWith(layerName,"RSAC-FHTET"))&&children[i].nodeName==="value_0"){value=value+sprintf(" (%.2f %%)",(parseFloat(value,10)-127)/128*100)}if((stringStartsWith(layerName.toUpperCase(),"NDMI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"NDVI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SWIR-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDVI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDMI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-SWIR-CURRENT"))&&children[i].nodeName==="value_0"){value=sprintf("%.0f %%",parseFloat(value,10)-128)}returnVals[i]=[children[i].nodeName,value]}}return returnVals}function stringStartsWith(string,prefix){return string.substring(0,prefix.length)===prefix}return createIdentifyTool}},{"./clicktool.js":14,"./legend_config.js":35,"./stringContainsChar.js":55}],25:[function(require,module,exports){module.exports=function(app){var ShareUrlInfo=require("./share.js");function init(config,projection,legendLookup,gisServerType,useProxyScript){var shareUrlInfo=ShareUrlInfo.parseUrl(window.location.toString());app.projection=projection;seldon.projection=projection;app.legendLookup=legendLookup;seldon.gisServerType=gisServerType;seldon.useProxyScript=useProxyScript;app.launch(config,shareUrlInfo);seldon.app=app}return init}},{"./share.js":52}],26:[function(require,module,exports){function initOpenLayers(baseLayerInfo,baseLayer,theme,themeOptions,initialExtent){var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets",{numZoomLevels:20})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings)}else if(baseLayer.type=="ArcGISCache"){var layer=new OpenLayers.Layer.ArcGISCache("AGSCache",baseLayer.url,{layerInfo:baseLayerInfo})}var maxExtentBounds;if(theme.xmax&&theme.xmin&&theme.ymax&&theme.ymin){maxExtentBounds=new OpenLayers.Bounds(theme.xmin,theme.ymin,theme.xmax,theme.ymax)}else{maxExtentBounds=new OpenLayers.Bounds(app.maxExtent.left,app.maxExtent.bottom,app.maxExtent.right,app.maxExtent.top)}if(initialExtent===undefined){initialExtent=app.maxExtent}app.tileManager=new OpenLayers.TileManager({cacheSize:12,moveDelay:750,zoomDelay:750});app.map=new OpenLayers.Map("map",{units:"m",tileManager:app.tileManager,controls:[new OpenLayers.Control.Navigation,new OpenLayers.Control.Attribution,app.zoomInTool,app.zoomOutTool,app.identifyTool,app.multigraphTool,app.markerTool],eventListeners:{moveend:function(){app.emit("extentchange")},zoomend:function(){app.emit("extentchange")}},projection:new OpenLayers.Projection(seldon.projection)});app.currentBaseLayer=baseLayer;app.emit("baselayerchange");app.map.addControl(new OpenLayers.Control.ScaleLine({bottomOutUnits:"mi"}));app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.setTheme(theme,themeOptions);app.zoomToExtent(initialExtent);app.saveCurrentExtent();app.map.events.register("mousemove",app.map,function(e){var pixel=app.map.events.getMousePosition(e);var lonlat=app.map.getLonLatFromPixel(pixel);lonlat=lonlat.transform(new OpenLayers.Projection("EPSG:3857"),new OpenLayers.Projection("EPSG:4326"));OpenLayers.Util.getElement("latLonTracker").innerHTML="Lat: "+sprintf("%.5f",lonlat.lat)+" Lon: "+sprintf("%.5f",lonlat.lon)+""});app.map.addControl(new OpenLayers.Control.PanZoomBar)}module.exports=initOpenLayers},{}],27:[function(require,module,exports){module.exports=function($){var createSplashScreen=require("./splash.js")($);var handle_search=require("./search.js")($);var ga_events=require("./set_google_analytics_events.js");var areasList=[];var activeBtn=[];function launch(configFile,shareUrlInfo){var deactivateActiveOpenLayersControls=require("./deactivate_controls.js")(this,activeBtn);var printMap=require("./print.js")($,this);var app=this;app.initialThemeLoad=true;var $configXML;$.ajax({url:configFile,dataType:"xml",success:function(configXML){$configXML=app.parseConfig(configXML,shareUrlInfo);ga_events($)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}});$("#btnTglLyrPick").click(function(){var $layerPickerDialog=$("#layerPickerDialog");if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close")}else{$layerPickerDialog.dialog("open")}});$("#layerPickerDialog").dialog({zIndex:10050,position:{my:"left top",at:"left+5 top+100"},autoOpen:true,hide:"fade",width:330});app.addListener("accordiongroupchange",function(){if(app.currentTheme){$("#layerPickerAccordion").accordion({active:app.currentTheme.getAccordionGroupIndex(app.currentAccordionGroup),collapsible:true,beforeActivate:function(event,ui){if(!app.initialThemeLoad){$("#layerPickerDialog").scrollTop(0)}},activate:function(event,ui){app.setupCollapsibleSublists(ui);if(app.initialThemeLoad){app.initialThemeLoad=false;$("#layerPickerDialog").scrollTop(755)}}})}});$("#btnTglMapTools").click(function(){var $mapToolsDialog=$("#mapToolsDialog");if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close")}else{$mapToolsDialog.dialog("open")}});$("#mapToolsDialog").dialog({zIndex:10050,position:{my:"right top",at:"right-5 top+100"},autoOpen:true,hide:"fade"});app.addListener("themechange",function(){app.updateShareMapUrl()});app.addListener("baselayerchange",function(){app.updateShareMapUrl()});app.addListener("accordiongroupchange",function(){app.updateShareMapUrl()});app.addListener("extentchange",function(){app.saveCurrentExtent();app.updateShareMapUrl()});var $mapToolsAccordion=$("#mapToolsAccordion"),accordionGroupIndexToOpen=0;$mapToolsAccordion.accordion({heightStyle:"content",collapsible:true});$mapToolsAccordion.find("div").each(function(i){if(this.id==="legend"){accordionGroupIndexToOpen=i;return false}return true});$mapToolsAccordion.accordion("option","active",accordionGroupIndexToOpen);$("#baseCombo").change(function(){var i=parseInt($(this).val(),10);app.setBaseLayer(app.baseLayers[i])});app.addListener("baselayerchange",function(){$("#baseCombo").val(app.currentBaseLayer.index)});$("#themeCombo").change(function(){var i=parseInt($(this).val(),10);app.setTheme(app.themes[i])});app.addListener("themechange",function(){$("#themeCombo").val(app.currentTheme.index)});$("#btnPan").click(function(){deactivateActiveOpenLayersControls();app.dragPanTool.activate()});$("#btnPrint").click(function(){if($configXML!==undefined){printMap($configXML)}else{console.log("Can't print yet; config file not yet parsed")}});$("#btnZoomIn").click(function(){deactivateActiveOpenLayersControls();app.zoomInTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomOut").click(function(){deactivateActiveOpenLayersControls();app.zoomOutTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomExtent").click(function(){app.zoomToExtent(app.maxExtent)});$("#btnID").click(function(){deactivateActiveOpenLayersControls();app.identifyTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnAbout").click(function(){var splashScreen=$("#splashScreenContainer");if(splashScreen.dialog("isOpen")){splashScreen.dialog("close")}else{splashScreen.dialog("open")}});$("#btnPrev").click(function(){app.zoomToPreviousExtent()});$("#btnNext").click(function(){app.zoomToNextExtent()});$("#btnMultiGraph").click(function(){deactivateActiveOpenLayersControls();app.multigraphTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnMarker").click(function(){deactivateActiveOpenLayersControls();app.markerTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});createSplashScreen();var $findArea=$("#findArea");$findArea.findArea();areasList=$findArea.findArea("getAreasList");$findArea.autocomplete({source:areasList});$findArea.keypress(function(e){if(e.which==13){var areaExtent=$findArea.findArea("getAreaExtent",$findArea.val(),areasList);app.zoomToExtent(areaExtent)}});$("#address_lookup").on("click",function(){var location=$("#address_field").val();handle_search(location,app)});$("#address_field").on("keypress",function(e){if(e.which===13){var location=$(this).val();handle_search(location,app)}});$(".mask-toggle").on("click",function(){if($(this).is(":checked")){app.setMaskByMask(true,this.value)}else{app.setMaskByMask(false,this.value)}});$("[data-mask-grouper='true']").on("change",function(){var disabled=$(this).is(":checked")?true:false;$("[data-mask-parent='"+this.value+"']").attr("disabled",disabled)});$(".mask-modifier").on("change",function(){var value=$(this).is(":checked")?this.value:"";var index=$(this).data("index");if($(this).data("maskGrouper")===true){app.handleMaskModifierGroup(this.value,$(this).is(":checked"))}app.handleMaskModifier(value,index)});$("textarea").focus(function(){var $this=$(this);$this.select();window.setTimeout(function(){$this.select()},1);function mouseUpHandler(){$this.off("mouseup",mouseUpHandler);return false}$this.mouseup(mouseUpHandler)});if($(window).width()<650){$("#mapToolsDialog").dialog("close");$("#layerPickerDialog").dialog("close")}if(window.addEventListener){window.addEventListener("orientationchange",function(){var $mapToolsDialog=$("#mapToolsDialog"),$layerPickerDialog=$("#layerPickerDialog");window.scroll(0,0);if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close").dialog("open")}if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close").dialog("open")}},false)}}return launch}},{"./deactivate_controls.js":17,"./print.js":43,"./search.js":45,"./set_google_analytics_events.js":48,"./splash.js":54}],28:[function(require,module,exports){module.exports=function($,app){var stringContainsChar=require("./stringContainsChar.js");function Layer(settings){EventEmitter.call(this);if(!settings){return}$.extend(true,this,settings);this.transparency=0;if(this.index==undefined){this.index=0}if(this.type==undefined){this.type="WMS"}this.createOpenLayersLayer=function(){if(this.openLayersLayer!==undefined){return this.openLayersLayer}var options={isBaseLayer:false,transitionEffect:"resize",buffer:0,singleTile:true,ratio:1};if(this.type==="WMTS"){var settings={name:this.name,url:this.url,layer:this.layers,style:this.style,matrixSet:this.srs,isBaseLayer:false,transitionEffect:"resize",format:"image/jpg",sphericalMercator:true};if(this.lid.indexOf("GLAM")>-1){$.extend(true,settings,{serverResolutions:[156543.033928041,78271.5169640205,39135.7584820102,19567.8792410051,9783.9396205026,4891.9698102513,2445.9849051256,1222.9924525628,611.4962262814,305.7481131407048],units:"m",tileOrigin:new OpenLayers.LonLat(-20037508.34,20037508.34)})}this.openLayersLayer=new OpenLayers.Layer.WMTS(settings)}else if(this.type==="XYZ"){this.openLayersLayer=new OpenLayers.Layer.XYZ(this.name,this.url,{isBaseLayer:false,projection:new OpenLayers.Projection(seldon.projection)})}else if(this.type==="ArcGIS93Rest"){this.openLayersLayer=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params.mosaicRule?$.extend(true,{},this.params,{mosaicRule:JSON.stringify(this.params.mosaicRule)}):this.params,options)}else{if(this.maxResolution){options.maxResolution=parseFloat(this.maxResolution)}var layer=this.layers+("mask"in this?app.maskModifiers.join(""):"");this.openLayersLayer=new OpenLayers.Layer.WMS(this.name,this.url,{projection:new OpenLayers.Projection(seldon.projection),units:"m",layers:layer,transparent:true},options)}var loadingimage=$('');$("#map").append(loadingimage);this.openLayersLayer.loadingimage=loadingimage;this.openLayersLayer.events.register("loadstart",this.openLayersLayer,function(){this.loadingimage.addClass("loading")});this.openLayersLayer.events.register("loadend",this.openLayersLayer,function(){this.loadingimage.removeClass("loading")});this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);this.openLayersLayer.seldonLayer=this;return this.openLayersLayer};this.activate=function(options){options=options||{};this.addToLegend();this.emit("activate");if(this.mask==="true"&&this.lid.indexOf("MaskFor")===-1){if(app.masks.length>0){app.setMaskByLayer(true,this)}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}var inMaskParentLayers=app.maskParentLayers.filter(function(layer){return this===layer},this).length;if(!inMaskParentLayers){app.maskParentLayers.push(this)}}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}vectorServices=["vlayers","fire","ads"];boundaryServices=["boundaries"];allVectorServices=vectorServices;Array.prototype.push.apply(allVectorServices,boundaryServices);var isVectorLayer=function(layer,serviceNames){return serviceNames.filter(function(serviceName){return layer.url&&layer.url.indexOf(serviceName+"?")>-1}).length};if(app.map.getNumLayers()>1){var lyrJustAdded=app.map.layers[app.map.getNumLayers()-1];if(!isVectorLayer(lyrJustAdded,allVectorServices)){for(var i=app.map.getNumLayers()-2;i>0;i--){var nextLayerDown=app.map.layers[i];if(!isVectorLayer(nextLayerDown,allVectorServices)){if(nextLayerDown.seldonLayer.index0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,vectorServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}for(var i=app.map.getNumLayers()-1;i>0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,boundaryServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}}app.updateShareMapUrl();app.map.updateSize()};this.deactivate=function(options){options=options||{};if(this.visible==="true"){app.map.removeLayer(this.openLayersLayer);this.visible="false"}if(!this.parentLayer){app.setMaskByLayer(false,this)}if(options.removeFromLegend){this.removeFromLegend()}if(options.removeFromParentMaskLayers){app.maskParentLayers=app.maskParentLayers.filter(function(layer){return layer.lid!==this.lid},this)}if(this.openLayersLayer&&this.openLayersLayer.loadingimage){this.openLayersLayer.loadingimage.removeClass("loading")}this.emit("deactivate")};this.addToLegend=function(){var that=this;var $legend=$("#legend");var lid=this.parentLayer?this.parentLayer.lid:this.lid;$(document.getElementById("lgd"+lid)).remove();this.$legendItem=$(document.createElement("div")).attr("id","lgd"+lid).prepend($(document.createElement("img")).attr("src",this.legend)).click(function(){that.deactivate();if(that.parentLayer){that.parentLayer.deactivate({removeFromParentMaskLayers:true})}that.removeFromLegend()});if(this.url.indexOf("vlayers")>-1){this.$legendItem.prependTo($legend)}else{this.$legendItem.appendTo($legend)}};this.removeFromLegend=function(){if(this.$legendItem)this.$legendItem.remove()};this.setTransparency=function(transparency){if(this.openLayersLayer){this.openLayersLayer.setOpacity(1-parseFloat(transparency)/100); - -}this.transparency=transparency;try{this.emit({type:"transparency",value:this.transparency})}catch(err){var test=this.transparency;var errTxt=err.Message}if(app.map!==undefined){var currentLayer,openLayersLayer,lid;var i;for(i=app.map.getNumLayers()-2;i>0;i--){currentLayer=app.map.layers[i];openLayersLayer=currentLayer.seldonLayer.openLayersLayer;lid=currentLayer.seldonLayer.lid;if(stringContainsChar(currentLayer.name,"Mask")){if(openLayersLayer&&lid.substring(0,lid.indexOf("MaskFor"))===this.lid){openLayersLayer.setOpacity(1-parseFloat(transparency)/100);currentLayer.seldonLayer.transparency=transparency}}}}}}window.EventEmitter.declare(Layer);return Layer}},{"./stringContainsChar.js":55}],29:[function(require,module,exports){module.exports=function($){function createLayerToggleCheckbox(layer){var checkbox=document.createElement("input"),$checkbox;checkbox.type="checkbox";checkbox.id="chk"+layer.lid;checkbox.onclick=function(){if($(this).is(":checked")){layer.activate()}else{layer.deactivate({removeFromLegend:true,removeFromParentMaskLayers:true})}};$checkbox=$(checkbox);$checkbox.addClass(layer.lid);layer.addListener("activate",function(){$("input."+this.lid).attr("checked",true)});layer.addListener("deactivate",function(){$("input."+this.lid).attr("checked",false)});return checkbox}return createLayerToggleCheckbox}},{}],30:[function(require,module,exports){module.exports=function($){function createLayerPropertiesDialog(layer){var localTransparency=0;var $html=$(""+'
'+""+""+""+""+""+""+"
Transparency:"+'
'+"
"+'%'+"
"+"
");$html.find("input.transparency-text").val(layer.transparency);if(layer.transparency>0){localTransparency=layer.transparency;layer.setTransparency(localTransparency)}$html.find(".transparency-slider").slider({min:0,max:100,step:1,value:localTransparency,slide:function(event,ui){try{layer.setTransparency(ui.value)}catch(err){var errTxt=err.message}}});$html.find("input.transparency-text").change(function(){var $this=$(this),newValueFloat=parseFloat($this.val());if(isNaN(newValueFloat)||newValueFloat<0||newValueFloat>100){$this.val(layer.transparency);return}layer.setTransparency($this.val())});layer.addListener("transparency",function(e){$html.find("input.transparency-text").val(e.value)});$html.dialog({zIndex:10050,position:"left",autoOpen:true,hide:"explode",title:layer.name,width:"auto",close:function(){$(this).dialog("destroy");$html.remove();createLayerPropertiesDialog.$html[layer.lid]=undefined}});createLayerPropertiesDialog.$html[layer.lid]=$html}createLayerPropertiesDialog.$html={};return createLayerPropertiesDialog}},{}],31:[function(require,module,exports){module.exports=function($){var createLayerPropertiesDialog=require("./layer_dialog.js")($);function createLayerPropertiesIcon(layer){var img=document.createElement("img");img.id=layer.lid;img.src="icons/settings.png";img.className="layerPropertiesIcon";img.onclick=function(){createLayerPropertiesDialog(layer)};return img}return createLayerPropertiesIcon}},{"./layer_dialog.js":30}],32:[function(require,module,exports){module.exports=function($,app){var generalRadioHandler=require("./layer_radio_handler.js")($,app);function createLayerToggleRadioButton(layer,radioGroupName){var checkbox=document.createElement("input"),$checkbox;checkbox.type="radio";checkbox.name=radioGroupName;checkbox.id=layer.lid;if(layer.selectedInConfig){checkbox.checked=true}$checkbox=$(checkbox);$checkbox.change(radioHandler);layer.addListener("activate",function(){$checkbox.attr("checked",true)});layer.addListener("deactivate",function(){$checkbox.attr("checked",false)});return checkbox}function radioHandler(){generalRadioHandler(app)}return createLayerToggleRadioButton}},{"./layer_radio_handler.js":33}],33:[function(require,module,exports){module.exports=function($,app){var Layer=require("./layer.js")($,app);function radioHandler(app){var $selectedOption=$(app.dropdownBoxList[0]).find(":selected");if($selectedOption.text()==="select..."){clearRadioLayers(app,null);return}var selectLayer=app.dropdownBoxLayers[$selectedOption.val()];var wanted_lid=getActiveDropdownBoxRadioLID(app);var wanted_layer=undefined;var i;for(i=0;i0;i--){currLayer=app.map.layers[i].seldonLayer;for(j=0;j"+selectBoxLayers[i].name+"")}selectBox.insertAdjacentHTML("afterbegin","");$(selectBox).change(selectHandler);return selectBox}function selectHandler(){radioHandler(app)}return createLayerToggleDropdownBox}},{"./layer_radio_handler.js":33}],35:[function(require,module,exports){module.exports=function($,app){function isLayerInLegendConfig(layerId){return layerId in app.legendLookup}function getLegendStringFromPixelValue(layerId,pixelValue){var legendString="";if(isLayerInLegendConfig(layerId)){legendString=app.legendLookup[layerId][pixelValue];if(!legendString){console.error("No legend string set for pixel value",pixelValue,"for layer",layerId)}}return legendString}return getLegendStringFromPixelValue}},{}],36:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js");var saveAs=require("../libs/FileSaver/FileSaver.js").saveAs;var popupId="marker-dialog";var points=[];var pointStyleDefault={pointRadius:4,fillColor:"blue",fillOpacity:.75};var pointStyleHover={pointRadius:5,fillColor:"orange",fillOpacity:.75};var pointStyle=new OpenLayers.StyleMap(pointStyleDefault);function marker(){return new ClickTool(markerHandler)}function markerHandler(e){var coords=app.map.getLonLatFromPixel(e.xy);var lonlat=app.map.getLonLatFromPixel(e.xy);lonlat.transform(app.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));var markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:pointStyle});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));markerLayer.addFeatures(feature);app.map.addLayer(markerLayer);if(!$("#"+popupId).length){createPopup()}if($(".marker-points").length){createPointItem(lonlat,markerLayer)}points.push({lonlat:lonlat,layer:markerLayer});if(typeof ga!=="undefined"){ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Create New Point",eventLabel:lonlat.lon+", "+lonlat.lat})}}function createPointItem(coords,layer){var itemString="";itemString+='
';itemString+='
';itemString+=' Lat:';itemString+=' '+coords.lat+"";itemString+="
";itemString+='
';itemString+=' Lon:';itemString+=' '+coords.lon+"";itemString+="
";itemString+='
';itemString+=' Notes:';itemString+='
';itemString+="
";itemString+="
";var item=$(itemString);item.data("point",layer);item.on("mouseenter",handlePointHoverEnter).on("mouseleave",handlePointHoverLeave);$(".marker-points").append(item)}function handlePointHoverEnter(e){var point=$(this).data("point");point.style=pointStyleHover;point.redraw()}function handlePointHoverLeave(e){var point=$(this).data("point");point.style=pointStyleDefault;point.redraw()}function createPopup(){var popup=$('
');$("body").append(popup);$(".marker-button-download").click(exportFileHandler);$(".marker-button-clear").click(clearPointsHandler);popup.dialog({width:300,height:400,resizable:false,position:{my:"right top",at:"right-5 top+120"},title:"Mark areas of interest",close:function(event,ui){clearPointsHandler();$(this).remove()}})}function exportFileHandler(){var lat,lon,url,notes;var SEP="|";var i;var csvContent="sep="+SEP+"\n";csvContent+="lat"+SEP+"long"+SEP+"google maps link"+SEP+"notes\n";for(i=0;i=0){direction="N"}else if(type==="lat"&&value<0){direction="S"}else if(type==="lon"&&value>=0){direction="E"}else if(type==="lon"&&value<0){direction="W"}value=Math.abs(value);var degree=Math.floor(value);value=(value-degree)*60;var minute=Math.floor(value);var second=(value-minute)*60;return degree+"%C2%B0"+minute+"'"+second+"%22"+direction}function getNotes(index){if(typeof ga!=="undefined"){var label=$(".marker-point-item").eq(index).find(".marker-point-notes").val();ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Notes",eventLabel:label})}return $(".marker-point-item").eq(index).find(".marker-point-notes").val()}function clearPointsHandler(){var i;for(i=0;i')}else{popup.html('
')}popup.dialog({width:600,resizable:false,position:{my:"center+"+offset+" center+"+offset,at:"center",of:window},title:Mustache.render("MODIS NDVI for Lat: {{{lat}}} Lon: {{{lon}}}",{lat:sprintf("%.4f",lonlat.lat),lon:sprintf("%.4f",lonlat.lon)}),close:function(event,ui){app.map.removeLayer(markerLayer);$(this).remove()}});var seldonMultigraph=$("#seldonMultigraph"+app.graphCount+""),promise=seldonMultigraph.multigraph({mugl:muglPrefix+lonlat.lon+","+lonlat.lat,swf:"libs/seldon/libs/Multigraph.swf"});seldonMultigraph.multigraph("done",function(m){if(m){$(m.div()).parent().children(".multigraphLoader").remove()}})})}return createMultigraphTool}},{"./clicktool.js":14}],41:[function(require,module,exports){module.exports=function($){Array.prototype.remove=function(value){if(this.indexOf(value)!==-1){this.splice(this.indexOf(value),1);return true}else{return false}};OpenLayers.Map.prototype.getCurrentSize=function(){var size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=this.div.offsetWidth;size.h=this.div.offsetHeight}if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=parseInt(this.div.style.width,10);size.h=parseInt(this.div.style.height,10)}size.h=size.h-parseInt($(this.div).css("padding-top"),10)-parseInt($(this.div).css("padding-bottom"),10);return size};$.widget("ui.dialog",$.extend({},$.ui.dialog.prototype,{_moveToTop:function(arg){if(arg){if(arg.handleObj.type!="mousedown"){var moved=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;if(moved&&!silent){this._trigger("focus",event)}return moved}}}}))}},{}],42:[function(require,module,exports){module.exports=function($){var createArcGIS93RestParams=require("./create_arcgis_rest_params.js")($);var AccordionGroup=require("./accordion_group.js");var AccordionGroupSublist=require("./accordion_group_sublist.js");var BaseLayer=require("./baselayer.js");var Theme=require("./theme.js");function parseConfig(configXML,shareUrlInfo){var Layer=require("./layer.js")($,this);var createIdentifyTool=require("./identify.js")($,this);var createMultigraphTool=require("./multigraph.js")($,this);var marker=require("./marker.js")($,this);var app=this,$configXML=$(configXML),initialBaseLayer,initialTheme,shareUrlLayerAlpha={},themeOptions={},i,j,k,l,ll,lll;if(shareUrlInfo!==undefined){for(i=0,l=shareUrlInfo.layerLids.length;i0){app.maxExtent={left:parseFloat($extent.attr("xmin")),bottom:parseFloat($extent.attr("ymin")),right:parseFloat($extent.attr("xmax")),top:parseFloat($extent.attr("ymax"))}}var $baseCombo=$("#baseCombo"),$images=$configXML.find("images image"),$image,selected,baseLayer;for(i=0,l=$images.length;ionline.',mapName:"Layers",description:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including the terms of use, visit us online at http://goto.arcgisonline.com/maps/World_Street_Map",copyrightText:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012",layers:[{id:0,name:"World Street Map",parentLayerId:-1,defaultVisibility:true,subLayerIds:null,minScale:0,maxScale:0}],tables:[],spatialReference:{wkid:102100},singleFusedMapCache:true,tileInfo:{rows:256,cols:256,dpi:96,format:"JPEG",compressionQuality:90,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:0,resolution:156543.033928,scale:591657527.591555},{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176}]},initialExtent:{xmin:-28872328.0888923,ymin:-11237732.4896886,xmax:28872328.0888923,ymax:11237732.4896886,spatialReference:{wkid:102100}},fullExtent:{xmin:-20037507.0671618,ymin:-19971868.8804086,xmax:20037507.0671618,ymax:19971868.8804086,spatialReference:{wkid:102100}},units:"esriMeters",supportedImageFormatTypes:"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI,BMP",documentInfo:{Title:"World Street Map",Author:"Esri",Comments:"",Subject:"streets, highways, major roads, railways, water features, administrative boundaries, cities, parks, protected areas, landmarks ",Category:"transportation(Transportation Networks) ",Keywords:"World, Global, Europe, Japan, Hong Kong, North America, United States, Canada, Mexico, Southern Africa, Asia, South America, Australia, New Zealand, India, Argentina, Brazil, Chile, Venezuela, Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, Switzerland, Russia, Thailand, Turkey, 2012",Credits:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"},capabilities:"Map"};app.initOpenLayers(baseLayerInfo,initialBaseLayer,initialTheme,themeOptions,initialExtent);return $configXML}function displayError(message){}return parseConfig}},{"./accordion_group.js":3,"./accordion_group_sublist.js":5,"./baselayer.js":13,"./create_arcgis_rest_params.js":16,"./identify.js":24,"./layer.js":28,"./marker.js":36,"./multigraph.js":40,"./theme.js":56}],43:[function(require,module,exports){module.exports=function($,app){function printMap($configXML){var offsetX=parseInt(app.map.layerContainerDiv.style.left,10);var offsetY=parseInt(app.map.layerContainerDiv.style.top,10);var size=app.map.getSize();var tiles=[];var layer,tile,position;var i,j,k;for(i=0;i
');printPopup.dialog({resizable:false,height:75,title:"Creating Image for Print...",close:function(event,ui){$(this).remove()}});var service_url=$configXML.find("tools tool[name=Print]").attr("service_url");if(!service_url){service_url="http://"+window.location.hostname+window.location.pathname}service_url=service_url.replace(/\/$/,"");var service_name=$configXML.find("tools tool[name=Print]").attr("service_name");if(!service_name){service_name="cgi-bin/print.cgi"}var title=$configXML.find("tools tool[name=Print]").attr("title");if(!title){title="U.S Forest Change Assessment Viewer"}$.ajax({url:service_url+"/"+service_name,type:"POST",data:OpenLayers.Util.getParameterString({ -width:size.w,height:size.h,tiles:tiles_json,legends:legends_json,title:title}),headers:{"Content-Type":"application/x-www-form-urlencoded"},success:function(data,status,jqxhr){data=data.replace(/\s+/,"");var href=service_url+"/cgi-bin/printed_map.jpg";if(data){href=service_url+"/"+data}$("#printMapLoader").html('
print image result
');printPopup.dialog("option","title","Print Image Created!")},error:function(jqxhr,status,err){$("#printMapLoader").html("
An error happended.
");printPopup.dialog("option","title","NO Print Image Created!")}})}return printMap}},{}],44:[function(require,module,exports){function RepeatingOperation(op,yieldEveryIteration){var count=0;var instance=this;this.step=function(args){if(++count>=yieldEveryIteration){count=0;setTimeout(function(){op(args)},1,[]);return}op(args)}}module.exports=RepeatingOperation},{}],45:[function(require,module,exports){module.exports=function($){function handle_search(location,app){var rest_endpoint="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text="+location+"&f=json";$.getJSON(rest_endpoint,function(data){var locations=data["locations"][0];if(locations===undefined){return}var extent=locations["extent"];var bounds=new OpenLayers.Bounds(extent.xmin,extent.ymin,extent.xmax,extent.ymax).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));app.zoomToExtent(bounds,true)})}return handle_search}},{}],46:[function(require,module,exports){(function($){"use strict";require("./overrides.js")($);var seldon={App:require("./app.js")($)};var app=new seldon.App;seldon.init=require("./init.js")(app);window.seldon=seldon})(jQuery)},{"./app.js":11,"./init.js":25,"./overrides.js":41}],47:[function(require,module,exports){module.exports=function($){function setBaseLayer(baseLayer){var resolutions=[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,.5971642833948135];var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets");handleBaseLayer(app,layer,baseLayer)}else if(baseLayer.type=="ArcGISCache"){$.ajax({url:baseLayer.url+"?f=json&pretty=true",dataType:"jsonp",success:function(layerInfo){var options={layerInfo:layerInfo};if(baseLayer.numZoomLevels){options.numZoomLevels=baseLayer.numZoomLevels;if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);options.serverResolutions=serverResolutions;options.resolutions=resolutions}}var layer=new OpenLayers.Layer.ArcGISCache(baseLayer.name,baseLayer.url,options);handleBaseLayer(app,layer,baseLayer)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet,sphericalMercator:true};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings);handleBaseLayer(app,layer,baseLayer)}}function handleBaseLayer(app,layer,baseLayer){app.map.removeLayer(app.map.layers[0]);app.currentBaseLayer=baseLayer;app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.emit("baselayerchange")}return setBaseLayer}},{}],48:[function(require,module,exports){function ga_events($){var eventAdded=false;try{$.ga.trackEvent;eventAdded=true}catch(err){eventAdded=false}if(typeof ga!=="undefined"){if(eventAdded){seldon.app.map.events.register("moveend",seldon.app.map,function(){var newMapExtent=seldon.app.map.getExtent();$.ga.trackEvent({category:"Map Extent",action:"Change",label:newMapExtent.toString(),nonInteractive:true})});$(".shareMapUrl").click(function(event){$.ga.trackEvent({category:"Share Map URL",action:"Click",label:$(".shareMapUrl").val()})});$("#mapTheme #themeCombo").change(function(event){$.ga.trackEvent({category:"Map Theme",action:"Change",label:$("#mapTheme #themeCombo option:selected").text()})});$("#txtFindArea input#address_field").keyup(function(event){if(event.which===13){$.ga.trackEvent({category:"Find Area",action:"Search Enter",label:$(this).val()})}});$("#txtFindArea #address_lookup img").click(function(event){$.ga.trackEvent({category:"Find Area",action:"Search Button",label:$("#txtFindArea input#address_field").val()})});$("#mapBase #baseCombo").change(function(event){$.ga.trackEvent({category:"Base Map",action:"Change",label:$("#mapBase #baseCombo option:selected").text()})});$(".header-bar .header-bar img.icon").gaTrackEvent({category:"Nav Bar",action:"click",useLabel:true,labelAttribute:"title",useEvent:true,event:"click"});$("#mapToolsDialog label[for^='chk']").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#mapToolsDialog input").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("#layerPickerDialog label[for^='chk']").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#layerPickerDialog input").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("h3.ui-accordion-header").gaTrackEvent({category:"Base Layer",action:"Toggle Accordion",useLabel:true,label:function(){return $(this).text()},useEvent:true,event:"click"});$("#marker-dialog .marker-button-wrapper .marker-button-download").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Download Points"})});$("#marker-dialog .marker-button-wrapper .marker-button-clear").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Clear Points"})});$("#marker-dialog .marker-point-label .marker-point-coords-label").focusout(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Notes",label:$(this).val()})});$("img[src$='slider.png']").mouseup(function(event){$.ga.trackEvent({category:"OpenLayers Buttons",action:"Slide",label:"Zoom Slider"})});$(".olButton").click(function(event){var eleId=$(this).attr("id");switch(true){case eleId.indexOf("ZoombarOpenLayers_Map")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Bar"});break;case eleId.indexOf("panleft")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan Left"});break;case eleId.indexOf("panright")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan right"});break;case eleId.indexOf("panup")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan up"});break;case eleId.indexOf("pandown")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan down"});break;case eleId.indexOf("zoomin")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom in"});break;case eleId.indexOf("zoomout")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Out"});break;default:}})}}}module.exports=ga_events},{}],49:[function(require,module,exports){module.exports=function($){function setMaskByLayer(toggle,parentLayer){var Layer=require("./layer.js")($,this);var app=this;var maskLayer,maskName,cleanMaskName;var m,ml,mld;if(toggle){for(m=0;m0;i--){var currLayer=app.map.layers[i];for(var j=0;j0||sublist.break?"":" empty";var collapsibleClass=sublist.collapsible?" collapsible":"";var collapseHeaderIcon=sublist.collapsible?'':"";var sublistObj={heading:sublist.label,items:[],collapsible:sublist.collapsible,contentElement:$('
'+'
'+collapseHeaderIcon+"

"+sublist.label+"

"+"
"+"
")};if(sublist.description){var sublistInfoButton=new MoreInfoButton(sublist);sublistObj.contentElement.children(".sublist-header").append(sublistInfoButton.element)}g.sublists.push(sublistObj);sublistItems.push(sublistObj.contentElement);var sublistLayerItems=[];for(var k=0,l=sublist.layers.length;k=0){name=this.substring(0,i);value=this.substring(i+1)}else{name=this;value=undefined}vars[name]=value});info.themeName=vars.theme;info.accordionGroupGid=vars.accgp;info.baseLayerName=vars.basemap;if(vars.extent){var extentCoords=vars.extent.split(",");info.extent={left:extentCoords[0],bottom:extentCoords[1],right:extentCoords[2],top:extentCoords[3]}}if(vars.layers){$.each(vars.layers.split(","),function(){info.layerLids.push(this)})}if(vars.mask){$.each(vars.mask.split(","),function(){info.layerMask.push(this)})}if(vars.modifiers){$.each(vars.modifiers.split(","),function(){info.maskModifiers.push(this)})}if(vars.alphas){$.each(vars.alphas.split(","),function(){info.layerAlphas.push(this)})}if(info.themeName&&info.baseLayerName){return info}return undefined};ShareUrlInfo.prototype.urlArgs=function(){return Mustache.render(""+"theme={{{theme}}}"+"&layers={{{layers}}}"+"&mask={{{mask}}}"+"{{{modifiers}}}"+"&alphas={{{alphas}}}"+"&accgp={{{accgp}}}"+"&basemap={{{basemap}}}"+"&extent={{{extent.left}}},{{{extent.bottom}}},{{{extent.right}}},{{{extent.top}}}",{theme:this.themeName,layers:this.layerLids.join(","),mask:this.layerMask.join(","),modifiers:this.maskModifiers.length>0?"&modifiers="+this.maskModifiers.join(","):"",alphas:this.layerAlphas.join(","),accgp:this.accordionGroupGid,basemap:this.baseLayerName,extent:this.extent})};module.exports=ShareUrlInfo},{}],53:[function(require,module,exports){module.exports=function($){var stringContainsChar=require("./stringContainsChar.js");var ShareUrlInfo=require("./share.js");function shareUrl(){if(!this.currentTheme){return undefined}if(!this.currentAccordionGroup){return undefined}if(!this.currentBaseLayer){return undefined}var extent=this.map.getExtent(),layerLids=[],layerAlphas=[],layerMask=[],url;if(!extent){return undefined}$.each(this.map.layers,function(){var op,lid,test;if(!this.isBaseLayer){if(this.opacity===1){op="1"}else if(this.opacity===0){op="0"}else{op=sprintf("%.2f",this.opacity)}if(stringContainsChar(this.name,"MaskFor")){lid=this.seldonLayer.lid;test=lid.substring(lid.indexOf("MaskFor"),lid.length).replace("MaskFor","");if(layerMask.indexOf(test)===-1){layerMask.push(test)}test=this.name.substring(0,this.name.indexOf("MaskFor"));if(layerLids.indexOf(test)===-1){layerLids.push(test);layerAlphas.push(op)}}else{if(this.seldonLayer){layerLids.push(this.seldonLayer.lid);layerAlphas.push(op)}}}});if(this.hasOwnProperty("maskModifiers")){var modifiers=this.maskModifiers.filter(function(val){return val!==""})}url=window.location.toString();url=url.replace(/\?.*$/,"");url=url.replace(/\/$/,"");url=url.replace("#","");return url+"?"+new ShareUrlInfo({themeName:this.currentTheme.name,layerLids:layerLids,layerMask:layerMask,maskModifiers:modifiers,layerAlphas:layerAlphas,accordionGroupGid:this.currentAccordionGroup.gid,baseLayerName:this.currentBaseLayer.name,extent:extent}).urlArgs()}return shareUrl}},{"./share.js":52,"./stringContainsChar.js":55}],54:[function(require,module,exports){module.exports=function($){function createSplashScreen(){var $document=$(document),windowWidth=Math.round($document.width()/2);$("#splashScreenContent").load("splashScreen.html");$("#splashScreenContainer").dialog({autoOpen:false,zIndex:10051,maxHeight:$document.height(),width:windowWidth,minWidth:300,dialogClass:"splashScreenStyle",hide:"explode"})}return createSplashScreen}},{}],55:[function(require,module,exports){function stringContainsChar(string,c){return string.indexOf(c)>=0}module.exports=stringContainsChar},{}],56:[function(require,module,exports){function Theme(settings){this.accordionGroups=[];if(!settings){return}this.name=settings.name;this.label=settings.label;this.index=settings.index;this.zoom=settings.zoom;this.xmin=settings.xmin;this.ymin=settings.ymin;this.xmax=settings.xmax;this.ymax=settings.ymax;this.getAccordionGroupIndex=function(accordionGroup){var i;for(i=0;i Date: Fri, 6 Aug 2021 19:36:37 +0000 Subject: [PATCH 4/8] Update WMS layers to use 2048x2048 tiles --- html/libs/seldon/js/layer.js | 6 ++---- html/libs/seldon/seldon-min.js | 3 +++ html/libs/seldon/seldon.js | 6 ++---- libs/seldon | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/html/libs/seldon/js/layer.js b/html/libs/seldon/js/layer.js index e69f2c2..879dd11 100644 --- a/html/libs/seldon/js/layer.js +++ b/html/libs/seldon/js/layer.js @@ -21,8 +21,7 @@ module.exports = function ($, app) { isBaseLayer : false, transitionEffect : 'resize', buffer : 0, - singleTile : true, - ratio : 1 + tileSize : new OpenLayers.Size(2048,2048) }; if (this.type === "WMTS") { @@ -82,7 +81,6 @@ module.exports = function ($, app) { options.maxResolution = parseFloat(this.maxResolution); } var layer = this.layers + (("mask" in this) ? app.maskModifiers.join("") : ""); - this.openLayersLayer = new OpenLayers.Layer.WMS( this.name, this.url, @@ -90,7 +88,7 @@ module.exports = function ($, app) { projection : new OpenLayers.Projection(seldon.projection), units : "m", layers : layer, - transparent : true + transparent : true, }, options ); diff --git a/html/libs/seldon/seldon-min.js b/html/libs/seldon/seldon-min.js index e69de29..ad24ef3 100644 --- a/html/libs/seldon/seldon-min.js +++ b/html/libs/seldon/seldon-min.js @@ -0,0 +1,3 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o"+'

'+el.description+"

"+"";$(dialogDiv).dialog({title:el.label||el.name,dialogClass:"tooltip-dialog "+dialogClass})}}}return MoreInfoButton}},{}],7:[function(require,module,exports){module.exports=function($){function addAccordionSection(accordionGroup,title){var sectionObj={title:title,titleElement:$("

"+title+"

"),contentElement:$("
"),sublists:[]};var $accordionGroup=$(accordionGroup);$accordionGroup.data("listAccordion").sections.push(sectionObj);$accordionGroup.append(sectionObj.titleElement).append(sectionObj.contentElement);$accordionGroup.accordion("refresh");return sectionObj}return addAccordionSection}},{}],8:[function(require,module,exports){module.exports=function($){function addAccordionSublists(g,items){$(g.contentElement).append(items)}return addAccordionSublists}},{}],9:[function(require,module,exports){module.exports=function($){function addAccordionSublistItems(s,items,theme,accGp){var collapsed=s.collapsible?"collapsed ":"";var contents=$('
');for(var i=0,l=items.length;i').append(items[i]))}var layer={name:name,contentElement:contents};s.items.push(layer);s.contentElement.append(layer.contentElement)}return addAccordionSublistItems}},{}],10:[function(require,module,exports){module.exports=function($){function addMaskToLegend(layer){var app=this;var maskName=layer.lid.substring(layer.lid.indexOf("MaskFor"),layer.lid.length);$("#lgd"+maskName).remove();layer.$legendItem=$(document.createElement("div")).attr("id","lgd"+maskName).prepend($(document.createElement("img")).attr("src",layer.legend)).prependTo($("#legend")).click(function(){app.setMaskByMask(false,maskName)})}return addMaskToLegend}},{}],11:[function(require,module,exports){module.exports=function($){var EventEmitter=window.EventEmitter;function App(){EventEmitter.call(this);this.map=undefined;this.tileManager=undefined;this.projection=undefined;this.gisServerType=undefined;this.useProxyScript=undefined;this.scalebar=undefined;this.zoomInTool=undefined;this.zoomOutTool=undefined;this.dragPanTool=undefined;this.id_markerLayer=undefined;this.maxExtent={left:-15e6,bottom:2e6,right:-6e6,top:7e6};this.baseLayers=[];this.accordionGroups=[];this.themes=[];this.maskParentLayers=[];this.masks=[];this.maskModifiers=[];this.defaultMasks=["MaskForForest"];this.radioButtonList=[];this.radioButtonLayers=[];this.dropdownBoxList=[];this.dropdownBoxLayers=[];this.currentBaseLayer=undefined;this.currentAccordionGroup=undefined;this.currentTheme=undefined;this.identifyTool=undefined;this.multigraphTool=undefined;this.markerTool=undefined;this.savedExtents=[];this.currentSavedExtentIndex=-1;this.saveCurrentExtent=require("./extent_save.js");this.zoomToExtent=require("./extent_zoom.js");this.zoomToPreviousExtent=require("./extent_zoom_previous.js");this.zoomToNextExtent=require("./extent_zoom_next.js");this.printSavedExtents=require("./extent_print.js");this.setBaseLayer=require("./set_base_layer.js")($);this.setAccordionGroup=require("./accordion_group_set.js");this.clearAccordionSections=require("./accordion_clear.js")($);this.addAccordionSection=require("./accordion_section_add.js")($);this.addAccordionSublists=require("./accordion_sublist_add.js")($);this.addAccordionSublistItems=require("./accordion_sublist_item_add.js")($);this.setTheme=require("./set_theme.js")($);this.shareUrl=require("./share_url.js")($);this.updateShareMapUrl=require("./update_share_url.js")($);this.launch=require("./launch.js")($);this.count=require("./count.js");this.addMaskToLegend=require("./add_mask_legend.js")($);this.setMaskByMask=require("./set_mask_by_mask.js")($);this.setMaskByLayer=require("./set_mask_by_layer.js")($);this.handleMaskModifier=require("./mask_modifier.js");this.handleMaskModifierGroup=require("./mask_modifier_group.js")($);this.parseConfig=require("./parse_config.js")($);this.initOpenLayers=require("./init_openlayers.js");this.setupCollapsibleSublists=require("./accordion_collapsible_sublist_setup.js")($);this.removeMaskFromLegend=function(layer){};OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.IMAGE_RELOAD_ATTEMPTS=3}EventEmitter.declare(App);return App}},{"./accordion_clear.js":1,"./accordion_collapsible_sublist_setup.js":2,"./accordion_group_set.js":4,"./accordion_section_add.js":7,"./accordion_sublist_add.js":8,"./accordion_sublist_item_add.js":9,"./add_mask_legend.js":10,"./count.js":15,"./extent_print.js":18,"./extent_save.js":19,"./extent_zoom.js":20,"./extent_zoom_next.js":21,"./extent_zoom_previous.js":22,"./init_openlayers.js":26,"./launch.js":27,"./mask_modifier.js":38,"./mask_modifier_group.js":39,"./parse_config.js":42,"./set_base_layer.js":47,"./set_mask_by_layer.js":49,"./set_mask_by_mask.js":50,"./set_theme.js":51,"./share_url.js":53,"./update_share_url.js":57}],12:[function(require,module,exports){function arrayContainsElement(array,element){var i;if(array===undefined){return false}for(i=0;iparam").each(function(i,param){var $param=$(param);if(param.hasAttribute("value")){obj[$param.attr("name")]=$param.attr("value")}else{obj[$param.attr("name")]=createArcGIS93RestParams($param)}});return obj}return createArcGIS93RestParams}},{}],17:[function(require,module,exports){module.exports=function(app,activeBtn){function deactivateActiveOpenLayersControls(){var controls,i;for(i=0;i=0;--i){e=this.savedExtents[i];html+=Mustache.render("{{{marker}}}{{{number}}}"+"left:{{{left}}}, bottom:{{{bottom}}}, right:{{{right}}}, top:{{{top}}}",{marker:i===this.currentSavedExtentIndex?"==>":"",number:i,left:e.left,bottom:e.bottom,right:e.right,top:e.top})}html+="";return html}module.exports=printSavedExtents},{}],19:[function(require,module,exports){var extentsAreEqual=require("./extents_equal.js");function saveCurrentExtent(){var newExtent=formatExtent(this.map.getExtent()),newSavedExtents=[],currentSavedExtent,i;if(this.currentSavedExtentIndex>=0){currentSavedExtent=this.savedExtents[this.currentSavedExtentIndex];if(extentsAreEqual(currentSavedExtent,newExtent)){return}}for(i=0;i<=this.currentSavedExtentIndex;++i){newSavedExtents.push(this.savedExtents[i])}this.savedExtents=newSavedExtents;this.savedExtents.push(newExtent);++this.currentSavedExtentIndex}function formatExtent(extent){return{left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top}}module.exports=saveCurrentExtent},{"./extents_equal.js":23}],20:[function(require,module,exports){function zoomToExtent(extent,save){if(save===undefined){save=true}var bounds=new OpenLayers.Bounds(extent.left,extent.bottom,extent.right,extent.top);this.map.zoomToExtent(bounds,true);if(save){this.saveCurrentExtent()}}module.exports=zoomToExtent},{}],21:[function(require,module,exports){function zoomToNextExtent(){if(this.currentSavedExtentIndex0){--this.currentSavedExtentIndex;this.zoomToExtent(this.savedExtents[this.currentSavedExtentIndex],false)}}module.exports=zoomToPreviousExtent},{}],23:[function(require,module,exports){function extentsAreEqual(e1,e2){var tolerance=.001;return Math.abs(e1.left-e2.left)<=tolerance&&Math.abs(e1.bottom-e2.bottom)<=tolerance&&Math.abs(e1.right-e2.right)<=tolerance&&Math.abs(e1.top-e2.top)<=tolerance}module.exports=extentsAreEqual},{}],24:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js"),stringContainsChar=require("./stringContainsChar.js");var getLegendStringFromPixelValue=require("./legend_config.js")($,app);function createIdentifyTool(){return new ClickTool(function(e){$("#identify_popup").remove();if(app.id_markerLayer){app.map.removeLayer(app.id_markerLayer)}var coords=app.map.getLonLatFromPixel(e.xy);var styleMap=new OpenLayers.StyleMap({pointRadius:4,fillColor:"yellow",fillOpacity:.75});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));app.id_markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:styleMap});app.id_markerLayer.addFeatures(feature);app.map.addLayer(app.id_markerLayer);var services=[],service,urlsrs;var layersAdded=[];var html='';$.each(app.map.layers,function(){var name,label;if(!this.isBaseLayer&&this.params&&(!("seldonLayer"in this)||String(this.seldonLayer.identify)!=="false")){name=this.params.LAYERS;if(String(name).match(/^\d+$/)){label=this.name}else{label=String(name).indexOf("MaskFor")!==-1?name.substring(0,name.indexOf("MaskFor")):name}if(layersAdded.indexOf(label)!==-1)return;layersAdded.push(label);services.push({url:this.url,srs:this.projection.projCode,name:name,label:label,proxyServerType:this.seldonLayer.proxyServerType});html=html+Mustache.render(""+''+''+''+"",{label:label})}});html=html+"
{{label}}:
";if(services.length===0){return}var popup=$(document.createElement("div"));popup.attr("id","identify_popup");popup.html(html);popup.dialog({width:600,height:300,resizable:true,title:"Identify Results",close:function(event,ui){app.map.removeLayer(app.id_markerLayer);app.id_markerLayer=undefined;$(this).remove()}});var i,l;for(i=0,l=services.length;i'+''+valueLabel.replace("_0","")+":  "+""+tableRow+""+""}$(newTableContents).insertAfter($group);if(!newTableContents)$group.find(".layer-results").text("N/A")},error:function(jqXHR,textStatus,errorThrown){}})}function createWMSGetFeatureInfoRequestURL(serviceUrl,layer,srs,x,y){var extent=app.map.getExtent();if(seldon.gisServerType==="ArcGIS"){extent=extent.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection(seldon.projection))}return Mustache.render(""+serviceUrl+"{{{c}}}LAYERS={{layer}}"+"&QUERY_LAYERS={{layer}}"+"&STYLES=,"+"&SERVICE=WMS"+"&VERSION=1.1.1"+"&REQUEST=GetFeatureInfo"+"&BBOX={{left}},{{bottom}},{{right}},{{top}}"+"&FEATURE_COUNT=100"+"&HEIGHT={{height}}"+"&WIDTH={{width}}"+"&FORMAT=image/png"+"&INFO_FORMAT=application/vnd.ogc.gml"+"&SRS={{srs}}"+"&X={{x}}"+"&Y={{y}}",{c:stringContainsChar(serviceUrl,"?")?"&":"?",layer:layer,height:app.map.size.h,width:app.map.size.w,left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top,srs:srs,x:x,y:y})}function getLayerResultsFromArcXML($xml,layerName,layerIDCount){var dataVals=[];try{var fields=$xml.find("FIELDS"),attributes=fields[layerIDCount].attributes,i;for(i=0;i=0||stringStartsWith(layerName,"EFETAC-NASA")||stringStartsWith(layerName,"RSAC-FHTET"))&&children[i].nodeName==="value_0"){value=value+sprintf(" (%.2f %%)",(parseFloat(value,10)-127)/128*100)}if((stringStartsWith(layerName.toUpperCase(),"NDMI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"NDVI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SWIR-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDVI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDMI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-SWIR-CURRENT"))&&children[i].nodeName==="value_0"){value=sprintf("%.0f %%",parseFloat(value,10)-128)}returnVals[i]=[children[i].nodeName,value]}}return returnVals}function stringStartsWith(string,prefix){return string.substring(0,prefix.length)===prefix}return createIdentifyTool}},{"./clicktool.js":14,"./legend_config.js":35,"./stringContainsChar.js":55}],25:[function(require,module,exports){module.exports=function(app){var ShareUrlInfo=require("./share.js");function init(config,projection,legendLookup,gisServerType,useProxyScript){var shareUrlInfo=ShareUrlInfo.parseUrl(window.location.toString());app.projection=projection;seldon.projection=projection;app.legendLookup=legendLookup;seldon.gisServerType=gisServerType;seldon.useProxyScript=useProxyScript;app.launch(config,shareUrlInfo);seldon.app=app}return init}},{"./share.js":52}],26:[function(require,module,exports){function initOpenLayers(baseLayerInfo,baseLayer,theme,themeOptions,initialExtent){var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets",{numZoomLevels:20})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings)}else if(baseLayer.type=="ArcGISCache"){var layer=new OpenLayers.Layer.ArcGISCache("AGSCache",baseLayer.url,{layerInfo:baseLayerInfo})}var maxExtentBounds;if(theme.xmax&&theme.xmin&&theme.ymax&&theme.ymin){maxExtentBounds=new OpenLayers.Bounds(theme.xmin,theme.ymin,theme.xmax,theme.ymax)}else{maxExtentBounds=new OpenLayers.Bounds(app.maxExtent.left,app.maxExtent.bottom,app.maxExtent.right,app.maxExtent.top)}if(initialExtent===undefined){initialExtent=app.maxExtent}app.tileManager=new OpenLayers.TileManager({cacheSize:12,moveDelay:750,zoomDelay:750});app.map=new OpenLayers.Map("map",{units:"m",tileManager:app.tileManager,controls:[new OpenLayers.Control.Navigation,new OpenLayers.Control.Attribution,app.zoomInTool,app.zoomOutTool,app.identifyTool,app.multigraphTool,app.markerTool],eventListeners:{moveend:function(){app.emit("extentchange")},zoomend:function(){app.emit("extentchange")}},projection:new OpenLayers.Projection(seldon.projection)});app.currentBaseLayer=baseLayer;app.emit("baselayerchange");app.map.addControl(new OpenLayers.Control.ScaleLine({bottomOutUnits:"mi"}));app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.setTheme(theme,themeOptions);app.zoomToExtent(initialExtent);app.saveCurrentExtent();app.map.events.register("mousemove",app.map,function(e){var pixel=app.map.events.getMousePosition(e);var lonlat=app.map.getLonLatFromPixel(pixel);lonlat=lonlat.transform(new OpenLayers.Projection("EPSG:3857"),new OpenLayers.Projection("EPSG:4326"));OpenLayers.Util.getElement("latLonTracker").innerHTML="Lat: "+sprintf("%.5f",lonlat.lat)+" Lon: "+sprintf("%.5f",lonlat.lon)+""});app.map.addControl(new OpenLayers.Control.PanZoomBar)}module.exports=initOpenLayers},{}],27:[function(require,module,exports){module.exports=function($){var createSplashScreen=require("./splash.js")($);var handle_search=require("./search.js")($);var ga_events=require("./set_google_analytics_events.js");var areasList=[];var activeBtn=[];function launch(configFile,shareUrlInfo){var deactivateActiveOpenLayersControls=require("./deactivate_controls.js")(this,activeBtn);var printMap=require("./print.js")($,this);var app=this;app.initialThemeLoad=true;var $configXML;$.ajax({url:configFile,dataType:"xml",success:function(configXML){$configXML=app.parseConfig(configXML,shareUrlInfo);ga_events($)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}});$("#btnTglLyrPick").click(function(){var $layerPickerDialog=$("#layerPickerDialog");if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close")}else{$layerPickerDialog.dialog("open")}});$("#layerPickerDialog").dialog({zIndex:10050,position:{my:"left top",at:"left+5 top+100"},autoOpen:true,hide:"fade",width:330});app.addListener("accordiongroupchange",function(){if(app.currentTheme){$("#layerPickerAccordion").accordion({active:app.currentTheme.getAccordionGroupIndex(app.currentAccordionGroup),collapsible:true,beforeActivate:function(event,ui){if(!app.initialThemeLoad){$("#layerPickerDialog").scrollTop(0)}},activate:function(event,ui){app.setupCollapsibleSublists(ui);if(app.initialThemeLoad){app.initialThemeLoad=false;$("#layerPickerDialog").scrollTop(755)}}})}});$("#btnTglMapTools").click(function(){var $mapToolsDialog=$("#mapToolsDialog");if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close")}else{$mapToolsDialog.dialog("open")}});$("#mapToolsDialog").dialog({zIndex:10050,position:{my:"right top",at:"right-5 top+100"},autoOpen:true,hide:"fade"});app.addListener("themechange",function(){app.updateShareMapUrl()});app.addListener("baselayerchange",function(){app.updateShareMapUrl()});app.addListener("accordiongroupchange",function(){app.updateShareMapUrl()});app.addListener("extentchange",function(){app.saveCurrentExtent();app.updateShareMapUrl()});var $mapToolsAccordion=$("#mapToolsAccordion"),accordionGroupIndexToOpen=0;$mapToolsAccordion.accordion({heightStyle:"content",collapsible:true});$mapToolsAccordion.find("div").each(function(i){if(this.id==="legend"){accordionGroupIndexToOpen=i;return false}return true});$mapToolsAccordion.accordion("option","active",accordionGroupIndexToOpen);$("#baseCombo").change(function(){var i=parseInt($(this).val(),10);app.setBaseLayer(app.baseLayers[i])});app.addListener("baselayerchange",function(){$("#baseCombo").val(app.currentBaseLayer.index)});$("#themeCombo").change(function(){var i=parseInt($(this).val(),10);app.setTheme(app.themes[i])});app.addListener("themechange",function(){$("#themeCombo").val(app.currentTheme.index)});$("#btnPan").click(function(){deactivateActiveOpenLayersControls();app.dragPanTool.activate()});$("#btnPrint").click(function(){if($configXML!==undefined){printMap($configXML)}else{console.log("Can't print yet; config file not yet parsed")}});$("#btnZoomIn").click(function(){deactivateActiveOpenLayersControls();app.zoomInTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomOut").click(function(){deactivateActiveOpenLayersControls();app.zoomOutTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomExtent").click(function(){app.zoomToExtent(app.maxExtent)});$("#btnID").click(function(){deactivateActiveOpenLayersControls();app.identifyTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnAbout").click(function(){var splashScreen=$("#splashScreenContainer");if(splashScreen.dialog("isOpen")){splashScreen.dialog("close")}else{splashScreen.dialog("open")}});$("#btnPrev").click(function(){app.zoomToPreviousExtent()});$("#btnNext").click(function(){app.zoomToNextExtent()});$("#btnMultiGraph").click(function(){deactivateActiveOpenLayersControls();app.multigraphTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnMarker").click(function(){deactivateActiveOpenLayersControls();app.markerTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});createSplashScreen();var $findArea=$("#findArea");$findArea.findArea();areasList=$findArea.findArea("getAreasList");$findArea.autocomplete({source:areasList});$findArea.keypress(function(e){if(e.which==13){var areaExtent=$findArea.findArea("getAreaExtent",$findArea.val(),areasList);app.zoomToExtent(areaExtent)}});$("#address_lookup").on("click",function(){var location=$("#address_field").val();handle_search(location,app)});$("#address_field").on("keypress",function(e){if(e.which===13){var location=$(this).val();handle_search(location,app)}});$(".mask-toggle").on("click",function(){if($(this).is(":checked")){app.setMaskByMask(true,this.value)}else{app.setMaskByMask(false,this.value)}});$("[data-mask-grouper='true']").on("change",function(){var disabled=$(this).is(":checked")?true:false;$("[data-mask-parent='"+this.value+"']").attr("disabled",disabled)});$(".mask-modifier").on("change",function(){var value=$(this).is(":checked")?this.value:"";var index=$(this).data("index");if($(this).data("maskGrouper")===true){app.handleMaskModifierGroup(this.value,$(this).is(":checked"))}app.handleMaskModifier(value,index)});$("textarea").focus(function(){var $this=$(this);$this.select();window.setTimeout(function(){$this.select()},1);function mouseUpHandler(){$this.off("mouseup",mouseUpHandler);return false}$this.mouseup(mouseUpHandler)});if($(window).width()<650){$("#mapToolsDialog").dialog("close");$("#layerPickerDialog").dialog("close")}if(window.addEventListener){window.addEventListener("orientationchange",function(){var $mapToolsDialog=$("#mapToolsDialog"),$layerPickerDialog=$("#layerPickerDialog");window.scroll(0,0);if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close").dialog("open")}if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close").dialog("open")}},false)}}return launch}},{"./deactivate_controls.js":17,"./print.js":43,"./search.js":45,"./set_google_analytics_events.js":48,"./splash.js":54}],28:[function(require,module,exports){module.exports=function($,app){var stringContainsChar=require("./stringContainsChar.js");function Layer(settings){EventEmitter.call(this);if(!settings){return}$.extend(true,this,settings);this.transparency=0;if(this.index==undefined){this.index=0}if(this.type==undefined){this.type="WMS"}this.createOpenLayersLayer=function(){if(this.openLayersLayer!==undefined){return this.openLayersLayer}var options={isBaseLayer:false,transitionEffect:"resize",buffer:0,tileSize:new OpenLayers.Size(2048,2048)};if(this.type==="WMTS"){var settings={name:this.name,url:this.url,layer:this.layers,style:this.style,matrixSet:this.srs,isBaseLayer:false,transitionEffect:"resize",format:"image/jpg",sphericalMercator:true};if(this.lid.indexOf("GLAM")>-1){$.extend(true,settings,{serverResolutions:[156543.033928041,78271.5169640205,39135.7584820102,19567.8792410051,9783.9396205026,4891.9698102513,2445.9849051256,1222.9924525628,611.4962262814,305.7481131407048],units:"m",tileOrigin:new OpenLayers.LonLat(-20037508.34,20037508.34)})}this.openLayersLayer=new OpenLayers.Layer.WMTS(settings)}else if(this.type==="XYZ"){this.openLayersLayer=new OpenLayers.Layer.XYZ(this.name,this.url,{isBaseLayer:false,projection:new OpenLayers.Projection(seldon.projection)})}else if(this.type==="ArcGIS93Rest"){this.openLayersLayer=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params.mosaicRule?$.extend(true,{},this.params,{mosaicRule:JSON.stringify(this.params.mosaicRule)}):this.params,options)}else{if(this.maxResolution){options.maxResolution=parseFloat(this.maxResolution)}var layer=this.layers+("mask"in this?app.maskModifiers.join(""):"");this.openLayersLayer=new OpenLayers.Layer.WMS(this.name,this.url,{projection:new OpenLayers.Projection(seldon.projection),units:"m",layers:layer,transparent:true},options)}var loadingimage=$('');$("#map").append(loadingimage);this.openLayersLayer.loadingimage=loadingimage;this.openLayersLayer.events.register("loadstart",this.openLayersLayer,function(){this.loadingimage.addClass("loading")});this.openLayersLayer.events.register("loadend",this.openLayersLayer,function(){this.loadingimage.removeClass("loading")});this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);this.openLayersLayer.seldonLayer=this;return this.openLayersLayer};this.activate=function(options){options=options||{};this.addToLegend();this.emit("activate");if(this.mask==="true"&&this.lid.indexOf("MaskFor")===-1){if(app.masks.length>0){app.setMaskByLayer(true,this)}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}var inMaskParentLayers=app.maskParentLayers.filter(function(layer){return this===layer},this).length;if(!inMaskParentLayers){app.maskParentLayers.push(this)}}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}vectorServices=["vlayers","fire","ads"];boundaryServices=["boundaries"];allVectorServices=vectorServices;Array.prototype.push.apply(allVectorServices,boundaryServices);var isVectorLayer=function(layer,serviceNames){return serviceNames.filter(function(serviceName){return layer.url&&layer.url.indexOf(serviceName+"?")>-1}).length};if(app.map.getNumLayers()>1){var lyrJustAdded=app.map.layers[app.map.getNumLayers()-1];if(!isVectorLayer(lyrJustAdded,allVectorServices)){for(var i=app.map.getNumLayers()-2;i>0;i--){var nextLayerDown=app.map.layers[i];if(!isVectorLayer(nextLayerDown,allVectorServices)){if(nextLayerDown.seldonLayer.index0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,vectorServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}for(var i=app.map.getNumLayers()-1;i>0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,boundaryServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}}app.updateShareMapUrl();app.map.updateSize()};this.deactivate=function(options){options=options||{};if(this.visible==="true"){app.map.removeLayer(this.openLayersLayer);this.visible="false"}if(!this.parentLayer){app.setMaskByLayer(false,this)}if(options.removeFromLegend){this.removeFromLegend()}if(options.removeFromParentMaskLayers){app.maskParentLayers=app.maskParentLayers.filter(function(layer){return layer.lid!==this.lid},this)}if(this.openLayersLayer&&this.openLayersLayer.loadingimage){this.openLayersLayer.loadingimage.removeClass("loading")}this.emit("deactivate")};this.addToLegend=function(){var that=this;var $legend=$("#legend");var lid=this.parentLayer?this.parentLayer.lid:this.lid;$(document.getElementById("lgd"+lid)).remove();this.$legendItem=$(document.createElement("div")).attr("id","lgd"+lid).prepend($(document.createElement("img")).attr("src",this.legend)).click(function(){that.deactivate();if(that.parentLayer){that.parentLayer.deactivate({removeFromParentMaskLayers:true})}that.removeFromLegend()});if(this.url.indexOf("vlayers")>-1){this.$legendItem.prependTo($legend)}else{this.$legendItem.appendTo($legend)}};this.removeFromLegend=function(){if(this.$legendItem)this.$legendItem.remove()};this.setTransparency=function(transparency){if(this.openLayersLayer){ +this.openLayersLayer.setOpacity(1-parseFloat(transparency)/100)}this.transparency=transparency;try{this.emit({type:"transparency",value:this.transparency})}catch(err){var test=this.transparency;var errTxt=err.Message}if(app.map!==undefined){var currentLayer,openLayersLayer,lid;var i;for(i=app.map.getNumLayers()-2;i>0;i--){currentLayer=app.map.layers[i];openLayersLayer=currentLayer.seldonLayer.openLayersLayer;lid=currentLayer.seldonLayer.lid;if(stringContainsChar(currentLayer.name,"Mask")){if(openLayersLayer&&lid.substring(0,lid.indexOf("MaskFor"))===this.lid){openLayersLayer.setOpacity(1-parseFloat(transparency)/100);currentLayer.seldonLayer.transparency=transparency}}}}}}window.EventEmitter.declare(Layer);return Layer}},{"./stringContainsChar.js":55}],29:[function(require,module,exports){module.exports=function($){function createLayerToggleCheckbox(layer){var checkbox=document.createElement("input"),$checkbox;checkbox.type="checkbox";checkbox.id="chk"+layer.lid;checkbox.onclick=function(){if($(this).is(":checked")){layer.activate()}else{layer.deactivate({removeFromLegend:true,removeFromParentMaskLayers:true})}};$checkbox=$(checkbox);$checkbox.addClass(layer.lid);layer.addListener("activate",function(){$("input."+this.lid).attr("checked",true)});layer.addListener("deactivate",function(){$("input."+this.lid).attr("checked",false)});return checkbox}return createLayerToggleCheckbox}},{}],30:[function(require,module,exports){module.exports=function($){function createLayerPropertiesDialog(layer){var localTransparency=0;var $html=$(""+'
'+""+""+""+""+""+""+"
Transparency:"+'
'+"
"+'%'+"
"+"
");$html.find("input.transparency-text").val(layer.transparency);if(layer.transparency>0){localTransparency=layer.transparency;layer.setTransparency(localTransparency)}$html.find(".transparency-slider").slider({min:0,max:100,step:1,value:localTransparency,slide:function(event,ui){try{layer.setTransparency(ui.value)}catch(err){var errTxt=err.message}}});$html.find("input.transparency-text").change(function(){var $this=$(this),newValueFloat=parseFloat($this.val());if(isNaN(newValueFloat)||newValueFloat<0||newValueFloat>100){$this.val(layer.transparency);return}layer.setTransparency($this.val())});layer.addListener("transparency",function(e){$html.find("input.transparency-text").val(e.value)});$html.dialog({zIndex:10050,position:"left",autoOpen:true,hide:"explode",title:layer.name,width:"auto",close:function(){$(this).dialog("destroy");$html.remove();createLayerPropertiesDialog.$html[layer.lid]=undefined}});createLayerPropertiesDialog.$html[layer.lid]=$html}createLayerPropertiesDialog.$html={};return createLayerPropertiesDialog}},{}],31:[function(require,module,exports){module.exports=function($){var createLayerPropertiesDialog=require("./layer_dialog.js")($);function createLayerPropertiesIcon(layer){var img=document.createElement("img");img.id=layer.lid;img.src="icons/settings.png";img.className="layerPropertiesIcon";img.onclick=function(){createLayerPropertiesDialog(layer)};return img}return createLayerPropertiesIcon}},{"./layer_dialog.js":30}],32:[function(require,module,exports){module.exports=function($,app){var generalRadioHandler=require("./layer_radio_handler.js")($,app);function createLayerToggleRadioButton(layer,radioGroupName){var checkbox=document.createElement("input"),$checkbox;checkbox.type="radio";checkbox.name=radioGroupName;checkbox.id=layer.lid;if(layer.selectedInConfig){checkbox.checked=true}$checkbox=$(checkbox);$checkbox.change(radioHandler);layer.addListener("activate",function(){$checkbox.attr("checked",true)});layer.addListener("deactivate",function(){$checkbox.attr("checked",false)});return checkbox}function radioHandler(){generalRadioHandler(app)}return createLayerToggleRadioButton}},{"./layer_radio_handler.js":33}],33:[function(require,module,exports){module.exports=function($,app){var Layer=require("./layer.js")($,app);function radioHandler(app){var $selectedOption=$(app.dropdownBoxList[0]).find(":selected");if($selectedOption.text()==="select..."){clearRadioLayers(app,null);return}var selectLayer=app.dropdownBoxLayers[$selectedOption.val()];var wanted_lid=getActiveDropdownBoxRadioLID(app);var wanted_layer=undefined;var i;for(i=0;i0;i--){currLayer=app.map.layers[i].seldonLayer;for(j=0;j"+selectBoxLayers[i].name+"")}selectBox.insertAdjacentHTML("afterbegin","");$(selectBox).change(selectHandler);return selectBox}function selectHandler(){radioHandler(app)}return createLayerToggleDropdownBox}},{"./layer_radio_handler.js":33}],35:[function(require,module,exports){module.exports=function($,app){function isLayerInLegendConfig(layerId){return layerId in app.legendLookup}function getLegendStringFromPixelValue(layerId,pixelValue){var legendString="";if(isLayerInLegendConfig(layerId)){legendString=app.legendLookup[layerId][pixelValue];if(!legendString){console.error("No legend string set for pixel value",pixelValue,"for layer",layerId)}}return legendString}return getLegendStringFromPixelValue}},{}],36:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js");var saveAs=require("../libs/FileSaver/FileSaver.js").saveAs;var popupId="marker-dialog";var points=[];var pointStyleDefault={pointRadius:4,fillColor:"blue",fillOpacity:.75};var pointStyleHover={pointRadius:5,fillColor:"orange",fillOpacity:.75};var pointStyle=new OpenLayers.StyleMap(pointStyleDefault);function marker(){return new ClickTool(markerHandler)}function markerHandler(e){var coords=app.map.getLonLatFromPixel(e.xy);var lonlat=app.map.getLonLatFromPixel(e.xy);lonlat.transform(app.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));var markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:pointStyle});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));markerLayer.addFeatures(feature);app.map.addLayer(markerLayer);if(!$("#"+popupId).length){createPopup()}if($(".marker-points").length){createPointItem(lonlat,markerLayer)}points.push({lonlat:lonlat,layer:markerLayer});if(typeof ga!=="undefined"){ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Create New Point",eventLabel:lonlat.lon+", "+lonlat.lat})}}function createPointItem(coords,layer){var itemString="";itemString+='
';itemString+='
';itemString+=' Lat:';itemString+=' '+coords.lat+"";itemString+="
";itemString+='
';itemString+=' Lon:';itemString+=' '+coords.lon+"";itemString+="
";itemString+='
';itemString+=' Notes:';itemString+='
';itemString+="
";itemString+="
";var item=$(itemString);item.data("point",layer);item.on("mouseenter",handlePointHoverEnter).on("mouseleave",handlePointHoverLeave);$(".marker-points").append(item)}function handlePointHoverEnter(e){var point=$(this).data("point");point.style=pointStyleHover;point.redraw()}function handlePointHoverLeave(e){var point=$(this).data("point");point.style=pointStyleDefault;point.redraw()}function createPopup(){var popup=$('
');$("body").append(popup);$(".marker-button-download").click(exportFileHandler);$(".marker-button-clear").click(clearPointsHandler);popup.dialog({width:300,height:400,resizable:false,position:{my:"right top",at:"right-5 top+120"},title:"Mark areas of interest",close:function(event,ui){clearPointsHandler();$(this).remove()}})}function exportFileHandler(){var lat,lon,url,notes;var SEP="|";var i;var csvContent="sep="+SEP+"\n";csvContent+="lat"+SEP+"long"+SEP+"google maps link"+SEP+"notes\n";for(i=0;i=0){direction="N"}else if(type==="lat"&&value<0){direction="S"}else if(type==="lon"&&value>=0){direction="E"}else if(type==="lon"&&value<0){direction="W"}value=Math.abs(value);var degree=Math.floor(value);value=(value-degree)*60;var minute=Math.floor(value);var second=(value-minute)*60;return degree+"%C2%B0"+minute+"'"+second+"%22"+direction}function getNotes(index){if(typeof ga!=="undefined"){var label=$(".marker-point-item").eq(index).find(".marker-point-notes").val();ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Notes",eventLabel:label})}return $(".marker-point-item").eq(index).find(".marker-point-notes").val()}function clearPointsHandler(){var i;for(i=0;i')}else{popup.html('
')}popup.dialog({width:600,resizable:false,position:{my:"center+"+offset+" center+"+offset,at:"center",of:window},title:Mustache.render("MODIS NDVI for Lat: {{{lat}}} Lon: {{{lon}}}",{lat:sprintf("%.4f",lonlat.lat),lon:sprintf("%.4f",lonlat.lon)}),close:function(event,ui){app.map.removeLayer(markerLayer);$(this).remove()}});var seldonMultigraph=$("#seldonMultigraph"+app.graphCount+""),promise=seldonMultigraph.multigraph({mugl:muglPrefix+lonlat.lon+","+lonlat.lat,swf:"libs/seldon/libs/Multigraph.swf"});seldonMultigraph.multigraph("done",function(m){if(m){$(m.div()).parent().children(".multigraphLoader").remove()}})})}return createMultigraphTool}},{"./clicktool.js":14}],41:[function(require,module,exports){module.exports=function($){Array.prototype.remove=function(value){if(this.indexOf(value)!==-1){this.splice(this.indexOf(value),1);return true}else{return false}};OpenLayers.Map.prototype.getCurrentSize=function(){var size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=this.div.offsetWidth;size.h=this.div.offsetHeight}if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=parseInt(this.div.style.width,10);size.h=parseInt(this.div.style.height,10)}size.h=size.h-parseInt($(this.div).css("padding-top"),10)-parseInt($(this.div).css("padding-bottom"),10);return size};$.widget("ui.dialog",$.extend({},$.ui.dialog.prototype,{_moveToTop:function(arg){if(arg){if(arg.handleObj.type!="mousedown"){var moved=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;if(moved&&!silent){this._trigger("focus",event)}return moved}}}}))}},{}],42:[function(require,module,exports){module.exports=function($){var createArcGIS93RestParams=require("./create_arcgis_rest_params.js")($);var AccordionGroup=require("./accordion_group.js");var AccordionGroupSublist=require("./accordion_group_sublist.js");var BaseLayer=require("./baselayer.js");var Theme=require("./theme.js");function parseConfig(configXML,shareUrlInfo){var Layer=require("./layer.js")($,this);var createIdentifyTool=require("./identify.js")($,this);var createMultigraphTool=require("./multigraph.js")($,this);var marker=require("./marker.js")($,this);var app=this,$configXML=$(configXML),initialBaseLayer,initialTheme,shareUrlLayerAlpha={},themeOptions={},i,j,k,l,ll,lll;if(shareUrlInfo!==undefined){for(i=0,l=shareUrlInfo.layerLids.length;i0){app.maxExtent={left:parseFloat($extent.attr("xmin")),bottom:parseFloat($extent.attr("ymin")),right:parseFloat($extent.attr("xmax")),top:parseFloat($extent.attr("ymax"))}}var $baseCombo=$("#baseCombo"),$images=$configXML.find("images image"),$image,selected,baseLayer;for(i=0,l=$images.length;ionline.',mapName:"Layers",description:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including the terms of use, visit us online at http://goto.arcgisonline.com/maps/World_Street_Map",copyrightText:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012",layers:[{id:0,name:"World Street Map",parentLayerId:-1,defaultVisibility:true,subLayerIds:null,minScale:0,maxScale:0}],tables:[],spatialReference:{wkid:102100},singleFusedMapCache:true,tileInfo:{rows:256,cols:256,dpi:96,format:"JPEG",compressionQuality:90,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:0,resolution:156543.033928,scale:591657527.591555},{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176}]},initialExtent:{xmin:-28872328.0888923,ymin:-11237732.4896886,xmax:28872328.0888923,ymax:11237732.4896886,spatialReference:{wkid:102100}},fullExtent:{xmin:-20037507.0671618,ymin:-19971868.8804086,xmax:20037507.0671618,ymax:19971868.8804086,spatialReference:{wkid:102100}},units:"esriMeters",supportedImageFormatTypes:"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI,BMP",documentInfo:{Title:"World Street Map",Author:"Esri",Comments:"",Subject:"streets, highways, major roads, railways, water features, administrative boundaries, cities, parks, protected areas, landmarks ",Category:"transportation(Transportation Networks) ",Keywords:"World, Global, Europe, Japan, Hong Kong, North America, United States, Canada, Mexico, Southern Africa, Asia, South America, Australia, New Zealand, India, Argentina, Brazil, Chile, Venezuela, Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, Switzerland, Russia, Thailand, Turkey, 2012",Credits:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"},capabilities:"Map"};app.initOpenLayers(baseLayerInfo,initialBaseLayer,initialTheme,themeOptions,initialExtent);return $configXML}function displayError(message){}return parseConfig}},{"./accordion_group.js":3,"./accordion_group_sublist.js":5,"./baselayer.js":13,"./create_arcgis_rest_params.js":16,"./identify.js":24,"./layer.js":28,"./marker.js":36,"./multigraph.js":40,"./theme.js":56}],43:[function(require,module,exports){module.exports=function($,app){function printMap($configXML){var offsetX=parseInt(app.map.layerContainerDiv.style.left,10);var offsetY=parseInt(app.map.layerContainerDiv.style.top,10);var size=app.map.getSize();var tiles=[];var layer,tile,position;var i,j,k;for(i=0;i
');printPopup.dialog({resizable:false,height:75,title:"Creating Image for Print...",close:function(event,ui){$(this).remove()}});var service_url=$configXML.find("tools tool[name=Print]").attr("service_url");if(!service_url){service_url="http://"+window.location.hostname+window.location.pathname}service_url=service_url.replace(/\/$/,"");var service_name=$configXML.find("tools tool[name=Print]").attr("service_name");if(!service_name){service_name="cgi-bin/print.cgi"}var title=$configXML.find("tools tool[name=Print]").attr("title");if(!title){title="U.S Forest Change Assessment Viewer"}$.ajax({url:service_url+"/"+service_name, +type:"POST",data:OpenLayers.Util.getParameterString({width:size.w,height:size.h,tiles:tiles_json,legends:legends_json,title:title}),headers:{"Content-Type":"application/x-www-form-urlencoded"},success:function(data,status,jqxhr){data=data.replace(/\s+/,"");var href=service_url+"/cgi-bin/printed_map.jpg";if(data){href=service_url+"/"+data}$("#printMapLoader").html('
print image result
');printPopup.dialog("option","title","Print Image Created!")},error:function(jqxhr,status,err){$("#printMapLoader").html("
An error happended.
");printPopup.dialog("option","title","NO Print Image Created!")}})}return printMap}},{}],44:[function(require,module,exports){function RepeatingOperation(op,yieldEveryIteration){var count=0;var instance=this;this.step=function(args){if(++count>=yieldEveryIteration){count=0;setTimeout(function(){op(args)},1,[]);return}op(args)}}module.exports=RepeatingOperation},{}],45:[function(require,module,exports){module.exports=function($){function handle_search(location,app){var rest_endpoint="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text="+location+"&f=json";$.getJSON(rest_endpoint,function(data){var locations=data["locations"][0];if(locations===undefined){return}var extent=locations["extent"];var bounds=new OpenLayers.Bounds(extent.xmin,extent.ymin,extent.xmax,extent.ymax).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));app.zoomToExtent(bounds,true)})}return handle_search}},{}],46:[function(require,module,exports){(function($){"use strict";require("./overrides.js")($);var seldon={App:require("./app.js")($)};var app=new seldon.App;seldon.init=require("./init.js")(app);window.seldon=seldon})(jQuery)},{"./app.js":11,"./init.js":25,"./overrides.js":41}],47:[function(require,module,exports){module.exports=function($){function setBaseLayer(baseLayer){var resolutions=[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,.5971642833948135];var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets");handleBaseLayer(app,layer,baseLayer)}else if(baseLayer.type=="ArcGISCache"){$.ajax({url:baseLayer.url+"?f=json&pretty=true",dataType:"jsonp",success:function(layerInfo){var options={layerInfo:layerInfo};if(baseLayer.numZoomLevels){options.numZoomLevels=baseLayer.numZoomLevels;if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);options.serverResolutions=serverResolutions;options.resolutions=resolutions}}var layer=new OpenLayers.Layer.ArcGISCache(baseLayer.name,baseLayer.url,options);handleBaseLayer(app,layer,baseLayer)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet,sphericalMercator:true};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings);handleBaseLayer(app,layer,baseLayer)}}function handleBaseLayer(app,layer,baseLayer){app.map.removeLayer(app.map.layers[0]);app.currentBaseLayer=baseLayer;app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.emit("baselayerchange")}return setBaseLayer}},{}],48:[function(require,module,exports){function ga_events($){var eventAdded=false;try{$.ga.trackEvent;eventAdded=true}catch(err){eventAdded=false}if(typeof ga!=="undefined"){if(eventAdded){seldon.app.map.events.register("moveend",seldon.app.map,function(){var newMapExtent=seldon.app.map.getExtent();$.ga.trackEvent({category:"Map Extent",action:"Change",label:newMapExtent.toString(),nonInteractive:true})});$(".shareMapUrl").click(function(event){$.ga.trackEvent({category:"Share Map URL",action:"Click",label:$(".shareMapUrl").val()})});$("#mapTheme #themeCombo").change(function(event){$.ga.trackEvent({category:"Map Theme",action:"Change",label:$("#mapTheme #themeCombo option:selected").text()})});$("#txtFindArea input#address_field").keyup(function(event){if(event.which===13){$.ga.trackEvent({category:"Find Area",action:"Search Enter",label:$(this).val()})}});$("#txtFindArea #address_lookup img").click(function(event){$.ga.trackEvent({category:"Find Area",action:"Search Button",label:$("#txtFindArea input#address_field").val()})});$("#mapBase #baseCombo").change(function(event){$.ga.trackEvent({category:"Base Map",action:"Change",label:$("#mapBase #baseCombo option:selected").text()})});$(".header-bar .header-bar img.icon").gaTrackEvent({category:"Nav Bar",action:"click",useLabel:true,labelAttribute:"title",useEvent:true,event:"click"});$("#mapToolsDialog label[for^='chk']").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#mapToolsDialog input").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("#layerPickerDialog label[for^='chk']").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#layerPickerDialog input").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("h3.ui-accordion-header").gaTrackEvent({category:"Base Layer",action:"Toggle Accordion",useLabel:true,label:function(){return $(this).text()},useEvent:true,event:"click"});$("#marker-dialog .marker-button-wrapper .marker-button-download").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Download Points"})});$("#marker-dialog .marker-button-wrapper .marker-button-clear").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Clear Points"})});$("#marker-dialog .marker-point-label .marker-point-coords-label").focusout(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Notes",label:$(this).val()})});$("img[src$='slider.png']").mouseup(function(event){$.ga.trackEvent({category:"OpenLayers Buttons",action:"Slide",label:"Zoom Slider"})});$(".olButton").click(function(event){var eleId=$(this).attr("id");switch(true){case eleId.indexOf("ZoombarOpenLayers_Map")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Bar"});break;case eleId.indexOf("panleft")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan Left"});break;case eleId.indexOf("panright")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan right"});break;case eleId.indexOf("panup")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan up"});break;case eleId.indexOf("pandown")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan down"});break;case eleId.indexOf("zoomin")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom in"});break;case eleId.indexOf("zoomout")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Out"});break;default:}})}}}module.exports=ga_events},{}],49:[function(require,module,exports){module.exports=function($){function setMaskByLayer(toggle,parentLayer){var Layer=require("./layer.js")($,this);var app=this;var maskLayer,maskName,cleanMaskName;var m,ml,mld;if(toggle){for(m=0;m0;i--){var currLayer=app.map.layers[i];for(var j=0;j0||sublist.break?"":" empty";var collapsibleClass=sublist.collapsible?" collapsible":"";var collapseHeaderIcon=sublist.collapsible?'':"";var sublistObj={heading:sublist.label,items:[],collapsible:sublist.collapsible,contentElement:$('
'+'
'+collapseHeaderIcon+"

"+sublist.label+"

"+"
"+"
")};if(sublist.description){var sublistInfoButton=new MoreInfoButton(sublist);sublistObj.contentElement.children(".sublist-header").append(sublistInfoButton.element)}g.sublists.push(sublistObj);sublistItems.push(sublistObj.contentElement);var sublistLayerItems=[];for(var k=0,l=sublist.layers.length;k=0){name=this.substring(0,i);value=this.substring(i+1)}else{name=this;value=undefined}vars[name]=value});info.themeName=vars.theme;info.accordionGroupGid=vars.accgp;info.baseLayerName=vars.basemap;if(vars.extent){var extentCoords=vars.extent.split(",");info.extent={left:extentCoords[0],bottom:extentCoords[1],right:extentCoords[2],top:extentCoords[3]}}if(vars.layers){$.each(vars.layers.split(","),function(){info.layerLids.push(this)})}if(vars.mask){$.each(vars.mask.split(","),function(){info.layerMask.push(this)})}if(vars.modifiers){$.each(vars.modifiers.split(","),function(){info.maskModifiers.push(this)})}if(vars.alphas){$.each(vars.alphas.split(","),function(){info.layerAlphas.push(this)})}if(info.themeName&&info.baseLayerName){return info}return undefined};ShareUrlInfo.prototype.urlArgs=function(){return Mustache.render(""+"theme={{{theme}}}"+"&layers={{{layers}}}"+"&mask={{{mask}}}"+"{{{modifiers}}}"+"&alphas={{{alphas}}}"+"&accgp={{{accgp}}}"+"&basemap={{{basemap}}}"+"&extent={{{extent.left}}},{{{extent.bottom}}},{{{extent.right}}},{{{extent.top}}}",{theme:this.themeName,layers:this.layerLids.join(","),mask:this.layerMask.join(","),modifiers:this.maskModifiers.length>0?"&modifiers="+this.maskModifiers.join(","):"",alphas:this.layerAlphas.join(","),accgp:this.accordionGroupGid,basemap:this.baseLayerName,extent:this.extent})};module.exports=ShareUrlInfo},{}],53:[function(require,module,exports){module.exports=function($){var stringContainsChar=require("./stringContainsChar.js");var ShareUrlInfo=require("./share.js");function shareUrl(){if(!this.currentTheme){return undefined}if(!this.currentAccordionGroup){return undefined}if(!this.currentBaseLayer){return undefined}var extent=this.map.getExtent(),layerLids=[],layerAlphas=[],layerMask=[],url;if(!extent){return undefined}$.each(this.map.layers,function(){var op,lid,test;if(!this.isBaseLayer){if(this.opacity===1){op="1"}else if(this.opacity===0){op="0"}else{op=sprintf("%.2f",this.opacity)}if(stringContainsChar(this.name,"MaskFor")){lid=this.seldonLayer.lid;test=lid.substring(lid.indexOf("MaskFor"),lid.length).replace("MaskFor","");if(layerMask.indexOf(test)===-1){layerMask.push(test)}test=this.name.substring(0,this.name.indexOf("MaskFor"));if(layerLids.indexOf(test)===-1){layerLids.push(test);layerAlphas.push(op)}}else{if(this.seldonLayer){layerLids.push(this.seldonLayer.lid);layerAlphas.push(op)}}}});if(this.hasOwnProperty("maskModifiers")){var modifiers=this.maskModifiers.filter(function(val){return val!==""})}url=window.location.toString();url=url.replace(/\?.*$/,"");url=url.replace(/\/$/,"");url=url.replace("#","");return url+"?"+new ShareUrlInfo({themeName:this.currentTheme.name,layerLids:layerLids,layerMask:layerMask,maskModifiers:modifiers,layerAlphas:layerAlphas,accordionGroupGid:this.currentAccordionGroup.gid,baseLayerName:this.currentBaseLayer.name,extent:extent}).urlArgs()}return shareUrl}},{"./share.js":52,"./stringContainsChar.js":55}],54:[function(require,module,exports){module.exports=function($){function createSplashScreen(){var $document=$(document),windowWidth=Math.round($document.width()/2);$("#splashScreenContent").load("splashScreen.html");$("#splashScreenContainer").dialog({autoOpen:false,zIndex:10051,maxHeight:$document.height(),width:windowWidth,minWidth:300,dialogClass:"splashScreenStyle",hide:"explode"})}return createSplashScreen}},{}],55:[function(require,module,exports){function stringContainsChar(string,c){return string.indexOf(c)>=0}module.exports=stringContainsChar},{}],56:[function(require,module,exports){function Theme(settings){this.accordionGroups=[];if(!settings){return}this.name=settings.name;this.label=settings.label;this.index=settings.index;this.zoom=settings.zoom;this.xmin=settings.xmin;this.ymin=settings.ymin;this.xmax=settings.xmax;this.ymax=settings.ymax;this.getAccordionGroupIndex=function(accordionGroup){var i;for(i=0;i Date: Tue, 24 Aug 2021 15:30:20 +0000 Subject: [PATCH 5/8] Update seldon - sublist info --- html/libs/seldon/js/accordion_group_sublist.js | 2 +- html/libs/seldon/js/parse_config.js | 12 ++++++------ html/libs/seldon/js/set_theme.js | 2 ++ html/libs/seldon/seldon-min.js | 6 +++--- html/libs/seldon/seldon.css | 5 +++++ html/libs/seldon/seldon.js | 16 +++++++++------- libs/seldon | 2 +- 7 files changed, 27 insertions(+), 18 deletions(-) diff --git a/html/libs/seldon/js/accordion_group_sublist.js b/html/libs/seldon/js/accordion_group_sublist.js index 8dec5a4..dc701cd 100644 --- a/html/libs/seldon/js/accordion_group_sublist.js +++ b/html/libs/seldon/js/accordion_group_sublist.js @@ -4,7 +4,7 @@ function AccordionGroupSublist (settings) { this.label = settings.label; this.sid = settings.sid this.type = settings.type; - this.description = settings.description + this.info = settings.info this.collapsible = settings.collapsible this.break = settings.break } diff --git a/html/libs/seldon/js/parse_config.js b/html/libs/seldon/js/parse_config.js index 06babbf..f9366af 100644 --- a/html/libs/seldon/js/parse_config.js +++ b/html/libs/seldon/js/parse_config.js @@ -104,7 +104,7 @@ module.exports = function ($) { sid : $wmsSubgroup.attr('sid'), label : $wmsSubgroup.attr('label'), type : $wmsSubgroup.attr('type'), - description : $wmsSubgroup.attr('description'), + info : ($wmsSubgroup.attr('info') ? $wmsSubgroup.attr('info') : undefined), collapsible : ($wmsSubgroup.attr('collapsible') === "true"), break : ($wmsSubgroup.attr('break') === "true") }) @@ -132,7 +132,7 @@ module.exports = function ($) { attribution : $wmsLayer.attr('attribution'), format : $wmsLayer.attr('format'), numZoomLevels : $wmsLayer.attr('numZoomLevels'), - description : ($wmsLayer.attr('description') ? $wmsLayer.attr('description') : undefined), + info : ($wmsLayer.attr('info') ? $wmsLayer.attr('info') : undefined), break : ($wmsLayer.attr('break') == "true" ? true : undefined) }) ) @@ -153,7 +153,7 @@ module.exports = function ($) { mask : $wmsLayer.attr('mask'), proxyServerType : ($wmsLayer.attr('proxyServerType')) ? $wmsLayer.attr('proxyServerType') : undefined, selectedInConfig : ($wmsLayer.attr('selected') === "true"), - description : ($wmsLayer.attr('description') ? $wmsLayer.attr('description') : undefined), + info : ($wmsLayer.attr('info') ? $wmsLayer.attr('info') : undefined), break : ($wmsLayer.attr('break') == "true" ? true : undefined), maxResolution : $wmsLayer.attr('maxResolution') ? $wmsLayer.attr('maxResolution') : undefined }) @@ -171,7 +171,7 @@ module.exports = function ($) { legend : $wmsLayer.attr('legend'), mask : $wmsLayer.attr('mask'), selectedInConfig : ($wmsLayer.attr('selected') === "true"), - description : ($wmsLayer.attr('description') ? $wmsLayer.attr('description') : undefined), + info : ($wmsLayer.attr('info') ? $wmsLayer.attr('info') : undefined), break : ($wmsLayer.attr('break') == "true" ? true : undefined), }) ); @@ -187,7 +187,7 @@ module.exports = function ($) { legend : $wmsLayer.attr('legend'), selectedInConfig : ($wmsLayer.attr('selected') === "true"), params : createArcGIS93RestParams($wmsLayer), - description : ($wmsLayer.attr('description') ? $wmsLayer.attr('description') : undefined), + info : ($wmsLayer.attr('info') ? $wmsLayer.attr('info') : undefined), break : ($wmsLayer.attr('break') == "true" ? true : undefined) }) } @@ -294,7 +294,7 @@ module.exports = function ($) { // Hardcoded service information here for faster loading // Now assuming street maps is always init base layer // comes from: initialBaseLayer.url + '?f=json&pretty=true' - var baseLayerInfo = {"currentVersion":10.01,"serviceDescription":"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including our terms of use, visit us \u003ca href=\"http://goto.arcgisonline.com/maps/World_Street_Map \" target=\"_new\"\u003eonline\u003c/a\u003e.","mapName":"Layers","description":"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including the terms of use, visit us online at http://goto.arcgisonline.com/maps/World_Street_Map","copyrightText":"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012","layers":[{"id":0,"name":"World Street Map","parentLayerId":-1,"defaultVisibility":true,"subLayerIds":null,"minScale":0,"maxScale":0}],"tables":[],"spatialReference":{"wkid":102100},"singleFusedMapCache":true,"tileInfo":{"rows":256,"cols":256,"dpi":96,"format":"JPEG","compressionQuality":90,"origin":{"x":-20037508.342787,"y":20037508.342787},"spatialReference":{"wkid":102100},"lods":[{"level":0,"resolution":156543.033928,"scale":591657527.591555},{"level":1,"resolution":78271.5169639999,"scale":295828763.795777},{"level":2,"resolution":39135.7584820001,"scale":147914381.897889},{"level":3,"resolution":19567.8792409999,"scale":73957190.948944},{"level":4,"resolution":9783.93962049996,"scale":36978595.474472},{"level":5,"resolution":4891.96981024998,"scale":18489297.737236},{"level":6,"resolution":2445.98490512499,"scale":9244648.868618},{"level":7,"resolution":1222.99245256249,"scale":4622324.434309},{"level":8,"resolution":611.49622628138,"scale":2311162.217155},{"level":9,"resolution":305.748113140558,"scale":1155581.108577},{"level":10,"resolution":152.874056570411,"scale":577790.554289},{"level":11,"resolution":76.4370282850732,"scale":288895.277144},{"level":12,"resolution":38.2185141425366,"scale":144447.638572},{"level":13,"resolution":19.1092570712683,"scale":72223.819286},{"level":14,"resolution":9.55462853563415,"scale":36111.909643},{"level":15,"resolution":4.77731426794937,"scale":18055.954822},{"level":16,"resolution":2.38865713397468,"scale":9027.977411},{"level":17,"resolution":1.19432856685505,"scale":4513.988705},{"level":18,"resolution":0.597164283559817,"scale":2256.994353},{"level":19,"resolution":0.298582141647617,"scale":1128.497176}]},"initialExtent":{"xmin":-28872328.0888923,"ymin":-11237732.4896886,"xmax":28872328.0888923,"ymax":11237732.4896886,"spatialReference":{"wkid":102100}},"fullExtent":{"xmin":-20037507.0671618,"ymin":-19971868.8804086,"xmax":20037507.0671618,"ymax":19971868.8804086,"spatialReference":{"wkid":102100}},"units":"esriMeters","supportedImageFormatTypes":"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI,BMP","documentInfo":{"Title":"World Street Map","Author":"Esri","Comments":"","Subject":"streets, highways, major roads, railways, water features, administrative boundaries, cities, parks, protected areas, landmarks ","Category":"transportation(Transportation Networks) ","Keywords":"World, Global, Europe, Japan, Hong Kong, North America, United States, Canada, Mexico, Southern Africa, Asia, South America, Australia, New Zealand, India, Argentina, Brazil, Chile, Venezuela, Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, Switzerland, Russia, Thailand, Turkey, 2012","Credits":"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"},"capabilities":"Map"}; + var baseLayerInfo = {"currentVersion":10.01,"serviceDescription":"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including our terms of use, visit us \u003ca href=\"http://goto.arcgisonline.com/maps/World_Street_Map \" target=\"_new\"\u003eonline\u003c/a\u003e.","mapName":"Layers","info":"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including the terms of use, visit us online at http://goto.arcgisonline.com/maps/World_Street_Map","copyrightText":"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012","layers":[{"id":0,"name":"World Street Map","parentLayerId":-1,"defaultVisibility":true,"subLayerIds":null,"minScale":0,"maxScale":0}],"tables":[],"spatialReference":{"wkid":102100},"singleFusedMapCache":true,"tileInfo":{"rows":256,"cols":256,"dpi":96,"format":"JPEG","compressionQuality":90,"origin":{"x":-20037508.342787,"y":20037508.342787},"spatialReference":{"wkid":102100},"lods":[{"level":0,"resolution":156543.033928,"scale":591657527.591555},{"level":1,"resolution":78271.5169639999,"scale":295828763.795777},{"level":2,"resolution":39135.7584820001,"scale":147914381.897889},{"level":3,"resolution":19567.8792409999,"scale":73957190.948944},{"level":4,"resolution":9783.93962049996,"scale":36978595.474472},{"level":5,"resolution":4891.96981024998,"scale":18489297.737236},{"level":6,"resolution":2445.98490512499,"scale":9244648.868618},{"level":7,"resolution":1222.99245256249,"scale":4622324.434309},{"level":8,"resolution":611.49622628138,"scale":2311162.217155},{"level":9,"resolution":305.748113140558,"scale":1155581.108577},{"level":10,"resolution":152.874056570411,"scale":577790.554289},{"level":11,"resolution":76.4370282850732,"scale":288895.277144},{"level":12,"resolution":38.2185141425366,"scale":144447.638572},{"level":13,"resolution":19.1092570712683,"scale":72223.819286},{"level":14,"resolution":9.55462853563415,"scale":36111.909643},{"level":15,"resolution":4.77731426794937,"scale":18055.954822},{"level":16,"resolution":2.38865713397468,"scale":9027.977411},{"level":17,"resolution":1.19432856685505,"scale":4513.988705},{"level":18,"resolution":0.597164283559817,"scale":2256.994353},{"level":19,"resolution":0.298582141647617,"scale":1128.497176}]},"initialExtent":{"xmin":-28872328.0888923,"ymin":-11237732.4896886,"xmax":28872328.0888923,"ymax":11237732.4896886,"spatialReference":{"wkid":102100}},"fullExtent":{"xmin":-20037507.0671618,"ymin":-19971868.8804086,"xmax":20037507.0671618,"ymax":19971868.8804086,"spatialReference":{"wkid":102100}},"units":"esriMeters","supportedImageFormatTypes":"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI,BMP","documentInfo":{"Title":"World Street Map","Author":"Esri","Comments":"","Subject":"streets, highways, major roads, railways, water features, administrative boundaries, cities, parks, protected areas, landmarks ","Category":"transportation(Transportation Networks) ","Keywords":"World, Global, Europe, Japan, Hong Kong, North America, United States, Canada, Mexico, Southern Africa, Asia, South America, Australia, New Zealand, India, Argentina, Brazil, Chile, Venezuela, Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, Switzerland, Russia, Thailand, Turkey, 2012","Credits":"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"},"capabilities":"Map"}; app.initOpenLayers(baseLayerInfo, initialBaseLayer, initialTheme, themeOptions, initialExtent); return $configXML; diff --git a/html/libs/seldon/js/set_theme.js b/html/libs/seldon/js/set_theme.js index 7b8912e..608d856 100644 --- a/html/libs/seldon/js/set_theme.js +++ b/html/libs/seldon/js/set_theme.js @@ -126,6 +126,7 @@ module.exports = function ($) { var collapsibleClass = sublist.collapsible ? ' collapsible' : '' var collapseHeaderIcon = sublist.collapsible ? '' : '' + var sublistInfo = sublist.info ? '
' + sublist.info + '
' : '' var sublistObj = { heading : sublist.label, items : [], @@ -135,6 +136,7 @@ module.exports = function ($) { +'
' + collapseHeaderIcon +'

' + sublist.label + '

' + + sublistInfo +'
' +'' ) diff --git a/html/libs/seldon/seldon-min.js b/html/libs/seldon/seldon-min.js index ad24ef3..5cfa2cc 100644 --- a/html/libs/seldon/seldon-min.js +++ b/html/libs/seldon/seldon-min.js @@ -1,3 +1,3 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o"+'

'+el.description+"

"+"";$(dialogDiv).dialog({title:el.label||el.name,dialogClass:"tooltip-dialog "+dialogClass})}}}return MoreInfoButton}},{}],7:[function(require,module,exports){module.exports=function($){function addAccordionSection(accordionGroup,title){var sectionObj={title:title,titleElement:$("

"+title+"

"),contentElement:$("
"),sublists:[]};var $accordionGroup=$(accordionGroup);$accordionGroup.data("listAccordion").sections.push(sectionObj);$accordionGroup.append(sectionObj.titleElement).append(sectionObj.contentElement);$accordionGroup.accordion("refresh");return sectionObj}return addAccordionSection}},{}],8:[function(require,module,exports){module.exports=function($){function addAccordionSublists(g,items){$(g.contentElement).append(items)}return addAccordionSublists}},{}],9:[function(require,module,exports){module.exports=function($){function addAccordionSublistItems(s,items,theme,accGp){var collapsed=s.collapsible?"collapsed ":"";var contents=$('
');for(var i=0,l=items.length;i').append(items[i]))}var layer={name:name,contentElement:contents};s.items.push(layer);s.contentElement.append(layer.contentElement)}return addAccordionSublistItems}},{}],10:[function(require,module,exports){module.exports=function($){function addMaskToLegend(layer){var app=this;var maskName=layer.lid.substring(layer.lid.indexOf("MaskFor"),layer.lid.length);$("#lgd"+maskName).remove();layer.$legendItem=$(document.createElement("div")).attr("id","lgd"+maskName).prepend($(document.createElement("img")).attr("src",layer.legend)).prependTo($("#legend")).click(function(){app.setMaskByMask(false,maskName)})}return addMaskToLegend}},{}],11:[function(require,module,exports){module.exports=function($){var EventEmitter=window.EventEmitter;function App(){EventEmitter.call(this);this.map=undefined;this.tileManager=undefined;this.projection=undefined;this.gisServerType=undefined;this.useProxyScript=undefined;this.scalebar=undefined;this.zoomInTool=undefined;this.zoomOutTool=undefined;this.dragPanTool=undefined;this.id_markerLayer=undefined;this.maxExtent={left:-15e6,bottom:2e6,right:-6e6,top:7e6};this.baseLayers=[];this.accordionGroups=[];this.themes=[];this.maskParentLayers=[];this.masks=[];this.maskModifiers=[];this.defaultMasks=["MaskForForest"];this.radioButtonList=[];this.radioButtonLayers=[];this.dropdownBoxList=[];this.dropdownBoxLayers=[];this.currentBaseLayer=undefined;this.currentAccordionGroup=undefined;this.currentTheme=undefined;this.identifyTool=undefined;this.multigraphTool=undefined;this.markerTool=undefined;this.savedExtents=[];this.currentSavedExtentIndex=-1;this.saveCurrentExtent=require("./extent_save.js");this.zoomToExtent=require("./extent_zoom.js");this.zoomToPreviousExtent=require("./extent_zoom_previous.js");this.zoomToNextExtent=require("./extent_zoom_next.js");this.printSavedExtents=require("./extent_print.js");this.setBaseLayer=require("./set_base_layer.js")($);this.setAccordionGroup=require("./accordion_group_set.js");this.clearAccordionSections=require("./accordion_clear.js")($);this.addAccordionSection=require("./accordion_section_add.js")($);this.addAccordionSublists=require("./accordion_sublist_add.js")($);this.addAccordionSublistItems=require("./accordion_sublist_item_add.js")($);this.setTheme=require("./set_theme.js")($);this.shareUrl=require("./share_url.js")($);this.updateShareMapUrl=require("./update_share_url.js")($);this.launch=require("./launch.js")($);this.count=require("./count.js");this.addMaskToLegend=require("./add_mask_legend.js")($);this.setMaskByMask=require("./set_mask_by_mask.js")($);this.setMaskByLayer=require("./set_mask_by_layer.js")($);this.handleMaskModifier=require("./mask_modifier.js");this.handleMaskModifierGroup=require("./mask_modifier_group.js")($);this.parseConfig=require("./parse_config.js")($);this.initOpenLayers=require("./init_openlayers.js");this.setupCollapsibleSublists=require("./accordion_collapsible_sublist_setup.js")($);this.removeMaskFromLegend=function(layer){};OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.IMAGE_RELOAD_ATTEMPTS=3}EventEmitter.declare(App);return App}},{"./accordion_clear.js":1,"./accordion_collapsible_sublist_setup.js":2,"./accordion_group_set.js":4,"./accordion_section_add.js":7,"./accordion_sublist_add.js":8,"./accordion_sublist_item_add.js":9,"./add_mask_legend.js":10,"./count.js":15,"./extent_print.js":18,"./extent_save.js":19,"./extent_zoom.js":20,"./extent_zoom_next.js":21,"./extent_zoom_previous.js":22,"./init_openlayers.js":26,"./launch.js":27,"./mask_modifier.js":38,"./mask_modifier_group.js":39,"./parse_config.js":42,"./set_base_layer.js":47,"./set_mask_by_layer.js":49,"./set_mask_by_mask.js":50,"./set_theme.js":51,"./share_url.js":53,"./update_share_url.js":57}],12:[function(require,module,exports){function arrayContainsElement(array,element){var i;if(array===undefined){return false}for(i=0;iparam").each(function(i,param){var $param=$(param);if(param.hasAttribute("value")){obj[$param.attr("name")]=$param.attr("value")}else{obj[$param.attr("name")]=createArcGIS93RestParams($param)}});return obj}return createArcGIS93RestParams}},{}],17:[function(require,module,exports){module.exports=function(app,activeBtn){function deactivateActiveOpenLayersControls(){var controls,i;for(i=0;i=0;--i){e=this.savedExtents[i];html+=Mustache.render("{{{marker}}}{{{number}}}"+"left:{{{left}}}, bottom:{{{bottom}}}, right:{{{right}}}, top:{{{top}}}",{marker:i===this.currentSavedExtentIndex?"==>":"",number:i,left:e.left,bottom:e.bottom,right:e.right,top:e.top})}html+="";return html}module.exports=printSavedExtents},{}],19:[function(require,module,exports){var extentsAreEqual=require("./extents_equal.js");function saveCurrentExtent(){var newExtent=formatExtent(this.map.getExtent()),newSavedExtents=[],currentSavedExtent,i;if(this.currentSavedExtentIndex>=0){currentSavedExtent=this.savedExtents[this.currentSavedExtentIndex];if(extentsAreEqual(currentSavedExtent,newExtent)){return}}for(i=0;i<=this.currentSavedExtentIndex;++i){newSavedExtents.push(this.savedExtents[i])}this.savedExtents=newSavedExtents;this.savedExtents.push(newExtent);++this.currentSavedExtentIndex}function formatExtent(extent){return{left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top}}module.exports=saveCurrentExtent},{"./extents_equal.js":23}],20:[function(require,module,exports){function zoomToExtent(extent,save){if(save===undefined){save=true}var bounds=new OpenLayers.Bounds(extent.left,extent.bottom,extent.right,extent.top);this.map.zoomToExtent(bounds,true);if(save){this.saveCurrentExtent()}}module.exports=zoomToExtent},{}],21:[function(require,module,exports){function zoomToNextExtent(){if(this.currentSavedExtentIndex0){--this.currentSavedExtentIndex;this.zoomToExtent(this.savedExtents[this.currentSavedExtentIndex],false)}}module.exports=zoomToPreviousExtent},{}],23:[function(require,module,exports){function extentsAreEqual(e1,e2){var tolerance=.001;return Math.abs(e1.left-e2.left)<=tolerance&&Math.abs(e1.bottom-e2.bottom)<=tolerance&&Math.abs(e1.right-e2.right)<=tolerance&&Math.abs(e1.top-e2.top)<=tolerance}module.exports=extentsAreEqual},{}],24:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js"),stringContainsChar=require("./stringContainsChar.js");var getLegendStringFromPixelValue=require("./legend_config.js")($,app);function createIdentifyTool(){return new ClickTool(function(e){$("#identify_popup").remove();if(app.id_markerLayer){app.map.removeLayer(app.id_markerLayer)}var coords=app.map.getLonLatFromPixel(e.xy);var styleMap=new OpenLayers.StyleMap({pointRadius:4,fillColor:"yellow",fillOpacity:.75});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));app.id_markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:styleMap});app.id_markerLayer.addFeatures(feature);app.map.addLayer(app.id_markerLayer);var services=[],service,urlsrs;var layersAdded=[];var html='';$.each(app.map.layers,function(){var name,label;if(!this.isBaseLayer&&this.params&&(!("seldonLayer"in this)||String(this.seldonLayer.identify)!=="false")){name=this.params.LAYERS;if(String(name).match(/^\d+$/)){label=this.name}else{label=String(name).indexOf("MaskFor")!==-1?name.substring(0,name.indexOf("MaskFor")):name}if(layersAdded.indexOf(label)!==-1)return;layersAdded.push(label);services.push({url:this.url,srs:this.projection.projCode,name:name,label:label,proxyServerType:this.seldonLayer.proxyServerType});html=html+Mustache.render(""+''+''+''+"",{label:label})}});html=html+"
{{label}}:
";if(services.length===0){return}var popup=$(document.createElement("div"));popup.attr("id","identify_popup");popup.html(html);popup.dialog({width:600,height:300,resizable:true,title:"Identify Results",close:function(event,ui){app.map.removeLayer(app.id_markerLayer);app.id_markerLayer=undefined;$(this).remove()}});var i,l;for(i=0,l=services.length;i'+''+valueLabel.replace("_0","")+":  "+""+tableRow+""+""}$(newTableContents).insertAfter($group);if(!newTableContents)$group.find(".layer-results").text("N/A")},error:function(jqXHR,textStatus,errorThrown){}})}function createWMSGetFeatureInfoRequestURL(serviceUrl,layer,srs,x,y){var extent=app.map.getExtent();if(seldon.gisServerType==="ArcGIS"){extent=extent.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection(seldon.projection))}return Mustache.render(""+serviceUrl+"{{{c}}}LAYERS={{layer}}"+"&QUERY_LAYERS={{layer}}"+"&STYLES=,"+"&SERVICE=WMS"+"&VERSION=1.1.1"+"&REQUEST=GetFeatureInfo"+"&BBOX={{left}},{{bottom}},{{right}},{{top}}"+"&FEATURE_COUNT=100"+"&HEIGHT={{height}}"+"&WIDTH={{width}}"+"&FORMAT=image/png"+"&INFO_FORMAT=application/vnd.ogc.gml"+"&SRS={{srs}}"+"&X={{x}}"+"&Y={{y}}",{c:stringContainsChar(serviceUrl,"?")?"&":"?",layer:layer,height:app.map.size.h,width:app.map.size.w,left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top,srs:srs,x:x,y:y})}function getLayerResultsFromArcXML($xml,layerName,layerIDCount){var dataVals=[];try{var fields=$xml.find("FIELDS"),attributes=fields[layerIDCount].attributes,i;for(i=0;i=0||stringStartsWith(layerName,"EFETAC-NASA")||stringStartsWith(layerName,"RSAC-FHTET"))&&children[i].nodeName==="value_0"){value=value+sprintf(" (%.2f %%)",(parseFloat(value,10)-127)/128*100)}if((stringStartsWith(layerName.toUpperCase(),"NDMI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"NDVI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SWIR-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDVI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDMI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-SWIR-CURRENT"))&&children[i].nodeName==="value_0"){value=sprintf("%.0f %%",parseFloat(value,10)-128)}returnVals[i]=[children[i].nodeName,value]}}return returnVals}function stringStartsWith(string,prefix){return string.substring(0,prefix.length)===prefix}return createIdentifyTool}},{"./clicktool.js":14,"./legend_config.js":35,"./stringContainsChar.js":55}],25:[function(require,module,exports){module.exports=function(app){var ShareUrlInfo=require("./share.js");function init(config,projection,legendLookup,gisServerType,useProxyScript){var shareUrlInfo=ShareUrlInfo.parseUrl(window.location.toString());app.projection=projection;seldon.projection=projection;app.legendLookup=legendLookup;seldon.gisServerType=gisServerType;seldon.useProxyScript=useProxyScript;app.launch(config,shareUrlInfo);seldon.app=app}return init}},{"./share.js":52}],26:[function(require,module,exports){function initOpenLayers(baseLayerInfo,baseLayer,theme,themeOptions,initialExtent){var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets",{numZoomLevels:20})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings)}else if(baseLayer.type=="ArcGISCache"){var layer=new OpenLayers.Layer.ArcGISCache("AGSCache",baseLayer.url,{layerInfo:baseLayerInfo})}var maxExtentBounds;if(theme.xmax&&theme.xmin&&theme.ymax&&theme.ymin){maxExtentBounds=new OpenLayers.Bounds(theme.xmin,theme.ymin,theme.xmax,theme.ymax)}else{maxExtentBounds=new OpenLayers.Bounds(app.maxExtent.left,app.maxExtent.bottom,app.maxExtent.right,app.maxExtent.top)}if(initialExtent===undefined){initialExtent=app.maxExtent}app.tileManager=new OpenLayers.TileManager({cacheSize:12,moveDelay:750,zoomDelay:750});app.map=new OpenLayers.Map("map",{units:"m",tileManager:app.tileManager,controls:[new OpenLayers.Control.Navigation,new OpenLayers.Control.Attribution,app.zoomInTool,app.zoomOutTool,app.identifyTool,app.multigraphTool,app.markerTool],eventListeners:{moveend:function(){app.emit("extentchange")},zoomend:function(){app.emit("extentchange")}},projection:new OpenLayers.Projection(seldon.projection)});app.currentBaseLayer=baseLayer;app.emit("baselayerchange");app.map.addControl(new OpenLayers.Control.ScaleLine({bottomOutUnits:"mi"}));app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.setTheme(theme,themeOptions);app.zoomToExtent(initialExtent);app.saveCurrentExtent();app.map.events.register("mousemove",app.map,function(e){var pixel=app.map.events.getMousePosition(e);var lonlat=app.map.getLonLatFromPixel(pixel);lonlat=lonlat.transform(new OpenLayers.Projection("EPSG:3857"),new OpenLayers.Projection("EPSG:4326"));OpenLayers.Util.getElement("latLonTracker").innerHTML="Lat: "+sprintf("%.5f",lonlat.lat)+" Lon: "+sprintf("%.5f",lonlat.lon)+""});app.map.addControl(new OpenLayers.Control.PanZoomBar)}module.exports=initOpenLayers},{}],27:[function(require,module,exports){module.exports=function($){var createSplashScreen=require("./splash.js")($);var handle_search=require("./search.js")($);var ga_events=require("./set_google_analytics_events.js");var areasList=[];var activeBtn=[];function launch(configFile,shareUrlInfo){var deactivateActiveOpenLayersControls=require("./deactivate_controls.js")(this,activeBtn);var printMap=require("./print.js")($,this);var app=this;app.initialThemeLoad=true;var $configXML;$.ajax({url:configFile,dataType:"xml",success:function(configXML){$configXML=app.parseConfig(configXML,shareUrlInfo);ga_events($)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}});$("#btnTglLyrPick").click(function(){var $layerPickerDialog=$("#layerPickerDialog");if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close")}else{$layerPickerDialog.dialog("open")}});$("#layerPickerDialog").dialog({zIndex:10050,position:{my:"left top",at:"left+5 top+100"},autoOpen:true,hide:"fade",width:330});app.addListener("accordiongroupchange",function(){if(app.currentTheme){$("#layerPickerAccordion").accordion({active:app.currentTheme.getAccordionGroupIndex(app.currentAccordionGroup),collapsible:true,beforeActivate:function(event,ui){if(!app.initialThemeLoad){$("#layerPickerDialog").scrollTop(0)}},activate:function(event,ui){app.setupCollapsibleSublists(ui);if(app.initialThemeLoad){app.initialThemeLoad=false;$("#layerPickerDialog").scrollTop(755)}}})}});$("#btnTglMapTools").click(function(){var $mapToolsDialog=$("#mapToolsDialog");if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close")}else{$mapToolsDialog.dialog("open")}});$("#mapToolsDialog").dialog({zIndex:10050,position:{my:"right top",at:"right-5 top+100"},autoOpen:true,hide:"fade"});app.addListener("themechange",function(){app.updateShareMapUrl()});app.addListener("baselayerchange",function(){app.updateShareMapUrl()});app.addListener("accordiongroupchange",function(){app.updateShareMapUrl()});app.addListener("extentchange",function(){app.saveCurrentExtent();app.updateShareMapUrl()});var $mapToolsAccordion=$("#mapToolsAccordion"),accordionGroupIndexToOpen=0;$mapToolsAccordion.accordion({heightStyle:"content",collapsible:true});$mapToolsAccordion.find("div").each(function(i){if(this.id==="legend"){accordionGroupIndexToOpen=i;return false}return true});$mapToolsAccordion.accordion("option","active",accordionGroupIndexToOpen);$("#baseCombo").change(function(){var i=parseInt($(this).val(),10);app.setBaseLayer(app.baseLayers[i])});app.addListener("baselayerchange",function(){$("#baseCombo").val(app.currentBaseLayer.index)});$("#themeCombo").change(function(){var i=parseInt($(this).val(),10);app.setTheme(app.themes[i])});app.addListener("themechange",function(){$("#themeCombo").val(app.currentTheme.index)});$("#btnPan").click(function(){deactivateActiveOpenLayersControls();app.dragPanTool.activate()});$("#btnPrint").click(function(){if($configXML!==undefined){printMap($configXML)}else{console.log("Can't print yet; config file not yet parsed")}});$("#btnZoomIn").click(function(){deactivateActiveOpenLayersControls();app.zoomInTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomOut").click(function(){deactivateActiveOpenLayersControls();app.zoomOutTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomExtent").click(function(){app.zoomToExtent(app.maxExtent)});$("#btnID").click(function(){deactivateActiveOpenLayersControls();app.identifyTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnAbout").click(function(){var splashScreen=$("#splashScreenContainer");if(splashScreen.dialog("isOpen")){splashScreen.dialog("close")}else{splashScreen.dialog("open")}});$("#btnPrev").click(function(){app.zoomToPreviousExtent()});$("#btnNext").click(function(){app.zoomToNextExtent()});$("#btnMultiGraph").click(function(){deactivateActiveOpenLayersControls();app.multigraphTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnMarker").click(function(){deactivateActiveOpenLayersControls();app.markerTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});createSplashScreen();var $findArea=$("#findArea");$findArea.findArea();areasList=$findArea.findArea("getAreasList");$findArea.autocomplete({source:areasList});$findArea.keypress(function(e){if(e.which==13){var areaExtent=$findArea.findArea("getAreaExtent",$findArea.val(),areasList);app.zoomToExtent(areaExtent)}});$("#address_lookup").on("click",function(){var location=$("#address_field").val();handle_search(location,app)});$("#address_field").on("keypress",function(e){if(e.which===13){var location=$(this).val();handle_search(location,app)}});$(".mask-toggle").on("click",function(){if($(this).is(":checked")){app.setMaskByMask(true,this.value)}else{app.setMaskByMask(false,this.value)}});$("[data-mask-grouper='true']").on("change",function(){var disabled=$(this).is(":checked")?true:false;$("[data-mask-parent='"+this.value+"']").attr("disabled",disabled)});$(".mask-modifier").on("change",function(){var value=$(this).is(":checked")?this.value:"";var index=$(this).data("index");if($(this).data("maskGrouper")===true){app.handleMaskModifierGroup(this.value,$(this).is(":checked"))}app.handleMaskModifier(value,index)});$("textarea").focus(function(){var $this=$(this);$this.select();window.setTimeout(function(){$this.select()},1);function mouseUpHandler(){$this.off("mouseup",mouseUpHandler);return false}$this.mouseup(mouseUpHandler)});if($(window).width()<650){$("#mapToolsDialog").dialog("close");$("#layerPickerDialog").dialog("close")}if(window.addEventListener){window.addEventListener("orientationchange",function(){var $mapToolsDialog=$("#mapToolsDialog"),$layerPickerDialog=$("#layerPickerDialog");window.scroll(0,0);if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close").dialog("open")}if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close").dialog("open")}},false)}}return launch}},{"./deactivate_controls.js":17,"./print.js":43,"./search.js":45,"./set_google_analytics_events.js":48,"./splash.js":54}],28:[function(require,module,exports){module.exports=function($,app){var stringContainsChar=require("./stringContainsChar.js");function Layer(settings){EventEmitter.call(this);if(!settings){return}$.extend(true,this,settings);this.transparency=0;if(this.index==undefined){this.index=0}if(this.type==undefined){this.type="WMS"}this.createOpenLayersLayer=function(){if(this.openLayersLayer!==undefined){return this.openLayersLayer}var options={isBaseLayer:false,transitionEffect:"resize",buffer:0,tileSize:new OpenLayers.Size(2048,2048)};if(this.type==="WMTS"){var settings={name:this.name,url:this.url,layer:this.layers,style:this.style,matrixSet:this.srs,isBaseLayer:false,transitionEffect:"resize",format:"image/jpg",sphericalMercator:true};if(this.lid.indexOf("GLAM")>-1){$.extend(true,settings,{serverResolutions:[156543.033928041,78271.5169640205,39135.7584820102,19567.8792410051,9783.9396205026,4891.9698102513,2445.9849051256,1222.9924525628,611.4962262814,305.7481131407048],units:"m",tileOrigin:new OpenLayers.LonLat(-20037508.34,20037508.34)})}this.openLayersLayer=new OpenLayers.Layer.WMTS(settings)}else if(this.type==="XYZ"){this.openLayersLayer=new OpenLayers.Layer.XYZ(this.name,this.url,{isBaseLayer:false,projection:new OpenLayers.Projection(seldon.projection)})}else if(this.type==="ArcGIS93Rest"){this.openLayersLayer=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params.mosaicRule?$.extend(true,{},this.params,{mosaicRule:JSON.stringify(this.params.mosaicRule)}):this.params,options)}else{if(this.maxResolution){options.maxResolution=parseFloat(this.maxResolution)}var layer=this.layers+("mask"in this?app.maskModifiers.join(""):"");this.openLayersLayer=new OpenLayers.Layer.WMS(this.name,this.url,{projection:new OpenLayers.Projection(seldon.projection),units:"m",layers:layer,transparent:true},options)}var loadingimage=$('');$("#map").append(loadingimage);this.openLayersLayer.loadingimage=loadingimage;this.openLayersLayer.events.register("loadstart",this.openLayersLayer,function(){this.loadingimage.addClass("loading")});this.openLayersLayer.events.register("loadend",this.openLayersLayer,function(){this.loadingimage.removeClass("loading")});this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);this.openLayersLayer.seldonLayer=this;return this.openLayersLayer};this.activate=function(options){options=options||{};this.addToLegend();this.emit("activate");if(this.mask==="true"&&this.lid.indexOf("MaskFor")===-1){if(app.masks.length>0){app.setMaskByLayer(true,this)}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}var inMaskParentLayers=app.maskParentLayers.filter(function(layer){return this===layer},this).length;if(!inMaskParentLayers){app.maskParentLayers.push(this)}}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}vectorServices=["vlayers","fire","ads"];boundaryServices=["boundaries"];allVectorServices=vectorServices;Array.prototype.push.apply(allVectorServices,boundaryServices);var isVectorLayer=function(layer,serviceNames){return serviceNames.filter(function(serviceName){return layer.url&&layer.url.indexOf(serviceName+"?")>-1}).length};if(app.map.getNumLayers()>1){var lyrJustAdded=app.map.layers[app.map.getNumLayers()-1];if(!isVectorLayer(lyrJustAdded,allVectorServices)){for(var i=app.map.getNumLayers()-2;i>0;i--){var nextLayerDown=app.map.layers[i];if(!isVectorLayer(nextLayerDown,allVectorServices)){if(nextLayerDown.seldonLayer.index0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,vectorServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}for(var i=app.map.getNumLayers()-1;i>0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,boundaryServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}}app.updateShareMapUrl();app.map.updateSize()};this.deactivate=function(options){options=options||{};if(this.visible==="true"){app.map.removeLayer(this.openLayersLayer);this.visible="false"}if(!this.parentLayer){app.setMaskByLayer(false,this)}if(options.removeFromLegend){this.removeFromLegend()}if(options.removeFromParentMaskLayers){app.maskParentLayers=app.maskParentLayers.filter(function(layer){return layer.lid!==this.lid},this)}if(this.openLayersLayer&&this.openLayersLayer.loadingimage){this.openLayersLayer.loadingimage.removeClass("loading")}this.emit("deactivate")};this.addToLegend=function(){var that=this;var $legend=$("#legend");var lid=this.parentLayer?this.parentLayer.lid:this.lid;$(document.getElementById("lgd"+lid)).remove();this.$legendItem=$(document.createElement("div")).attr("id","lgd"+lid).prepend($(document.createElement("img")).attr("src",this.legend)).click(function(){that.deactivate();if(that.parentLayer){that.parentLayer.deactivate({removeFromParentMaskLayers:true})}that.removeFromLegend()});if(this.url.indexOf("vlayers")>-1){this.$legendItem.prependTo($legend)}else{this.$legendItem.appendTo($legend)}};this.removeFromLegend=function(){if(this.$legendItem)this.$legendItem.remove()};this.setTransparency=function(transparency){if(this.openLayersLayer){ -this.openLayersLayer.setOpacity(1-parseFloat(transparency)/100)}this.transparency=transparency;try{this.emit({type:"transparency",value:this.transparency})}catch(err){var test=this.transparency;var errTxt=err.Message}if(app.map!==undefined){var currentLayer,openLayersLayer,lid;var i;for(i=app.map.getNumLayers()-2;i>0;i--){currentLayer=app.map.layers[i];openLayersLayer=currentLayer.seldonLayer.openLayersLayer;lid=currentLayer.seldonLayer.lid;if(stringContainsChar(currentLayer.name,"Mask")){if(openLayersLayer&&lid.substring(0,lid.indexOf("MaskFor"))===this.lid){openLayersLayer.setOpacity(1-parseFloat(transparency)/100);currentLayer.seldonLayer.transparency=transparency}}}}}}window.EventEmitter.declare(Layer);return Layer}},{"./stringContainsChar.js":55}],29:[function(require,module,exports){module.exports=function($){function createLayerToggleCheckbox(layer){var checkbox=document.createElement("input"),$checkbox;checkbox.type="checkbox";checkbox.id="chk"+layer.lid;checkbox.onclick=function(){if($(this).is(":checked")){layer.activate()}else{layer.deactivate({removeFromLegend:true,removeFromParentMaskLayers:true})}};$checkbox=$(checkbox);$checkbox.addClass(layer.lid);layer.addListener("activate",function(){$("input."+this.lid).attr("checked",true)});layer.addListener("deactivate",function(){$("input."+this.lid).attr("checked",false)});return checkbox}return createLayerToggleCheckbox}},{}],30:[function(require,module,exports){module.exports=function($){function createLayerPropertiesDialog(layer){var localTransparency=0;var $html=$(""+'
'+""+""+""+""+""+""+"
Transparency:"+'
'+"
"+'%'+"
"+"
");$html.find("input.transparency-text").val(layer.transparency);if(layer.transparency>0){localTransparency=layer.transparency;layer.setTransparency(localTransparency)}$html.find(".transparency-slider").slider({min:0,max:100,step:1,value:localTransparency,slide:function(event,ui){try{layer.setTransparency(ui.value)}catch(err){var errTxt=err.message}}});$html.find("input.transparency-text").change(function(){var $this=$(this),newValueFloat=parseFloat($this.val());if(isNaN(newValueFloat)||newValueFloat<0||newValueFloat>100){$this.val(layer.transparency);return}layer.setTransparency($this.val())});layer.addListener("transparency",function(e){$html.find("input.transparency-text").val(e.value)});$html.dialog({zIndex:10050,position:"left",autoOpen:true,hide:"explode",title:layer.name,width:"auto",close:function(){$(this).dialog("destroy");$html.remove();createLayerPropertiesDialog.$html[layer.lid]=undefined}});createLayerPropertiesDialog.$html[layer.lid]=$html}createLayerPropertiesDialog.$html={};return createLayerPropertiesDialog}},{}],31:[function(require,module,exports){module.exports=function($){var createLayerPropertiesDialog=require("./layer_dialog.js")($);function createLayerPropertiesIcon(layer){var img=document.createElement("img");img.id=layer.lid;img.src="icons/settings.png";img.className="layerPropertiesIcon";img.onclick=function(){createLayerPropertiesDialog(layer)};return img}return createLayerPropertiesIcon}},{"./layer_dialog.js":30}],32:[function(require,module,exports){module.exports=function($,app){var generalRadioHandler=require("./layer_radio_handler.js")($,app);function createLayerToggleRadioButton(layer,radioGroupName){var checkbox=document.createElement("input"),$checkbox;checkbox.type="radio";checkbox.name=radioGroupName;checkbox.id=layer.lid;if(layer.selectedInConfig){checkbox.checked=true}$checkbox=$(checkbox);$checkbox.change(radioHandler);layer.addListener("activate",function(){$checkbox.attr("checked",true)});layer.addListener("deactivate",function(){$checkbox.attr("checked",false)});return checkbox}function radioHandler(){generalRadioHandler(app)}return createLayerToggleRadioButton}},{"./layer_radio_handler.js":33}],33:[function(require,module,exports){module.exports=function($,app){var Layer=require("./layer.js")($,app);function radioHandler(app){var $selectedOption=$(app.dropdownBoxList[0]).find(":selected");if($selectedOption.text()==="select..."){clearRadioLayers(app,null);return}var selectLayer=app.dropdownBoxLayers[$selectedOption.val()];var wanted_lid=getActiveDropdownBoxRadioLID(app);var wanted_layer=undefined;var i;for(i=0;i0;i--){currLayer=app.map.layers[i].seldonLayer;for(j=0;j"+selectBoxLayers[i].name+"")}selectBox.insertAdjacentHTML("afterbegin","");$(selectBox).change(selectHandler);return selectBox}function selectHandler(){radioHandler(app)}return createLayerToggleDropdownBox}},{"./layer_radio_handler.js":33}],35:[function(require,module,exports){module.exports=function($,app){function isLayerInLegendConfig(layerId){return layerId in app.legendLookup}function getLegendStringFromPixelValue(layerId,pixelValue){var legendString="";if(isLayerInLegendConfig(layerId)){legendString=app.legendLookup[layerId][pixelValue];if(!legendString){console.error("No legend string set for pixel value",pixelValue,"for layer",layerId)}}return legendString}return getLegendStringFromPixelValue}},{}],36:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js");var saveAs=require("../libs/FileSaver/FileSaver.js").saveAs;var popupId="marker-dialog";var points=[];var pointStyleDefault={pointRadius:4,fillColor:"blue",fillOpacity:.75};var pointStyleHover={pointRadius:5,fillColor:"orange",fillOpacity:.75};var pointStyle=new OpenLayers.StyleMap(pointStyleDefault);function marker(){return new ClickTool(markerHandler)}function markerHandler(e){var coords=app.map.getLonLatFromPixel(e.xy);var lonlat=app.map.getLonLatFromPixel(e.xy);lonlat.transform(app.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));var markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:pointStyle});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));markerLayer.addFeatures(feature);app.map.addLayer(markerLayer);if(!$("#"+popupId).length){createPopup()}if($(".marker-points").length){createPointItem(lonlat,markerLayer)}points.push({lonlat:lonlat,layer:markerLayer});if(typeof ga!=="undefined"){ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Create New Point",eventLabel:lonlat.lon+", "+lonlat.lat})}}function createPointItem(coords,layer){var itemString="";itemString+='
';itemString+='
';itemString+=' Lat:';itemString+=' '+coords.lat+"";itemString+="
";itemString+='
';itemString+=' Lon:';itemString+=' '+coords.lon+"";itemString+="
";itemString+='
';itemString+=' Notes:';itemString+='
';itemString+="
";itemString+="
";var item=$(itemString);item.data("point",layer);item.on("mouseenter",handlePointHoverEnter).on("mouseleave",handlePointHoverLeave);$(".marker-points").append(item)}function handlePointHoverEnter(e){var point=$(this).data("point");point.style=pointStyleHover;point.redraw()}function handlePointHoverLeave(e){var point=$(this).data("point");point.style=pointStyleDefault;point.redraw()}function createPopup(){var popup=$('
');$("body").append(popup);$(".marker-button-download").click(exportFileHandler);$(".marker-button-clear").click(clearPointsHandler);popup.dialog({width:300,height:400,resizable:false,position:{my:"right top",at:"right-5 top+120"},title:"Mark areas of interest",close:function(event,ui){clearPointsHandler();$(this).remove()}})}function exportFileHandler(){var lat,lon,url,notes;var SEP="|";var i;var csvContent="sep="+SEP+"\n";csvContent+="lat"+SEP+"long"+SEP+"google maps link"+SEP+"notes\n";for(i=0;i=0){direction="N"}else if(type==="lat"&&value<0){direction="S"}else if(type==="lon"&&value>=0){direction="E"}else if(type==="lon"&&value<0){direction="W"}value=Math.abs(value);var degree=Math.floor(value);value=(value-degree)*60;var minute=Math.floor(value);var second=(value-minute)*60;return degree+"%C2%B0"+minute+"'"+second+"%22"+direction}function getNotes(index){if(typeof ga!=="undefined"){var label=$(".marker-point-item").eq(index).find(".marker-point-notes").val();ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Notes",eventLabel:label})}return $(".marker-point-item").eq(index).find(".marker-point-notes").val()}function clearPointsHandler(){var i;for(i=0;i')}else{popup.html('
')}popup.dialog({width:600,resizable:false,position:{my:"center+"+offset+" center+"+offset,at:"center",of:window},title:Mustache.render("MODIS NDVI for Lat: {{{lat}}} Lon: {{{lon}}}",{lat:sprintf("%.4f",lonlat.lat),lon:sprintf("%.4f",lonlat.lon)}),close:function(event,ui){app.map.removeLayer(markerLayer);$(this).remove()}});var seldonMultigraph=$("#seldonMultigraph"+app.graphCount+""),promise=seldonMultigraph.multigraph({mugl:muglPrefix+lonlat.lon+","+lonlat.lat,swf:"libs/seldon/libs/Multigraph.swf"});seldonMultigraph.multigraph("done",function(m){if(m){$(m.div()).parent().children(".multigraphLoader").remove()}})})}return createMultigraphTool}},{"./clicktool.js":14}],41:[function(require,module,exports){module.exports=function($){Array.prototype.remove=function(value){if(this.indexOf(value)!==-1){this.splice(this.indexOf(value),1);return true}else{return false}};OpenLayers.Map.prototype.getCurrentSize=function(){var size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=this.div.offsetWidth;size.h=this.div.offsetHeight}if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=parseInt(this.div.style.width,10);size.h=parseInt(this.div.style.height,10)}size.h=size.h-parseInt($(this.div).css("padding-top"),10)-parseInt($(this.div).css("padding-bottom"),10);return size};$.widget("ui.dialog",$.extend({},$.ui.dialog.prototype,{_moveToTop:function(arg){if(arg){if(arg.handleObj.type!="mousedown"){var moved=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;if(moved&&!silent){this._trigger("focus",event)}return moved}}}}))}},{}],42:[function(require,module,exports){module.exports=function($){var createArcGIS93RestParams=require("./create_arcgis_rest_params.js")($);var AccordionGroup=require("./accordion_group.js");var AccordionGroupSublist=require("./accordion_group_sublist.js");var BaseLayer=require("./baselayer.js");var Theme=require("./theme.js");function parseConfig(configXML,shareUrlInfo){var Layer=require("./layer.js")($,this);var createIdentifyTool=require("./identify.js")($,this);var createMultigraphTool=require("./multigraph.js")($,this);var marker=require("./marker.js")($,this);var app=this,$configXML=$(configXML),initialBaseLayer,initialTheme,shareUrlLayerAlpha={},themeOptions={},i,j,k,l,ll,lll;if(shareUrlInfo!==undefined){for(i=0,l=shareUrlInfo.layerLids.length;i0){app.maxExtent={left:parseFloat($extent.attr("xmin")),bottom:parseFloat($extent.attr("ymin")),right:parseFloat($extent.attr("xmax")),top:parseFloat($extent.attr("ymax"))}}var $baseCombo=$("#baseCombo"),$images=$configXML.find("images image"),$image,selected,baseLayer;for(i=0,l=$images.length;ionline.',mapName:"Layers",description:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including the terms of use, visit us online at http://goto.arcgisonline.com/maps/World_Street_Map",copyrightText:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012",layers:[{id:0,name:"World Street Map",parentLayerId:-1,defaultVisibility:true,subLayerIds:null,minScale:0,maxScale:0}],tables:[],spatialReference:{wkid:102100},singleFusedMapCache:true,tileInfo:{rows:256,cols:256,dpi:96,format:"JPEG",compressionQuality:90,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:0,resolution:156543.033928,scale:591657527.591555},{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176}]},initialExtent:{xmin:-28872328.0888923,ymin:-11237732.4896886,xmax:28872328.0888923,ymax:11237732.4896886,spatialReference:{wkid:102100}},fullExtent:{xmin:-20037507.0671618,ymin:-19971868.8804086,xmax:20037507.0671618,ymax:19971868.8804086,spatialReference:{wkid:102100}},units:"esriMeters",supportedImageFormatTypes:"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI,BMP",documentInfo:{Title:"World Street Map",Author:"Esri",Comments:"",Subject:"streets, highways, major roads, railways, water features, administrative boundaries, cities, parks, protected areas, landmarks ",Category:"transportation(Transportation Networks) ",Keywords:"World, Global, Europe, Japan, Hong Kong, North America, United States, Canada, Mexico, Southern Africa, Asia, South America, Australia, New Zealand, India, Argentina, Brazil, Chile, Venezuela, Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, Switzerland, Russia, Thailand, Turkey, 2012",Credits:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"},capabilities:"Map"};app.initOpenLayers(baseLayerInfo,initialBaseLayer,initialTheme,themeOptions,initialExtent);return $configXML}function displayError(message){}return parseConfig}},{"./accordion_group.js":3,"./accordion_group_sublist.js":5,"./baselayer.js":13,"./create_arcgis_rest_params.js":16,"./identify.js":24,"./layer.js":28,"./marker.js":36,"./multigraph.js":40,"./theme.js":56}],43:[function(require,module,exports){module.exports=function($,app){function printMap($configXML){var offsetX=parseInt(app.map.layerContainerDiv.style.left,10);var offsetY=parseInt(app.map.layerContainerDiv.style.top,10);var size=app.map.getSize();var tiles=[];var layer,tile,position;var i,j,k;for(i=0;i
');printPopup.dialog({resizable:false,height:75,title:"Creating Image for Print...",close:function(event,ui){$(this).remove()}});var service_url=$configXML.find("tools tool[name=Print]").attr("service_url");if(!service_url){service_url="http://"+window.location.hostname+window.location.pathname}service_url=service_url.replace(/\/$/,"");var service_name=$configXML.find("tools tool[name=Print]").attr("service_name");if(!service_name){service_name="cgi-bin/print.cgi"}var title=$configXML.find("tools tool[name=Print]").attr("title");if(!title){title="U.S Forest Change Assessment Viewer"}$.ajax({url:service_url+"/"+service_name, -type:"POST",data:OpenLayers.Util.getParameterString({width:size.w,height:size.h,tiles:tiles_json,legends:legends_json,title:title}),headers:{"Content-Type":"application/x-www-form-urlencoded"},success:function(data,status,jqxhr){data=data.replace(/\s+/,"");var href=service_url+"/cgi-bin/printed_map.jpg";if(data){href=service_url+"/"+data}$("#printMapLoader").html('
print image result
');printPopup.dialog("option","title","Print Image Created!")},error:function(jqxhr,status,err){$("#printMapLoader").html("
An error happended.
");printPopup.dialog("option","title","NO Print Image Created!")}})}return printMap}},{}],44:[function(require,module,exports){function RepeatingOperation(op,yieldEveryIteration){var count=0;var instance=this;this.step=function(args){if(++count>=yieldEveryIteration){count=0;setTimeout(function(){op(args)},1,[]);return}op(args)}}module.exports=RepeatingOperation},{}],45:[function(require,module,exports){module.exports=function($){function handle_search(location,app){var rest_endpoint="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text="+location+"&f=json";$.getJSON(rest_endpoint,function(data){var locations=data["locations"][0];if(locations===undefined){return}var extent=locations["extent"];var bounds=new OpenLayers.Bounds(extent.xmin,extent.ymin,extent.xmax,extent.ymax).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));app.zoomToExtent(bounds,true)})}return handle_search}},{}],46:[function(require,module,exports){(function($){"use strict";require("./overrides.js")($);var seldon={App:require("./app.js")($)};var app=new seldon.App;seldon.init=require("./init.js")(app);window.seldon=seldon})(jQuery)},{"./app.js":11,"./init.js":25,"./overrides.js":41}],47:[function(require,module,exports){module.exports=function($){function setBaseLayer(baseLayer){var resolutions=[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,.5971642833948135];var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets");handleBaseLayer(app,layer,baseLayer)}else if(baseLayer.type=="ArcGISCache"){$.ajax({url:baseLayer.url+"?f=json&pretty=true",dataType:"jsonp",success:function(layerInfo){var options={layerInfo:layerInfo};if(baseLayer.numZoomLevels){options.numZoomLevels=baseLayer.numZoomLevels;if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);options.serverResolutions=serverResolutions;options.resolutions=resolutions}}var layer=new OpenLayers.Layer.ArcGISCache(baseLayer.name,baseLayer.url,options);handleBaseLayer(app,layer,baseLayer)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet,sphericalMercator:true};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings);handleBaseLayer(app,layer,baseLayer)}}function handleBaseLayer(app,layer,baseLayer){app.map.removeLayer(app.map.layers[0]);app.currentBaseLayer=baseLayer;app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.emit("baselayerchange")}return setBaseLayer}},{}],48:[function(require,module,exports){function ga_events($){var eventAdded=false;try{$.ga.trackEvent;eventAdded=true}catch(err){eventAdded=false}if(typeof ga!=="undefined"){if(eventAdded){seldon.app.map.events.register("moveend",seldon.app.map,function(){var newMapExtent=seldon.app.map.getExtent();$.ga.trackEvent({category:"Map Extent",action:"Change",label:newMapExtent.toString(),nonInteractive:true})});$(".shareMapUrl").click(function(event){$.ga.trackEvent({category:"Share Map URL",action:"Click",label:$(".shareMapUrl").val()})});$("#mapTheme #themeCombo").change(function(event){$.ga.trackEvent({category:"Map Theme",action:"Change",label:$("#mapTheme #themeCombo option:selected").text()})});$("#txtFindArea input#address_field").keyup(function(event){if(event.which===13){$.ga.trackEvent({category:"Find Area",action:"Search Enter",label:$(this).val()})}});$("#txtFindArea #address_lookup img").click(function(event){$.ga.trackEvent({category:"Find Area",action:"Search Button",label:$("#txtFindArea input#address_field").val()})});$("#mapBase #baseCombo").change(function(event){$.ga.trackEvent({category:"Base Map",action:"Change",label:$("#mapBase #baseCombo option:selected").text()})});$(".header-bar .header-bar img.icon").gaTrackEvent({category:"Nav Bar",action:"click",useLabel:true,labelAttribute:"title",useEvent:true,event:"click"});$("#mapToolsDialog label[for^='chk']").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#mapToolsDialog input").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("#layerPickerDialog label[for^='chk']").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#layerPickerDialog input").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("h3.ui-accordion-header").gaTrackEvent({category:"Base Layer",action:"Toggle Accordion",useLabel:true,label:function(){return $(this).text()},useEvent:true,event:"click"});$("#marker-dialog .marker-button-wrapper .marker-button-download").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Download Points"})});$("#marker-dialog .marker-button-wrapper .marker-button-clear").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Clear Points"})});$("#marker-dialog .marker-point-label .marker-point-coords-label").focusout(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Notes",label:$(this).val()})});$("img[src$='slider.png']").mouseup(function(event){$.ga.trackEvent({category:"OpenLayers Buttons",action:"Slide",label:"Zoom Slider"})});$(".olButton").click(function(event){var eleId=$(this).attr("id");switch(true){case eleId.indexOf("ZoombarOpenLayers_Map")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Bar"});break;case eleId.indexOf("panleft")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan Left"});break;case eleId.indexOf("panright")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan right"});break;case eleId.indexOf("panup")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan up"});break;case eleId.indexOf("pandown")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan down"});break;case eleId.indexOf("zoomin")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom in"});break;case eleId.indexOf("zoomout")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Out"});break;default:}})}}}module.exports=ga_events},{}],49:[function(require,module,exports){module.exports=function($){function setMaskByLayer(toggle,parentLayer){var Layer=require("./layer.js")($,this);var app=this;var maskLayer,maskName,cleanMaskName;var m,ml,mld;if(toggle){for(m=0;m0;i--){var currLayer=app.map.layers[i];for(var j=0;j0||sublist.break?"":" empty";var collapsibleClass=sublist.collapsible?" collapsible":"";var collapseHeaderIcon=sublist.collapsible?'':"";var sublistObj={heading:sublist.label,items:[],collapsible:sublist.collapsible,contentElement:$('
'+'
'+collapseHeaderIcon+"

"+sublist.label+"

"+"
"+"
")};if(sublist.description){var sublistInfoButton=new MoreInfoButton(sublist);sublistObj.contentElement.children(".sublist-header").append(sublistInfoButton.element)}g.sublists.push(sublistObj);sublistItems.push(sublistObj.contentElement);var sublistLayerItems=[];for(var k=0,l=sublist.layers.length;k=0){name=this.substring(0,i);value=this.substring(i+1)}else{name=this;value=undefined}vars[name]=value});info.themeName=vars.theme;info.accordionGroupGid=vars.accgp;info.baseLayerName=vars.basemap;if(vars.extent){var extentCoords=vars.extent.split(",");info.extent={left:extentCoords[0],bottom:extentCoords[1],right:extentCoords[2],top:extentCoords[3]}}if(vars.layers){$.each(vars.layers.split(","),function(){info.layerLids.push(this)})}if(vars.mask){$.each(vars.mask.split(","),function(){info.layerMask.push(this)})}if(vars.modifiers){$.each(vars.modifiers.split(","),function(){info.maskModifiers.push(this)})}if(vars.alphas){$.each(vars.alphas.split(","),function(){info.layerAlphas.push(this)})}if(info.themeName&&info.baseLayerName){return info}return undefined};ShareUrlInfo.prototype.urlArgs=function(){return Mustache.render(""+"theme={{{theme}}}"+"&layers={{{layers}}}"+"&mask={{{mask}}}"+"{{{modifiers}}}"+"&alphas={{{alphas}}}"+"&accgp={{{accgp}}}"+"&basemap={{{basemap}}}"+"&extent={{{extent.left}}},{{{extent.bottom}}},{{{extent.right}}},{{{extent.top}}}",{theme:this.themeName,layers:this.layerLids.join(","),mask:this.layerMask.join(","),modifiers:this.maskModifiers.length>0?"&modifiers="+this.maskModifiers.join(","):"",alphas:this.layerAlphas.join(","),accgp:this.accordionGroupGid,basemap:this.baseLayerName,extent:this.extent})};module.exports=ShareUrlInfo},{}],53:[function(require,module,exports){module.exports=function($){var stringContainsChar=require("./stringContainsChar.js");var ShareUrlInfo=require("./share.js");function shareUrl(){if(!this.currentTheme){return undefined}if(!this.currentAccordionGroup){return undefined}if(!this.currentBaseLayer){return undefined}var extent=this.map.getExtent(),layerLids=[],layerAlphas=[],layerMask=[],url;if(!extent){return undefined}$.each(this.map.layers,function(){var op,lid,test;if(!this.isBaseLayer){if(this.opacity===1){op="1"}else if(this.opacity===0){op="0"}else{op=sprintf("%.2f",this.opacity)}if(stringContainsChar(this.name,"MaskFor")){lid=this.seldonLayer.lid;test=lid.substring(lid.indexOf("MaskFor"),lid.length).replace("MaskFor","");if(layerMask.indexOf(test)===-1){layerMask.push(test)}test=this.name.substring(0,this.name.indexOf("MaskFor"));if(layerLids.indexOf(test)===-1){layerLids.push(test);layerAlphas.push(op)}}else{if(this.seldonLayer){layerLids.push(this.seldonLayer.lid);layerAlphas.push(op)}}}});if(this.hasOwnProperty("maskModifiers")){var modifiers=this.maskModifiers.filter(function(val){return val!==""})}url=window.location.toString();url=url.replace(/\?.*$/,"");url=url.replace(/\/$/,"");url=url.replace("#","");return url+"?"+new ShareUrlInfo({themeName:this.currentTheme.name,layerLids:layerLids,layerMask:layerMask,maskModifiers:modifiers,layerAlphas:layerAlphas,accordionGroupGid:this.currentAccordionGroup.gid,baseLayerName:this.currentBaseLayer.name,extent:extent}).urlArgs()}return shareUrl}},{"./share.js":52,"./stringContainsChar.js":55}],54:[function(require,module,exports){module.exports=function($){function createSplashScreen(){var $document=$(document),windowWidth=Math.round($document.width()/2);$("#splashScreenContent").load("splashScreen.html");$("#splashScreenContainer").dialog({autoOpen:false,zIndex:10051,maxHeight:$document.height(),width:windowWidth,minWidth:300,dialogClass:"splashScreenStyle",hide:"explode"})}return createSplashScreen}},{}],55:[function(require,module,exports){function stringContainsChar(string,c){return string.indexOf(c)>=0}module.exports=stringContainsChar},{}],56:[function(require,module,exports){function Theme(settings){this.accordionGroups=[];if(!settings){return}this.name=settings.name;this.label=settings.label;this.index=settings.index;this.zoom=settings.zoom;this.xmin=settings.xmin;this.ymin=settings.ymin;this.xmax=settings.xmax;this.ymax=settings.ymax;this.getAccordionGroupIndex=function(accordionGroup){var i;for(i=0;i"+'

'+el.description+"

"+"";$(dialogDiv).dialog({title:el.label||el.name,dialogClass:"tooltip-dialog "+dialogClass})}}}return MoreInfoButton}},{}],7:[function(require,module,exports){module.exports=function($){function addAccordionSection(accordionGroup,title){var sectionObj={title:title,titleElement:$("

"+title+"

"),contentElement:$("
"),sublists:[]};var $accordionGroup=$(accordionGroup);$accordionGroup.data("listAccordion").sections.push(sectionObj);$accordionGroup.append(sectionObj.titleElement).append(sectionObj.contentElement);$accordionGroup.accordion("refresh");return sectionObj}return addAccordionSection}},{}],8:[function(require,module,exports){module.exports=function($){function addAccordionSublists(g,items){$(g.contentElement).append(items)}return addAccordionSublists}},{}],9:[function(require,module,exports){module.exports=function($){function addAccordionSublistItems(s,items,theme,accGp){var collapsed=s.collapsible?"collapsed ":"";var contents=$('
');for(var i=0,l=items.length;i').append(items[i]))}var layer={name:name,contentElement:contents};s.items.push(layer);s.contentElement.append(layer.contentElement)}return addAccordionSublistItems}},{}],10:[function(require,module,exports){module.exports=function($){function addMaskToLegend(layer){var app=this;var maskName=layer.lid.substring(layer.lid.indexOf("MaskFor"),layer.lid.length);$("#lgd"+maskName).remove();layer.$legendItem=$(document.createElement("div")).attr("id","lgd"+maskName).prepend($(document.createElement("img")).attr("src",layer.legend)).prependTo($("#legend")).click(function(){app.setMaskByMask(false,maskName)})}return addMaskToLegend}},{}],11:[function(require,module,exports){module.exports=function($){var EventEmitter=window.EventEmitter;function App(){EventEmitter.call(this);this.map=undefined;this.tileManager=undefined;this.projection=undefined;this.gisServerType=undefined;this.useProxyScript=undefined;this.scalebar=undefined;this.zoomInTool=undefined;this.zoomOutTool=undefined;this.dragPanTool=undefined;this.id_markerLayer=undefined;this.maxExtent={left:-15e6,bottom:2e6,right:-6e6,top:7e6};this.baseLayers=[];this.accordionGroups=[];this.themes=[];this.maskParentLayers=[];this.masks=[];this.maskModifiers=[];this.defaultMasks=["MaskForForest"];this.radioButtonList=[];this.radioButtonLayers=[];this.dropdownBoxList=[];this.dropdownBoxLayers=[];this.currentBaseLayer=undefined;this.currentAccordionGroup=undefined;this.currentTheme=undefined;this.identifyTool=undefined;this.multigraphTool=undefined;this.markerTool=undefined;this.savedExtents=[];this.currentSavedExtentIndex=-1;this.saveCurrentExtent=require("./extent_save.js");this.zoomToExtent=require("./extent_zoom.js");this.zoomToPreviousExtent=require("./extent_zoom_previous.js");this.zoomToNextExtent=require("./extent_zoom_next.js");this.printSavedExtents=require("./extent_print.js");this.setBaseLayer=require("./set_base_layer.js")($);this.setAccordionGroup=require("./accordion_group_set.js");this.clearAccordionSections=require("./accordion_clear.js")($);this.addAccordionSection=require("./accordion_section_add.js")($);this.addAccordionSublists=require("./accordion_sublist_add.js")($);this.addAccordionSublistItems=require("./accordion_sublist_item_add.js")($);this.setTheme=require("./set_theme.js")($);this.shareUrl=require("./share_url.js")($);this.updateShareMapUrl=require("./update_share_url.js")($);this.launch=require("./launch.js")($);this.count=require("./count.js");this.addMaskToLegend=require("./add_mask_legend.js")($);this.setMaskByMask=require("./set_mask_by_mask.js")($);this.setMaskByLayer=require("./set_mask_by_layer.js")($);this.handleMaskModifier=require("./mask_modifier.js");this.handleMaskModifierGroup=require("./mask_modifier_group.js")($);this.parseConfig=require("./parse_config.js")($);this.initOpenLayers=require("./init_openlayers.js");this.setupCollapsibleSublists=require("./accordion_collapsible_sublist_setup.js")($);this.removeMaskFromLegend=function(layer){};OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.IMAGE_RELOAD_ATTEMPTS=3}EventEmitter.declare(App);return App}},{"./accordion_clear.js":1,"./accordion_collapsible_sublist_setup.js":2,"./accordion_group_set.js":4,"./accordion_section_add.js":7,"./accordion_sublist_add.js":8,"./accordion_sublist_item_add.js":9,"./add_mask_legend.js":10,"./count.js":15,"./extent_print.js":18,"./extent_save.js":19,"./extent_zoom.js":20,"./extent_zoom_next.js":21,"./extent_zoom_previous.js":22,"./init_openlayers.js":26,"./launch.js":27,"./mask_modifier.js":38,"./mask_modifier_group.js":39,"./parse_config.js":42,"./set_base_layer.js":47,"./set_mask_by_layer.js":49,"./set_mask_by_mask.js":50,"./set_theme.js":51,"./share_url.js":53,"./update_share_url.js":57}],12:[function(require,module,exports){function arrayContainsElement(array,element){var i;if(array===undefined){return false}for(i=0;iparam").each(function(i,param){var $param=$(param);if(param.hasAttribute("value")){obj[$param.attr("name")]=$param.attr("value")}else{obj[$param.attr("name")]=createArcGIS93RestParams($param)}});return obj}return createArcGIS93RestParams}},{}],17:[function(require,module,exports){module.exports=function(app,activeBtn){function deactivateActiveOpenLayersControls(){var controls,i;for(i=0;i=0;--i){e=this.savedExtents[i];html+=Mustache.render("{{{marker}}}{{{number}}}"+"left:{{{left}}}, bottom:{{{bottom}}}, right:{{{right}}}, top:{{{top}}}",{marker:i===this.currentSavedExtentIndex?"==>":"",number:i,left:e.left,bottom:e.bottom,right:e.right,top:e.top})}html+="";return html}module.exports=printSavedExtents},{}],19:[function(require,module,exports){var extentsAreEqual=require("./extents_equal.js");function saveCurrentExtent(){var newExtent=formatExtent(this.map.getExtent()),newSavedExtents=[],currentSavedExtent,i;if(this.currentSavedExtentIndex>=0){currentSavedExtent=this.savedExtents[this.currentSavedExtentIndex];if(extentsAreEqual(currentSavedExtent,newExtent)){return}}for(i=0;i<=this.currentSavedExtentIndex;++i){newSavedExtents.push(this.savedExtents[i])}this.savedExtents=newSavedExtents;this.savedExtents.push(newExtent);++this.currentSavedExtentIndex}function formatExtent(extent){return{left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top}}module.exports=saveCurrentExtent},{"./extents_equal.js":23}],20:[function(require,module,exports){function zoomToExtent(extent,save){if(save===undefined){save=true}var bounds=new OpenLayers.Bounds(extent.left,extent.bottom,extent.right,extent.top);this.map.zoomToExtent(bounds,true);if(save){this.saveCurrentExtent()}}module.exports=zoomToExtent},{}],21:[function(require,module,exports){function zoomToNextExtent(){if(this.currentSavedExtentIndex0){--this.currentSavedExtentIndex;this.zoomToExtent(this.savedExtents[this.currentSavedExtentIndex],false)}}module.exports=zoomToPreviousExtent},{}],23:[function(require,module,exports){function extentsAreEqual(e1,e2){var tolerance=.001;return Math.abs(e1.left-e2.left)<=tolerance&&Math.abs(e1.bottom-e2.bottom)<=tolerance&&Math.abs(e1.right-e2.right)<=tolerance&&Math.abs(e1.top-e2.top)<=tolerance}module.exports=extentsAreEqual},{}],24:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js"),stringContainsChar=require("./stringContainsChar.js");var getLegendStringFromPixelValue=require("./legend_config.js")($,app);function createIdentifyTool(){return new ClickTool(function(e){$("#identify_popup").remove();if(app.id_markerLayer){app.map.removeLayer(app.id_markerLayer)}var coords=app.map.getLonLatFromPixel(e.xy);var styleMap=new OpenLayers.StyleMap({pointRadius:4,fillColor:"yellow",fillOpacity:.75});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));app.id_markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:styleMap});app.id_markerLayer.addFeatures(feature);app.map.addLayer(app.id_markerLayer);var services=[],service,urlsrs;var layersAdded=[];var html='';$.each(app.map.layers,function(){var name,label;if(!this.isBaseLayer&&this.params&&(!("seldonLayer"in this)||String(this.seldonLayer.identify)!=="false")){name=this.params.LAYERS;if(String(name).match(/^\d+$/)){label=this.name}else{label=String(name).indexOf("MaskFor")!==-1?name.substring(0,name.indexOf("MaskFor")):name}if(layersAdded.indexOf(label)!==-1)return;layersAdded.push(label);services.push({url:this.url,srs:this.projection.projCode,name:name,label:label,proxyServerType:this.seldonLayer.proxyServerType});html=html+Mustache.render(""+''+''+''+"",{label:label})}});html=html+"
{{label}}:
";if(services.length===0){return}var popup=$(document.createElement("div"));popup.attr("id","identify_popup");popup.html(html);popup.dialog({width:600,height:300,resizable:true,title:"Identify Results",close:function(event,ui){app.map.removeLayer(app.id_markerLayer);app.id_markerLayer=undefined;$(this).remove()}});var i,l;for(i=0,l=services.length;i'+''+valueLabel.replace("_0","")+":  "+""+tableRow+""+""}$(newTableContents).insertAfter($group);if(!newTableContents)$group.find(".layer-results").text("N/A")},error:function(jqXHR,textStatus,errorThrown){}})}function createWMSGetFeatureInfoRequestURL(serviceUrl,layer,srs,x,y){var extent=app.map.getExtent();if(seldon.gisServerType==="ArcGIS"){extent=extent.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection(seldon.projection))}return Mustache.render(""+serviceUrl+"{{{c}}}LAYERS={{layer}}"+"&QUERY_LAYERS={{layer}}"+"&STYLES=,"+"&SERVICE=WMS"+"&VERSION=1.1.1"+"&REQUEST=GetFeatureInfo"+"&BBOX={{left}},{{bottom}},{{right}},{{top}}"+"&FEATURE_COUNT=100"+"&HEIGHT={{height}}"+"&WIDTH={{width}}"+"&FORMAT=image/png"+"&INFO_FORMAT=application/vnd.ogc.gml"+"&SRS={{srs}}"+"&X={{x}}"+"&Y={{y}}",{c:stringContainsChar(serviceUrl,"?")?"&":"?",layer:layer,height:app.map.size.h,width:app.map.size.w,left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top,srs:srs,x:x,y:y})}function getLayerResultsFromArcXML($xml,layerName,layerIDCount){var dataVals=[];try{var fields=$xml.find("FIELDS"),attributes=fields[layerIDCount].attributes,i;for(i=0;i=0||stringStartsWith(layerName,"EFETAC-NASA")||stringStartsWith(layerName,"RSAC-FHTET"))&&children[i].nodeName==="value_0"){value=value+sprintf(" (%.2f %%)",(parseFloat(value,10)-127)/128*100)}if((stringStartsWith(layerName.toUpperCase(),"NDMI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"NDVI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SWIR-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDVI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDMI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-SWIR-CURRENT"))&&children[i].nodeName==="value_0"){value=sprintf("%.0f %%",parseFloat(value,10)-128)}returnVals[i]=[children[i].nodeName,value]}}return returnVals}function stringStartsWith(string,prefix){return string.substring(0,prefix.length)===prefix}return createIdentifyTool}},{"./clicktool.js":14,"./legend_config.js":35,"./stringContainsChar.js":55}],25:[function(require,module,exports){module.exports=function(app){var ShareUrlInfo=require("./share.js");function init(config,projection,legendLookup,gisServerType,useProxyScript){var shareUrlInfo=ShareUrlInfo.parseUrl(window.location.toString());app.projection=projection;seldon.projection=projection;app.legendLookup=legendLookup;seldon.gisServerType=gisServerType;seldon.useProxyScript=useProxyScript;app.launch(config,shareUrlInfo);seldon.app=app}return init}},{"./share.js":52}],26:[function(require,module,exports){function initOpenLayers(baseLayerInfo,baseLayer,theme,themeOptions,initialExtent){var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets",{numZoomLevels:20})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings)}else if(baseLayer.type=="ArcGISCache"){var layer=new OpenLayers.Layer.ArcGISCache("AGSCache",baseLayer.url,{layerInfo:baseLayerInfo})}var maxExtentBounds;if(theme.xmax&&theme.xmin&&theme.ymax&&theme.ymin){maxExtentBounds=new OpenLayers.Bounds(theme.xmin,theme.ymin,theme.xmax,theme.ymax)}else{maxExtentBounds=new OpenLayers.Bounds(app.maxExtent.left,app.maxExtent.bottom,app.maxExtent.right,app.maxExtent.top)}if(initialExtent===undefined){initialExtent=app.maxExtent}app.tileManager=new OpenLayers.TileManager({cacheSize:12,moveDelay:750,zoomDelay:750});app.map=new OpenLayers.Map("map",{units:"m",tileManager:app.tileManager,controls:[new OpenLayers.Control.Navigation,new OpenLayers.Control.Attribution,app.zoomInTool,app.zoomOutTool,app.identifyTool,app.multigraphTool,app.markerTool],eventListeners:{moveend:function(){app.emit("extentchange")},zoomend:function(){app.emit("extentchange")}},projection:new OpenLayers.Projection(seldon.projection)});app.currentBaseLayer=baseLayer;app.emit("baselayerchange");app.map.addControl(new OpenLayers.Control.ScaleLine({bottomOutUnits:"mi"}));app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.setTheme(theme,themeOptions);app.zoomToExtent(initialExtent);app.saveCurrentExtent();app.map.events.register("mousemove",app.map,function(e){var pixel=app.map.events.getMousePosition(e);var lonlat=app.map.getLonLatFromPixel(pixel);lonlat=lonlat.transform(new OpenLayers.Projection("EPSG:3857"),new OpenLayers.Projection("EPSG:4326"));OpenLayers.Util.getElement("latLonTracker").innerHTML="Lat: "+sprintf("%.5f",lonlat.lat)+" Lon: "+sprintf("%.5f",lonlat.lon)+""});app.map.addControl(new OpenLayers.Control.PanZoomBar)}module.exports=initOpenLayers},{}],27:[function(require,module,exports){module.exports=function($){var createSplashScreen=require("./splash.js")($);var handle_search=require("./search.js")($);var ga_events=require("./set_google_analytics_events.js");var areasList=[];var activeBtn=[];function launch(configFile,shareUrlInfo){var deactivateActiveOpenLayersControls=require("./deactivate_controls.js")(this,activeBtn);var printMap=require("./print.js")($,this);var app=this;app.initialThemeLoad=true;var $configXML;$.ajax({url:configFile,dataType:"xml",success:function(configXML){$configXML=app.parseConfig(configXML,shareUrlInfo);ga_events($)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}});$("#btnTglLyrPick").click(function(){var $layerPickerDialog=$("#layerPickerDialog");if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close")}else{$layerPickerDialog.dialog("open")}});$("#layerPickerDialog").dialog({zIndex:10050,position:{my:"left top",at:"left+5 top+100"},autoOpen:true,hide:"fade",width:330});app.addListener("accordiongroupchange",function(){if(app.currentTheme){$("#layerPickerAccordion").accordion({active:app.currentTheme.getAccordionGroupIndex(app.currentAccordionGroup),collapsible:true,beforeActivate:function(event,ui){if(!app.initialThemeLoad){$("#layerPickerDialog").scrollTop(0)}},activate:function(event,ui){app.setupCollapsibleSublists(ui);if(app.initialThemeLoad){app.initialThemeLoad=false;$("#layerPickerDialog").scrollTop(755)}}})}});$("#btnTglMapTools").click(function(){var $mapToolsDialog=$("#mapToolsDialog");if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close")}else{$mapToolsDialog.dialog("open")}});$("#mapToolsDialog").dialog({zIndex:10050,position:{my:"right top",at:"right-5 top+100"},autoOpen:true,hide:"fade"});app.addListener("themechange",function(){app.updateShareMapUrl()});app.addListener("baselayerchange",function(){app.updateShareMapUrl()});app.addListener("accordiongroupchange",function(){app.updateShareMapUrl()});app.addListener("extentchange",function(){app.saveCurrentExtent();app.updateShareMapUrl()});var $mapToolsAccordion=$("#mapToolsAccordion"),accordionGroupIndexToOpen=0;$mapToolsAccordion.accordion({heightStyle:"content",collapsible:true});$mapToolsAccordion.find("div").each(function(i){if(this.id==="legend"){accordionGroupIndexToOpen=i;return false}return true});$mapToolsAccordion.accordion("option","active",accordionGroupIndexToOpen);$("#baseCombo").change(function(){var i=parseInt($(this).val(),10);app.setBaseLayer(app.baseLayers[i])});app.addListener("baselayerchange",function(){$("#baseCombo").val(app.currentBaseLayer.index)});$("#themeCombo").change(function(){var i=parseInt($(this).val(),10);app.setTheme(app.themes[i])});app.addListener("themechange",function(){$("#themeCombo").val(app.currentTheme.index)});$("#btnPan").click(function(){deactivateActiveOpenLayersControls();app.dragPanTool.activate()});$("#btnPrint").click(function(){if($configXML!==undefined){printMap($configXML)}else{console.log("Can't print yet; config file not yet parsed")}});$("#btnZoomIn").click(function(){deactivateActiveOpenLayersControls();app.zoomInTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomOut").click(function(){deactivateActiveOpenLayersControls();app.zoomOutTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomExtent").click(function(){app.zoomToExtent(app.maxExtent)});$("#btnID").click(function(){deactivateActiveOpenLayersControls();app.identifyTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnAbout").click(function(){var splashScreen=$("#splashScreenContainer");if(splashScreen.dialog("isOpen")){splashScreen.dialog("close")}else{splashScreen.dialog("open")}});$("#btnPrev").click(function(){app.zoomToPreviousExtent()});$("#btnNext").click(function(){app.zoomToNextExtent()});$("#btnMultiGraph").click(function(){deactivateActiveOpenLayersControls();app.multigraphTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnMarker").click(function(){deactivateActiveOpenLayersControls();app.markerTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});createSplashScreen();var $findArea=$("#findArea");$findArea.findArea();areasList=$findArea.findArea("getAreasList");$findArea.autocomplete({source:areasList});$findArea.keypress(function(e){if(e.which==13){var areaExtent=$findArea.findArea("getAreaExtent",$findArea.val(),areasList);app.zoomToExtent(areaExtent)}});$("#address_lookup").on("click",function(){var location=$("#address_field").val();handle_search(location,app)});$("#address_field").on("keypress",function(e){if(e.which===13){var location=$(this).val();handle_search(location,app)}});$(".mask-toggle").on("click",function(){if($(this).is(":checked")){app.setMaskByMask(true,this.value)}else{app.setMaskByMask(false,this.value)}});$("[data-mask-grouper='true']").on("change",function(){var disabled=$(this).is(":checked")?true:false;$("[data-mask-parent='"+this.value+"']").attr("disabled",disabled)});$(".mask-modifier").on("change",function(){var value=$(this).is(":checked")?this.value:"";var index=$(this).data("index");if($(this).data("maskGrouper")===true){app.handleMaskModifierGroup(this.value,$(this).is(":checked"))}app.handleMaskModifier(value,index)});$("textarea").focus(function(){var $this=$(this);$this.select();window.setTimeout(function(){$this.select()},1);function mouseUpHandler(){$this.off("mouseup",mouseUpHandler);return false}$this.mouseup(mouseUpHandler)});if($(window).width()<650){$("#mapToolsDialog").dialog("close");$("#layerPickerDialog").dialog("close")}if(window.addEventListener){window.addEventListener("orientationchange",function(){var $mapToolsDialog=$("#mapToolsDialog"),$layerPickerDialog=$("#layerPickerDialog");window.scroll(0,0);if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close").dialog("open")}if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close").dialog("open")}},false)}}return launch}},{"./deactivate_controls.js":17,"./print.js":43,"./search.js":45,"./set_google_analytics_events.js":48,"./splash.js":54}],28:[function(require,module,exports){module.exports=function($,app){var stringContainsChar=require("./stringContainsChar.js");function Layer(settings){EventEmitter.call(this);if(!settings){return}$.extend(true,this,settings);this.transparency=0;if(this.index==undefined){this.index=0}if(this.type==undefined){this.type="WMS"}this.createOpenLayersLayer=function(){if(this.openLayersLayer!==undefined){return this.openLayersLayer}var options={isBaseLayer:false,transitionEffect:"resize",buffer:0,tileSize:new OpenLayers.Size(2048,2048)};if(this.type==="WMTS"){var settings={name:this.name,url:this.url,layer:this.layers,style:this.style,matrixSet:this.srs,isBaseLayer:false,transitionEffect:"resize",format:"image/jpg",sphericalMercator:true};if(this.lid.indexOf("GLAM")>-1){$.extend(true,settings,{serverResolutions:[156543.033928041,78271.5169640205,39135.7584820102,19567.8792410051,9783.9396205026,4891.9698102513,2445.9849051256,1222.9924525628,611.4962262814,305.7481131407048],units:"m",tileOrigin:new OpenLayers.LonLat(-20037508.34,20037508.34)})}this.openLayersLayer=new OpenLayers.Layer.WMTS(settings)}else if(this.type==="XYZ"){this.openLayersLayer=new OpenLayers.Layer.XYZ(this.name,this.url,{isBaseLayer:false,projection:new OpenLayers.Projection(seldon.projection)})}else if(this.type==="ArcGIS93Rest"){this.openLayersLayer=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params.mosaicRule?$.extend(true,{},this.params,{mosaicRule:JSON.stringify(this.params.mosaicRule)}):this.params,options)}else{if(this.maxResolution){options.maxResolution=parseFloat(this.maxResolution)}var layer=this.layers+("mask"in this?app.maskModifiers.join(""):"");this.openLayersLayer=new OpenLayers.Layer.WMS(this.name,this.url,{projection:new OpenLayers.Projection(seldon.projection),units:"m",layers:layer,transparent:true},options)}var loadingimage=$('');$("#map").append(loadingimage);this.openLayersLayer.loadingimage=loadingimage;this.openLayersLayer.events.register("loadstart",this.openLayersLayer,function(){this.loadingimage.addClass("loading")});this.openLayersLayer.events.register("loadend",this.openLayersLayer,function(){this.loadingimage.removeClass("loading")});this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);this.openLayersLayer.seldonLayer=this;return this.openLayersLayer};this.activate=function(options){options=options||{};this.addToLegend();this.emit("activate");if(this.mask==="true"&&this.lid.indexOf("MaskFor")===-1){if(app.masks.length>0){app.setMaskByLayer(true,this)}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}var inMaskParentLayers=app.maskParentLayers.filter(function(layer){return this===layer},this).length;if(!inMaskParentLayers){app.maskParentLayers.push(this)}}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}vectorServices=["vlayers","fire","ads"];boundaryServices=["boundaries"];allVectorServices=vectorServices;Array.prototype.push.apply(allVectorServices,boundaryServices);var isVectorLayer=function(layer,serviceNames){return serviceNames.filter(function(serviceName){return layer.url&&layer.url.indexOf(serviceName+"?")>-1}).length};if(app.map.getNumLayers()>1){var lyrJustAdded=app.map.layers[app.map.getNumLayers()-1];if(!isVectorLayer(lyrJustAdded,allVectorServices)){for(var i=app.map.getNumLayers()-2;i>0;i--){var nextLayerDown=app.map.layers[i];if(!isVectorLayer(nextLayerDown,allVectorServices)){if(nextLayerDown.seldonLayer.index0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,vectorServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}for(var i=app.map.getNumLayers()-1;i>0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,boundaryServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}}app.updateShareMapUrl();app.map.updateSize()};this.deactivate=function(options){options=options||{};if(this.visible==="true"){app.map.removeLayer(this.openLayersLayer);this.visible="false"}if(!this.parentLayer){app.setMaskByLayer(false,this)}if(options.removeFromLegend){this.removeFromLegend()}if(options.removeFromParentMaskLayers){app.maskParentLayers=app.maskParentLayers.filter(function(layer){return layer.lid!==this.lid},this)}if(this.openLayersLayer&&this.openLayersLayer.loadingimage){this.openLayersLayer.loadingimage.removeClass("loading")}this.emit("deactivate")};this.addToLegend=function(){var that=this;var $legend=$("#legend");var lid=this.parentLayer?this.parentLayer.lid:this.lid;$(document.getElementById("lgd"+lid)).remove();this.$legendItem=$(document.createElement("div")).attr("id","lgd"+lid).prepend($(document.createElement("img")).attr("src",this.legend)).click(function(){that.deactivate();if(that.parentLayer){that.parentLayer.deactivate({removeFromParentMaskLayers:true})}that.removeFromLegend()});if(this.url.indexOf("vlayers")>-1){this.$legendItem.prependTo($legend)}else{this.$legendItem.appendTo($legend)}};this.removeFromLegend=function(){if(this.$legendItem)this.$legendItem.remove()};this.setTransparency=function(transparency){if(this.openLayersLayer){ +this.openLayersLayer.setOpacity(1-parseFloat(transparency)/100)}this.transparency=transparency;try{this.emit({type:"transparency",value:this.transparency})}catch(err){var test=this.transparency;var errTxt=err.Message}if(app.map!==undefined){var currentLayer,openLayersLayer,lid;var i;for(i=app.map.getNumLayers()-2;i>0;i--){currentLayer=app.map.layers[i];openLayersLayer=currentLayer.seldonLayer.openLayersLayer;lid=currentLayer.seldonLayer.lid;if(stringContainsChar(currentLayer.name,"Mask")){if(openLayersLayer&&lid.substring(0,lid.indexOf("MaskFor"))===this.lid){openLayersLayer.setOpacity(1-parseFloat(transparency)/100);currentLayer.seldonLayer.transparency=transparency}}}}}}window.EventEmitter.declare(Layer);return Layer}},{"./stringContainsChar.js":55}],29:[function(require,module,exports){module.exports=function($){function createLayerToggleCheckbox(layer){var checkbox=document.createElement("input"),$checkbox;checkbox.type="checkbox";checkbox.id="chk"+layer.lid;checkbox.onclick=function(){if($(this).is(":checked")){layer.activate()}else{layer.deactivate({removeFromLegend:true,removeFromParentMaskLayers:true})}};$checkbox=$(checkbox);$checkbox.addClass(layer.lid);layer.addListener("activate",function(){$("input."+this.lid).attr("checked",true)});layer.addListener("deactivate",function(){$("input."+this.lid).attr("checked",false)});return checkbox}return createLayerToggleCheckbox}},{}],30:[function(require,module,exports){module.exports=function($){function createLayerPropertiesDialog(layer){var localTransparency=0;var $html=$(""+'
'+""+""+""+""+""+""+"
Transparency:"+'
'+"
"+'%'+"
"+"
");$html.find("input.transparency-text").val(layer.transparency);if(layer.transparency>0){localTransparency=layer.transparency;layer.setTransparency(localTransparency)}$html.find(".transparency-slider").slider({min:0,max:100,step:1,value:localTransparency,slide:function(event,ui){try{layer.setTransparency(ui.value)}catch(err){var errTxt=err.message}}});$html.find("input.transparency-text").change(function(){var $this=$(this),newValueFloat=parseFloat($this.val());if(isNaN(newValueFloat)||newValueFloat<0||newValueFloat>100){$this.val(layer.transparency);return}layer.setTransparency($this.val())});layer.addListener("transparency",function(e){$html.find("input.transparency-text").val(e.value)});$html.dialog({zIndex:10050,position:"left",autoOpen:true,hide:"explode",title:layer.name,width:"auto",close:function(){$(this).dialog("destroy");$html.remove();createLayerPropertiesDialog.$html[layer.lid]=undefined}});createLayerPropertiesDialog.$html[layer.lid]=$html}createLayerPropertiesDialog.$html={};return createLayerPropertiesDialog}},{}],31:[function(require,module,exports){module.exports=function($){var createLayerPropertiesDialog=require("./layer_dialog.js")($);function createLayerPropertiesIcon(layer){var img=document.createElement("img");img.id=layer.lid;img.src="icons/settings.png";img.className="layerPropertiesIcon";img.onclick=function(){createLayerPropertiesDialog(layer)};return img}return createLayerPropertiesIcon}},{"./layer_dialog.js":30}],32:[function(require,module,exports){module.exports=function($,app){var generalRadioHandler=require("./layer_radio_handler.js")($,app);function createLayerToggleRadioButton(layer,radioGroupName){var checkbox=document.createElement("input"),$checkbox;checkbox.type="radio";checkbox.name=radioGroupName;checkbox.id=layer.lid;if(layer.selectedInConfig){checkbox.checked=true}$checkbox=$(checkbox);$checkbox.change(radioHandler);layer.addListener("activate",function(){$checkbox.attr("checked",true)});layer.addListener("deactivate",function(){$checkbox.attr("checked",false)});return checkbox}function radioHandler(){generalRadioHandler(app)}return createLayerToggleRadioButton}},{"./layer_radio_handler.js":33}],33:[function(require,module,exports){module.exports=function($,app){var Layer=require("./layer.js")($,app);function radioHandler(app){var $selectedOption=$(app.dropdownBoxList[0]).find(":selected");if($selectedOption.text()==="select..."){clearRadioLayers(app,null);return}var selectLayer=app.dropdownBoxLayers[$selectedOption.val()];var wanted_lid=getActiveDropdownBoxRadioLID(app);var wanted_layer=undefined;var i;for(i=0;i0;i--){currLayer=app.map.layers[i].seldonLayer;for(j=0;j"+selectBoxLayers[i].name+"")}selectBox.insertAdjacentHTML("afterbegin","");$(selectBox).change(selectHandler);return selectBox}function selectHandler(){radioHandler(app)}return createLayerToggleDropdownBox}},{"./layer_radio_handler.js":33}],35:[function(require,module,exports){module.exports=function($,app){function isLayerInLegendConfig(layerId){return layerId in app.legendLookup}function getLegendStringFromPixelValue(layerId,pixelValue){var legendString="";if(isLayerInLegendConfig(layerId)){legendString=app.legendLookup[layerId][pixelValue];if(!legendString){console.error("No legend string set for pixel value",pixelValue,"for layer",layerId)}}return legendString}return getLegendStringFromPixelValue}},{}],36:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js");var saveAs=require("../libs/FileSaver/FileSaver.js").saveAs;var popupId="marker-dialog";var points=[];var pointStyleDefault={pointRadius:4,fillColor:"blue",fillOpacity:.75};var pointStyleHover={pointRadius:5,fillColor:"orange",fillOpacity:.75};var pointStyle=new OpenLayers.StyleMap(pointStyleDefault);function marker(){return new ClickTool(markerHandler)}function markerHandler(e){var coords=app.map.getLonLatFromPixel(e.xy);var lonlat=app.map.getLonLatFromPixel(e.xy);lonlat.transform(app.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));var markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:pointStyle});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));markerLayer.addFeatures(feature);app.map.addLayer(markerLayer);if(!$("#"+popupId).length){createPopup()}if($(".marker-points").length){createPointItem(lonlat,markerLayer)}points.push({lonlat:lonlat,layer:markerLayer});if(typeof ga!=="undefined"){ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Create New Point",eventLabel:lonlat.lon+", "+lonlat.lat})}}function createPointItem(coords,layer){var itemString="";itemString+='
';itemString+='
';itemString+=' Lat:';itemString+=' '+coords.lat+"";itemString+="
";itemString+='
';itemString+=' Lon:';itemString+=' '+coords.lon+"";itemString+="
";itemString+='
';itemString+=' Notes:';itemString+='
';itemString+="
";itemString+="
";var item=$(itemString);item.data("point",layer);item.on("mouseenter",handlePointHoverEnter).on("mouseleave",handlePointHoverLeave);$(".marker-points").append(item)}function handlePointHoverEnter(e){var point=$(this).data("point");point.style=pointStyleHover;point.redraw()}function handlePointHoverLeave(e){var point=$(this).data("point");point.style=pointStyleDefault;point.redraw()}function createPopup(){var popup=$('
');$("body").append(popup);$(".marker-button-download").click(exportFileHandler);$(".marker-button-clear").click(clearPointsHandler);popup.dialog({width:300,height:400,resizable:false,position:{my:"right top",at:"right-5 top+120"},title:"Mark areas of interest",close:function(event,ui){clearPointsHandler();$(this).remove()}})}function exportFileHandler(){var lat,lon,url,notes;var SEP="|";var i;var csvContent="sep="+SEP+"\n";csvContent+="lat"+SEP+"long"+SEP+"google maps link"+SEP+"notes\n";for(i=0;i=0){direction="N"}else if(type==="lat"&&value<0){direction="S"}else if(type==="lon"&&value>=0){direction="E"}else if(type==="lon"&&value<0){direction="W"}value=Math.abs(value);var degree=Math.floor(value);value=(value-degree)*60;var minute=Math.floor(value);var second=(value-minute)*60;return degree+"%C2%B0"+minute+"'"+second+"%22"+direction}function getNotes(index){if(typeof ga!=="undefined"){var label=$(".marker-point-item").eq(index).find(".marker-point-notes").val();ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Notes",eventLabel:label})}return $(".marker-point-item").eq(index).find(".marker-point-notes").val()}function clearPointsHandler(){var i;for(i=0;i')}else{popup.html('
')}popup.dialog({width:600,resizable:false,position:{my:"center+"+offset+" center+"+offset,at:"center",of:window},title:Mustache.render("MODIS NDVI for Lat: {{{lat}}} Lon: {{{lon}}}",{lat:sprintf("%.4f",lonlat.lat),lon:sprintf("%.4f",lonlat.lon)}),close:function(event,ui){app.map.removeLayer(markerLayer);$(this).remove()}});var seldonMultigraph=$("#seldonMultigraph"+app.graphCount+""),promise=seldonMultigraph.multigraph({mugl:muglPrefix+lonlat.lon+","+lonlat.lat,swf:"libs/seldon/libs/Multigraph.swf"});seldonMultigraph.multigraph("done",function(m){if(m){$(m.div()).parent().children(".multigraphLoader").remove()}})})}return createMultigraphTool}},{"./clicktool.js":14}],41:[function(require,module,exports){module.exports=function($){Array.prototype.remove=function(value){if(this.indexOf(value)!==-1){this.splice(this.indexOf(value),1);return true}else{return false}};OpenLayers.Map.prototype.getCurrentSize=function(){var size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=this.div.offsetWidth;size.h=this.div.offsetHeight}if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=parseInt(this.div.style.width,10);size.h=parseInt(this.div.style.height,10)}size.h=size.h-parseInt($(this.div).css("padding-top"),10)-parseInt($(this.div).css("padding-bottom"),10);return size};$.widget("ui.dialog",$.extend({},$.ui.dialog.prototype,{_moveToTop:function(arg){if(arg){if(arg.handleObj.type!="mousedown"){var moved=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;if(moved&&!silent){this._trigger("focus",event)}return moved}}}}))}},{}],42:[function(require,module,exports){module.exports=function($){var createArcGIS93RestParams=require("./create_arcgis_rest_params.js")($);var AccordionGroup=require("./accordion_group.js");var AccordionGroupSublist=require("./accordion_group_sublist.js");var BaseLayer=require("./baselayer.js");var Theme=require("./theme.js");function parseConfig(configXML,shareUrlInfo){var Layer=require("./layer.js")($,this);var createIdentifyTool=require("./identify.js")($,this);var createMultigraphTool=require("./multigraph.js")($,this);var marker=require("./marker.js")($,this);var app=this,$configXML=$(configXML),initialBaseLayer,initialTheme,shareUrlLayerAlpha={},themeOptions={},i,j,k,l,ll,lll;if(shareUrlInfo!==undefined){for(i=0,l=shareUrlInfo.layerLids.length;i0){app.maxExtent={left:parseFloat($extent.attr("xmin")),bottom:parseFloat($extent.attr("ymin")),right:parseFloat($extent.attr("xmax")),top:parseFloat($extent.attr("ymax"))}}var $baseCombo=$("#baseCombo"),$images=$configXML.find("images image"),$image,selected,baseLayer;for(i=0,l=$images.length;ionline.',mapName:"Layers",info:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including the terms of use, visit us online at http://goto.arcgisonline.com/maps/World_Street_Map",copyrightText:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012",layers:[{id:0,name:"World Street Map",parentLayerId:-1,defaultVisibility:true,subLayerIds:null,minScale:0,maxScale:0}],tables:[],spatialReference:{wkid:102100},singleFusedMapCache:true,tileInfo:{rows:256,cols:256,dpi:96,format:"JPEG",compressionQuality:90,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:0,resolution:156543.033928,scale:591657527.591555},{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176}]},initialExtent:{xmin:-28872328.0888923,ymin:-11237732.4896886,xmax:28872328.0888923,ymax:11237732.4896886,spatialReference:{wkid:102100}},fullExtent:{xmin:-20037507.0671618,ymin:-19971868.8804086,xmax:20037507.0671618,ymax:19971868.8804086,spatialReference:{wkid:102100}},units:"esriMeters",supportedImageFormatTypes:"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI,BMP",documentInfo:{Title:"World Street Map",Author:"Esri",Comments:"",Subject:"streets, highways, major roads, railways, water features, administrative boundaries, cities, parks, protected areas, landmarks ",Category:"transportation(Transportation Networks) ",Keywords:"World, Global, Europe, Japan, Hong Kong, North America, United States, Canada, Mexico, Southern Africa, Asia, South America, Australia, New Zealand, India, Argentina, Brazil, Chile, Venezuela, Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, Switzerland, Russia, Thailand, Turkey, 2012",Credits:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"},capabilities:"Map"};app.initOpenLayers(baseLayerInfo,initialBaseLayer,initialTheme,themeOptions,initialExtent);return $configXML}function displayError(message){}return parseConfig}},{"./accordion_group.js":3,"./accordion_group_sublist.js":5,"./baselayer.js":13,"./create_arcgis_rest_params.js":16,"./identify.js":24,"./layer.js":28,"./marker.js":36,"./multigraph.js":40,"./theme.js":56}],43:[function(require,module,exports){module.exports=function($,app){function printMap($configXML){var offsetX=parseInt(app.map.layerContainerDiv.style.left,10);var offsetY=parseInt(app.map.layerContainerDiv.style.top,10);var size=app.map.getSize();var tiles=[];var layer,tile,position;var i,j,k;for(i=0;i
');printPopup.dialog({resizable:false,height:75,title:"Creating Image for Print...",close:function(event,ui){$(this).remove()}});var service_url=$configXML.find("tools tool[name=Print]").attr("service_url");if(!service_url){service_url="http://"+window.location.hostname+window.location.pathname}service_url=service_url.replace(/\/$/,"");var service_name=$configXML.find("tools tool[name=Print]").attr("service_name");if(!service_name){service_name="cgi-bin/print.cgi"}var title=$configXML.find("tools tool[name=Print]").attr("title");if(!title){title="U.S Forest Change Assessment Viewer"}$.ajax({url:service_url+"/"+service_name,type:"POST",data:OpenLayers.Util.getParameterString({ +width:size.w,height:size.h,tiles:tiles_json,legends:legends_json,title:title}),headers:{"Content-Type":"application/x-www-form-urlencoded"},success:function(data,status,jqxhr){data=data.replace(/\s+/,"");var href=service_url+"/cgi-bin/printed_map.jpg";if(data){href=service_url+"/"+data}$("#printMapLoader").html('
print image result
');printPopup.dialog("option","title","Print Image Created!")},error:function(jqxhr,status,err){$("#printMapLoader").html("
An error happended.
");printPopup.dialog("option","title","NO Print Image Created!")}})}return printMap}},{}],44:[function(require,module,exports){function RepeatingOperation(op,yieldEveryIteration){var count=0;var instance=this;this.step=function(args){if(++count>=yieldEveryIteration){count=0;setTimeout(function(){op(args)},1,[]);return}op(args)}}module.exports=RepeatingOperation},{}],45:[function(require,module,exports){module.exports=function($){function handle_search(location,app){var rest_endpoint="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text="+location+"&f=json";$.getJSON(rest_endpoint,function(data){var locations=data["locations"][0];if(locations===undefined){return}var extent=locations["extent"];var bounds=new OpenLayers.Bounds(extent.xmin,extent.ymin,extent.xmax,extent.ymax).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));app.zoomToExtent(bounds,true)})}return handle_search}},{}],46:[function(require,module,exports){(function($){"use strict";require("./overrides.js")($);var seldon={App:require("./app.js")($)};var app=new seldon.App;seldon.init=require("./init.js")(app);window.seldon=seldon})(jQuery)},{"./app.js":11,"./init.js":25,"./overrides.js":41}],47:[function(require,module,exports){module.exports=function($){function setBaseLayer(baseLayer){var resolutions=[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,.5971642833948135];var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets");handleBaseLayer(app,layer,baseLayer)}else if(baseLayer.type=="ArcGISCache"){$.ajax({url:baseLayer.url+"?f=json&pretty=true",dataType:"jsonp",success:function(layerInfo){var options={layerInfo:layerInfo};if(baseLayer.numZoomLevels){options.numZoomLevels=baseLayer.numZoomLevels;if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);options.serverResolutions=serverResolutions;options.resolutions=resolutions}}var layer=new OpenLayers.Layer.ArcGISCache(baseLayer.name,baseLayer.url,options);handleBaseLayer(app,layer,baseLayer)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet,sphericalMercator:true};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings);handleBaseLayer(app,layer,baseLayer)}}function handleBaseLayer(app,layer,baseLayer){app.map.removeLayer(app.map.layers[0]);app.currentBaseLayer=baseLayer;app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.emit("baselayerchange")}return setBaseLayer}},{}],48:[function(require,module,exports){function ga_events($){var eventAdded=false;try{$.ga.trackEvent;eventAdded=true}catch(err){eventAdded=false}if(typeof ga!=="undefined"){if(eventAdded){seldon.app.map.events.register("moveend",seldon.app.map,function(){var newMapExtent=seldon.app.map.getExtent();$.ga.trackEvent({category:"Map Extent",action:"Change",label:newMapExtent.toString(),nonInteractive:true})});$(".shareMapUrl").click(function(event){$.ga.trackEvent({category:"Share Map URL",action:"Click",label:$(".shareMapUrl").val()})});$("#mapTheme #themeCombo").change(function(event){$.ga.trackEvent({category:"Map Theme",action:"Change",label:$("#mapTheme #themeCombo option:selected").text()})});$("#txtFindArea input#address_field").keyup(function(event){if(event.which===13){$.ga.trackEvent({category:"Find Area",action:"Search Enter",label:$(this).val()})}});$("#txtFindArea #address_lookup img").click(function(event){$.ga.trackEvent({category:"Find Area",action:"Search Button",label:$("#txtFindArea input#address_field").val()})});$("#mapBase #baseCombo").change(function(event){$.ga.trackEvent({category:"Base Map",action:"Change",label:$("#mapBase #baseCombo option:selected").text()})});$(".header-bar .header-bar img.icon").gaTrackEvent({category:"Nav Bar",action:"click",useLabel:true,labelAttribute:"title",useEvent:true,event:"click"});$("#mapToolsDialog label[for^='chk']").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#mapToolsDialog input").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("#layerPickerDialog label[for^='chk']").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#layerPickerDialog input").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("h3.ui-accordion-header").gaTrackEvent({category:"Base Layer",action:"Toggle Accordion",useLabel:true,label:function(){return $(this).text()},useEvent:true,event:"click"});$("#marker-dialog .marker-button-wrapper .marker-button-download").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Download Points"})});$("#marker-dialog .marker-button-wrapper .marker-button-clear").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Clear Points"})});$("#marker-dialog .marker-point-label .marker-point-coords-label").focusout(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Notes",label:$(this).val()})});$("img[src$='slider.png']").mouseup(function(event){$.ga.trackEvent({category:"OpenLayers Buttons",action:"Slide",label:"Zoom Slider"})});$(".olButton").click(function(event){var eleId=$(this).attr("id");switch(true){case eleId.indexOf("ZoombarOpenLayers_Map")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Bar"});break;case eleId.indexOf("panleft")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan Left"});break;case eleId.indexOf("panright")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan right"});break;case eleId.indexOf("panup")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan up"});break;case eleId.indexOf("pandown")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan down"});break;case eleId.indexOf("zoomin")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom in"});break;case eleId.indexOf("zoomout")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Out"});break;default:}})}}}module.exports=ga_events},{}],49:[function(require,module,exports){module.exports=function($){function setMaskByLayer(toggle,parentLayer){var Layer=require("./layer.js")($,this);var app=this;var maskLayer,maskName,cleanMaskName;var m,ml,mld;if(toggle){for(m=0;m0;i--){var currLayer=app.map.layers[i];for(var j=0;j0||sublist.break?"":" empty";var collapsibleClass=sublist.collapsible?" collapsible":"";var collapseHeaderIcon=sublist.collapsible?'':"";var sublistInfo=sublist.info?'
'+sublist.info+"
":"";var sublistObj={heading:sublist.label,items:[],collapsible:sublist.collapsible,contentElement:$('
'+'
'+collapseHeaderIcon+"

"+sublist.label+"

"+sublistInfo+"
"+"
")};if(sublist.description){var sublistInfoButton=new MoreInfoButton(sublist);sublistObj.contentElement.children(".sublist-header").append(sublistInfoButton.element)}g.sublists.push(sublistObj);sublistItems.push(sublistObj.contentElement);var sublistLayerItems=[];for(var k=0,l=sublist.layers.length;k=0){name=this.substring(0,i);value=this.substring(i+1)}else{name=this;value=undefined}vars[name]=value});info.themeName=vars.theme;info.accordionGroupGid=vars.accgp;info.baseLayerName=vars.basemap;if(vars.extent){var extentCoords=vars.extent.split(",");info.extent={left:extentCoords[0],bottom:extentCoords[1],right:extentCoords[2],top:extentCoords[3]}}if(vars.layers){$.each(vars.layers.split(","),function(){info.layerLids.push(this)})}if(vars.mask){$.each(vars.mask.split(","),function(){info.layerMask.push(this)})}if(vars.modifiers){$.each(vars.modifiers.split(","),function(){info.maskModifiers.push(this)})}if(vars.alphas){$.each(vars.alphas.split(","),function(){info.layerAlphas.push(this)})}if(info.themeName&&info.baseLayerName){return info}return undefined};ShareUrlInfo.prototype.urlArgs=function(){return Mustache.render(""+"theme={{{theme}}}"+"&layers={{{layers}}}"+"&mask={{{mask}}}"+"{{{modifiers}}}"+"&alphas={{{alphas}}}"+"&accgp={{{accgp}}}"+"&basemap={{{basemap}}}"+"&extent={{{extent.left}}},{{{extent.bottom}}},{{{extent.right}}},{{{extent.top}}}",{theme:this.themeName,layers:this.layerLids.join(","),mask:this.layerMask.join(","),modifiers:this.maskModifiers.length>0?"&modifiers="+this.maskModifiers.join(","):"",alphas:this.layerAlphas.join(","),accgp:this.accordionGroupGid,basemap:this.baseLayerName,extent:this.extent})};module.exports=ShareUrlInfo},{}],53:[function(require,module,exports){module.exports=function($){var stringContainsChar=require("./stringContainsChar.js");var ShareUrlInfo=require("./share.js");function shareUrl(){if(!this.currentTheme){return undefined}if(!this.currentAccordionGroup){return undefined}if(!this.currentBaseLayer){return undefined}var extent=this.map.getExtent(),layerLids=[],layerAlphas=[],layerMask=[],url;if(!extent){return undefined}$.each(this.map.layers,function(){var op,lid,test;if(!this.isBaseLayer){if(this.opacity===1){op="1"}else if(this.opacity===0){op="0"}else{op=sprintf("%.2f",this.opacity)}if(stringContainsChar(this.name,"MaskFor")){lid=this.seldonLayer.lid;test=lid.substring(lid.indexOf("MaskFor"),lid.length).replace("MaskFor","");if(layerMask.indexOf(test)===-1){layerMask.push(test)}test=this.name.substring(0,this.name.indexOf("MaskFor"));if(layerLids.indexOf(test)===-1){layerLids.push(test);layerAlphas.push(op)}}else{if(this.seldonLayer){layerLids.push(this.seldonLayer.lid);layerAlphas.push(op)}}}});if(this.hasOwnProperty("maskModifiers")){var modifiers=this.maskModifiers.filter(function(val){return val!==""})}url=window.location.toString();url=url.replace(/\?.*$/,"");url=url.replace(/\/$/,"");url=url.replace("#","");return url+"?"+new ShareUrlInfo({themeName:this.currentTheme.name,layerLids:layerLids,layerMask:layerMask,maskModifiers:modifiers,layerAlphas:layerAlphas,accordionGroupGid:this.currentAccordionGroup.gid,baseLayerName:this.currentBaseLayer.name,extent:extent}).urlArgs()}return shareUrl}},{"./share.js":52,"./stringContainsChar.js":55}],54:[function(require,module,exports){module.exports=function($){function createSplashScreen(){var $document=$(document),windowWidth=Math.round($document.width()/2);$("#splashScreenContent").load("splashScreen.html");$("#splashScreenContainer").dialog({autoOpen:false,zIndex:10051,maxHeight:$document.height(),width:windowWidth,minWidth:300,dialogClass:"splashScreenStyle",hide:"explode"})}return createSplashScreen}},{}],55:[function(require,module,exports){function stringContainsChar(string,c){return string.indexOf(c)>=0}module.exports=stringContainsChar},{}],56:[function(require,module,exports){function Theme(settings){this.accordionGroups=[];if(!settings){return}this.name=settings.name;this.label=settings.label;this.index=settings.index;this.zoom=settings.zoom;this.xmin=settings.xmin;this.ymin=settings.ymin;this.xmax=settings.xmax;this.ymax=settings.ymax;this.getAccordionGroupIndex=function(accordionGroup){var i;for(i=0;i' : '' + var sublistInfo = sublist.info ? '
' + sublist.info + '
' : '' var sublistObj = { heading : sublist.label, items : [], @@ -3524,6 +3525,7 @@ module.exports = function ($) { +'
' + collapseHeaderIcon +'

' + sublist.label + '

' + + sublistInfo +'
' +'' ) diff --git a/libs/seldon b/libs/seldon index 024a68a..16e5cf1 160000 --- a/libs/seldon +++ b/libs/seldon @@ -1 +1 @@ -Subproject commit 024a68a17fb6dd68ab679d0a518488c9c63a08a4 +Subproject commit 16e5cf1f364488f8bf8455758d02f2d69dd497f3 From 580eb054c78f506000457ebd30d4b2e68580e9a8 Mon Sep 17 00:00:00 2001 From: Matthew Geiger Date: Tue, 24 Aug 2021 15:38:13 +0000 Subject: [PATCH 6/8] update seldon - run build --- libs/seldon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/seldon b/libs/seldon index 16e5cf1..ea77261 160000 --- a/libs/seldon +++ b/libs/seldon @@ -1 +1 @@ -Subproject commit 16e5cf1f364488f8bf8455758d02f2d69dd497f3 +Subproject commit ea772613b4b8d5a2a10e75b322a9f3279dcbc02a From a1cf77b7d179113f2af580ac4ae297ae78aeb40f Mon Sep 17 00:00:00 2001 From: Matthew Geiger Date: Wed, 8 Sep 2021 15:01:06 +0000 Subject: [PATCH 7/8] Closes #86 --- html/libs/seldon/js/layer.js | 12 ++++----- html/libs/seldon/js/layer_dialog.js | 17 +++++++----- html/libs/seldon/js/parse_config.js | 2 +- html/libs/seldon/js/set_mask_by_layer.js | 3 ++- html/libs/seldon/seldon-min.js | 7 ++--- html/libs/seldon/seldon.js | 34 +++++++++++++----------- libs/seldon | 2 +- 7 files changed, 41 insertions(+), 36 deletions(-) diff --git a/html/libs/seldon/js/layer.js b/html/libs/seldon/js/layer.js index 879dd11..7fbe35a 100644 --- a/html/libs/seldon/js/layer.js +++ b/html/libs/seldon/js/layer.js @@ -5,7 +5,6 @@ module.exports = function ($, app) { EventEmitter.call(this); if (!settings) { return; } $.extend(true, this, settings); // copy all properties from `settings` into `this` - this.transparency = 0; if (this.index == undefined) { this.index = 0; } @@ -142,6 +141,8 @@ module.exports = function ($, app) { app.map.addLayer(this.createOpenLayersLayer()) } + this.setTransparency() + vectorServices = [ 'vlayers', 'fire', 'ads' ] boundaryServices = [ 'boundaries' ] allVectorServices = vectorServices @@ -258,11 +259,10 @@ module.exports = function ($, app) { }; this.setTransparency = function (transparency) { + this.transparency = parseFloat(transparency) || this.transparency || 0 if (this.openLayersLayer) { - this.openLayersLayer.setOpacity(1 - parseFloat(transparency)/100.0); + this.openLayersLayer.setOpacity(1.0 - parseFloat(this.transparency)/100.0); } - this.transparency = transparency; - //Comment this out for now //Essentially emits the following two commands: try { @@ -273,8 +273,6 @@ module.exports = function ($, app) { var errTxt = err.Message; } - // Handle transparency for mask - // Still need to make this parent-layer specific if (app.map !== undefined) { var currentLayer, openLayersLayer, lid; var i; @@ -285,7 +283,7 @@ module.exports = function ($, app) { if (stringContainsChar(currentLayer.name, 'Mask')) { if (openLayersLayer && (lid.substring(0, lid.indexOf("MaskFor")) === this.lid)) { - openLayersLayer.setOpacity(1 - parseFloat(transparency)/100.0); + openLayersLayer.setOpacity(1 - parseFloat(this.transparency)/100.0); currentLayer.seldonLayer.transparency = transparency; } } diff --git a/html/libs/seldon/js/layer_dialog.js b/html/libs/seldon/js/layer_dialog.js index 26bccf3..40e8503 100644 --- a/html/libs/seldon/js/layer_dialog.js +++ b/html/libs/seldon/js/layer_dialog.js @@ -1,5 +1,14 @@ // This function gets called every time the layer properties icon gets clicked module.exports = function ($) { + + function updateTransparency (layer, value) { + try { + layer.setTransparency(value); + } catch (e) { + var errTxt = e.message; + } + } + function createLayerPropertiesDialog (layer) { var localTransparency = 0; var $html = $('' @@ -31,13 +40,7 @@ module.exports = function ($) { step : 1, value : localTransparency, slide : function(event, ui) { - try { - layer.setTransparency(ui.value); - } - catch(err) { - var errTxt = err.message; - // layer.setTransparency($('input.transparency-text').val()); - } + updateTransparency(layer, ui.value) } }); //This seems redundant as there is already a listener on the slider object diff --git a/html/libs/seldon/js/parse_config.js b/html/libs/seldon/js/parse_config.js index f9366af..2f77724 100644 --- a/html/libs/seldon/js/parse_config.js +++ b/html/libs/seldon/js/parse_config.js @@ -203,7 +203,7 @@ module.exports = function ($) { if (!layerInThemeOptionsLayers) { layer.selectedInConfig = true themeOptions.layers.push(layer); - layer.setTransparency(100 * (1-shareUrlLayerAlpha[layer.lid])); + layer.transparency = 100 * (1-shareUrlLayerAlpha[layer.lid]) } } index = index + 1; diff --git a/html/libs/seldon/js/set_mask_by_layer.js b/html/libs/seldon/js/set_mask_by_layer.js index d3b531a..0817e9f 100644 --- a/html/libs/seldon/js/set_mask_by_layer.js +++ b/html/libs/seldon/js/set_mask_by_layer.js @@ -23,7 +23,8 @@ module.exports = function ($) { legend : parentLayer.legend, index : parentLayer.index, parentLayer : parentLayer, - description : (parentLayer.description ? parentLayer.description : undefined) + description : (parentLayer.description ? parentLayer.description : undefined), + transparency: parentLayer.transparency }); maskLayer.activate(); diff --git a/html/libs/seldon/seldon-min.js b/html/libs/seldon/seldon-min.js index 5cfa2cc..14b5719 100644 --- a/html/libs/seldon/seldon-min.js +++ b/html/libs/seldon/seldon-min.js @@ -1,3 +1,4 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o"+'

'+el.description+"

"+"";$(dialogDiv).dialog({title:el.label||el.name,dialogClass:"tooltip-dialog "+dialogClass})}}}return MoreInfoButton}},{}],7:[function(require,module,exports){module.exports=function($){function addAccordionSection(accordionGroup,title){var sectionObj={title:title,titleElement:$("

"+title+"

"),contentElement:$("
"),sublists:[]};var $accordionGroup=$(accordionGroup);$accordionGroup.data("listAccordion").sections.push(sectionObj);$accordionGroup.append(sectionObj.titleElement).append(sectionObj.contentElement);$accordionGroup.accordion("refresh");return sectionObj}return addAccordionSection}},{}],8:[function(require,module,exports){module.exports=function($){function addAccordionSublists(g,items){$(g.contentElement).append(items)}return addAccordionSublists}},{}],9:[function(require,module,exports){module.exports=function($){function addAccordionSublistItems(s,items,theme,accGp){var collapsed=s.collapsible?"collapsed ":"";var contents=$('
');for(var i=0,l=items.length;i').append(items[i]))}var layer={name:name,contentElement:contents};s.items.push(layer);s.contentElement.append(layer.contentElement)}return addAccordionSublistItems}},{}],10:[function(require,module,exports){module.exports=function($){function addMaskToLegend(layer){var app=this;var maskName=layer.lid.substring(layer.lid.indexOf("MaskFor"),layer.lid.length);$("#lgd"+maskName).remove();layer.$legendItem=$(document.createElement("div")).attr("id","lgd"+maskName).prepend($(document.createElement("img")).attr("src",layer.legend)).prependTo($("#legend")).click(function(){app.setMaskByMask(false,maskName)})}return addMaskToLegend}},{}],11:[function(require,module,exports){module.exports=function($){var EventEmitter=window.EventEmitter;function App(){EventEmitter.call(this);this.map=undefined;this.tileManager=undefined;this.projection=undefined;this.gisServerType=undefined;this.useProxyScript=undefined;this.scalebar=undefined;this.zoomInTool=undefined;this.zoomOutTool=undefined;this.dragPanTool=undefined;this.id_markerLayer=undefined;this.maxExtent={left:-15e6,bottom:2e6,right:-6e6,top:7e6};this.baseLayers=[];this.accordionGroups=[];this.themes=[];this.maskParentLayers=[];this.masks=[];this.maskModifiers=[];this.defaultMasks=["MaskForForest"];this.radioButtonList=[];this.radioButtonLayers=[];this.dropdownBoxList=[];this.dropdownBoxLayers=[];this.currentBaseLayer=undefined;this.currentAccordionGroup=undefined;this.currentTheme=undefined;this.identifyTool=undefined;this.multigraphTool=undefined;this.markerTool=undefined;this.savedExtents=[];this.currentSavedExtentIndex=-1;this.saveCurrentExtent=require("./extent_save.js");this.zoomToExtent=require("./extent_zoom.js");this.zoomToPreviousExtent=require("./extent_zoom_previous.js");this.zoomToNextExtent=require("./extent_zoom_next.js");this.printSavedExtents=require("./extent_print.js");this.setBaseLayer=require("./set_base_layer.js")($);this.setAccordionGroup=require("./accordion_group_set.js");this.clearAccordionSections=require("./accordion_clear.js")($);this.addAccordionSection=require("./accordion_section_add.js")($);this.addAccordionSublists=require("./accordion_sublist_add.js")($);this.addAccordionSublistItems=require("./accordion_sublist_item_add.js")($);this.setTheme=require("./set_theme.js")($);this.shareUrl=require("./share_url.js")($);this.updateShareMapUrl=require("./update_share_url.js")($);this.launch=require("./launch.js")($);this.count=require("./count.js");this.addMaskToLegend=require("./add_mask_legend.js")($);this.setMaskByMask=require("./set_mask_by_mask.js")($);this.setMaskByLayer=require("./set_mask_by_layer.js")($);this.handleMaskModifier=require("./mask_modifier.js");this.handleMaskModifierGroup=require("./mask_modifier_group.js")($);this.parseConfig=require("./parse_config.js")($);this.initOpenLayers=require("./init_openlayers.js");this.setupCollapsibleSublists=require("./accordion_collapsible_sublist_setup.js")($);this.removeMaskFromLegend=function(layer){};OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.IMAGE_RELOAD_ATTEMPTS=3}EventEmitter.declare(App);return App}},{"./accordion_clear.js":1,"./accordion_collapsible_sublist_setup.js":2,"./accordion_group_set.js":4,"./accordion_section_add.js":7,"./accordion_sublist_add.js":8,"./accordion_sublist_item_add.js":9,"./add_mask_legend.js":10,"./count.js":15,"./extent_print.js":18,"./extent_save.js":19,"./extent_zoom.js":20,"./extent_zoom_next.js":21,"./extent_zoom_previous.js":22,"./init_openlayers.js":26,"./launch.js":27,"./mask_modifier.js":38,"./mask_modifier_group.js":39,"./parse_config.js":42,"./set_base_layer.js":47,"./set_mask_by_layer.js":49,"./set_mask_by_mask.js":50,"./set_theme.js":51,"./share_url.js":53,"./update_share_url.js":57}],12:[function(require,module,exports){function arrayContainsElement(array,element){var i;if(array===undefined){return false}for(i=0;iparam").each(function(i,param){var $param=$(param);if(param.hasAttribute("value")){obj[$param.attr("name")]=$param.attr("value")}else{obj[$param.attr("name")]=createArcGIS93RestParams($param)}});return obj}return createArcGIS93RestParams}},{}],17:[function(require,module,exports){module.exports=function(app,activeBtn){function deactivateActiveOpenLayersControls(){var controls,i;for(i=0;i=0;--i){e=this.savedExtents[i];html+=Mustache.render("{{{marker}}}{{{number}}}"+"left:{{{left}}}, bottom:{{{bottom}}}, right:{{{right}}}, top:{{{top}}}",{marker:i===this.currentSavedExtentIndex?"==>":"",number:i,left:e.left,bottom:e.bottom,right:e.right,top:e.top})}html+="";return html}module.exports=printSavedExtents},{}],19:[function(require,module,exports){var extentsAreEqual=require("./extents_equal.js");function saveCurrentExtent(){var newExtent=formatExtent(this.map.getExtent()),newSavedExtents=[],currentSavedExtent,i;if(this.currentSavedExtentIndex>=0){currentSavedExtent=this.savedExtents[this.currentSavedExtentIndex];if(extentsAreEqual(currentSavedExtent,newExtent)){return}}for(i=0;i<=this.currentSavedExtentIndex;++i){newSavedExtents.push(this.savedExtents[i])}this.savedExtents=newSavedExtents;this.savedExtents.push(newExtent);++this.currentSavedExtentIndex}function formatExtent(extent){return{left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top}}module.exports=saveCurrentExtent},{"./extents_equal.js":23}],20:[function(require,module,exports){function zoomToExtent(extent,save){if(save===undefined){save=true}var bounds=new OpenLayers.Bounds(extent.left,extent.bottom,extent.right,extent.top);this.map.zoomToExtent(bounds,true);if(save){this.saveCurrentExtent()}}module.exports=zoomToExtent},{}],21:[function(require,module,exports){function zoomToNextExtent(){if(this.currentSavedExtentIndex0){--this.currentSavedExtentIndex;this.zoomToExtent(this.savedExtents[this.currentSavedExtentIndex],false)}}module.exports=zoomToPreviousExtent},{}],23:[function(require,module,exports){function extentsAreEqual(e1,e2){var tolerance=.001;return Math.abs(e1.left-e2.left)<=tolerance&&Math.abs(e1.bottom-e2.bottom)<=tolerance&&Math.abs(e1.right-e2.right)<=tolerance&&Math.abs(e1.top-e2.top)<=tolerance}module.exports=extentsAreEqual},{}],24:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js"),stringContainsChar=require("./stringContainsChar.js");var getLegendStringFromPixelValue=require("./legend_config.js")($,app);function createIdentifyTool(){return new ClickTool(function(e){$("#identify_popup").remove();if(app.id_markerLayer){app.map.removeLayer(app.id_markerLayer)}var coords=app.map.getLonLatFromPixel(e.xy);var styleMap=new OpenLayers.StyleMap({pointRadius:4,fillColor:"yellow",fillOpacity:.75});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));app.id_markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:styleMap});app.id_markerLayer.addFeatures(feature);app.map.addLayer(app.id_markerLayer);var services=[],service,urlsrs;var layersAdded=[];var html='';$.each(app.map.layers,function(){var name,label;if(!this.isBaseLayer&&this.params&&(!("seldonLayer"in this)||String(this.seldonLayer.identify)!=="false")){name=this.params.LAYERS;if(String(name).match(/^\d+$/)){label=this.name}else{label=String(name).indexOf("MaskFor")!==-1?name.substring(0,name.indexOf("MaskFor")):name}if(layersAdded.indexOf(label)!==-1)return;layersAdded.push(label);services.push({url:this.url,srs:this.projection.projCode,name:name,label:label,proxyServerType:this.seldonLayer.proxyServerType});html=html+Mustache.render(""+''+''+''+"",{label:label})}});html=html+"
{{label}}:
";if(services.length===0){return}var popup=$(document.createElement("div"));popup.attr("id","identify_popup");popup.html(html);popup.dialog({width:600,height:300,resizable:true,title:"Identify Results",close:function(event,ui){app.map.removeLayer(app.id_markerLayer);app.id_markerLayer=undefined;$(this).remove()}});var i,l;for(i=0,l=services.length;i'+''+valueLabel.replace("_0","")+":  "+""+tableRow+""+""}$(newTableContents).insertAfter($group);if(!newTableContents)$group.find(".layer-results").text("N/A")},error:function(jqXHR,textStatus,errorThrown){}})}function createWMSGetFeatureInfoRequestURL(serviceUrl,layer,srs,x,y){var extent=app.map.getExtent();if(seldon.gisServerType==="ArcGIS"){extent=extent.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection(seldon.projection))}return Mustache.render(""+serviceUrl+"{{{c}}}LAYERS={{layer}}"+"&QUERY_LAYERS={{layer}}"+"&STYLES=,"+"&SERVICE=WMS"+"&VERSION=1.1.1"+"&REQUEST=GetFeatureInfo"+"&BBOX={{left}},{{bottom}},{{right}},{{top}}"+"&FEATURE_COUNT=100"+"&HEIGHT={{height}}"+"&WIDTH={{width}}"+"&FORMAT=image/png"+"&INFO_FORMAT=application/vnd.ogc.gml"+"&SRS={{srs}}"+"&X={{x}}"+"&Y={{y}}",{c:stringContainsChar(serviceUrl,"?")?"&":"?",layer:layer,height:app.map.size.h,width:app.map.size.w,left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top,srs:srs,x:x,y:y})}function getLayerResultsFromArcXML($xml,layerName,layerIDCount){var dataVals=[];try{var fields=$xml.find("FIELDS"),attributes=fields[layerIDCount].attributes,i;for(i=0;i=0||stringStartsWith(layerName,"EFETAC-NASA")||stringStartsWith(layerName,"RSAC-FHTET"))&&children[i].nodeName==="value_0"){value=value+sprintf(" (%.2f %%)",(parseFloat(value,10)-127)/128*100)}if((stringStartsWith(layerName.toUpperCase(),"NDMI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"NDVI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SWIR-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDVI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDMI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-SWIR-CURRENT"))&&children[i].nodeName==="value_0"){value=sprintf("%.0f %%",parseFloat(value,10)-128)}returnVals[i]=[children[i].nodeName,value]}}return returnVals}function stringStartsWith(string,prefix){return string.substring(0,prefix.length)===prefix}return createIdentifyTool}},{"./clicktool.js":14,"./legend_config.js":35,"./stringContainsChar.js":55}],25:[function(require,module,exports){module.exports=function(app){var ShareUrlInfo=require("./share.js");function init(config,projection,legendLookup,gisServerType,useProxyScript){var shareUrlInfo=ShareUrlInfo.parseUrl(window.location.toString());app.projection=projection;seldon.projection=projection;app.legendLookup=legendLookup;seldon.gisServerType=gisServerType;seldon.useProxyScript=useProxyScript;app.launch(config,shareUrlInfo);seldon.app=app}return init}},{"./share.js":52}],26:[function(require,module,exports){function initOpenLayers(baseLayerInfo,baseLayer,theme,themeOptions,initialExtent){var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets",{numZoomLevels:20})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings)}else if(baseLayer.type=="ArcGISCache"){var layer=new OpenLayers.Layer.ArcGISCache("AGSCache",baseLayer.url,{layerInfo:baseLayerInfo})}var maxExtentBounds;if(theme.xmax&&theme.xmin&&theme.ymax&&theme.ymin){maxExtentBounds=new OpenLayers.Bounds(theme.xmin,theme.ymin,theme.xmax,theme.ymax)}else{maxExtentBounds=new OpenLayers.Bounds(app.maxExtent.left,app.maxExtent.bottom,app.maxExtent.right,app.maxExtent.top)}if(initialExtent===undefined){initialExtent=app.maxExtent}app.tileManager=new OpenLayers.TileManager({cacheSize:12,moveDelay:750,zoomDelay:750});app.map=new OpenLayers.Map("map",{units:"m",tileManager:app.tileManager,controls:[new OpenLayers.Control.Navigation,new OpenLayers.Control.Attribution,app.zoomInTool,app.zoomOutTool,app.identifyTool,app.multigraphTool,app.markerTool],eventListeners:{moveend:function(){app.emit("extentchange")},zoomend:function(){app.emit("extentchange")}},projection:new OpenLayers.Projection(seldon.projection)});app.currentBaseLayer=baseLayer;app.emit("baselayerchange");app.map.addControl(new OpenLayers.Control.ScaleLine({bottomOutUnits:"mi"}));app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.setTheme(theme,themeOptions);app.zoomToExtent(initialExtent);app.saveCurrentExtent();app.map.events.register("mousemove",app.map,function(e){var pixel=app.map.events.getMousePosition(e);var lonlat=app.map.getLonLatFromPixel(pixel);lonlat=lonlat.transform(new OpenLayers.Projection("EPSG:3857"),new OpenLayers.Projection("EPSG:4326"));OpenLayers.Util.getElement("latLonTracker").innerHTML="Lat: "+sprintf("%.5f",lonlat.lat)+" Lon: "+sprintf("%.5f",lonlat.lon)+""});app.map.addControl(new OpenLayers.Control.PanZoomBar)}module.exports=initOpenLayers},{}],27:[function(require,module,exports){module.exports=function($){var createSplashScreen=require("./splash.js")($);var handle_search=require("./search.js")($);var ga_events=require("./set_google_analytics_events.js");var areasList=[];var activeBtn=[];function launch(configFile,shareUrlInfo){var deactivateActiveOpenLayersControls=require("./deactivate_controls.js")(this,activeBtn);var printMap=require("./print.js")($,this);var app=this;app.initialThemeLoad=true;var $configXML;$.ajax({url:configFile,dataType:"xml",success:function(configXML){$configXML=app.parseConfig(configXML,shareUrlInfo);ga_events($)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}});$("#btnTglLyrPick").click(function(){var $layerPickerDialog=$("#layerPickerDialog");if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close")}else{$layerPickerDialog.dialog("open")}});$("#layerPickerDialog").dialog({zIndex:10050,position:{my:"left top",at:"left+5 top+100"},autoOpen:true,hide:"fade",width:330});app.addListener("accordiongroupchange",function(){if(app.currentTheme){$("#layerPickerAccordion").accordion({active:app.currentTheme.getAccordionGroupIndex(app.currentAccordionGroup),collapsible:true,beforeActivate:function(event,ui){if(!app.initialThemeLoad){$("#layerPickerDialog").scrollTop(0)}},activate:function(event,ui){app.setupCollapsibleSublists(ui);if(app.initialThemeLoad){app.initialThemeLoad=false;$("#layerPickerDialog").scrollTop(755)}}})}});$("#btnTglMapTools").click(function(){var $mapToolsDialog=$("#mapToolsDialog");if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close")}else{$mapToolsDialog.dialog("open")}});$("#mapToolsDialog").dialog({zIndex:10050,position:{my:"right top",at:"right-5 top+100"},autoOpen:true,hide:"fade"});app.addListener("themechange",function(){app.updateShareMapUrl()});app.addListener("baselayerchange",function(){app.updateShareMapUrl()});app.addListener("accordiongroupchange",function(){app.updateShareMapUrl()});app.addListener("extentchange",function(){app.saveCurrentExtent();app.updateShareMapUrl()});var $mapToolsAccordion=$("#mapToolsAccordion"),accordionGroupIndexToOpen=0;$mapToolsAccordion.accordion({heightStyle:"content",collapsible:true});$mapToolsAccordion.find("div").each(function(i){if(this.id==="legend"){accordionGroupIndexToOpen=i;return false}return true});$mapToolsAccordion.accordion("option","active",accordionGroupIndexToOpen);$("#baseCombo").change(function(){var i=parseInt($(this).val(),10);app.setBaseLayer(app.baseLayers[i])});app.addListener("baselayerchange",function(){$("#baseCombo").val(app.currentBaseLayer.index)});$("#themeCombo").change(function(){var i=parseInt($(this).val(),10);app.setTheme(app.themes[i])});app.addListener("themechange",function(){$("#themeCombo").val(app.currentTheme.index)});$("#btnPan").click(function(){deactivateActiveOpenLayersControls();app.dragPanTool.activate()});$("#btnPrint").click(function(){if($configXML!==undefined){printMap($configXML)}else{console.log("Can't print yet; config file not yet parsed")}});$("#btnZoomIn").click(function(){deactivateActiveOpenLayersControls();app.zoomInTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomOut").click(function(){deactivateActiveOpenLayersControls();app.zoomOutTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomExtent").click(function(){app.zoomToExtent(app.maxExtent)});$("#btnID").click(function(){deactivateActiveOpenLayersControls();app.identifyTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnAbout").click(function(){var splashScreen=$("#splashScreenContainer");if(splashScreen.dialog("isOpen")){splashScreen.dialog("close")}else{splashScreen.dialog("open")}});$("#btnPrev").click(function(){app.zoomToPreviousExtent()});$("#btnNext").click(function(){app.zoomToNextExtent()});$("#btnMultiGraph").click(function(){deactivateActiveOpenLayersControls();app.multigraphTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnMarker").click(function(){deactivateActiveOpenLayersControls();app.markerTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});createSplashScreen();var $findArea=$("#findArea");$findArea.findArea();areasList=$findArea.findArea("getAreasList");$findArea.autocomplete({source:areasList});$findArea.keypress(function(e){if(e.which==13){var areaExtent=$findArea.findArea("getAreaExtent",$findArea.val(),areasList);app.zoomToExtent(areaExtent)}});$("#address_lookup").on("click",function(){var location=$("#address_field").val();handle_search(location,app)});$("#address_field").on("keypress",function(e){if(e.which===13){var location=$(this).val();handle_search(location,app)}});$(".mask-toggle").on("click",function(){if($(this).is(":checked")){app.setMaskByMask(true,this.value)}else{app.setMaskByMask(false,this.value)}});$("[data-mask-grouper='true']").on("change",function(){var disabled=$(this).is(":checked")?true:false;$("[data-mask-parent='"+this.value+"']").attr("disabled",disabled)});$(".mask-modifier").on("change",function(){var value=$(this).is(":checked")?this.value:"";var index=$(this).data("index");if($(this).data("maskGrouper")===true){app.handleMaskModifierGroup(this.value,$(this).is(":checked"))}app.handleMaskModifier(value,index)});$("textarea").focus(function(){var $this=$(this);$this.select();window.setTimeout(function(){$this.select()},1);function mouseUpHandler(){$this.off("mouseup",mouseUpHandler);return false}$this.mouseup(mouseUpHandler)});if($(window).width()<650){$("#mapToolsDialog").dialog("close");$("#layerPickerDialog").dialog("close")}if(window.addEventListener){window.addEventListener("orientationchange",function(){var $mapToolsDialog=$("#mapToolsDialog"),$layerPickerDialog=$("#layerPickerDialog");window.scroll(0,0);if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close").dialog("open")}if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close").dialog("open")}},false)}}return launch}},{"./deactivate_controls.js":17,"./print.js":43,"./search.js":45,"./set_google_analytics_events.js":48,"./splash.js":54}],28:[function(require,module,exports){module.exports=function($,app){var stringContainsChar=require("./stringContainsChar.js");function Layer(settings){EventEmitter.call(this);if(!settings){return}$.extend(true,this,settings);this.transparency=0;if(this.index==undefined){this.index=0}if(this.type==undefined){this.type="WMS"}this.createOpenLayersLayer=function(){if(this.openLayersLayer!==undefined){return this.openLayersLayer}var options={isBaseLayer:false,transitionEffect:"resize",buffer:0,tileSize:new OpenLayers.Size(2048,2048)};if(this.type==="WMTS"){var settings={name:this.name,url:this.url,layer:this.layers,style:this.style,matrixSet:this.srs,isBaseLayer:false,transitionEffect:"resize",format:"image/jpg",sphericalMercator:true};if(this.lid.indexOf("GLAM")>-1){$.extend(true,settings,{serverResolutions:[156543.033928041,78271.5169640205,39135.7584820102,19567.8792410051,9783.9396205026,4891.9698102513,2445.9849051256,1222.9924525628,611.4962262814,305.7481131407048],units:"m",tileOrigin:new OpenLayers.LonLat(-20037508.34,20037508.34)})}this.openLayersLayer=new OpenLayers.Layer.WMTS(settings)}else if(this.type==="XYZ"){this.openLayersLayer=new OpenLayers.Layer.XYZ(this.name,this.url,{isBaseLayer:false,projection:new OpenLayers.Projection(seldon.projection)})}else if(this.type==="ArcGIS93Rest"){this.openLayersLayer=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params.mosaicRule?$.extend(true,{},this.params,{mosaicRule:JSON.stringify(this.params.mosaicRule)}):this.params,options)}else{if(this.maxResolution){options.maxResolution=parseFloat(this.maxResolution)}var layer=this.layers+("mask"in this?app.maskModifiers.join(""):"");this.openLayersLayer=new OpenLayers.Layer.WMS(this.name,this.url,{projection:new OpenLayers.Projection(seldon.projection),units:"m",layers:layer,transparent:true},options)}var loadingimage=$('');$("#map").append(loadingimage);this.openLayersLayer.loadingimage=loadingimage;this.openLayersLayer.events.register("loadstart",this.openLayersLayer,function(){this.loadingimage.addClass("loading")});this.openLayersLayer.events.register("loadend",this.openLayersLayer,function(){this.loadingimage.removeClass("loading")});this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);this.openLayersLayer.seldonLayer=this;return this.openLayersLayer};this.activate=function(options){options=options||{};this.addToLegend();this.emit("activate");if(this.mask==="true"&&this.lid.indexOf("MaskFor")===-1){if(app.masks.length>0){app.setMaskByLayer(true,this)}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}var inMaskParentLayers=app.maskParentLayers.filter(function(layer){return this===layer},this).length;if(!inMaskParentLayers){app.maskParentLayers.push(this)}}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}vectorServices=["vlayers","fire","ads"];boundaryServices=["boundaries"];allVectorServices=vectorServices;Array.prototype.push.apply(allVectorServices,boundaryServices);var isVectorLayer=function(layer,serviceNames){return serviceNames.filter(function(serviceName){return layer.url&&layer.url.indexOf(serviceName+"?")>-1}).length};if(app.map.getNumLayers()>1){var lyrJustAdded=app.map.layers[app.map.getNumLayers()-1];if(!isVectorLayer(lyrJustAdded,allVectorServices)){for(var i=app.map.getNumLayers()-2;i>0;i--){var nextLayerDown=app.map.layers[i];if(!isVectorLayer(nextLayerDown,allVectorServices)){if(nextLayerDown.seldonLayer.index0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,vectorServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}for(var i=app.map.getNumLayers()-1;i>0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,boundaryServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}}app.updateShareMapUrl();app.map.updateSize()};this.deactivate=function(options){options=options||{};if(this.visible==="true"){app.map.removeLayer(this.openLayersLayer);this.visible="false"}if(!this.parentLayer){app.setMaskByLayer(false,this)}if(options.removeFromLegend){this.removeFromLegend()}if(options.removeFromParentMaskLayers){app.maskParentLayers=app.maskParentLayers.filter(function(layer){return layer.lid!==this.lid},this)}if(this.openLayersLayer&&this.openLayersLayer.loadingimage){this.openLayersLayer.loadingimage.removeClass("loading")}this.emit("deactivate")};this.addToLegend=function(){var that=this;var $legend=$("#legend");var lid=this.parentLayer?this.parentLayer.lid:this.lid;$(document.getElementById("lgd"+lid)).remove();this.$legendItem=$(document.createElement("div")).attr("id","lgd"+lid).prepend($(document.createElement("img")).attr("src",this.legend)).click(function(){that.deactivate();if(that.parentLayer){that.parentLayer.deactivate({removeFromParentMaskLayers:true})}that.removeFromLegend()});if(this.url.indexOf("vlayers")>-1){this.$legendItem.prependTo($legend)}else{this.$legendItem.appendTo($legend)}};this.removeFromLegend=function(){if(this.$legendItem)this.$legendItem.remove()};this.setTransparency=function(transparency){if(this.openLayersLayer){ -this.openLayersLayer.setOpacity(1-parseFloat(transparency)/100)}this.transparency=transparency;try{this.emit({type:"transparency",value:this.transparency})}catch(err){var test=this.transparency;var errTxt=err.Message}if(app.map!==undefined){var currentLayer,openLayersLayer,lid;var i;for(i=app.map.getNumLayers()-2;i>0;i--){currentLayer=app.map.layers[i];openLayersLayer=currentLayer.seldonLayer.openLayersLayer;lid=currentLayer.seldonLayer.lid;if(stringContainsChar(currentLayer.name,"Mask")){if(openLayersLayer&&lid.substring(0,lid.indexOf("MaskFor"))===this.lid){openLayersLayer.setOpacity(1-parseFloat(transparency)/100);currentLayer.seldonLayer.transparency=transparency}}}}}}window.EventEmitter.declare(Layer);return Layer}},{"./stringContainsChar.js":55}],29:[function(require,module,exports){module.exports=function($){function createLayerToggleCheckbox(layer){var checkbox=document.createElement("input"),$checkbox;checkbox.type="checkbox";checkbox.id="chk"+layer.lid;checkbox.onclick=function(){if($(this).is(":checked")){layer.activate()}else{layer.deactivate({removeFromLegend:true,removeFromParentMaskLayers:true})}};$checkbox=$(checkbox);$checkbox.addClass(layer.lid);layer.addListener("activate",function(){$("input."+this.lid).attr("checked",true)});layer.addListener("deactivate",function(){$("input."+this.lid).attr("checked",false)});return checkbox}return createLayerToggleCheckbox}},{}],30:[function(require,module,exports){module.exports=function($){function createLayerPropertiesDialog(layer){var localTransparency=0;var $html=$(""+'
'+""+""+""+""+""+""+"
Transparency:"+'
'+"
"+'%'+"
"+"
");$html.find("input.transparency-text").val(layer.transparency);if(layer.transparency>0){localTransparency=layer.transparency;layer.setTransparency(localTransparency)}$html.find(".transparency-slider").slider({min:0,max:100,step:1,value:localTransparency,slide:function(event,ui){try{layer.setTransparency(ui.value)}catch(err){var errTxt=err.message}}});$html.find("input.transparency-text").change(function(){var $this=$(this),newValueFloat=parseFloat($this.val());if(isNaN(newValueFloat)||newValueFloat<0||newValueFloat>100){$this.val(layer.transparency);return}layer.setTransparency($this.val())});layer.addListener("transparency",function(e){$html.find("input.transparency-text").val(e.value)});$html.dialog({zIndex:10050,position:"left",autoOpen:true,hide:"explode",title:layer.name,width:"auto",close:function(){$(this).dialog("destroy");$html.remove();createLayerPropertiesDialog.$html[layer.lid]=undefined}});createLayerPropertiesDialog.$html[layer.lid]=$html}createLayerPropertiesDialog.$html={};return createLayerPropertiesDialog}},{}],31:[function(require,module,exports){module.exports=function($){var createLayerPropertiesDialog=require("./layer_dialog.js")($);function createLayerPropertiesIcon(layer){var img=document.createElement("img");img.id=layer.lid;img.src="icons/settings.png";img.className="layerPropertiesIcon";img.onclick=function(){createLayerPropertiesDialog(layer)};return img}return createLayerPropertiesIcon}},{"./layer_dialog.js":30}],32:[function(require,module,exports){module.exports=function($,app){var generalRadioHandler=require("./layer_radio_handler.js")($,app);function createLayerToggleRadioButton(layer,radioGroupName){var checkbox=document.createElement("input"),$checkbox;checkbox.type="radio";checkbox.name=radioGroupName;checkbox.id=layer.lid;if(layer.selectedInConfig){checkbox.checked=true}$checkbox=$(checkbox);$checkbox.change(radioHandler);layer.addListener("activate",function(){$checkbox.attr("checked",true)});layer.addListener("deactivate",function(){$checkbox.attr("checked",false)});return checkbox}function radioHandler(){generalRadioHandler(app)}return createLayerToggleRadioButton}},{"./layer_radio_handler.js":33}],33:[function(require,module,exports){module.exports=function($,app){var Layer=require("./layer.js")($,app);function radioHandler(app){var $selectedOption=$(app.dropdownBoxList[0]).find(":selected");if($selectedOption.text()==="select..."){clearRadioLayers(app,null);return}var selectLayer=app.dropdownBoxLayers[$selectedOption.val()];var wanted_lid=getActiveDropdownBoxRadioLID(app);var wanted_layer=undefined;var i;for(i=0;i0;i--){currLayer=app.map.layers[i].seldonLayer;for(j=0;j"+selectBoxLayers[i].name+"")}selectBox.insertAdjacentHTML("afterbegin","");$(selectBox).change(selectHandler);return selectBox}function selectHandler(){radioHandler(app)}return createLayerToggleDropdownBox}},{"./layer_radio_handler.js":33}],35:[function(require,module,exports){module.exports=function($,app){function isLayerInLegendConfig(layerId){return layerId in app.legendLookup}function getLegendStringFromPixelValue(layerId,pixelValue){var legendString="";if(isLayerInLegendConfig(layerId)){legendString=app.legendLookup[layerId][pixelValue];if(!legendString){console.error("No legend string set for pixel value",pixelValue,"for layer",layerId)}}return legendString}return getLegendStringFromPixelValue}},{}],36:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js");var saveAs=require("../libs/FileSaver/FileSaver.js").saveAs;var popupId="marker-dialog";var points=[];var pointStyleDefault={pointRadius:4,fillColor:"blue",fillOpacity:.75};var pointStyleHover={pointRadius:5,fillColor:"orange",fillOpacity:.75};var pointStyle=new OpenLayers.StyleMap(pointStyleDefault);function marker(){return new ClickTool(markerHandler)}function markerHandler(e){var coords=app.map.getLonLatFromPixel(e.xy);var lonlat=app.map.getLonLatFromPixel(e.xy);lonlat.transform(app.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));var markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:pointStyle});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));markerLayer.addFeatures(feature);app.map.addLayer(markerLayer);if(!$("#"+popupId).length){createPopup()}if($(".marker-points").length){createPointItem(lonlat,markerLayer)}points.push({lonlat:lonlat,layer:markerLayer});if(typeof ga!=="undefined"){ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Create New Point",eventLabel:lonlat.lon+", "+lonlat.lat})}}function createPointItem(coords,layer){var itemString="";itemString+='
';itemString+='
';itemString+=' Lat:';itemString+=' '+coords.lat+"";itemString+="
";itemString+='
';itemString+=' Lon:';itemString+=' '+coords.lon+"";itemString+="
";itemString+='
';itemString+=' Notes:';itemString+='
';itemString+="
";itemString+="
";var item=$(itemString);item.data("point",layer);item.on("mouseenter",handlePointHoverEnter).on("mouseleave",handlePointHoverLeave);$(".marker-points").append(item)}function handlePointHoverEnter(e){var point=$(this).data("point");point.style=pointStyleHover;point.redraw()}function handlePointHoverLeave(e){var point=$(this).data("point");point.style=pointStyleDefault;point.redraw()}function createPopup(){var popup=$('
');$("body").append(popup);$(".marker-button-download").click(exportFileHandler);$(".marker-button-clear").click(clearPointsHandler);popup.dialog({width:300,height:400,resizable:false,position:{my:"right top",at:"right-5 top+120"},title:"Mark areas of interest",close:function(event,ui){clearPointsHandler();$(this).remove()}})}function exportFileHandler(){var lat,lon,url,notes;var SEP="|";var i;var csvContent="sep="+SEP+"\n";csvContent+="lat"+SEP+"long"+SEP+"google maps link"+SEP+"notes\n";for(i=0;i=0){direction="N"}else if(type==="lat"&&value<0){direction="S"}else if(type==="lon"&&value>=0){direction="E"}else if(type==="lon"&&value<0){direction="W"}value=Math.abs(value);var degree=Math.floor(value);value=(value-degree)*60;var minute=Math.floor(value);var second=(value-minute)*60;return degree+"%C2%B0"+minute+"'"+second+"%22"+direction}function getNotes(index){if(typeof ga!=="undefined"){var label=$(".marker-point-item").eq(index).find(".marker-point-notes").val();ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Notes",eventLabel:label})}return $(".marker-point-item").eq(index).find(".marker-point-notes").val()}function clearPointsHandler(){var i;for(i=0;i')}else{popup.html('
')}popup.dialog({width:600,resizable:false,position:{my:"center+"+offset+" center+"+offset,at:"center",of:window},title:Mustache.render("MODIS NDVI for Lat: {{{lat}}} Lon: {{{lon}}}",{lat:sprintf("%.4f",lonlat.lat),lon:sprintf("%.4f",lonlat.lon)}),close:function(event,ui){app.map.removeLayer(markerLayer);$(this).remove()}});var seldonMultigraph=$("#seldonMultigraph"+app.graphCount+""),promise=seldonMultigraph.multigraph({mugl:muglPrefix+lonlat.lon+","+lonlat.lat,swf:"libs/seldon/libs/Multigraph.swf"});seldonMultigraph.multigraph("done",function(m){if(m){$(m.div()).parent().children(".multigraphLoader").remove()}})})}return createMultigraphTool}},{"./clicktool.js":14}],41:[function(require,module,exports){module.exports=function($){Array.prototype.remove=function(value){if(this.indexOf(value)!==-1){this.splice(this.indexOf(value),1);return true}else{return false}};OpenLayers.Map.prototype.getCurrentSize=function(){var size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=this.div.offsetWidth;size.h=this.div.offsetHeight}if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=parseInt(this.div.style.width,10);size.h=parseInt(this.div.style.height,10)}size.h=size.h-parseInt($(this.div).css("padding-top"),10)-parseInt($(this.div).css("padding-bottom"),10);return size};$.widget("ui.dialog",$.extend({},$.ui.dialog.prototype,{_moveToTop:function(arg){if(arg){if(arg.handleObj.type!="mousedown"){var moved=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;if(moved&&!silent){this._trigger("focus",event)}return moved}}}}))}},{}],42:[function(require,module,exports){module.exports=function($){var createArcGIS93RestParams=require("./create_arcgis_rest_params.js")($);var AccordionGroup=require("./accordion_group.js");var AccordionGroupSublist=require("./accordion_group_sublist.js");var BaseLayer=require("./baselayer.js");var Theme=require("./theme.js");function parseConfig(configXML,shareUrlInfo){var Layer=require("./layer.js")($,this);var createIdentifyTool=require("./identify.js")($,this);var createMultigraphTool=require("./multigraph.js")($,this);var marker=require("./marker.js")($,this);var app=this,$configXML=$(configXML),initialBaseLayer,initialTheme,shareUrlLayerAlpha={},themeOptions={},i,j,k,l,ll,lll;if(shareUrlInfo!==undefined){for(i=0,l=shareUrlInfo.layerLids.length;i0){app.maxExtent={left:parseFloat($extent.attr("xmin")),bottom:parseFloat($extent.attr("ymin")),right:parseFloat($extent.attr("xmax")),top:parseFloat($extent.attr("ymax"))}}var $baseCombo=$("#baseCombo"),$images=$configXML.find("images image"),$image,selected,baseLayer;for(i=0,l=$images.length;ionline.',mapName:"Layers",info:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including the terms of use, visit us online at http://goto.arcgisonline.com/maps/World_Street_Map",copyrightText:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012",layers:[{id:0,name:"World Street Map",parentLayerId:-1,defaultVisibility:true,subLayerIds:null,minScale:0,maxScale:0}],tables:[],spatialReference:{wkid:102100},singleFusedMapCache:true,tileInfo:{rows:256,cols:256,dpi:96,format:"JPEG",compressionQuality:90,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:0,resolution:156543.033928,scale:591657527.591555},{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176}]},initialExtent:{xmin:-28872328.0888923,ymin:-11237732.4896886,xmax:28872328.0888923,ymax:11237732.4896886,spatialReference:{wkid:102100}},fullExtent:{xmin:-20037507.0671618,ymin:-19971868.8804086,xmax:20037507.0671618,ymax:19971868.8804086,spatialReference:{wkid:102100}},units:"esriMeters",supportedImageFormatTypes:"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI,BMP",documentInfo:{Title:"World Street Map",Author:"Esri",Comments:"",Subject:"streets, highways, major roads, railways, water features, administrative boundaries, cities, parks, protected areas, landmarks ",Category:"transportation(Transportation Networks) ",Keywords:"World, Global, Europe, Japan, Hong Kong, North America, United States, Canada, Mexico, Southern Africa, Asia, South America, Australia, New Zealand, India, Argentina, Brazil, Chile, Venezuela, Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, Switzerland, Russia, Thailand, Turkey, 2012",Credits:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"},capabilities:"Map"};app.initOpenLayers(baseLayerInfo,initialBaseLayer,initialTheme,themeOptions,initialExtent);return $configXML}function displayError(message){}return parseConfig}},{"./accordion_group.js":3,"./accordion_group_sublist.js":5,"./baselayer.js":13,"./create_arcgis_rest_params.js":16,"./identify.js":24,"./layer.js":28,"./marker.js":36,"./multigraph.js":40,"./theme.js":56}],43:[function(require,module,exports){module.exports=function($,app){function printMap($configXML){var offsetX=parseInt(app.map.layerContainerDiv.style.left,10);var offsetY=parseInt(app.map.layerContainerDiv.style.top,10);var size=app.map.getSize();var tiles=[];var layer,tile,position;var i,j,k;for(i=0;i
');printPopup.dialog({resizable:false,height:75,title:"Creating Image for Print...",close:function(event,ui){$(this).remove()}});var service_url=$configXML.find("tools tool[name=Print]").attr("service_url");if(!service_url){service_url="http://"+window.location.hostname+window.location.pathname}service_url=service_url.replace(/\/$/,"");var service_name=$configXML.find("tools tool[name=Print]").attr("service_name");if(!service_name){service_name="cgi-bin/print.cgi"}var title=$configXML.find("tools tool[name=Print]").attr("title");if(!title){title="U.S Forest Change Assessment Viewer"}$.ajax({url:service_url+"/"+service_name,type:"POST",data:OpenLayers.Util.getParameterString({ -width:size.w,height:size.h,tiles:tiles_json,legends:legends_json,title:title}),headers:{"Content-Type":"application/x-www-form-urlencoded"},success:function(data,status,jqxhr){data=data.replace(/\s+/,"");var href=service_url+"/cgi-bin/printed_map.jpg";if(data){href=service_url+"/"+data}$("#printMapLoader").html('
print image result
');printPopup.dialog("option","title","Print Image Created!")},error:function(jqxhr,status,err){$("#printMapLoader").html("
An error happended.
");printPopup.dialog("option","title","NO Print Image Created!")}})}return printMap}},{}],44:[function(require,module,exports){function RepeatingOperation(op,yieldEveryIteration){var count=0;var instance=this;this.step=function(args){if(++count>=yieldEveryIteration){count=0;setTimeout(function(){op(args)},1,[]);return}op(args)}}module.exports=RepeatingOperation},{}],45:[function(require,module,exports){module.exports=function($){function handle_search(location,app){var rest_endpoint="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text="+location+"&f=json";$.getJSON(rest_endpoint,function(data){var locations=data["locations"][0];if(locations===undefined){return}var extent=locations["extent"];var bounds=new OpenLayers.Bounds(extent.xmin,extent.ymin,extent.xmax,extent.ymax).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));app.zoomToExtent(bounds,true)})}return handle_search}},{}],46:[function(require,module,exports){(function($){"use strict";require("./overrides.js")($);var seldon={App:require("./app.js")($)};var app=new seldon.App;seldon.init=require("./init.js")(app);window.seldon=seldon})(jQuery)},{"./app.js":11,"./init.js":25,"./overrides.js":41}],47:[function(require,module,exports){module.exports=function($){function setBaseLayer(baseLayer){var resolutions=[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,.5971642833948135];var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets");handleBaseLayer(app,layer,baseLayer)}else if(baseLayer.type=="ArcGISCache"){$.ajax({url:baseLayer.url+"?f=json&pretty=true",dataType:"jsonp",success:function(layerInfo){var options={layerInfo:layerInfo};if(baseLayer.numZoomLevels){options.numZoomLevels=baseLayer.numZoomLevels;if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);options.serverResolutions=serverResolutions;options.resolutions=resolutions}}var layer=new OpenLayers.Layer.ArcGISCache(baseLayer.name,baseLayer.url,options);handleBaseLayer(app,layer,baseLayer)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet,sphericalMercator:true};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings);handleBaseLayer(app,layer,baseLayer)}}function handleBaseLayer(app,layer,baseLayer){app.map.removeLayer(app.map.layers[0]);app.currentBaseLayer=baseLayer;app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.emit("baselayerchange")}return setBaseLayer}},{}],48:[function(require,module,exports){function ga_events($){var eventAdded=false;try{$.ga.trackEvent;eventAdded=true}catch(err){eventAdded=false}if(typeof ga!=="undefined"){if(eventAdded){seldon.app.map.events.register("moveend",seldon.app.map,function(){var newMapExtent=seldon.app.map.getExtent();$.ga.trackEvent({category:"Map Extent",action:"Change",label:newMapExtent.toString(),nonInteractive:true})});$(".shareMapUrl").click(function(event){$.ga.trackEvent({category:"Share Map URL",action:"Click",label:$(".shareMapUrl").val()})});$("#mapTheme #themeCombo").change(function(event){$.ga.trackEvent({category:"Map Theme",action:"Change",label:$("#mapTheme #themeCombo option:selected").text()})});$("#txtFindArea input#address_field").keyup(function(event){if(event.which===13){$.ga.trackEvent({category:"Find Area",action:"Search Enter",label:$(this).val()})}});$("#txtFindArea #address_lookup img").click(function(event){$.ga.trackEvent({category:"Find Area",action:"Search Button",label:$("#txtFindArea input#address_field").val()})});$("#mapBase #baseCombo").change(function(event){$.ga.trackEvent({category:"Base Map",action:"Change",label:$("#mapBase #baseCombo option:selected").text()})});$(".header-bar .header-bar img.icon").gaTrackEvent({category:"Nav Bar",action:"click",useLabel:true,labelAttribute:"title",useEvent:true,event:"click"});$("#mapToolsDialog label[for^='chk']").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#mapToolsDialog input").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("#layerPickerDialog label[for^='chk']").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#layerPickerDialog input").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("h3.ui-accordion-header").gaTrackEvent({category:"Base Layer",action:"Toggle Accordion",useLabel:true,label:function(){return $(this).text()},useEvent:true,event:"click"});$("#marker-dialog .marker-button-wrapper .marker-button-download").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Download Points"})});$("#marker-dialog .marker-button-wrapper .marker-button-clear").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Clear Points"})});$("#marker-dialog .marker-point-label .marker-point-coords-label").focusout(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Notes",label:$(this).val()})});$("img[src$='slider.png']").mouseup(function(event){$.ga.trackEvent({category:"OpenLayers Buttons",action:"Slide",label:"Zoom Slider"})});$(".olButton").click(function(event){var eleId=$(this).attr("id");switch(true){case eleId.indexOf("ZoombarOpenLayers_Map")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Bar"});break;case eleId.indexOf("panleft")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan Left"});break;case eleId.indexOf("panright")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan right"});break;case eleId.indexOf("panup")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan up"});break;case eleId.indexOf("pandown")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan down"});break;case eleId.indexOf("zoomin")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom in"});break;case eleId.indexOf("zoomout")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Out"});break;default:}})}}}module.exports=ga_events},{}],49:[function(require,module,exports){module.exports=function($){function setMaskByLayer(toggle,parentLayer){var Layer=require("./layer.js")($,this);var app=this;var maskLayer,maskName,cleanMaskName;var m,ml,mld;if(toggle){for(m=0;m0;i--){var currLayer=app.map.layers[i];for(var j=0;j0||sublist.break?"":" empty";var collapsibleClass=sublist.collapsible?" collapsible":"";var collapseHeaderIcon=sublist.collapsible?'':"";var sublistInfo=sublist.info?'
'+sublist.info+"
":"";var sublistObj={heading:sublist.label,items:[],collapsible:sublist.collapsible,contentElement:$('
'+'
'+collapseHeaderIcon+"

"+sublist.label+"

"+sublistInfo+"
"+"
")};if(sublist.description){var sublistInfoButton=new MoreInfoButton(sublist);sublistObj.contentElement.children(".sublist-header").append(sublistInfoButton.element)}g.sublists.push(sublistObj);sublistItems.push(sublistObj.contentElement);var sublistLayerItems=[];for(var k=0,l=sublist.layers.length;k=0){name=this.substring(0,i);value=this.substring(i+1)}else{name=this;value=undefined}vars[name]=value});info.themeName=vars.theme;info.accordionGroupGid=vars.accgp;info.baseLayerName=vars.basemap;if(vars.extent){var extentCoords=vars.extent.split(",");info.extent={left:extentCoords[0],bottom:extentCoords[1],right:extentCoords[2],top:extentCoords[3]}}if(vars.layers){$.each(vars.layers.split(","),function(){info.layerLids.push(this)})}if(vars.mask){$.each(vars.mask.split(","),function(){info.layerMask.push(this)})}if(vars.modifiers){$.each(vars.modifiers.split(","),function(){info.maskModifiers.push(this)})}if(vars.alphas){$.each(vars.alphas.split(","),function(){info.layerAlphas.push(this)})}if(info.themeName&&info.baseLayerName){return info}return undefined};ShareUrlInfo.prototype.urlArgs=function(){return Mustache.render(""+"theme={{{theme}}}"+"&layers={{{layers}}}"+"&mask={{{mask}}}"+"{{{modifiers}}}"+"&alphas={{{alphas}}}"+"&accgp={{{accgp}}}"+"&basemap={{{basemap}}}"+"&extent={{{extent.left}}},{{{extent.bottom}}},{{{extent.right}}},{{{extent.top}}}",{theme:this.themeName,layers:this.layerLids.join(","),mask:this.layerMask.join(","),modifiers:this.maskModifiers.length>0?"&modifiers="+this.maskModifiers.join(","):"",alphas:this.layerAlphas.join(","),accgp:this.accordionGroupGid,basemap:this.baseLayerName,extent:this.extent})};module.exports=ShareUrlInfo},{}],53:[function(require,module,exports){module.exports=function($){var stringContainsChar=require("./stringContainsChar.js");var ShareUrlInfo=require("./share.js");function shareUrl(){if(!this.currentTheme){return undefined}if(!this.currentAccordionGroup){return undefined}if(!this.currentBaseLayer){return undefined}var extent=this.map.getExtent(),layerLids=[],layerAlphas=[],layerMask=[],url;if(!extent){return undefined}$.each(this.map.layers,function(){var op,lid,test;if(!this.isBaseLayer){if(this.opacity===1){op="1"}else if(this.opacity===0){op="0"}else{op=sprintf("%.2f",this.opacity)}if(stringContainsChar(this.name,"MaskFor")){lid=this.seldonLayer.lid;test=lid.substring(lid.indexOf("MaskFor"),lid.length).replace("MaskFor","");if(layerMask.indexOf(test)===-1){layerMask.push(test)}test=this.name.substring(0,this.name.indexOf("MaskFor"));if(layerLids.indexOf(test)===-1){layerLids.push(test);layerAlphas.push(op)}}else{if(this.seldonLayer){layerLids.push(this.seldonLayer.lid);layerAlphas.push(op)}}}});if(this.hasOwnProperty("maskModifiers")){var modifiers=this.maskModifiers.filter(function(val){return val!==""})}url=window.location.toString();url=url.replace(/\?.*$/,"");url=url.replace(/\/$/,"");url=url.replace("#","");return url+"?"+new ShareUrlInfo({themeName:this.currentTheme.name,layerLids:layerLids,layerMask:layerMask,maskModifiers:modifiers,layerAlphas:layerAlphas,accordionGroupGid:this.currentAccordionGroup.gid,baseLayerName:this.currentBaseLayer.name,extent:extent}).urlArgs()}return shareUrl}},{"./share.js":52,"./stringContainsChar.js":55}],54:[function(require,module,exports){module.exports=function($){function createSplashScreen(){var $document=$(document),windowWidth=Math.round($document.width()/2);$("#splashScreenContent").load("splashScreen.html");$("#splashScreenContainer").dialog({autoOpen:false,zIndex:10051,maxHeight:$document.height(),width:windowWidth,minWidth:300,dialogClass:"splashScreenStyle",hide:"explode"})}return createSplashScreen}},{}],55:[function(require,module,exports){function stringContainsChar(string,c){return string.indexOf(c)>=0}module.exports=stringContainsChar},{}],56:[function(require,module,exports){function Theme(settings){this.accordionGroups=[];if(!settings){return}this.name=settings.name;this.label=settings.label;this.index=settings.index;this.zoom=settings.zoom;this.xmin=settings.xmin;this.ymin=settings.ymin;this.xmax=settings.xmax;this.ymax=settings.ymax;this.getAccordionGroupIndex=function(accordionGroup){var i;for(i=0;i"+'

'+el.description+"

"+"";$(dialogDiv).dialog({title:el.label||el.name,dialogClass:"tooltip-dialog "+dialogClass})}}}return MoreInfoButton}},{}],7:[function(require,module,exports){module.exports=function($){function addAccordionSection(accordionGroup,title){var sectionObj={title:title,titleElement:$("

"+title+"

"),contentElement:$("
"),sublists:[]};var $accordionGroup=$(accordionGroup);$accordionGroup.data("listAccordion").sections.push(sectionObj);$accordionGroup.append(sectionObj.titleElement).append(sectionObj.contentElement);$accordionGroup.accordion("refresh");return sectionObj}return addAccordionSection}},{}],8:[function(require,module,exports){module.exports=function($){function addAccordionSublists(g,items){$(g.contentElement).append(items)}return addAccordionSublists}},{}],9:[function(require,module,exports){module.exports=function($){function addAccordionSublistItems(s,items,theme,accGp){var collapsed=s.collapsible?"collapsed ":"";var contents=$('
');for(var i=0,l=items.length;i').append(items[i]))}var layer={name:name,contentElement:contents};s.items.push(layer);s.contentElement.append(layer.contentElement)}return addAccordionSublistItems}},{}],10:[function(require,module,exports){module.exports=function($){function addMaskToLegend(layer){var app=this;var maskName=layer.lid.substring(layer.lid.indexOf("MaskFor"),layer.lid.length);$("#lgd"+maskName).remove();layer.$legendItem=$(document.createElement("div")).attr("id","lgd"+maskName).prepend($(document.createElement("img")).attr("src",layer.legend)).prependTo($("#legend")).click(function(){app.setMaskByMask(false,maskName)})}return addMaskToLegend}},{}],11:[function(require,module,exports){module.exports=function($){var EventEmitter=window.EventEmitter;function App(){EventEmitter.call(this);this.map=undefined;this.tileManager=undefined;this.projection=undefined;this.gisServerType=undefined;this.useProxyScript=undefined;this.scalebar=undefined;this.zoomInTool=undefined;this.zoomOutTool=undefined;this.dragPanTool=undefined;this.id_markerLayer=undefined;this.maxExtent={left:-15e6,bottom:2e6,right:-6e6,top:7e6};this.baseLayers=[];this.accordionGroups=[];this.themes=[];this.maskParentLayers=[];this.masks=[];this.maskModifiers=[];this.defaultMasks=["MaskForForest"];this.radioButtonList=[];this.radioButtonLayers=[];this.dropdownBoxList=[];this.dropdownBoxLayers=[];this.currentBaseLayer=undefined;this.currentAccordionGroup=undefined;this.currentTheme=undefined;this.identifyTool=undefined;this.multigraphTool=undefined;this.markerTool=undefined;this.savedExtents=[];this.currentSavedExtentIndex=-1;this.saveCurrentExtent=require("./extent_save.js");this.zoomToExtent=require("./extent_zoom.js");this.zoomToPreviousExtent=require("./extent_zoom_previous.js");this.zoomToNextExtent=require("./extent_zoom_next.js");this.printSavedExtents=require("./extent_print.js");this.setBaseLayer=require("./set_base_layer.js")($);this.setAccordionGroup=require("./accordion_group_set.js");this.clearAccordionSections=require("./accordion_clear.js")($);this.addAccordionSection=require("./accordion_section_add.js")($);this.addAccordionSublists=require("./accordion_sublist_add.js")($);this.addAccordionSublistItems=require("./accordion_sublist_item_add.js")($);this.setTheme=require("./set_theme.js")($);this.shareUrl=require("./share_url.js")($);this.updateShareMapUrl=require("./update_share_url.js")($);this.launch=require("./launch.js")($);this.count=require("./count.js");this.addMaskToLegend=require("./add_mask_legend.js")($);this.setMaskByMask=require("./set_mask_by_mask.js")($);this.setMaskByLayer=require("./set_mask_by_layer.js")($);this.handleMaskModifier=require("./mask_modifier.js");this.handleMaskModifierGroup=require("./mask_modifier_group.js")($);this.parseConfig=require("./parse_config.js")($);this.initOpenLayers=require("./init_openlayers.js");this.setupCollapsibleSublists=require("./accordion_collapsible_sublist_setup.js")($);this.removeMaskFromLegend=function(layer){};OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.IMAGE_RELOAD_ATTEMPTS=3}EventEmitter.declare(App);return App}},{"./accordion_clear.js":1,"./accordion_collapsible_sublist_setup.js":2,"./accordion_group_set.js":4,"./accordion_section_add.js":7,"./accordion_sublist_add.js":8,"./accordion_sublist_item_add.js":9,"./add_mask_legend.js":10,"./count.js":15,"./extent_print.js":18,"./extent_save.js":19,"./extent_zoom.js":20,"./extent_zoom_next.js":21,"./extent_zoom_previous.js":22,"./init_openlayers.js":26,"./launch.js":27,"./mask_modifier.js":38,"./mask_modifier_group.js":39,"./parse_config.js":42,"./set_base_layer.js":47,"./set_mask_by_layer.js":49,"./set_mask_by_mask.js":50,"./set_theme.js":51,"./share_url.js":53,"./update_share_url.js":57}],12:[function(require,module,exports){function arrayContainsElement(array,element){var i;if(array===undefined){return false}for(i=0;iparam").each(function(i,param){var $param=$(param);if(param.hasAttribute("value")){obj[$param.attr("name")]=$param.attr("value")}else{obj[$param.attr("name")]=createArcGIS93RestParams($param)}});return obj}return createArcGIS93RestParams}},{}],17:[function(require,module,exports){module.exports=function(app,activeBtn){function deactivateActiveOpenLayersControls(){var controls,i;for(i=0;i=0;--i){e=this.savedExtents[i];html+=Mustache.render("{{{marker}}}{{{number}}}"+"left:{{{left}}}, bottom:{{{bottom}}}, right:{{{right}}}, top:{{{top}}}",{marker:i===this.currentSavedExtentIndex?"==>":"",number:i,left:e.left,bottom:e.bottom,right:e.right,top:e.top})}html+="";return html}module.exports=printSavedExtents},{}],19:[function(require,module,exports){var extentsAreEqual=require("./extents_equal.js");function saveCurrentExtent(){var newExtent=formatExtent(this.map.getExtent()),newSavedExtents=[],currentSavedExtent,i;if(this.currentSavedExtentIndex>=0){currentSavedExtent=this.savedExtents[this.currentSavedExtentIndex];if(extentsAreEqual(currentSavedExtent,newExtent)){return}}for(i=0;i<=this.currentSavedExtentIndex;++i){newSavedExtents.push(this.savedExtents[i])}this.savedExtents=newSavedExtents;this.savedExtents.push(newExtent);++this.currentSavedExtentIndex}function formatExtent(extent){return{left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top}}module.exports=saveCurrentExtent},{"./extents_equal.js":23}],20:[function(require,module,exports){function zoomToExtent(extent,save){if(save===undefined){save=true}var bounds=new OpenLayers.Bounds(extent.left,extent.bottom,extent.right,extent.top);this.map.zoomToExtent(bounds,true);if(save){this.saveCurrentExtent()}}module.exports=zoomToExtent},{}],21:[function(require,module,exports){function zoomToNextExtent(){if(this.currentSavedExtentIndex0){--this.currentSavedExtentIndex;this.zoomToExtent(this.savedExtents[this.currentSavedExtentIndex],false)}}module.exports=zoomToPreviousExtent},{}],23:[function(require,module,exports){function extentsAreEqual(e1,e2){var tolerance=.001;return Math.abs(e1.left-e2.left)<=tolerance&&Math.abs(e1.bottom-e2.bottom)<=tolerance&&Math.abs(e1.right-e2.right)<=tolerance&&Math.abs(e1.top-e2.top)<=tolerance}module.exports=extentsAreEqual},{}],24:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js"),stringContainsChar=require("./stringContainsChar.js");var getLegendStringFromPixelValue=require("./legend_config.js")($,app);function createIdentifyTool(){return new ClickTool(function(e){$("#identify_popup").remove();if(app.id_markerLayer){app.map.removeLayer(app.id_markerLayer)}var coords=app.map.getLonLatFromPixel(e.xy);var styleMap=new OpenLayers.StyleMap({pointRadius:4,fillColor:"yellow",fillOpacity:.75});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));app.id_markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:styleMap});app.id_markerLayer.addFeatures(feature);app.map.addLayer(app.id_markerLayer);var services=[],service,urlsrs;var layersAdded=[];var html='';$.each(app.map.layers,function(){var name,label;if(!this.isBaseLayer&&this.params&&(!("seldonLayer"in this)||String(this.seldonLayer.identify)!=="false")){name=this.params.LAYERS;if(String(name).match(/^\d+$/)){label=this.name}else{label=String(name).indexOf("MaskFor")!==-1?name.substring(0,name.indexOf("MaskFor")):name}if(layersAdded.indexOf(label)!==-1)return;layersAdded.push(label);services.push({url:this.url,srs:this.projection.projCode,name:name,label:label,proxyServerType:this.seldonLayer.proxyServerType});html=html+Mustache.render(""+''+''+''+"",{label:label})}});html=html+"
{{label}}:
";if(services.length===0){return}var popup=$(document.createElement("div"));popup.attr("id","identify_popup");popup.html(html);popup.dialog({width:600,height:300,resizable:true,title:"Identify Results",close:function(event,ui){app.map.removeLayer(app.id_markerLayer);app.id_markerLayer=undefined;$(this).remove()}});var i,l;for(i=0,l=services.length;i'+''+valueLabel.replace("_0","")+":  "+""+tableRow+""+""}$(newTableContents).insertAfter($group);if(!newTableContents)$group.find(".layer-results").text("N/A")},error:function(jqXHR,textStatus,errorThrown){}})}function createWMSGetFeatureInfoRequestURL(serviceUrl,layer,srs,x,y){var extent=app.map.getExtent();if(seldon.gisServerType==="ArcGIS"){extent=extent.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection(seldon.projection))}return Mustache.render(""+serviceUrl+"{{{c}}}LAYERS={{layer}}"+"&QUERY_LAYERS={{layer}}"+"&STYLES=,"+"&SERVICE=WMS"+"&VERSION=1.1.1"+"&REQUEST=GetFeatureInfo"+"&BBOX={{left}},{{bottom}},{{right}},{{top}}"+"&FEATURE_COUNT=100"+"&HEIGHT={{height}}"+"&WIDTH={{width}}"+"&FORMAT=image/png"+"&INFO_FORMAT=application/vnd.ogc.gml"+"&SRS={{srs}}"+"&X={{x}}"+"&Y={{y}}",{c:stringContainsChar(serviceUrl,"?")?"&":"?",layer:layer,height:app.map.size.h,width:app.map.size.w,left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top,srs:srs,x:x,y:y})}function getLayerResultsFromArcXML($xml,layerName,layerIDCount){var dataVals=[];try{var fields=$xml.find("FIELDS"),attributes=fields[layerIDCount].attributes,i;for(i=0;i=0||stringStartsWith(layerName,"EFETAC-NASA")||stringStartsWith(layerName,"RSAC-FHTET"))&&children[i].nodeName==="value_0"){value=value+sprintf(" (%.2f %%)",(parseFloat(value,10)-127)/128*100)}if((stringStartsWith(layerName.toUpperCase(),"NDMI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"NDVI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SWIR-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDVI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDMI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-SWIR-CURRENT"))&&children[i].nodeName==="value_0"){value=sprintf("%.0f %%",parseFloat(value,10)-128)}returnVals[i]=[children[i].nodeName,value]}}return returnVals}function stringStartsWith(string,prefix){return string.substring(0,prefix.length)===prefix}return createIdentifyTool}},{"./clicktool.js":14,"./legend_config.js":35,"./stringContainsChar.js":55}],25:[function(require,module,exports){module.exports=function(app){var ShareUrlInfo=require("./share.js");function init(config,projection,legendLookup,gisServerType,useProxyScript){var shareUrlInfo=ShareUrlInfo.parseUrl(window.location.toString());app.projection=projection;seldon.projection=projection;app.legendLookup=legendLookup;seldon.gisServerType=gisServerType;seldon.useProxyScript=useProxyScript;app.launch(config,shareUrlInfo);seldon.app=app}return init}},{"./share.js":52}],26:[function(require,module,exports){function initOpenLayers(baseLayerInfo,baseLayer,theme,themeOptions,initialExtent){var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets",{numZoomLevels:20})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings)}else if(baseLayer.type=="ArcGISCache"){var layer=new OpenLayers.Layer.ArcGISCache("AGSCache",baseLayer.url,{layerInfo:baseLayerInfo})}var maxExtentBounds;if(theme.xmax&&theme.xmin&&theme.ymax&&theme.ymin){maxExtentBounds=new OpenLayers.Bounds(theme.xmin,theme.ymin,theme.xmax,theme.ymax)}else{maxExtentBounds=new OpenLayers.Bounds(app.maxExtent.left,app.maxExtent.bottom,app.maxExtent.right,app.maxExtent.top)}if(initialExtent===undefined){initialExtent=app.maxExtent}app.tileManager=new OpenLayers.TileManager({cacheSize:12,moveDelay:750,zoomDelay:750});app.map=new OpenLayers.Map("map",{units:"m",tileManager:app.tileManager,controls:[new OpenLayers.Control.Navigation,new OpenLayers.Control.Attribution,app.zoomInTool,app.zoomOutTool,app.identifyTool,app.multigraphTool,app.markerTool],eventListeners:{moveend:function(){app.emit("extentchange")},zoomend:function(){app.emit("extentchange")}},projection:new OpenLayers.Projection(seldon.projection)});app.currentBaseLayer=baseLayer;app.emit("baselayerchange");app.map.addControl(new OpenLayers.Control.ScaleLine({bottomOutUnits:"mi"}));app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.setTheme(theme,themeOptions);app.zoomToExtent(initialExtent);app.saveCurrentExtent();app.map.events.register("mousemove",app.map,function(e){var pixel=app.map.events.getMousePosition(e);var lonlat=app.map.getLonLatFromPixel(pixel);lonlat=lonlat.transform(new OpenLayers.Projection("EPSG:3857"),new OpenLayers.Projection("EPSG:4326"));OpenLayers.Util.getElement("latLonTracker").innerHTML="Lat: "+sprintf("%.5f",lonlat.lat)+" Lon: "+sprintf("%.5f",lonlat.lon)+""});app.map.addControl(new OpenLayers.Control.PanZoomBar)}module.exports=initOpenLayers},{}],27:[function(require,module,exports){module.exports=function($){var createSplashScreen=require("./splash.js")($);var handle_search=require("./search.js")($);var ga_events=require("./set_google_analytics_events.js");var areasList=[];var activeBtn=[];function launch(configFile,shareUrlInfo){var deactivateActiveOpenLayersControls=require("./deactivate_controls.js")(this,activeBtn);var printMap=require("./print.js")($,this);var app=this;app.initialThemeLoad=true;var $configXML;$.ajax({url:configFile,dataType:"xml",success:function(configXML){$configXML=app.parseConfig(configXML,shareUrlInfo);ga_events($)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}});$("#btnTglLyrPick").click(function(){var $layerPickerDialog=$("#layerPickerDialog");if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close")}else{$layerPickerDialog.dialog("open")}});$("#layerPickerDialog").dialog({zIndex:10050,position:{my:"left top",at:"left+5 top+100"},autoOpen:true,hide:"fade",width:330});app.addListener("accordiongroupchange",function(){if(app.currentTheme){$("#layerPickerAccordion").accordion({active:app.currentTheme.getAccordionGroupIndex(app.currentAccordionGroup),collapsible:true,beforeActivate:function(event,ui){if(!app.initialThemeLoad){$("#layerPickerDialog").scrollTop(0)}},activate:function(event,ui){app.setupCollapsibleSublists(ui);if(app.initialThemeLoad){app.initialThemeLoad=false;$("#layerPickerDialog").scrollTop(755)}}})}});$("#btnTglMapTools").click(function(){var $mapToolsDialog=$("#mapToolsDialog");if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close")}else{$mapToolsDialog.dialog("open")}});$("#mapToolsDialog").dialog({zIndex:10050,position:{my:"right top",at:"right-5 top+100"},autoOpen:true,hide:"fade"});app.addListener("themechange",function(){app.updateShareMapUrl()});app.addListener("baselayerchange",function(){app.updateShareMapUrl()});app.addListener("accordiongroupchange",function(){app.updateShareMapUrl()});app.addListener("extentchange",function(){app.saveCurrentExtent();app.updateShareMapUrl()});var $mapToolsAccordion=$("#mapToolsAccordion"),accordionGroupIndexToOpen=0;$mapToolsAccordion.accordion({heightStyle:"content",collapsible:true});$mapToolsAccordion.find("div").each(function(i){if(this.id==="legend"){accordionGroupIndexToOpen=i;return false}return true});$mapToolsAccordion.accordion("option","active",accordionGroupIndexToOpen);$("#baseCombo").change(function(){var i=parseInt($(this).val(),10);app.setBaseLayer(app.baseLayers[i])});app.addListener("baselayerchange",function(){$("#baseCombo").val(app.currentBaseLayer.index)});$("#themeCombo").change(function(){var i=parseInt($(this).val(),10);app.setTheme(app.themes[i])});app.addListener("themechange",function(){$("#themeCombo").val(app.currentTheme.index)});$("#btnPan").click(function(){deactivateActiveOpenLayersControls();app.dragPanTool.activate()});$("#btnPrint").click(function(){if($configXML!==undefined){printMap($configXML)}else{console.log("Can't print yet; config file not yet parsed")}});$("#btnZoomIn").click(function(){deactivateActiveOpenLayersControls();app.zoomInTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomOut").click(function(){deactivateActiveOpenLayersControls();app.zoomOutTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomExtent").click(function(){app.zoomToExtent(app.maxExtent)});$("#btnID").click(function(){deactivateActiveOpenLayersControls();app.identifyTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnAbout").click(function(){var splashScreen=$("#splashScreenContainer");if(splashScreen.dialog("isOpen")){splashScreen.dialog("close")}else{splashScreen.dialog("open")}});$("#btnPrev").click(function(){app.zoomToPreviousExtent()});$("#btnNext").click(function(){app.zoomToNextExtent()});$("#btnMultiGraph").click(function(){deactivateActiveOpenLayersControls();app.multigraphTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnMarker").click(function(){deactivateActiveOpenLayersControls();app.markerTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});createSplashScreen();var $findArea=$("#findArea");$findArea.findArea();areasList=$findArea.findArea("getAreasList");$findArea.autocomplete({source:areasList});$findArea.keypress(function(e){if(e.which==13){var areaExtent=$findArea.findArea("getAreaExtent",$findArea.val(),areasList);app.zoomToExtent(areaExtent)}});$("#address_lookup").on("click",function(){var location=$("#address_field").val();handle_search(location,app)});$("#address_field").on("keypress",function(e){if(e.which===13){var location=$(this).val();handle_search(location,app)}});$(".mask-toggle").on("click",function(){if($(this).is(":checked")){app.setMaskByMask(true,this.value)}else{app.setMaskByMask(false,this.value)}});$("[data-mask-grouper='true']").on("change",function(){var disabled=$(this).is(":checked")?true:false;$("[data-mask-parent='"+this.value+"']").attr("disabled",disabled)});$(".mask-modifier").on("change",function(){var value=$(this).is(":checked")?this.value:"";var index=$(this).data("index");if($(this).data("maskGrouper")===true){app.handleMaskModifierGroup(this.value,$(this).is(":checked"))}app.handleMaskModifier(value,index)});$("textarea").focus(function(){var $this=$(this);$this.select();window.setTimeout(function(){$this.select()},1);function mouseUpHandler(){$this.off("mouseup",mouseUpHandler);return false}$this.mouseup(mouseUpHandler)});if($(window).width()<650){$("#mapToolsDialog").dialog("close");$("#layerPickerDialog").dialog("close")}if(window.addEventListener){window.addEventListener("orientationchange",function(){var $mapToolsDialog=$("#mapToolsDialog"),$layerPickerDialog=$("#layerPickerDialog");window.scroll(0,0);if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close").dialog("open")}if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close").dialog("open")}},false)}}return launch}},{"./deactivate_controls.js":17,"./print.js":43,"./search.js":45,"./set_google_analytics_events.js":48,"./splash.js":54}],28:[function(require,module,exports){module.exports=function($,app){var stringContainsChar=require("./stringContainsChar.js");function Layer(settings){EventEmitter.call(this);if(!settings){return}$.extend(true,this,settings);if(this.index==undefined){this.index=0}if(this.type==undefined){this.type="WMS"}this.createOpenLayersLayer=function(){if(this.openLayersLayer!==undefined){return this.openLayersLayer}var options={isBaseLayer:false,transitionEffect:"resize",buffer:0,tileSize:new OpenLayers.Size(2048,2048)};if(this.type==="WMTS"){var settings={name:this.name,url:this.url,layer:this.layers,style:this.style,matrixSet:this.srs,isBaseLayer:false,transitionEffect:"resize",format:"image/jpg",sphericalMercator:true};if(this.lid.indexOf("GLAM")>-1){$.extend(true,settings,{serverResolutions:[156543.033928041,78271.5169640205,39135.7584820102,19567.8792410051,9783.9396205026,4891.9698102513,2445.9849051256,1222.9924525628,611.4962262814,305.7481131407048],units:"m",tileOrigin:new OpenLayers.LonLat(-20037508.34,20037508.34)})}this.openLayersLayer=new OpenLayers.Layer.WMTS(settings)}else if(this.type==="XYZ"){this.openLayersLayer=new OpenLayers.Layer.XYZ(this.name,this.url,{isBaseLayer:false,projection:new OpenLayers.Projection(seldon.projection)})}else if(this.type==="ArcGIS93Rest"){this.openLayersLayer=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params.mosaicRule?$.extend(true,{},this.params,{mosaicRule:JSON.stringify(this.params.mosaicRule)}):this.params,options)}else{if(this.maxResolution){options.maxResolution=parseFloat(this.maxResolution)}var layer=this.layers+("mask"in this?app.maskModifiers.join(""):"");this.openLayersLayer=new OpenLayers.Layer.WMS(this.name,this.url,{projection:new OpenLayers.Projection(seldon.projection),units:"m",layers:layer,transparent:true},options)}var loadingimage=$('');$("#map").append(loadingimage);this.openLayersLayer.loadingimage=loadingimage;this.openLayersLayer.events.register("loadstart",this.openLayersLayer,function(){this.loadingimage.addClass("loading")});this.openLayersLayer.events.register("loadend",this.openLayersLayer,function(){this.loadingimage.removeClass("loading")});this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);this.openLayersLayer.seldonLayer=this;return this.openLayersLayer};this.activate=function(options){options=options||{};this.addToLegend();this.emit("activate");if(this.mask==="true"&&this.lid.indexOf("MaskFor")===-1){if(app.masks.length>0){app.setMaskByLayer(true,this)}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}var inMaskParentLayers=app.maskParentLayers.filter(function(layer){return this===layer},this).length;if(!inMaskParentLayers){app.maskParentLayers.push(this)}}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}this.setTransparency();vectorServices=["vlayers","fire","ads"];boundaryServices=["boundaries"];allVectorServices=vectorServices;Array.prototype.push.apply(allVectorServices,boundaryServices);var isVectorLayer=function(layer,serviceNames){return serviceNames.filter(function(serviceName){return layer.url&&layer.url.indexOf(serviceName+"?")>-1}).length};if(app.map.getNumLayers()>1){var lyrJustAdded=app.map.layers[app.map.getNumLayers()-1];if(!isVectorLayer(lyrJustAdded,allVectorServices)){for(var i=app.map.getNumLayers()-2;i>0;i--){var nextLayerDown=app.map.layers[i];if(!isVectorLayer(nextLayerDown,allVectorServices)){if(nextLayerDown.seldonLayer.index0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,vectorServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}for(var i=app.map.getNumLayers()-1;i>0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,boundaryServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}}app.updateShareMapUrl();app.map.updateSize()};this.deactivate=function(options){options=options||{};if(this.visible==="true"){app.map.removeLayer(this.openLayersLayer);this.visible="false"}if(!this.parentLayer){app.setMaskByLayer(false,this)}if(options.removeFromLegend){this.removeFromLegend()}if(options.removeFromParentMaskLayers){app.maskParentLayers=app.maskParentLayers.filter(function(layer){return layer.lid!==this.lid},this)}if(this.openLayersLayer&&this.openLayersLayer.loadingimage){this.openLayersLayer.loadingimage.removeClass("loading")}this.emit("deactivate")};this.addToLegend=function(){var that=this;var $legend=$("#legend");var lid=this.parentLayer?this.parentLayer.lid:this.lid;$(document.getElementById("lgd"+lid)).remove();this.$legendItem=$(document.createElement("div")).attr("id","lgd"+lid).prepend($(document.createElement("img")).attr("src",this.legend)).click(function(){that.deactivate();if(that.parentLayer){that.parentLayer.deactivate({removeFromParentMaskLayers:true})}that.removeFromLegend()});if(this.url.indexOf("vlayers")>-1){this.$legendItem.prependTo($legend)}else{this.$legendItem.appendTo($legend)}};this.removeFromLegend=function(){if(this.$legendItem)this.$legendItem.remove()};this.setTransparency=function(transparency){this.transparency=parseFloat(transparency)||this.transparency||0; + +if(this.openLayersLayer){this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100)}try{this.emit({type:"transparency",value:this.transparency})}catch(err){var test=this.transparency;var errTxt=err.Message}if(app.map!==undefined){var currentLayer,openLayersLayer,lid;var i;for(i=app.map.getNumLayers()-2;i>0;i--){currentLayer=app.map.layers[i];openLayersLayer=currentLayer.seldonLayer.openLayersLayer;lid=currentLayer.seldonLayer.lid;if(stringContainsChar(currentLayer.name,"Mask")){if(openLayersLayer&&lid.substring(0,lid.indexOf("MaskFor"))===this.lid){openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);currentLayer.seldonLayer.transparency=transparency}}}}}}window.EventEmitter.declare(Layer);return Layer}},{"./stringContainsChar.js":55}],29:[function(require,module,exports){module.exports=function($){function createLayerToggleCheckbox(layer){var checkbox=document.createElement("input"),$checkbox;checkbox.type="checkbox";checkbox.id="chk"+layer.lid;checkbox.onclick=function(){if($(this).is(":checked")){layer.activate()}else{layer.deactivate({removeFromLegend:true,removeFromParentMaskLayers:true})}};$checkbox=$(checkbox);$checkbox.addClass(layer.lid);layer.addListener("activate",function(){$("input."+this.lid).attr("checked",true)});layer.addListener("deactivate",function(){$("input."+this.lid).attr("checked",false)});return checkbox}return createLayerToggleCheckbox}},{}],30:[function(require,module,exports){module.exports=function($){function updateTransparency(layer,value){try{layer.setTransparency(value)}catch(e){var errTxt=e.message}}function createLayerPropertiesDialog(layer){var localTransparency=0;var $html=$(""+'
'+""+""+""+""+""+""+"
Transparency:"+'
'+"
"+'%'+"
"+"
");$html.find("input.transparency-text").val(layer.transparency);if(layer.transparency>0){localTransparency=layer.transparency;layer.setTransparency(localTransparency)}$html.find(".transparency-slider").slider({min:0,max:100,step:1,value:localTransparency,slide:function(event,ui){updateTransparency(layer,ui.value)}});$html.find("input.transparency-text").change(function(){var $this=$(this),newValueFloat=parseFloat($this.val());if(isNaN(newValueFloat)||newValueFloat<0||newValueFloat>100){$this.val(layer.transparency);return}layer.setTransparency($this.val())});layer.addListener("transparency",function(e){$html.find("input.transparency-text").val(e.value)});$html.dialog({zIndex:10050,position:"left",autoOpen:true,hide:"explode",title:layer.name,width:"auto",close:function(){$(this).dialog("destroy");$html.remove();createLayerPropertiesDialog.$html[layer.lid]=undefined}});createLayerPropertiesDialog.$html[layer.lid]=$html}createLayerPropertiesDialog.$html={};return createLayerPropertiesDialog}},{}],31:[function(require,module,exports){module.exports=function($){var createLayerPropertiesDialog=require("./layer_dialog.js")($);function createLayerPropertiesIcon(layer){var img=document.createElement("img");img.id=layer.lid;img.src="icons/settings.png";img.className="layerPropertiesIcon";img.onclick=function(){createLayerPropertiesDialog(layer)};return img}return createLayerPropertiesIcon}},{"./layer_dialog.js":30}],32:[function(require,module,exports){module.exports=function($,app){var generalRadioHandler=require("./layer_radio_handler.js")($,app);function createLayerToggleRadioButton(layer,radioGroupName){var checkbox=document.createElement("input"),$checkbox;checkbox.type="radio";checkbox.name=radioGroupName;checkbox.id=layer.lid;if(layer.selectedInConfig){checkbox.checked=true}$checkbox=$(checkbox);$checkbox.change(radioHandler);layer.addListener("activate",function(){$checkbox.attr("checked",true)});layer.addListener("deactivate",function(){$checkbox.attr("checked",false)});return checkbox}function radioHandler(){generalRadioHandler(app)}return createLayerToggleRadioButton}},{"./layer_radio_handler.js":33}],33:[function(require,module,exports){module.exports=function($,app){var Layer=require("./layer.js")($,app);function radioHandler(app){var $selectedOption=$(app.dropdownBoxList[0]).find(":selected");if($selectedOption.text()==="select..."){clearRadioLayers(app,null);return}var selectLayer=app.dropdownBoxLayers[$selectedOption.val()];var wanted_lid=getActiveDropdownBoxRadioLID(app);var wanted_layer=undefined;var i;for(i=0;i0;i--){currLayer=app.map.layers[i].seldonLayer;for(j=0;j"+selectBoxLayers[i].name+"")}selectBox.insertAdjacentHTML("afterbegin","");$(selectBox).change(selectHandler);return selectBox}function selectHandler(){radioHandler(app)}return createLayerToggleDropdownBox}},{"./layer_radio_handler.js":33}],35:[function(require,module,exports){module.exports=function($,app){function isLayerInLegendConfig(layerId){return layerId in app.legendLookup}function getLegendStringFromPixelValue(layerId,pixelValue){var legendString="";if(isLayerInLegendConfig(layerId)){legendString=app.legendLookup[layerId][pixelValue];if(!legendString){console.error("No legend string set for pixel value",pixelValue,"for layer",layerId)}}return legendString}return getLegendStringFromPixelValue}},{}],36:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js");var saveAs=require("../libs/FileSaver/FileSaver.js").saveAs;var popupId="marker-dialog";var points=[];var pointStyleDefault={pointRadius:4,fillColor:"blue",fillOpacity:.75};var pointStyleHover={pointRadius:5,fillColor:"orange",fillOpacity:.75};var pointStyle=new OpenLayers.StyleMap(pointStyleDefault);function marker(){return new ClickTool(markerHandler)}function markerHandler(e){var coords=app.map.getLonLatFromPixel(e.xy);var lonlat=app.map.getLonLatFromPixel(e.xy);lonlat.transform(app.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));var markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:pointStyle});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));markerLayer.addFeatures(feature);app.map.addLayer(markerLayer);if(!$("#"+popupId).length){createPopup()}if($(".marker-points").length){createPointItem(lonlat,markerLayer)}points.push({lonlat:lonlat,layer:markerLayer});if(typeof ga!=="undefined"){ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Create New Point",eventLabel:lonlat.lon+", "+lonlat.lat})}}function createPointItem(coords,layer){var itemString="";itemString+='
';itemString+='
';itemString+=' Lat:';itemString+=' '+coords.lat+"";itemString+="
";itemString+='
';itemString+=' Lon:';itemString+=' '+coords.lon+"";itemString+="
";itemString+='
';itemString+=' Notes:';itemString+='
';itemString+="
";itemString+="
";var item=$(itemString);item.data("point",layer);item.on("mouseenter",handlePointHoverEnter).on("mouseleave",handlePointHoverLeave);$(".marker-points").append(item)}function handlePointHoverEnter(e){var point=$(this).data("point");point.style=pointStyleHover;point.redraw()}function handlePointHoverLeave(e){var point=$(this).data("point");point.style=pointStyleDefault;point.redraw()}function createPopup(){var popup=$('
');$("body").append(popup);$(".marker-button-download").click(exportFileHandler);$(".marker-button-clear").click(clearPointsHandler);popup.dialog({width:300,height:400,resizable:false,position:{my:"right top",at:"right-5 top+120"},title:"Mark areas of interest",close:function(event,ui){clearPointsHandler();$(this).remove()}})}function exportFileHandler(){var lat,lon,url,notes;var SEP="|";var i;var csvContent="sep="+SEP+"\n";csvContent+="lat"+SEP+"long"+SEP+"google maps link"+SEP+"notes\n";for(i=0;i=0){direction="N"}else if(type==="lat"&&value<0){direction="S"}else if(type==="lon"&&value>=0){direction="E"}else if(type==="lon"&&value<0){direction="W"}value=Math.abs(value);var degree=Math.floor(value);value=(value-degree)*60;var minute=Math.floor(value);var second=(value-minute)*60;return degree+"%C2%B0"+minute+"'"+second+"%22"+direction}function getNotes(index){if(typeof ga!=="undefined"){var label=$(".marker-point-item").eq(index).find(".marker-point-notes").val();ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Notes",eventLabel:label})}return $(".marker-point-item").eq(index).find(".marker-point-notes").val()}function clearPointsHandler(){var i;for(i=0;i')}else{popup.html('
')}popup.dialog({width:600,resizable:false,position:{my:"center+"+offset+" center+"+offset,at:"center",of:window},title:Mustache.render("MODIS NDVI for Lat: {{{lat}}} Lon: {{{lon}}}",{lat:sprintf("%.4f",lonlat.lat),lon:sprintf("%.4f",lonlat.lon)}),close:function(event,ui){app.map.removeLayer(markerLayer);$(this).remove()}});var seldonMultigraph=$("#seldonMultigraph"+app.graphCount+""),promise=seldonMultigraph.multigraph({mugl:muglPrefix+lonlat.lon+","+lonlat.lat,swf:"libs/seldon/libs/Multigraph.swf"});seldonMultigraph.multigraph("done",function(m){if(m){$(m.div()).parent().children(".multigraphLoader").remove()}})})}return createMultigraphTool}},{"./clicktool.js":14}],41:[function(require,module,exports){module.exports=function($){Array.prototype.remove=function(value){if(this.indexOf(value)!==-1){this.splice(this.indexOf(value),1);return true}else{return false}};OpenLayers.Map.prototype.getCurrentSize=function(){var size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=this.div.offsetWidth;size.h=this.div.offsetHeight}if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=parseInt(this.div.style.width,10);size.h=parseInt(this.div.style.height,10)}size.h=size.h-parseInt($(this.div).css("padding-top"),10)-parseInt($(this.div).css("padding-bottom"),10);return size};$.widget("ui.dialog",$.extend({},$.ui.dialog.prototype,{_moveToTop:function(arg){if(arg){if(arg.handleObj.type!="mousedown"){var moved=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;if(moved&&!silent){this._trigger("focus",event)}return moved}}}}))}},{}],42:[function(require,module,exports){module.exports=function($){var createArcGIS93RestParams=require("./create_arcgis_rest_params.js")($);var AccordionGroup=require("./accordion_group.js");var AccordionGroupSublist=require("./accordion_group_sublist.js");var BaseLayer=require("./baselayer.js");var Theme=require("./theme.js");function parseConfig(configXML,shareUrlInfo){var Layer=require("./layer.js")($,this);var createIdentifyTool=require("./identify.js")($,this);var createMultigraphTool=require("./multigraph.js")($,this);var marker=require("./marker.js")($,this);var app=this,$configXML=$(configXML),initialBaseLayer,initialTheme,shareUrlLayerAlpha={},themeOptions={},i,j,k,l,ll,lll;if(shareUrlInfo!==undefined){for(i=0,l=shareUrlInfo.layerLids.length;i0){app.maxExtent={left:parseFloat($extent.attr("xmin")),bottom:parseFloat($extent.attr("ymin")),right:parseFloat($extent.attr("xmax")),top:parseFloat($extent.attr("ymax"))}}var $baseCombo=$("#baseCombo"),$images=$configXML.find("images image"),$image,selected,baseLayer;for(i=0,l=$images.length;ionline.',mapName:"Layers",info:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including the terms of use, visit us online at http://goto.arcgisonline.com/maps/World_Street_Map",copyrightText:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012",layers:[{id:0,name:"World Street Map",parentLayerId:-1,defaultVisibility:true,subLayerIds:null,minScale:0,maxScale:0}],tables:[],spatialReference:{wkid:102100},singleFusedMapCache:true,tileInfo:{rows:256,cols:256,dpi:96,format:"JPEG",compressionQuality:90,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:0,resolution:156543.033928,scale:591657527.591555},{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176}]},initialExtent:{xmin:-28872328.0888923,ymin:-11237732.4896886,xmax:28872328.0888923,ymax:11237732.4896886,spatialReference:{wkid:102100}},fullExtent:{xmin:-20037507.0671618,ymin:-19971868.8804086,xmax:20037507.0671618,ymax:19971868.8804086,spatialReference:{wkid:102100}},units:"esriMeters",supportedImageFormatTypes:"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI,BMP",documentInfo:{Title:"World Street Map",Author:"Esri",Comments:"",Subject:"streets, highways, major roads, railways, water features, administrative boundaries, cities, parks, protected areas, landmarks ",Category:"transportation(Transportation Networks) ",Keywords:"World, Global, Europe, Japan, Hong Kong, North America, United States, Canada, Mexico, Southern Africa, Asia, South America, Australia, New Zealand, India, Argentina, Brazil, Chile, Venezuela, Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, Switzerland, Russia, Thailand, Turkey, 2012",Credits:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"},capabilities:"Map"};app.initOpenLayers(baseLayerInfo,initialBaseLayer,initialTheme,themeOptions,initialExtent);return $configXML}function displayError(message){}return parseConfig}},{"./accordion_group.js":3,"./accordion_group_sublist.js":5,"./baselayer.js":13,"./create_arcgis_rest_params.js":16,"./identify.js":24,"./layer.js":28,"./marker.js":36,"./multigraph.js":40,"./theme.js":56}],43:[function(require,module,exports){module.exports=function($,app){function printMap($configXML){var offsetX=parseInt(app.map.layerContainerDiv.style.left,10);var offsetY=parseInt(app.map.layerContainerDiv.style.top,10);var size=app.map.getSize();var tiles=[];var layer,tile,position;var i,j,k;for(i=0;i
');printPopup.dialog({resizable:false,height:75,title:"Creating Image for Print...",close:function(event,ui){$(this).remove()}});var service_url=$configXML.find("tools tool[name=Print]").attr("service_url");if(!service_url){service_url="http://"+window.location.hostname+window.location.pathname}service_url=service_url.replace(/\/$/,"");var service_name=$configXML.find("tools tool[name=Print]").attr("service_name");if(!service_name){service_name="cgi-bin/print.cgi"}var title=$configXML.find("tools tool[name=Print]").attr("title");if(!title){title="U.S Forest Change Assessment Viewer"}$.ajax({url:service_url+"/"+service_name, +type:"POST",data:OpenLayers.Util.getParameterString({width:size.w,height:size.h,tiles:tiles_json,legends:legends_json,title:title}),headers:{"Content-Type":"application/x-www-form-urlencoded"},success:function(data,status,jqxhr){data=data.replace(/\s+/,"");var href=service_url+"/cgi-bin/printed_map.jpg";if(data){href=service_url+"/"+data}$("#printMapLoader").html('
print image result
');printPopup.dialog("option","title","Print Image Created!")},error:function(jqxhr,status,err){$("#printMapLoader").html("
An error happended.
");printPopup.dialog("option","title","NO Print Image Created!")}})}return printMap}},{}],44:[function(require,module,exports){function RepeatingOperation(op,yieldEveryIteration){var count=0;var instance=this;this.step=function(args){if(++count>=yieldEveryIteration){count=0;setTimeout(function(){op(args)},1,[]);return}op(args)}}module.exports=RepeatingOperation},{}],45:[function(require,module,exports){module.exports=function($){function handle_search(location,app){var rest_endpoint="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text="+location+"&f=json";$.getJSON(rest_endpoint,function(data){var locations=data["locations"][0];if(locations===undefined){return}var extent=locations["extent"];var bounds=new OpenLayers.Bounds(extent.xmin,extent.ymin,extent.xmax,extent.ymax).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));app.zoomToExtent(bounds,true)})}return handle_search}},{}],46:[function(require,module,exports){(function($){"use strict";require("./overrides.js")($);var seldon={App:require("./app.js")($)};var app=new seldon.App;seldon.init=require("./init.js")(app);window.seldon=seldon})(jQuery)},{"./app.js":11,"./init.js":25,"./overrides.js":41}],47:[function(require,module,exports){module.exports=function($){function setBaseLayer(baseLayer){var resolutions=[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,.5971642833948135];var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets");handleBaseLayer(app,layer,baseLayer)}else if(baseLayer.type=="ArcGISCache"){$.ajax({url:baseLayer.url+"?f=json&pretty=true",dataType:"jsonp",success:function(layerInfo){var options={layerInfo:layerInfo};if(baseLayer.numZoomLevels){options.numZoomLevels=baseLayer.numZoomLevels;if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);options.serverResolutions=serverResolutions;options.resolutions=resolutions}}var layer=new OpenLayers.Layer.ArcGISCache(baseLayer.name,baseLayer.url,options);handleBaseLayer(app,layer,baseLayer)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet,sphericalMercator:true};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings);handleBaseLayer(app,layer,baseLayer)}}function handleBaseLayer(app,layer,baseLayer){app.map.removeLayer(app.map.layers[0]);app.currentBaseLayer=baseLayer;app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.emit("baselayerchange")}return setBaseLayer}},{}],48:[function(require,module,exports){function ga_events($){var eventAdded=false;try{$.ga.trackEvent;eventAdded=true}catch(err){eventAdded=false}if(typeof ga!=="undefined"){if(eventAdded){seldon.app.map.events.register("moveend",seldon.app.map,function(){var newMapExtent=seldon.app.map.getExtent();$.ga.trackEvent({category:"Map Extent",action:"Change",label:newMapExtent.toString(),nonInteractive:true})});$(".shareMapUrl").click(function(event){$.ga.trackEvent({category:"Share Map URL",action:"Click",label:$(".shareMapUrl").val()})});$("#mapTheme #themeCombo").change(function(event){$.ga.trackEvent({category:"Map Theme",action:"Change",label:$("#mapTheme #themeCombo option:selected").text()})});$("#txtFindArea input#address_field").keyup(function(event){if(event.which===13){$.ga.trackEvent({category:"Find Area",action:"Search Enter",label:$(this).val()})}});$("#txtFindArea #address_lookup img").click(function(event){$.ga.trackEvent({category:"Find Area",action:"Search Button",label:$("#txtFindArea input#address_field").val()})});$("#mapBase #baseCombo").change(function(event){$.ga.trackEvent({category:"Base Map",action:"Change",label:$("#mapBase #baseCombo option:selected").text()})});$(".header-bar .header-bar img.icon").gaTrackEvent({category:"Nav Bar",action:"click",useLabel:true,labelAttribute:"title",useEvent:true,event:"click"});$("#mapToolsDialog label[for^='chk']").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#mapToolsDialog input").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("#layerPickerDialog label[for^='chk']").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#layerPickerDialog input").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("h3.ui-accordion-header").gaTrackEvent({category:"Base Layer",action:"Toggle Accordion",useLabel:true,label:function(){return $(this).text()},useEvent:true,event:"click"});$("#marker-dialog .marker-button-wrapper .marker-button-download").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Download Points"})});$("#marker-dialog .marker-button-wrapper .marker-button-clear").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Clear Points"})});$("#marker-dialog .marker-point-label .marker-point-coords-label").focusout(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Notes",label:$(this).val()})});$("img[src$='slider.png']").mouseup(function(event){$.ga.trackEvent({category:"OpenLayers Buttons",action:"Slide",label:"Zoom Slider"})});$(".olButton").click(function(event){var eleId=$(this).attr("id");switch(true){case eleId.indexOf("ZoombarOpenLayers_Map")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Bar"});break;case eleId.indexOf("panleft")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan Left"});break;case eleId.indexOf("panright")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan right"});break;case eleId.indexOf("panup")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan up"});break;case eleId.indexOf("pandown")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan down"});break;case eleId.indexOf("zoomin")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom in"});break;case eleId.indexOf("zoomout")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Out"});break;default:}})}}}module.exports=ga_events},{}],49:[function(require,module,exports){module.exports=function($){function setMaskByLayer(toggle,parentLayer){var Layer=require("./layer.js")($,this);var app=this;var maskLayer,maskName,cleanMaskName;var m,ml,mld;if(toggle){for(m=0;m0;i--){var currLayer=app.map.layers[i];for(var j=0;j0||sublist.break?"":" empty";var collapsibleClass=sublist.collapsible?" collapsible":"";var collapseHeaderIcon=sublist.collapsible?'':"";var sublistInfo=sublist.info?'
'+sublist.info+"
":"";var sublistObj={heading:sublist.label,items:[],collapsible:sublist.collapsible,contentElement:$('
'+'
'+collapseHeaderIcon+"

"+sublist.label+"

"+sublistInfo+"
"+"
")};if(sublist.description){var sublistInfoButton=new MoreInfoButton(sublist);sublistObj.contentElement.children(".sublist-header").append(sublistInfoButton.element)}g.sublists.push(sublistObj);sublistItems.push(sublistObj.contentElement);var sublistLayerItems=[];for(var k=0,l=sublist.layers.length;k=0){name=this.substring(0,i);value=this.substring(i+1)}else{name=this;value=undefined}vars[name]=value});info.themeName=vars.theme;info.accordionGroupGid=vars.accgp;info.baseLayerName=vars.basemap;if(vars.extent){var extentCoords=vars.extent.split(",");info.extent={left:extentCoords[0],bottom:extentCoords[1],right:extentCoords[2],top:extentCoords[3]}}if(vars.layers){$.each(vars.layers.split(","),function(){info.layerLids.push(this)})}if(vars.mask){$.each(vars.mask.split(","),function(){info.layerMask.push(this)})}if(vars.modifiers){$.each(vars.modifiers.split(","),function(){info.maskModifiers.push(this)})}if(vars.alphas){$.each(vars.alphas.split(","),function(){info.layerAlphas.push(this)})}if(info.themeName&&info.baseLayerName){return info}return undefined};ShareUrlInfo.prototype.urlArgs=function(){return Mustache.render(""+"theme={{{theme}}}"+"&layers={{{layers}}}"+"&mask={{{mask}}}"+"{{{modifiers}}}"+"&alphas={{{alphas}}}"+"&accgp={{{accgp}}}"+"&basemap={{{basemap}}}"+"&extent={{{extent.left}}},{{{extent.bottom}}},{{{extent.right}}},{{{extent.top}}}",{theme:this.themeName,layers:this.layerLids.join(","),mask:this.layerMask.join(","),modifiers:this.maskModifiers.length>0?"&modifiers="+this.maskModifiers.join(","):"",alphas:this.layerAlphas.join(","),accgp:this.accordionGroupGid,basemap:this.baseLayerName,extent:this.extent})};module.exports=ShareUrlInfo},{}],53:[function(require,module,exports){module.exports=function($){var stringContainsChar=require("./stringContainsChar.js");var ShareUrlInfo=require("./share.js");function shareUrl(){if(!this.currentTheme){return undefined}if(!this.currentAccordionGroup){return undefined}if(!this.currentBaseLayer){return undefined}var extent=this.map.getExtent(),layerLids=[],layerAlphas=[],layerMask=[],url;if(!extent){return undefined}$.each(this.map.layers,function(){var op,lid,test;if(!this.isBaseLayer){if(this.opacity===1){op="1"}else if(this.opacity===0){op="0"}else{op=sprintf("%.2f",this.opacity)}if(stringContainsChar(this.name,"MaskFor")){lid=this.seldonLayer.lid;test=lid.substring(lid.indexOf("MaskFor"),lid.length).replace("MaskFor","");if(layerMask.indexOf(test)===-1){layerMask.push(test)}test=this.name.substring(0,this.name.indexOf("MaskFor"));if(layerLids.indexOf(test)===-1){layerLids.push(test);layerAlphas.push(op)}}else{if(this.seldonLayer){layerLids.push(this.seldonLayer.lid);layerAlphas.push(op)}}}});if(this.hasOwnProperty("maskModifiers")){var modifiers=this.maskModifiers.filter(function(val){return val!==""})}url=window.location.toString();url=url.replace(/\?.*$/,"");url=url.replace(/\/$/,"");url=url.replace("#","");return url+"?"+new ShareUrlInfo({themeName:this.currentTheme.name,layerLids:layerLids,layerMask:layerMask,maskModifiers:modifiers,layerAlphas:layerAlphas,accordionGroupGid:this.currentAccordionGroup.gid,baseLayerName:this.currentBaseLayer.name,extent:extent}).urlArgs()}return shareUrl}},{"./share.js":52,"./stringContainsChar.js":55}],54:[function(require,module,exports){module.exports=function($){function createSplashScreen(){var $document=$(document),windowWidth=Math.round($document.width()/2);$("#splashScreenContent").load("splashScreen.html");$("#splashScreenContainer").dialog({autoOpen:false,zIndex:10051,maxHeight:$document.height(),width:windowWidth,minWidth:300,dialogClass:"splashScreenStyle",hide:"explode"})}return createSplashScreen}},{}],55:[function(require,module,exports){function stringContainsChar(string,c){return string.indexOf(c)>=0}module.exports=stringContainsChar},{}],56:[function(require,module,exports){function Theme(settings){this.accordionGroups=[];if(!settings){return}this.name=settings.name;this.label=settings.label;this.index=settings.index;this.zoom=settings.zoom;this.xmin=settings.xmin;this.ymin=settings.ymin;this.xmax=settings.xmax;this.ymax=settings.ymax;this.getAccordionGroupIndex=function(accordionGroup){var i;for(i=0;i Date: Fri, 16 Sep 2022 13:16:06 -0400 Subject: [PATCH 8/8] upgraded seldon in support of sentinel-3 multigraph --- html/libs/seldon/js/multigraph.js | 2 +- html/libs/seldon/seldon-min.js | 5 +---- html/libs/seldon/seldon.js | 4 ++-- libs/seldon | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/html/libs/seldon/js/multigraph.js b/html/libs/seldon/js/multigraph.js index 03bbdf9..4e2ed69 100644 --- a/html/libs/seldon/js/multigraph.js +++ b/html/libs/seldon/js/multigraph.js @@ -55,7 +55,7 @@ module.exports = function ($, app) { width : 600, resizable : false, position : { my: "center+" + offset + " center+" + offset, at: "center", of: window }, - title : Mustache.render('MODIS NDVI for Lat: {{{lat}}} Lon: {{{lon}}}', + title : Mustache.render('Sentinel-3 NDVI for Lat: {{{lat}}} Lon: {{{lon}}}', { lat : sprintf("%.4f", lonlat.lat), lon : sprintf("%.4f", lonlat.lon) diff --git a/html/libs/seldon/seldon-min.js b/html/libs/seldon/seldon-min.js index 14b5719..259419b 100644 --- a/html/libs/seldon/seldon-min.js +++ b/html/libs/seldon/seldon-min.js @@ -1,4 +1 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o"+'

'+el.description+"

"+"";$(dialogDiv).dialog({title:el.label||el.name,dialogClass:"tooltip-dialog "+dialogClass})}}}return MoreInfoButton}},{}],7:[function(require,module,exports){module.exports=function($){function addAccordionSection(accordionGroup,title){var sectionObj={title:title,titleElement:$("

"+title+"

"),contentElement:$("
"),sublists:[]};var $accordionGroup=$(accordionGroup);$accordionGroup.data("listAccordion").sections.push(sectionObj);$accordionGroup.append(sectionObj.titleElement).append(sectionObj.contentElement);$accordionGroup.accordion("refresh");return sectionObj}return addAccordionSection}},{}],8:[function(require,module,exports){module.exports=function($){function addAccordionSublists(g,items){$(g.contentElement).append(items)}return addAccordionSublists}},{}],9:[function(require,module,exports){module.exports=function($){function addAccordionSublistItems(s,items,theme,accGp){var collapsed=s.collapsible?"collapsed ":"";var contents=$('
');for(var i=0,l=items.length;i').append(items[i]))}var layer={name:name,contentElement:contents};s.items.push(layer);s.contentElement.append(layer.contentElement)}return addAccordionSublistItems}},{}],10:[function(require,module,exports){module.exports=function($){function addMaskToLegend(layer){var app=this;var maskName=layer.lid.substring(layer.lid.indexOf("MaskFor"),layer.lid.length);$("#lgd"+maskName).remove();layer.$legendItem=$(document.createElement("div")).attr("id","lgd"+maskName).prepend($(document.createElement("img")).attr("src",layer.legend)).prependTo($("#legend")).click(function(){app.setMaskByMask(false,maskName)})}return addMaskToLegend}},{}],11:[function(require,module,exports){module.exports=function($){var EventEmitter=window.EventEmitter;function App(){EventEmitter.call(this);this.map=undefined;this.tileManager=undefined;this.projection=undefined;this.gisServerType=undefined;this.useProxyScript=undefined;this.scalebar=undefined;this.zoomInTool=undefined;this.zoomOutTool=undefined;this.dragPanTool=undefined;this.id_markerLayer=undefined;this.maxExtent={left:-15e6,bottom:2e6,right:-6e6,top:7e6};this.baseLayers=[];this.accordionGroups=[];this.themes=[];this.maskParentLayers=[];this.masks=[];this.maskModifiers=[];this.defaultMasks=["MaskForForest"];this.radioButtonList=[];this.radioButtonLayers=[];this.dropdownBoxList=[];this.dropdownBoxLayers=[];this.currentBaseLayer=undefined;this.currentAccordionGroup=undefined;this.currentTheme=undefined;this.identifyTool=undefined;this.multigraphTool=undefined;this.markerTool=undefined;this.savedExtents=[];this.currentSavedExtentIndex=-1;this.saveCurrentExtent=require("./extent_save.js");this.zoomToExtent=require("./extent_zoom.js");this.zoomToPreviousExtent=require("./extent_zoom_previous.js");this.zoomToNextExtent=require("./extent_zoom_next.js");this.printSavedExtents=require("./extent_print.js");this.setBaseLayer=require("./set_base_layer.js")($);this.setAccordionGroup=require("./accordion_group_set.js");this.clearAccordionSections=require("./accordion_clear.js")($);this.addAccordionSection=require("./accordion_section_add.js")($);this.addAccordionSublists=require("./accordion_sublist_add.js")($);this.addAccordionSublistItems=require("./accordion_sublist_item_add.js")($);this.setTheme=require("./set_theme.js")($);this.shareUrl=require("./share_url.js")($);this.updateShareMapUrl=require("./update_share_url.js")($);this.launch=require("./launch.js")($);this.count=require("./count.js");this.addMaskToLegend=require("./add_mask_legend.js")($);this.setMaskByMask=require("./set_mask_by_mask.js")($);this.setMaskByLayer=require("./set_mask_by_layer.js")($);this.handleMaskModifier=require("./mask_modifier.js");this.handleMaskModifierGroup=require("./mask_modifier_group.js")($);this.parseConfig=require("./parse_config.js")($);this.initOpenLayers=require("./init_openlayers.js");this.setupCollapsibleSublists=require("./accordion_collapsible_sublist_setup.js")($);this.removeMaskFromLegend=function(layer){};OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.IMAGE_RELOAD_ATTEMPTS=3}EventEmitter.declare(App);return App}},{"./accordion_clear.js":1,"./accordion_collapsible_sublist_setup.js":2,"./accordion_group_set.js":4,"./accordion_section_add.js":7,"./accordion_sublist_add.js":8,"./accordion_sublist_item_add.js":9,"./add_mask_legend.js":10,"./count.js":15,"./extent_print.js":18,"./extent_save.js":19,"./extent_zoom.js":20,"./extent_zoom_next.js":21,"./extent_zoom_previous.js":22,"./init_openlayers.js":26,"./launch.js":27,"./mask_modifier.js":38,"./mask_modifier_group.js":39,"./parse_config.js":42,"./set_base_layer.js":47,"./set_mask_by_layer.js":49,"./set_mask_by_mask.js":50,"./set_theme.js":51,"./share_url.js":53,"./update_share_url.js":57}],12:[function(require,module,exports){function arrayContainsElement(array,element){var i;if(array===undefined){return false}for(i=0;iparam").each(function(i,param){var $param=$(param);if(param.hasAttribute("value")){obj[$param.attr("name")]=$param.attr("value")}else{obj[$param.attr("name")]=createArcGIS93RestParams($param)}});return obj}return createArcGIS93RestParams}},{}],17:[function(require,module,exports){module.exports=function(app,activeBtn){function deactivateActiveOpenLayersControls(){var controls,i;for(i=0;i=0;--i){e=this.savedExtents[i];html+=Mustache.render("{{{marker}}}{{{number}}}"+"left:{{{left}}}, bottom:{{{bottom}}}, right:{{{right}}}, top:{{{top}}}",{marker:i===this.currentSavedExtentIndex?"==>":"",number:i,left:e.left,bottom:e.bottom,right:e.right,top:e.top})}html+="";return html}module.exports=printSavedExtents},{}],19:[function(require,module,exports){var extentsAreEqual=require("./extents_equal.js");function saveCurrentExtent(){var newExtent=formatExtent(this.map.getExtent()),newSavedExtents=[],currentSavedExtent,i;if(this.currentSavedExtentIndex>=0){currentSavedExtent=this.savedExtents[this.currentSavedExtentIndex];if(extentsAreEqual(currentSavedExtent,newExtent)){return}}for(i=0;i<=this.currentSavedExtentIndex;++i){newSavedExtents.push(this.savedExtents[i])}this.savedExtents=newSavedExtents;this.savedExtents.push(newExtent);++this.currentSavedExtentIndex}function formatExtent(extent){return{left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top}}module.exports=saveCurrentExtent},{"./extents_equal.js":23}],20:[function(require,module,exports){function zoomToExtent(extent,save){if(save===undefined){save=true}var bounds=new OpenLayers.Bounds(extent.left,extent.bottom,extent.right,extent.top);this.map.zoomToExtent(bounds,true);if(save){this.saveCurrentExtent()}}module.exports=zoomToExtent},{}],21:[function(require,module,exports){function zoomToNextExtent(){if(this.currentSavedExtentIndex0){--this.currentSavedExtentIndex;this.zoomToExtent(this.savedExtents[this.currentSavedExtentIndex],false)}}module.exports=zoomToPreviousExtent},{}],23:[function(require,module,exports){function extentsAreEqual(e1,e2){var tolerance=.001;return Math.abs(e1.left-e2.left)<=tolerance&&Math.abs(e1.bottom-e2.bottom)<=tolerance&&Math.abs(e1.right-e2.right)<=tolerance&&Math.abs(e1.top-e2.top)<=tolerance}module.exports=extentsAreEqual},{}],24:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js"),stringContainsChar=require("./stringContainsChar.js");var getLegendStringFromPixelValue=require("./legend_config.js")($,app);function createIdentifyTool(){return new ClickTool(function(e){$("#identify_popup").remove();if(app.id_markerLayer){app.map.removeLayer(app.id_markerLayer)}var coords=app.map.getLonLatFromPixel(e.xy);var styleMap=new OpenLayers.StyleMap({pointRadius:4,fillColor:"yellow",fillOpacity:.75});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));app.id_markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:styleMap});app.id_markerLayer.addFeatures(feature);app.map.addLayer(app.id_markerLayer);var services=[],service,urlsrs;var layersAdded=[];var html='';$.each(app.map.layers,function(){var name,label;if(!this.isBaseLayer&&this.params&&(!("seldonLayer"in this)||String(this.seldonLayer.identify)!=="false")){name=this.params.LAYERS;if(String(name).match(/^\d+$/)){label=this.name}else{label=String(name).indexOf("MaskFor")!==-1?name.substring(0,name.indexOf("MaskFor")):name}if(layersAdded.indexOf(label)!==-1)return;layersAdded.push(label);services.push({url:this.url,srs:this.projection.projCode,name:name,label:label,proxyServerType:this.seldonLayer.proxyServerType});html=html+Mustache.render(""+''+''+''+"",{label:label})}});html=html+"
{{label}}:
";if(services.length===0){return}var popup=$(document.createElement("div"));popup.attr("id","identify_popup");popup.html(html);popup.dialog({width:600,height:300,resizable:true,title:"Identify Results",close:function(event,ui){app.map.removeLayer(app.id_markerLayer);app.id_markerLayer=undefined;$(this).remove()}});var i,l;for(i=0,l=services.length;i'+''+valueLabel.replace("_0","")+":  "+""+tableRow+""+""}$(newTableContents).insertAfter($group);if(!newTableContents)$group.find(".layer-results").text("N/A")},error:function(jqXHR,textStatus,errorThrown){}})}function createWMSGetFeatureInfoRequestURL(serviceUrl,layer,srs,x,y){var extent=app.map.getExtent();if(seldon.gisServerType==="ArcGIS"){extent=extent.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection(seldon.projection))}return Mustache.render(""+serviceUrl+"{{{c}}}LAYERS={{layer}}"+"&QUERY_LAYERS={{layer}}"+"&STYLES=,"+"&SERVICE=WMS"+"&VERSION=1.1.1"+"&REQUEST=GetFeatureInfo"+"&BBOX={{left}},{{bottom}},{{right}},{{top}}"+"&FEATURE_COUNT=100"+"&HEIGHT={{height}}"+"&WIDTH={{width}}"+"&FORMAT=image/png"+"&INFO_FORMAT=application/vnd.ogc.gml"+"&SRS={{srs}}"+"&X={{x}}"+"&Y={{y}}",{c:stringContainsChar(serviceUrl,"?")?"&":"?",layer:layer,height:app.map.size.h,width:app.map.size.w,left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top,srs:srs,x:x,y:y})}function getLayerResultsFromArcXML($xml,layerName,layerIDCount){var dataVals=[];try{var fields=$xml.find("FIELDS"),attributes=fields[layerIDCount].attributes,i;for(i=0;i=0||stringStartsWith(layerName,"EFETAC-NASA")||stringStartsWith(layerName,"RSAC-FHTET"))&&children[i].nodeName==="value_0"){value=value+sprintf(" (%.2f %%)",(parseFloat(value,10)-127)/128*100)}if((stringStartsWith(layerName.toUpperCase(),"NDMI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"NDVI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SWIR-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDVI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDMI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-SWIR-CURRENT"))&&children[i].nodeName==="value_0"){value=sprintf("%.0f %%",parseFloat(value,10)-128)}returnVals[i]=[children[i].nodeName,value]}}return returnVals}function stringStartsWith(string,prefix){return string.substring(0,prefix.length)===prefix}return createIdentifyTool}},{"./clicktool.js":14,"./legend_config.js":35,"./stringContainsChar.js":55}],25:[function(require,module,exports){module.exports=function(app){var ShareUrlInfo=require("./share.js");function init(config,projection,legendLookup,gisServerType,useProxyScript){var shareUrlInfo=ShareUrlInfo.parseUrl(window.location.toString());app.projection=projection;seldon.projection=projection;app.legendLookup=legendLookup;seldon.gisServerType=gisServerType;seldon.useProxyScript=useProxyScript;app.launch(config,shareUrlInfo);seldon.app=app}return init}},{"./share.js":52}],26:[function(require,module,exports){function initOpenLayers(baseLayerInfo,baseLayer,theme,themeOptions,initialExtent){var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets",{numZoomLevels:20})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings)}else if(baseLayer.type=="ArcGISCache"){var layer=new OpenLayers.Layer.ArcGISCache("AGSCache",baseLayer.url,{layerInfo:baseLayerInfo})}var maxExtentBounds;if(theme.xmax&&theme.xmin&&theme.ymax&&theme.ymin){maxExtentBounds=new OpenLayers.Bounds(theme.xmin,theme.ymin,theme.xmax,theme.ymax)}else{maxExtentBounds=new OpenLayers.Bounds(app.maxExtent.left,app.maxExtent.bottom,app.maxExtent.right,app.maxExtent.top)}if(initialExtent===undefined){initialExtent=app.maxExtent}app.tileManager=new OpenLayers.TileManager({cacheSize:12,moveDelay:750,zoomDelay:750});app.map=new OpenLayers.Map("map",{units:"m",tileManager:app.tileManager,controls:[new OpenLayers.Control.Navigation,new OpenLayers.Control.Attribution,app.zoomInTool,app.zoomOutTool,app.identifyTool,app.multigraphTool,app.markerTool],eventListeners:{moveend:function(){app.emit("extentchange")},zoomend:function(){app.emit("extentchange")}},projection:new OpenLayers.Projection(seldon.projection)});app.currentBaseLayer=baseLayer;app.emit("baselayerchange");app.map.addControl(new OpenLayers.Control.ScaleLine({bottomOutUnits:"mi"}));app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.setTheme(theme,themeOptions);app.zoomToExtent(initialExtent);app.saveCurrentExtent();app.map.events.register("mousemove",app.map,function(e){var pixel=app.map.events.getMousePosition(e);var lonlat=app.map.getLonLatFromPixel(pixel);lonlat=lonlat.transform(new OpenLayers.Projection("EPSG:3857"),new OpenLayers.Projection("EPSG:4326"));OpenLayers.Util.getElement("latLonTracker").innerHTML="Lat: "+sprintf("%.5f",lonlat.lat)+" Lon: "+sprintf("%.5f",lonlat.lon)+""});app.map.addControl(new OpenLayers.Control.PanZoomBar)}module.exports=initOpenLayers},{}],27:[function(require,module,exports){module.exports=function($){var createSplashScreen=require("./splash.js")($);var handle_search=require("./search.js")($);var ga_events=require("./set_google_analytics_events.js");var areasList=[];var activeBtn=[];function launch(configFile,shareUrlInfo){var deactivateActiveOpenLayersControls=require("./deactivate_controls.js")(this,activeBtn);var printMap=require("./print.js")($,this);var app=this;app.initialThemeLoad=true;var $configXML;$.ajax({url:configFile,dataType:"xml",success:function(configXML){$configXML=app.parseConfig(configXML,shareUrlInfo);ga_events($)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}});$("#btnTglLyrPick").click(function(){var $layerPickerDialog=$("#layerPickerDialog");if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close")}else{$layerPickerDialog.dialog("open")}});$("#layerPickerDialog").dialog({zIndex:10050,position:{my:"left top",at:"left+5 top+100"},autoOpen:true,hide:"fade",width:330});app.addListener("accordiongroupchange",function(){if(app.currentTheme){$("#layerPickerAccordion").accordion({active:app.currentTheme.getAccordionGroupIndex(app.currentAccordionGroup),collapsible:true,beforeActivate:function(event,ui){if(!app.initialThemeLoad){$("#layerPickerDialog").scrollTop(0)}},activate:function(event,ui){app.setupCollapsibleSublists(ui);if(app.initialThemeLoad){app.initialThemeLoad=false;$("#layerPickerDialog").scrollTop(755)}}})}});$("#btnTglMapTools").click(function(){var $mapToolsDialog=$("#mapToolsDialog");if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close")}else{$mapToolsDialog.dialog("open")}});$("#mapToolsDialog").dialog({zIndex:10050,position:{my:"right top",at:"right-5 top+100"},autoOpen:true,hide:"fade"});app.addListener("themechange",function(){app.updateShareMapUrl()});app.addListener("baselayerchange",function(){app.updateShareMapUrl()});app.addListener("accordiongroupchange",function(){app.updateShareMapUrl()});app.addListener("extentchange",function(){app.saveCurrentExtent();app.updateShareMapUrl()});var $mapToolsAccordion=$("#mapToolsAccordion"),accordionGroupIndexToOpen=0;$mapToolsAccordion.accordion({heightStyle:"content",collapsible:true});$mapToolsAccordion.find("div").each(function(i){if(this.id==="legend"){accordionGroupIndexToOpen=i;return false}return true});$mapToolsAccordion.accordion("option","active",accordionGroupIndexToOpen);$("#baseCombo").change(function(){var i=parseInt($(this).val(),10);app.setBaseLayer(app.baseLayers[i])});app.addListener("baselayerchange",function(){$("#baseCombo").val(app.currentBaseLayer.index)});$("#themeCombo").change(function(){var i=parseInt($(this).val(),10);app.setTheme(app.themes[i])});app.addListener("themechange",function(){$("#themeCombo").val(app.currentTheme.index)});$("#btnPan").click(function(){deactivateActiveOpenLayersControls();app.dragPanTool.activate()});$("#btnPrint").click(function(){if($configXML!==undefined){printMap($configXML)}else{console.log("Can't print yet; config file not yet parsed")}});$("#btnZoomIn").click(function(){deactivateActiveOpenLayersControls();app.zoomInTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomOut").click(function(){deactivateActiveOpenLayersControls();app.zoomOutTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomExtent").click(function(){app.zoomToExtent(app.maxExtent)});$("#btnID").click(function(){deactivateActiveOpenLayersControls();app.identifyTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnAbout").click(function(){var splashScreen=$("#splashScreenContainer");if(splashScreen.dialog("isOpen")){splashScreen.dialog("close")}else{splashScreen.dialog("open")}});$("#btnPrev").click(function(){app.zoomToPreviousExtent()});$("#btnNext").click(function(){app.zoomToNextExtent()});$("#btnMultiGraph").click(function(){deactivateActiveOpenLayersControls();app.multigraphTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnMarker").click(function(){deactivateActiveOpenLayersControls();app.markerTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});createSplashScreen();var $findArea=$("#findArea");$findArea.findArea();areasList=$findArea.findArea("getAreasList");$findArea.autocomplete({source:areasList});$findArea.keypress(function(e){if(e.which==13){var areaExtent=$findArea.findArea("getAreaExtent",$findArea.val(),areasList);app.zoomToExtent(areaExtent)}});$("#address_lookup").on("click",function(){var location=$("#address_field").val();handle_search(location,app)});$("#address_field").on("keypress",function(e){if(e.which===13){var location=$(this).val();handle_search(location,app)}});$(".mask-toggle").on("click",function(){if($(this).is(":checked")){app.setMaskByMask(true,this.value)}else{app.setMaskByMask(false,this.value)}});$("[data-mask-grouper='true']").on("change",function(){var disabled=$(this).is(":checked")?true:false;$("[data-mask-parent='"+this.value+"']").attr("disabled",disabled)});$(".mask-modifier").on("change",function(){var value=$(this).is(":checked")?this.value:"";var index=$(this).data("index");if($(this).data("maskGrouper")===true){app.handleMaskModifierGroup(this.value,$(this).is(":checked"))}app.handleMaskModifier(value,index)});$("textarea").focus(function(){var $this=$(this);$this.select();window.setTimeout(function(){$this.select()},1);function mouseUpHandler(){$this.off("mouseup",mouseUpHandler);return false}$this.mouseup(mouseUpHandler)});if($(window).width()<650){$("#mapToolsDialog").dialog("close");$("#layerPickerDialog").dialog("close")}if(window.addEventListener){window.addEventListener("orientationchange",function(){var $mapToolsDialog=$("#mapToolsDialog"),$layerPickerDialog=$("#layerPickerDialog");window.scroll(0,0);if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close").dialog("open")}if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close").dialog("open")}},false)}}return launch}},{"./deactivate_controls.js":17,"./print.js":43,"./search.js":45,"./set_google_analytics_events.js":48,"./splash.js":54}],28:[function(require,module,exports){module.exports=function($,app){var stringContainsChar=require("./stringContainsChar.js");function Layer(settings){EventEmitter.call(this);if(!settings){return}$.extend(true,this,settings);if(this.index==undefined){this.index=0}if(this.type==undefined){this.type="WMS"}this.createOpenLayersLayer=function(){if(this.openLayersLayer!==undefined){return this.openLayersLayer}var options={isBaseLayer:false,transitionEffect:"resize",buffer:0,tileSize:new OpenLayers.Size(2048,2048)};if(this.type==="WMTS"){var settings={name:this.name,url:this.url,layer:this.layers,style:this.style,matrixSet:this.srs,isBaseLayer:false,transitionEffect:"resize",format:"image/jpg",sphericalMercator:true};if(this.lid.indexOf("GLAM")>-1){$.extend(true,settings,{serverResolutions:[156543.033928041,78271.5169640205,39135.7584820102,19567.8792410051,9783.9396205026,4891.9698102513,2445.9849051256,1222.9924525628,611.4962262814,305.7481131407048],units:"m",tileOrigin:new OpenLayers.LonLat(-20037508.34,20037508.34)})}this.openLayersLayer=new OpenLayers.Layer.WMTS(settings)}else if(this.type==="XYZ"){this.openLayersLayer=new OpenLayers.Layer.XYZ(this.name,this.url,{isBaseLayer:false,projection:new OpenLayers.Projection(seldon.projection)})}else if(this.type==="ArcGIS93Rest"){this.openLayersLayer=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params.mosaicRule?$.extend(true,{},this.params,{mosaicRule:JSON.stringify(this.params.mosaicRule)}):this.params,options)}else{if(this.maxResolution){options.maxResolution=parseFloat(this.maxResolution)}var layer=this.layers+("mask"in this?app.maskModifiers.join(""):"");this.openLayersLayer=new OpenLayers.Layer.WMS(this.name,this.url,{projection:new OpenLayers.Projection(seldon.projection),units:"m",layers:layer,transparent:true},options)}var loadingimage=$('');$("#map").append(loadingimage);this.openLayersLayer.loadingimage=loadingimage;this.openLayersLayer.events.register("loadstart",this.openLayersLayer,function(){this.loadingimage.addClass("loading")});this.openLayersLayer.events.register("loadend",this.openLayersLayer,function(){this.loadingimage.removeClass("loading")});this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);this.openLayersLayer.seldonLayer=this;return this.openLayersLayer};this.activate=function(options){options=options||{};this.addToLegend();this.emit("activate");if(this.mask==="true"&&this.lid.indexOf("MaskFor")===-1){if(app.masks.length>0){app.setMaskByLayer(true,this)}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}var inMaskParentLayers=app.maskParentLayers.filter(function(layer){return this===layer},this).length;if(!inMaskParentLayers){app.maskParentLayers.push(this)}}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}this.setTransparency();vectorServices=["vlayers","fire","ads"];boundaryServices=["boundaries"];allVectorServices=vectorServices;Array.prototype.push.apply(allVectorServices,boundaryServices);var isVectorLayer=function(layer,serviceNames){return serviceNames.filter(function(serviceName){return layer.url&&layer.url.indexOf(serviceName+"?")>-1}).length};if(app.map.getNumLayers()>1){var lyrJustAdded=app.map.layers[app.map.getNumLayers()-1];if(!isVectorLayer(lyrJustAdded,allVectorServices)){for(var i=app.map.getNumLayers()-2;i>0;i--){var nextLayerDown=app.map.layers[i];if(!isVectorLayer(nextLayerDown,allVectorServices)){if(nextLayerDown.seldonLayer.index0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,vectorServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}for(var i=app.map.getNumLayers()-1;i>0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,boundaryServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}}app.updateShareMapUrl();app.map.updateSize()};this.deactivate=function(options){options=options||{};if(this.visible==="true"){app.map.removeLayer(this.openLayersLayer);this.visible="false"}if(!this.parentLayer){app.setMaskByLayer(false,this)}if(options.removeFromLegend){this.removeFromLegend()}if(options.removeFromParentMaskLayers){app.maskParentLayers=app.maskParentLayers.filter(function(layer){return layer.lid!==this.lid},this)}if(this.openLayersLayer&&this.openLayersLayer.loadingimage){this.openLayersLayer.loadingimage.removeClass("loading")}this.emit("deactivate")};this.addToLegend=function(){var that=this;var $legend=$("#legend");var lid=this.parentLayer?this.parentLayer.lid:this.lid;$(document.getElementById("lgd"+lid)).remove();this.$legendItem=$(document.createElement("div")).attr("id","lgd"+lid).prepend($(document.createElement("img")).attr("src",this.legend)).click(function(){that.deactivate();if(that.parentLayer){that.parentLayer.deactivate({removeFromParentMaskLayers:true})}that.removeFromLegend()});if(this.url.indexOf("vlayers")>-1){this.$legendItem.prependTo($legend)}else{this.$legendItem.appendTo($legend)}};this.removeFromLegend=function(){if(this.$legendItem)this.$legendItem.remove()};this.setTransparency=function(transparency){this.transparency=parseFloat(transparency)||this.transparency||0; - -if(this.openLayersLayer){this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100)}try{this.emit({type:"transparency",value:this.transparency})}catch(err){var test=this.transparency;var errTxt=err.Message}if(app.map!==undefined){var currentLayer,openLayersLayer,lid;var i;for(i=app.map.getNumLayers()-2;i>0;i--){currentLayer=app.map.layers[i];openLayersLayer=currentLayer.seldonLayer.openLayersLayer;lid=currentLayer.seldonLayer.lid;if(stringContainsChar(currentLayer.name,"Mask")){if(openLayersLayer&&lid.substring(0,lid.indexOf("MaskFor"))===this.lid){openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);currentLayer.seldonLayer.transparency=transparency}}}}}}window.EventEmitter.declare(Layer);return Layer}},{"./stringContainsChar.js":55}],29:[function(require,module,exports){module.exports=function($){function createLayerToggleCheckbox(layer){var checkbox=document.createElement("input"),$checkbox;checkbox.type="checkbox";checkbox.id="chk"+layer.lid;checkbox.onclick=function(){if($(this).is(":checked")){layer.activate()}else{layer.deactivate({removeFromLegend:true,removeFromParentMaskLayers:true})}};$checkbox=$(checkbox);$checkbox.addClass(layer.lid);layer.addListener("activate",function(){$("input."+this.lid).attr("checked",true)});layer.addListener("deactivate",function(){$("input."+this.lid).attr("checked",false)});return checkbox}return createLayerToggleCheckbox}},{}],30:[function(require,module,exports){module.exports=function($){function updateTransparency(layer,value){try{layer.setTransparency(value)}catch(e){var errTxt=e.message}}function createLayerPropertiesDialog(layer){var localTransparency=0;var $html=$(""+'
'+""+""+""+""+""+""+"
Transparency:"+'
'+"
"+'%'+"
"+"
");$html.find("input.transparency-text").val(layer.transparency);if(layer.transparency>0){localTransparency=layer.transparency;layer.setTransparency(localTransparency)}$html.find(".transparency-slider").slider({min:0,max:100,step:1,value:localTransparency,slide:function(event,ui){updateTransparency(layer,ui.value)}});$html.find("input.transparency-text").change(function(){var $this=$(this),newValueFloat=parseFloat($this.val());if(isNaN(newValueFloat)||newValueFloat<0||newValueFloat>100){$this.val(layer.transparency);return}layer.setTransparency($this.val())});layer.addListener("transparency",function(e){$html.find("input.transparency-text").val(e.value)});$html.dialog({zIndex:10050,position:"left",autoOpen:true,hide:"explode",title:layer.name,width:"auto",close:function(){$(this).dialog("destroy");$html.remove();createLayerPropertiesDialog.$html[layer.lid]=undefined}});createLayerPropertiesDialog.$html[layer.lid]=$html}createLayerPropertiesDialog.$html={};return createLayerPropertiesDialog}},{}],31:[function(require,module,exports){module.exports=function($){var createLayerPropertiesDialog=require("./layer_dialog.js")($);function createLayerPropertiesIcon(layer){var img=document.createElement("img");img.id=layer.lid;img.src="icons/settings.png";img.className="layerPropertiesIcon";img.onclick=function(){createLayerPropertiesDialog(layer)};return img}return createLayerPropertiesIcon}},{"./layer_dialog.js":30}],32:[function(require,module,exports){module.exports=function($,app){var generalRadioHandler=require("./layer_radio_handler.js")($,app);function createLayerToggleRadioButton(layer,radioGroupName){var checkbox=document.createElement("input"),$checkbox;checkbox.type="radio";checkbox.name=radioGroupName;checkbox.id=layer.lid;if(layer.selectedInConfig){checkbox.checked=true}$checkbox=$(checkbox);$checkbox.change(radioHandler);layer.addListener("activate",function(){$checkbox.attr("checked",true)});layer.addListener("deactivate",function(){$checkbox.attr("checked",false)});return checkbox}function radioHandler(){generalRadioHandler(app)}return createLayerToggleRadioButton}},{"./layer_radio_handler.js":33}],33:[function(require,module,exports){module.exports=function($,app){var Layer=require("./layer.js")($,app);function radioHandler(app){var $selectedOption=$(app.dropdownBoxList[0]).find(":selected");if($selectedOption.text()==="select..."){clearRadioLayers(app,null);return}var selectLayer=app.dropdownBoxLayers[$selectedOption.val()];var wanted_lid=getActiveDropdownBoxRadioLID(app);var wanted_layer=undefined;var i;for(i=0;i0;i--){currLayer=app.map.layers[i].seldonLayer;for(j=0;j"+selectBoxLayers[i].name+"")}selectBox.insertAdjacentHTML("afterbegin","");$(selectBox).change(selectHandler);return selectBox}function selectHandler(){radioHandler(app)}return createLayerToggleDropdownBox}},{"./layer_radio_handler.js":33}],35:[function(require,module,exports){module.exports=function($,app){function isLayerInLegendConfig(layerId){return layerId in app.legendLookup}function getLegendStringFromPixelValue(layerId,pixelValue){var legendString="";if(isLayerInLegendConfig(layerId)){legendString=app.legendLookup[layerId][pixelValue];if(!legendString){console.error("No legend string set for pixel value",pixelValue,"for layer",layerId)}}return legendString}return getLegendStringFromPixelValue}},{}],36:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js");var saveAs=require("../libs/FileSaver/FileSaver.js").saveAs;var popupId="marker-dialog";var points=[];var pointStyleDefault={pointRadius:4,fillColor:"blue",fillOpacity:.75};var pointStyleHover={pointRadius:5,fillColor:"orange",fillOpacity:.75};var pointStyle=new OpenLayers.StyleMap(pointStyleDefault);function marker(){return new ClickTool(markerHandler)}function markerHandler(e){var coords=app.map.getLonLatFromPixel(e.xy);var lonlat=app.map.getLonLatFromPixel(e.xy);lonlat.transform(app.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));var markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:pointStyle});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));markerLayer.addFeatures(feature);app.map.addLayer(markerLayer);if(!$("#"+popupId).length){createPopup()}if($(".marker-points").length){createPointItem(lonlat,markerLayer)}points.push({lonlat:lonlat,layer:markerLayer});if(typeof ga!=="undefined"){ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Create New Point",eventLabel:lonlat.lon+", "+lonlat.lat})}}function createPointItem(coords,layer){var itemString="";itemString+='
';itemString+='
';itemString+=' Lat:';itemString+=' '+coords.lat+"";itemString+="
";itemString+='
';itemString+=' Lon:';itemString+=' '+coords.lon+"";itemString+="
";itemString+='
';itemString+=' Notes:';itemString+='
';itemString+="
";itemString+="
";var item=$(itemString);item.data("point",layer);item.on("mouseenter",handlePointHoverEnter).on("mouseleave",handlePointHoverLeave);$(".marker-points").append(item)}function handlePointHoverEnter(e){var point=$(this).data("point");point.style=pointStyleHover;point.redraw()}function handlePointHoverLeave(e){var point=$(this).data("point");point.style=pointStyleDefault;point.redraw()}function createPopup(){var popup=$('
');$("body").append(popup);$(".marker-button-download").click(exportFileHandler);$(".marker-button-clear").click(clearPointsHandler);popup.dialog({width:300,height:400,resizable:false,position:{my:"right top",at:"right-5 top+120"},title:"Mark areas of interest",close:function(event,ui){clearPointsHandler();$(this).remove()}})}function exportFileHandler(){var lat,lon,url,notes;var SEP="|";var i;var csvContent="sep="+SEP+"\n";csvContent+="lat"+SEP+"long"+SEP+"google maps link"+SEP+"notes\n";for(i=0;i=0){direction="N"}else if(type==="lat"&&value<0){direction="S"}else if(type==="lon"&&value>=0){direction="E"}else if(type==="lon"&&value<0){direction="W"}value=Math.abs(value);var degree=Math.floor(value);value=(value-degree)*60;var minute=Math.floor(value);var second=(value-minute)*60;return degree+"%C2%B0"+minute+"'"+second+"%22"+direction}function getNotes(index){if(typeof ga!=="undefined"){var label=$(".marker-point-item").eq(index).find(".marker-point-notes").val();ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Notes",eventLabel:label})}return $(".marker-point-item").eq(index).find(".marker-point-notes").val()}function clearPointsHandler(){var i;for(i=0;i')}else{popup.html('
')}popup.dialog({width:600,resizable:false,position:{my:"center+"+offset+" center+"+offset,at:"center",of:window},title:Mustache.render("MODIS NDVI for Lat: {{{lat}}} Lon: {{{lon}}}",{lat:sprintf("%.4f",lonlat.lat),lon:sprintf("%.4f",lonlat.lon)}),close:function(event,ui){app.map.removeLayer(markerLayer);$(this).remove()}});var seldonMultigraph=$("#seldonMultigraph"+app.graphCount+""),promise=seldonMultigraph.multigraph({mugl:muglPrefix+lonlat.lon+","+lonlat.lat,swf:"libs/seldon/libs/Multigraph.swf"});seldonMultigraph.multigraph("done",function(m){if(m){$(m.div()).parent().children(".multigraphLoader").remove()}})})}return createMultigraphTool}},{"./clicktool.js":14}],41:[function(require,module,exports){module.exports=function($){Array.prototype.remove=function(value){if(this.indexOf(value)!==-1){this.splice(this.indexOf(value),1);return true}else{return false}};OpenLayers.Map.prototype.getCurrentSize=function(){var size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=this.div.offsetWidth;size.h=this.div.offsetHeight}if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=parseInt(this.div.style.width,10);size.h=parseInt(this.div.style.height,10)}size.h=size.h-parseInt($(this.div).css("padding-top"),10)-parseInt($(this.div).css("padding-bottom"),10);return size};$.widget("ui.dialog",$.extend({},$.ui.dialog.prototype,{_moveToTop:function(arg){if(arg){if(arg.handleObj.type!="mousedown"){var moved=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;if(moved&&!silent){this._trigger("focus",event)}return moved}}}}))}},{}],42:[function(require,module,exports){module.exports=function($){var createArcGIS93RestParams=require("./create_arcgis_rest_params.js")($);var AccordionGroup=require("./accordion_group.js");var AccordionGroupSublist=require("./accordion_group_sublist.js");var BaseLayer=require("./baselayer.js");var Theme=require("./theme.js");function parseConfig(configXML,shareUrlInfo){var Layer=require("./layer.js")($,this);var createIdentifyTool=require("./identify.js")($,this);var createMultigraphTool=require("./multigraph.js")($,this);var marker=require("./marker.js")($,this);var app=this,$configXML=$(configXML),initialBaseLayer,initialTheme,shareUrlLayerAlpha={},themeOptions={},i,j,k,l,ll,lll;if(shareUrlInfo!==undefined){for(i=0,l=shareUrlInfo.layerLids.length;i0){app.maxExtent={left:parseFloat($extent.attr("xmin")),bottom:parseFloat($extent.attr("ymin")),right:parseFloat($extent.attr("xmax")),top:parseFloat($extent.attr("ymax"))}}var $baseCombo=$("#baseCombo"),$images=$configXML.find("images image"),$image,selected,baseLayer;for(i=0,l=$images.length;ionline.',mapName:"Layers",info:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including the terms of use, visit us online at http://goto.arcgisonline.com/maps/World_Street_Map",copyrightText:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012",layers:[{id:0,name:"World Street Map",parentLayerId:-1,defaultVisibility:true,subLayerIds:null,minScale:0,maxScale:0}],tables:[],spatialReference:{wkid:102100},singleFusedMapCache:true,tileInfo:{rows:256,cols:256,dpi:96,format:"JPEG",compressionQuality:90,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:0,resolution:156543.033928,scale:591657527.591555},{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176}]},initialExtent:{xmin:-28872328.0888923,ymin:-11237732.4896886,xmax:28872328.0888923,ymax:11237732.4896886,spatialReference:{wkid:102100}},fullExtent:{xmin:-20037507.0671618,ymin:-19971868.8804086,xmax:20037507.0671618,ymax:19971868.8804086,spatialReference:{wkid:102100}},units:"esriMeters",supportedImageFormatTypes:"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI,BMP",documentInfo:{Title:"World Street Map",Author:"Esri",Comments:"",Subject:"streets, highways, major roads, railways, water features, administrative boundaries, cities, parks, protected areas, landmarks ",Category:"transportation(Transportation Networks) ",Keywords:"World, Global, Europe, Japan, Hong Kong, North America, United States, Canada, Mexico, Southern Africa, Asia, South America, Australia, New Zealand, India, Argentina, Brazil, Chile, Venezuela, Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, Switzerland, Russia, Thailand, Turkey, 2012",Credits:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"},capabilities:"Map"};app.initOpenLayers(baseLayerInfo,initialBaseLayer,initialTheme,themeOptions,initialExtent);return $configXML}function displayError(message){}return parseConfig}},{"./accordion_group.js":3,"./accordion_group_sublist.js":5,"./baselayer.js":13,"./create_arcgis_rest_params.js":16,"./identify.js":24,"./layer.js":28,"./marker.js":36,"./multigraph.js":40,"./theme.js":56}],43:[function(require,module,exports){module.exports=function($,app){function printMap($configXML){var offsetX=parseInt(app.map.layerContainerDiv.style.left,10);var offsetY=parseInt(app.map.layerContainerDiv.style.top,10);var size=app.map.getSize();var tiles=[];var layer,tile,position;var i,j,k;for(i=0;i
');printPopup.dialog({resizable:false,height:75,title:"Creating Image for Print...",close:function(event,ui){$(this).remove()}});var service_url=$configXML.find("tools tool[name=Print]").attr("service_url");if(!service_url){service_url="http://"+window.location.hostname+window.location.pathname}service_url=service_url.replace(/\/$/,"");var service_name=$configXML.find("tools tool[name=Print]").attr("service_name");if(!service_name){service_name="cgi-bin/print.cgi"}var title=$configXML.find("tools tool[name=Print]").attr("title");if(!title){title="U.S Forest Change Assessment Viewer"}$.ajax({url:service_url+"/"+service_name, -type:"POST",data:OpenLayers.Util.getParameterString({width:size.w,height:size.h,tiles:tiles_json,legends:legends_json,title:title}),headers:{"Content-Type":"application/x-www-form-urlencoded"},success:function(data,status,jqxhr){data=data.replace(/\s+/,"");var href=service_url+"/cgi-bin/printed_map.jpg";if(data){href=service_url+"/"+data}$("#printMapLoader").html('
print image result
');printPopup.dialog("option","title","Print Image Created!")},error:function(jqxhr,status,err){$("#printMapLoader").html("
An error happended.
");printPopup.dialog("option","title","NO Print Image Created!")}})}return printMap}},{}],44:[function(require,module,exports){function RepeatingOperation(op,yieldEveryIteration){var count=0;var instance=this;this.step=function(args){if(++count>=yieldEveryIteration){count=0;setTimeout(function(){op(args)},1,[]);return}op(args)}}module.exports=RepeatingOperation},{}],45:[function(require,module,exports){module.exports=function($){function handle_search(location,app){var rest_endpoint="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text="+location+"&f=json";$.getJSON(rest_endpoint,function(data){var locations=data["locations"][0];if(locations===undefined){return}var extent=locations["extent"];var bounds=new OpenLayers.Bounds(extent.xmin,extent.ymin,extent.xmax,extent.ymax).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));app.zoomToExtent(bounds,true)})}return handle_search}},{}],46:[function(require,module,exports){(function($){"use strict";require("./overrides.js")($);var seldon={App:require("./app.js")($)};var app=new seldon.App;seldon.init=require("./init.js")(app);window.seldon=seldon})(jQuery)},{"./app.js":11,"./init.js":25,"./overrides.js":41}],47:[function(require,module,exports){module.exports=function($){function setBaseLayer(baseLayer){var resolutions=[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,.5971642833948135];var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets");handleBaseLayer(app,layer,baseLayer)}else if(baseLayer.type=="ArcGISCache"){$.ajax({url:baseLayer.url+"?f=json&pretty=true",dataType:"jsonp",success:function(layerInfo){var options={layerInfo:layerInfo};if(baseLayer.numZoomLevels){options.numZoomLevels=baseLayer.numZoomLevels;if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);options.serverResolutions=serverResolutions;options.resolutions=resolutions}}var layer=new OpenLayers.Layer.ArcGISCache(baseLayer.name,baseLayer.url,options);handleBaseLayer(app,layer,baseLayer)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet,sphericalMercator:true};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings);handleBaseLayer(app,layer,baseLayer)}}function handleBaseLayer(app,layer,baseLayer){app.map.removeLayer(app.map.layers[0]);app.currentBaseLayer=baseLayer;app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.emit("baselayerchange")}return setBaseLayer}},{}],48:[function(require,module,exports){function ga_events($){var eventAdded=false;try{$.ga.trackEvent;eventAdded=true}catch(err){eventAdded=false}if(typeof ga!=="undefined"){if(eventAdded){seldon.app.map.events.register("moveend",seldon.app.map,function(){var newMapExtent=seldon.app.map.getExtent();$.ga.trackEvent({category:"Map Extent",action:"Change",label:newMapExtent.toString(),nonInteractive:true})});$(".shareMapUrl").click(function(event){$.ga.trackEvent({category:"Share Map URL",action:"Click",label:$(".shareMapUrl").val()})});$("#mapTheme #themeCombo").change(function(event){$.ga.trackEvent({category:"Map Theme",action:"Change",label:$("#mapTheme #themeCombo option:selected").text()})});$("#txtFindArea input#address_field").keyup(function(event){if(event.which===13){$.ga.trackEvent({category:"Find Area",action:"Search Enter",label:$(this).val()})}});$("#txtFindArea #address_lookup img").click(function(event){$.ga.trackEvent({category:"Find Area",action:"Search Button",label:$("#txtFindArea input#address_field").val()})});$("#mapBase #baseCombo").change(function(event){$.ga.trackEvent({category:"Base Map",action:"Change",label:$("#mapBase #baseCombo option:selected").text()})});$(".header-bar .header-bar img.icon").gaTrackEvent({category:"Nav Bar",action:"click",useLabel:true,labelAttribute:"title",useEvent:true,event:"click"});$("#mapToolsDialog label[for^='chk']").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#mapToolsDialog input").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("#layerPickerDialog label[for^='chk']").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#layerPickerDialog input").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("h3.ui-accordion-header").gaTrackEvent({category:"Base Layer",action:"Toggle Accordion",useLabel:true,label:function(){return $(this).text()},useEvent:true,event:"click"});$("#marker-dialog .marker-button-wrapper .marker-button-download").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Download Points"})});$("#marker-dialog .marker-button-wrapper .marker-button-clear").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Clear Points"})});$("#marker-dialog .marker-point-label .marker-point-coords-label").focusout(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Notes",label:$(this).val()})});$("img[src$='slider.png']").mouseup(function(event){$.ga.trackEvent({category:"OpenLayers Buttons",action:"Slide",label:"Zoom Slider"})});$(".olButton").click(function(event){var eleId=$(this).attr("id");switch(true){case eleId.indexOf("ZoombarOpenLayers_Map")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Bar"});break;case eleId.indexOf("panleft")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan Left"});break;case eleId.indexOf("panright")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan right"});break;case eleId.indexOf("panup")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan up"});break;case eleId.indexOf("pandown")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan down"});break;case eleId.indexOf("zoomin")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom in"});break;case eleId.indexOf("zoomout")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Out"});break;default:}})}}}module.exports=ga_events},{}],49:[function(require,module,exports){module.exports=function($){function setMaskByLayer(toggle,parentLayer){var Layer=require("./layer.js")($,this);var app=this;var maskLayer,maskName,cleanMaskName;var m,ml,mld;if(toggle){for(m=0;m0;i--){var currLayer=app.map.layers[i];for(var j=0;j0||sublist.break?"":" empty";var collapsibleClass=sublist.collapsible?" collapsible":"";var collapseHeaderIcon=sublist.collapsible?'':"";var sublistInfo=sublist.info?'
'+sublist.info+"
":"";var sublistObj={heading:sublist.label,items:[],collapsible:sublist.collapsible,contentElement:$('
'+'
'+collapseHeaderIcon+"

"+sublist.label+"

"+sublistInfo+"
"+"
")};if(sublist.description){var sublistInfoButton=new MoreInfoButton(sublist);sublistObj.contentElement.children(".sublist-header").append(sublistInfoButton.element)}g.sublists.push(sublistObj);sublistItems.push(sublistObj.contentElement);var sublistLayerItems=[];for(var k=0,l=sublist.layers.length;k=0){name=this.substring(0,i);value=this.substring(i+1)}else{name=this;value=undefined}vars[name]=value});info.themeName=vars.theme;info.accordionGroupGid=vars.accgp;info.baseLayerName=vars.basemap;if(vars.extent){var extentCoords=vars.extent.split(",");info.extent={left:extentCoords[0],bottom:extentCoords[1],right:extentCoords[2],top:extentCoords[3]}}if(vars.layers){$.each(vars.layers.split(","),function(){info.layerLids.push(this)})}if(vars.mask){$.each(vars.mask.split(","),function(){info.layerMask.push(this)})}if(vars.modifiers){$.each(vars.modifiers.split(","),function(){info.maskModifiers.push(this)})}if(vars.alphas){$.each(vars.alphas.split(","),function(){info.layerAlphas.push(this)})}if(info.themeName&&info.baseLayerName){return info}return undefined};ShareUrlInfo.prototype.urlArgs=function(){return Mustache.render(""+"theme={{{theme}}}"+"&layers={{{layers}}}"+"&mask={{{mask}}}"+"{{{modifiers}}}"+"&alphas={{{alphas}}}"+"&accgp={{{accgp}}}"+"&basemap={{{basemap}}}"+"&extent={{{extent.left}}},{{{extent.bottom}}},{{{extent.right}}},{{{extent.top}}}",{theme:this.themeName,layers:this.layerLids.join(","),mask:this.layerMask.join(","),modifiers:this.maskModifiers.length>0?"&modifiers="+this.maskModifiers.join(","):"",alphas:this.layerAlphas.join(","),accgp:this.accordionGroupGid,basemap:this.baseLayerName,extent:this.extent})};module.exports=ShareUrlInfo},{}],53:[function(require,module,exports){module.exports=function($){var stringContainsChar=require("./stringContainsChar.js");var ShareUrlInfo=require("./share.js");function shareUrl(){if(!this.currentTheme){return undefined}if(!this.currentAccordionGroup){return undefined}if(!this.currentBaseLayer){return undefined}var extent=this.map.getExtent(),layerLids=[],layerAlphas=[],layerMask=[],url;if(!extent){return undefined}$.each(this.map.layers,function(){var op,lid,test;if(!this.isBaseLayer){if(this.opacity===1){op="1"}else if(this.opacity===0){op="0"}else{op=sprintf("%.2f",this.opacity)}if(stringContainsChar(this.name,"MaskFor")){lid=this.seldonLayer.lid;test=lid.substring(lid.indexOf("MaskFor"),lid.length).replace("MaskFor","");if(layerMask.indexOf(test)===-1){layerMask.push(test)}test=this.name.substring(0,this.name.indexOf("MaskFor"));if(layerLids.indexOf(test)===-1){layerLids.push(test);layerAlphas.push(op)}}else{if(this.seldonLayer){layerLids.push(this.seldonLayer.lid);layerAlphas.push(op)}}}});if(this.hasOwnProperty("maskModifiers")){var modifiers=this.maskModifiers.filter(function(val){return val!==""})}url=window.location.toString();url=url.replace(/\?.*$/,"");url=url.replace(/\/$/,"");url=url.replace("#","");return url+"?"+new ShareUrlInfo({themeName:this.currentTheme.name,layerLids:layerLids,layerMask:layerMask,maskModifiers:modifiers,layerAlphas:layerAlphas,accordionGroupGid:this.currentAccordionGroup.gid,baseLayerName:this.currentBaseLayer.name,extent:extent}).urlArgs()}return shareUrl}},{"./share.js":52,"./stringContainsChar.js":55}],54:[function(require,module,exports){module.exports=function($){function createSplashScreen(){var $document=$(document),windowWidth=Math.round($document.width()/2);$("#splashScreenContent").load("splashScreen.html");$("#splashScreenContainer").dialog({autoOpen:false,zIndex:10051,maxHeight:$document.height(),width:windowWidth,minWidth:300,dialogClass:"splashScreenStyle",hide:"explode"})}return createSplashScreen}},{}],55:[function(require,module,exports){function stringContainsChar(string,c){return string.indexOf(c)>=0}module.exports=stringContainsChar},{}],56:[function(require,module,exports){function Theme(settings){this.accordionGroups=[];if(!settings){return}this.name=settings.name;this.label=settings.label;this.index=settings.index;this.zoom=settings.zoom;this.xmin=settings.xmin;this.ymin=settings.ymin;this.xmax=settings.xmax;this.ymax=settings.ymax;this.getAccordionGroupIndex=function(accordionGroup){var i;for(i=0;i"+'

'+el.description+"

"+"";$(dialogDiv).dialog({title:el.label||el.name,dialogClass:"tooltip-dialog "+dialogClass})}}}return MoreInfoButton}},{}],7:[function(require,module,exports){module.exports=function($){function addAccordionSection(accordionGroup,title){var sectionObj={title:title,titleElement:$("

"+title+"

"),contentElement:$("
"),sublists:[]};var $accordionGroup=$(accordionGroup);$accordionGroup.data("listAccordion").sections.push(sectionObj);$accordionGroup.append(sectionObj.titleElement).append(sectionObj.contentElement);$accordionGroup.accordion("refresh");return sectionObj}return addAccordionSection}},{}],8:[function(require,module,exports){module.exports=function($){function addAccordionSublists(g,items){$(g.contentElement).append(items)}return addAccordionSublists}},{}],9:[function(require,module,exports){module.exports=function($){function addAccordionSublistItems(s,items,theme,accGp){var collapsed=s.collapsible?"collapsed ":"";var contents=$('
');for(var i=0,l=items.length;i').append(items[i]))}var layer={name:name,contentElement:contents};s.items.push(layer);s.contentElement.append(layer.contentElement)}return addAccordionSublistItems}},{}],10:[function(require,module,exports){module.exports=function($){function addMaskToLegend(layer){var app=this;var maskName=layer.lid.substring(layer.lid.indexOf("MaskFor"),layer.lid.length);$("#lgd"+maskName).remove();layer.$legendItem=$(document.createElement("div")).attr("id","lgd"+maskName).prepend($(document.createElement("img")).attr("src",layer.legend)).prependTo($("#legend")).click(function(){app.setMaskByMask(false,maskName)})}return addMaskToLegend}},{}],11:[function(require,module,exports){module.exports=function($){var EventEmitter=window.EventEmitter;function App(){EventEmitter.call(this);this.map=undefined;this.tileManager=undefined;this.projection=undefined;this.gisServerType=undefined;this.useProxyScript=undefined;this.scalebar=undefined;this.zoomInTool=undefined;this.zoomOutTool=undefined;this.dragPanTool=undefined;this.id_markerLayer=undefined;this.maxExtent={left:-15e6,bottom:2e6,right:-6e6,top:7e6};this.baseLayers=[];this.accordionGroups=[];this.themes=[];this.maskParentLayers=[];this.masks=[];this.maskModifiers=[];this.defaultMasks=["MaskForForest"];this.radioButtonList=[];this.radioButtonLayers=[];this.dropdownBoxList=[];this.dropdownBoxLayers=[];this.currentBaseLayer=undefined;this.currentAccordionGroup=undefined;this.currentTheme=undefined;this.identifyTool=undefined;this.multigraphTool=undefined;this.markerTool=undefined;this.savedExtents=[];this.currentSavedExtentIndex=-1;this.saveCurrentExtent=require("./extent_save.js");this.zoomToExtent=require("./extent_zoom.js");this.zoomToPreviousExtent=require("./extent_zoom_previous.js");this.zoomToNextExtent=require("./extent_zoom_next.js");this.printSavedExtents=require("./extent_print.js");this.setBaseLayer=require("./set_base_layer.js")($);this.setAccordionGroup=require("./accordion_group_set.js");this.clearAccordionSections=require("./accordion_clear.js")($);this.addAccordionSection=require("./accordion_section_add.js")($);this.addAccordionSublists=require("./accordion_sublist_add.js")($);this.addAccordionSublistItems=require("./accordion_sublist_item_add.js")($);this.setTheme=require("./set_theme.js")($);this.shareUrl=require("./share_url.js")($);this.updateShareMapUrl=require("./update_share_url.js")($);this.launch=require("./launch.js")($);this.count=require("./count.js");this.addMaskToLegend=require("./add_mask_legend.js")($);this.setMaskByMask=require("./set_mask_by_mask.js")($);this.setMaskByLayer=require("./set_mask_by_layer.js")($);this.handleMaskModifier=require("./mask_modifier.js");this.handleMaskModifierGroup=require("./mask_modifier_group.js")($);this.parseConfig=require("./parse_config.js")($);this.initOpenLayers=require("./init_openlayers.js");this.setupCollapsibleSublists=require("./accordion_collapsible_sublist_setup.js")($);this.removeMaskFromLegend=function(layer){};OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.IMAGE_RELOAD_ATTEMPTS=3}EventEmitter.declare(App);return App}},{"./accordion_clear.js":1,"./accordion_collapsible_sublist_setup.js":2,"./accordion_group_set.js":4,"./accordion_section_add.js":7,"./accordion_sublist_add.js":8,"./accordion_sublist_item_add.js":9,"./add_mask_legend.js":10,"./count.js":15,"./extent_print.js":18,"./extent_save.js":19,"./extent_zoom.js":20,"./extent_zoom_next.js":21,"./extent_zoom_previous.js":22,"./init_openlayers.js":26,"./launch.js":27,"./mask_modifier.js":38,"./mask_modifier_group.js":39,"./parse_config.js":42,"./set_base_layer.js":47,"./set_mask_by_layer.js":49,"./set_mask_by_mask.js":50,"./set_theme.js":51,"./share_url.js":53,"./update_share_url.js":57}],12:[function(require,module,exports){function arrayContainsElement(array,element){var i;if(array===undefined){return false}for(i=0;iparam").each(function(i,param){var $param=$(param);if(param.hasAttribute("value")){obj[$param.attr("name")]=$param.attr("value")}else{obj[$param.attr("name")]=createArcGIS93RestParams($param)}});return obj}return createArcGIS93RestParams}},{}],17:[function(require,module,exports){module.exports=function(app,activeBtn){function deactivateActiveOpenLayersControls(){var controls,i;for(i=0;i=0;--i){e=this.savedExtents[i];html+=Mustache.render("{{{marker}}}{{{number}}}"+"left:{{{left}}}, bottom:{{{bottom}}}, right:{{{right}}}, top:{{{top}}}",{marker:i===this.currentSavedExtentIndex?"==>":"",number:i,left:e.left,bottom:e.bottom,right:e.right,top:e.top})}html+="";return html}module.exports=printSavedExtents},{}],19:[function(require,module,exports){var extentsAreEqual=require("./extents_equal.js");function saveCurrentExtent(){var newExtent=formatExtent(this.map.getExtent()),newSavedExtents=[],currentSavedExtent,i;if(this.currentSavedExtentIndex>=0){currentSavedExtent=this.savedExtents[this.currentSavedExtentIndex];if(extentsAreEqual(currentSavedExtent,newExtent)){return}}for(i=0;i<=this.currentSavedExtentIndex;++i){newSavedExtents.push(this.savedExtents[i])}this.savedExtents=newSavedExtents;this.savedExtents.push(newExtent);++this.currentSavedExtentIndex}function formatExtent(extent){return{left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top}}module.exports=saveCurrentExtent},{"./extents_equal.js":23}],20:[function(require,module,exports){function zoomToExtent(extent,save){if(save===undefined){save=true}var bounds=new OpenLayers.Bounds(extent.left,extent.bottom,extent.right,extent.top);this.map.zoomToExtent(bounds,true);if(save){this.saveCurrentExtent()}}module.exports=zoomToExtent},{}],21:[function(require,module,exports){function zoomToNextExtent(){if(this.currentSavedExtentIndex0){--this.currentSavedExtentIndex;this.zoomToExtent(this.savedExtents[this.currentSavedExtentIndex],false)}}module.exports=zoomToPreviousExtent},{}],23:[function(require,module,exports){function extentsAreEqual(e1,e2){var tolerance=.001;return Math.abs(e1.left-e2.left)<=tolerance&&Math.abs(e1.bottom-e2.bottom)<=tolerance&&Math.abs(e1.right-e2.right)<=tolerance&&Math.abs(e1.top-e2.top)<=tolerance}module.exports=extentsAreEqual},{}],24:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js"),stringContainsChar=require("./stringContainsChar.js");var getLegendStringFromPixelValue=require("./legend_config.js")($,app);function createIdentifyTool(){return new ClickTool(function(e){$("#identify_popup").remove();if(app.id_markerLayer){app.map.removeLayer(app.id_markerLayer)}var coords=app.map.getLonLatFromPixel(e.xy);var styleMap=new OpenLayers.StyleMap({pointRadius:4,fillColor:"yellow",fillOpacity:.75});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));app.id_markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:styleMap});app.id_markerLayer.addFeatures(feature);app.map.addLayer(app.id_markerLayer);var services=[],service,urlsrs;var layersAdded=[];var html='';$.each(app.map.layers,function(){var name,label;if(!this.isBaseLayer&&this.params&&(!("seldonLayer"in this)||String(this.seldonLayer.identify)!=="false")){name=this.params.LAYERS;if(String(name).match(/^\d+$/)){label=this.name}else{label=String(name).indexOf("MaskFor")!==-1?name.substring(0,name.indexOf("MaskFor")):name}if(layersAdded.indexOf(label)!==-1)return;layersAdded.push(label);services.push({url:this.url,srs:this.projection.projCode,name:name,label:label,proxyServerType:this.seldonLayer.proxyServerType});html=html+Mustache.render(""+''+''+''+"",{label:label})}});html=html+"
{{label}}:
";if(services.length===0){return}var popup=$(document.createElement("div"));popup.attr("id","identify_popup");popup.html(html);popup.dialog({width:600,height:300,resizable:true,title:"Identify Results",close:function(event,ui){app.map.removeLayer(app.id_markerLayer);app.id_markerLayer=undefined;$(this).remove()}});var i,l;for(i=0,l=services.length;i'+''+valueLabel.replace("_0","")+":  "+""+tableRow+""+""}$(newTableContents).insertAfter($group);if(!newTableContents)$group.find(".layer-results").text("N/A")},error:function(jqXHR,textStatus,errorThrown){}})}function createWMSGetFeatureInfoRequestURL(serviceUrl,layer,srs,x,y){var extent=app.map.getExtent();if(seldon.gisServerType==="ArcGIS"){extent=extent.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection(seldon.projection))}return Mustache.render(""+serviceUrl+"{{{c}}}LAYERS={{layer}}"+"&QUERY_LAYERS={{layer}}"+"&STYLES=,"+"&SERVICE=WMS"+"&VERSION=1.1.1"+"&REQUEST=GetFeatureInfo"+"&BBOX={{left}},{{bottom}},{{right}},{{top}}"+"&FEATURE_COUNT=100"+"&HEIGHT={{height}}"+"&WIDTH={{width}}"+"&FORMAT=image/png"+"&INFO_FORMAT=application/vnd.ogc.gml"+"&SRS={{srs}}"+"&X={{x}}"+"&Y={{y}}",{c:stringContainsChar(serviceUrl,"?")?"&":"?",layer:layer,height:app.map.size.h,width:app.map.size.w,left:extent.left,bottom:extent.bottom,right:extent.right,top:extent.top,srs:srs,x:x,y:y})}function getLayerResultsFromArcXML($xml,layerName,layerIDCount){var dataVals=[];try{var fields=$xml.find("FIELDS"),attributes=fields[layerIDCount].attributes,i;for(i=0;i=0||stringStartsWith(layerName,"EFETAC-NASA")||stringStartsWith(layerName,"RSAC-FHTET"))&&children[i].nodeName==="value_0"){value=value+sprintf(" (%.2f %%)",(parseFloat(value,10)-127)/128*100)}if((stringStartsWith(layerName.toUpperCase(),"NDMI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"NDVI-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SWIR-ARCHIVE")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDVI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-NDMI-CURRENT")||stringStartsWith(layerName.toUpperCase(),"SOUTHEAST-SWIR-CURRENT"))&&children[i].nodeName==="value_0"){value=sprintf("%.0f %%",parseFloat(value,10)-128)}returnVals[i]=[children[i].nodeName,value]}}return returnVals}function stringStartsWith(string,prefix){return string.substring(0,prefix.length)===prefix}return createIdentifyTool}},{"./clicktool.js":14,"./legend_config.js":35,"./stringContainsChar.js":55}],25:[function(require,module,exports){module.exports=function(app){var ShareUrlInfo=require("./share.js");function init(config,projection,legendLookup,gisServerType,useProxyScript){var shareUrlInfo=ShareUrlInfo.parseUrl(window.location.toString());app.projection=projection;seldon.projection=projection;app.legendLookup=legendLookup;seldon.gisServerType=gisServerType;seldon.useProxyScript=useProxyScript;app.launch(config,shareUrlInfo);seldon.app=app}return init}},{"./share.js":52}],26:[function(require,module,exports){function initOpenLayers(baseLayerInfo,baseLayer,theme,themeOptions,initialExtent){var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets",{numZoomLevels:20})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings)}else if(baseLayer.type=="ArcGISCache"){var layer=new OpenLayers.Layer.ArcGISCache("AGSCache",baseLayer.url,{layerInfo:baseLayerInfo})}var maxExtentBounds;if(theme.xmax&&theme.xmin&&theme.ymax&&theme.ymin){maxExtentBounds=new OpenLayers.Bounds(theme.xmin,theme.ymin,theme.xmax,theme.ymax)}else{maxExtentBounds=new OpenLayers.Bounds(app.maxExtent.left,app.maxExtent.bottom,app.maxExtent.right,app.maxExtent.top)}if(initialExtent===undefined){initialExtent=app.maxExtent}app.tileManager=new OpenLayers.TileManager({cacheSize:12,moveDelay:750,zoomDelay:750});app.map=new OpenLayers.Map("map",{units:"m",tileManager:app.tileManager,controls:[new OpenLayers.Control.Navigation,new OpenLayers.Control.Attribution,app.zoomInTool,app.zoomOutTool,app.identifyTool,app.multigraphTool,app.markerTool],eventListeners:{moveend:function(){app.emit("extentchange")},zoomend:function(){app.emit("extentchange")}},projection:new OpenLayers.Projection(seldon.projection)});app.currentBaseLayer=baseLayer;app.emit("baselayerchange");app.map.addControl(new OpenLayers.Control.ScaleLine({bottomOutUnits:"mi"}));app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.setTheme(theme,themeOptions);app.zoomToExtent(initialExtent);app.saveCurrentExtent();app.map.events.register("mousemove",app.map,function(e){var pixel=app.map.events.getMousePosition(e);var lonlat=app.map.getLonLatFromPixel(pixel);lonlat=lonlat.transform(new OpenLayers.Projection("EPSG:3857"),new OpenLayers.Projection("EPSG:4326"));OpenLayers.Util.getElement("latLonTracker").innerHTML="Lat: "+sprintf("%.5f",lonlat.lat)+" Lon: "+sprintf("%.5f",lonlat.lon)+""});app.map.addControl(new OpenLayers.Control.PanZoomBar)}module.exports=initOpenLayers},{}],27:[function(require,module,exports){module.exports=function($){var createSplashScreen=require("./splash.js")($);var handle_search=require("./search.js")($);var ga_events=require("./set_google_analytics_events.js");var areasList=[];var activeBtn=[];function launch(configFile,shareUrlInfo){var deactivateActiveOpenLayersControls=require("./deactivate_controls.js")(this,activeBtn);var printMap=require("./print.js")($,this);var app=this;app.initialThemeLoad=true;var $configXML;$.ajax({url:configFile,dataType:"xml",success:function(configXML){$configXML=app.parseConfig(configXML,shareUrlInfo);ga_events($)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}});$("#btnTglLyrPick").click(function(){var $layerPickerDialog=$("#layerPickerDialog");if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close")}else{$layerPickerDialog.dialog("open")}});$("#layerPickerDialog").dialog({zIndex:10050,position:{my:"left top",at:"left+5 top+100"},autoOpen:true,hide:"fade",width:330});app.addListener("accordiongroupchange",function(){if(app.currentTheme){$("#layerPickerAccordion").accordion({active:app.currentTheme.getAccordionGroupIndex(app.currentAccordionGroup),collapsible:true,beforeActivate:function(event,ui){if(!app.initialThemeLoad){$("#layerPickerDialog").scrollTop(0)}},activate:function(event,ui){app.setupCollapsibleSublists(ui);if(app.initialThemeLoad){app.initialThemeLoad=false;$("#layerPickerDialog").scrollTop(755)}}})}});$("#btnTglMapTools").click(function(){var $mapToolsDialog=$("#mapToolsDialog");if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close")}else{$mapToolsDialog.dialog("open")}});$("#mapToolsDialog").dialog({zIndex:10050,position:{my:"right top",at:"right-5 top+100"},autoOpen:true,hide:"fade"});app.addListener("themechange",function(){app.updateShareMapUrl()});app.addListener("baselayerchange",function(){app.updateShareMapUrl()});app.addListener("accordiongroupchange",function(){app.updateShareMapUrl()});app.addListener("extentchange",function(){app.saveCurrentExtent();app.updateShareMapUrl()});var $mapToolsAccordion=$("#mapToolsAccordion"),accordionGroupIndexToOpen=0;$mapToolsAccordion.accordion({heightStyle:"content",collapsible:true});$mapToolsAccordion.find("div").each(function(i){if(this.id==="legend"){accordionGroupIndexToOpen=i;return false}return true});$mapToolsAccordion.accordion("option","active",accordionGroupIndexToOpen);$("#baseCombo").change(function(){var i=parseInt($(this).val(),10);app.setBaseLayer(app.baseLayers[i])});app.addListener("baselayerchange",function(){$("#baseCombo").val(app.currentBaseLayer.index)});$("#themeCombo").change(function(){var i=parseInt($(this).val(),10);app.setTheme(app.themes[i])});app.addListener("themechange",function(){$("#themeCombo").val(app.currentTheme.index)});$("#btnPan").click(function(){deactivateActiveOpenLayersControls();app.dragPanTool.activate()});$("#btnPrint").click(function(){if($configXML!==undefined){printMap($configXML)}else{console.log("Can't print yet; config file not yet parsed")}});$("#btnZoomIn").click(function(){deactivateActiveOpenLayersControls();app.zoomInTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomOut").click(function(){deactivateActiveOpenLayersControls();app.zoomOutTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnZoomExtent").click(function(){app.zoomToExtent(app.maxExtent)});$("#btnID").click(function(){deactivateActiveOpenLayersControls();app.identifyTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnAbout").click(function(){var splashScreen=$("#splashScreenContainer");if(splashScreen.dialog("isOpen")){splashScreen.dialog("close")}else{splashScreen.dialog("open")}});$("#btnPrev").click(function(){app.zoomToPreviousExtent()});$("#btnNext").click(function(){app.zoomToNextExtent()});$("#btnMultiGraph").click(function(){deactivateActiveOpenLayersControls();app.multigraphTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});$("#btnMarker").click(function(){deactivateActiveOpenLayersControls();app.markerTool.activate();activeBtn=$(this);activeBtn.children().addClass("icon-active")});createSplashScreen();var $findArea=$("#findArea");$findArea.findArea();areasList=$findArea.findArea("getAreasList");$findArea.autocomplete({source:areasList});$findArea.keypress(function(e){if(e.which==13){var areaExtent=$findArea.findArea("getAreaExtent",$findArea.val(),areasList);app.zoomToExtent(areaExtent)}});$("#address_lookup").on("click",function(){var location=$("#address_field").val();handle_search(location,app)});$("#address_field").on("keypress",function(e){if(e.which===13){var location=$(this).val();handle_search(location,app)}});$(".mask-toggle").on("click",function(){if($(this).is(":checked")){app.setMaskByMask(true,this.value)}else{app.setMaskByMask(false,this.value)}});$("[data-mask-grouper='true']").on("change",function(){var disabled=$(this).is(":checked")?true:false;$("[data-mask-parent='"+this.value+"']").attr("disabled",disabled)});$(".mask-modifier").on("change",function(){var value=$(this).is(":checked")?this.value:"";var index=$(this).data("index");if($(this).data("maskGrouper")===true){app.handleMaskModifierGroup(this.value,$(this).is(":checked"))}app.handleMaskModifier(value,index)});$("textarea").focus(function(){var $this=$(this);$this.select();window.setTimeout(function(){$this.select()},1);function mouseUpHandler(){$this.off("mouseup",mouseUpHandler);return false}$this.mouseup(mouseUpHandler)});if($(window).width()<650){$("#mapToolsDialog").dialog("close");$("#layerPickerDialog").dialog("close")}if(window.addEventListener){window.addEventListener("orientationchange",function(){var $mapToolsDialog=$("#mapToolsDialog"),$layerPickerDialog=$("#layerPickerDialog");window.scroll(0,0);if($mapToolsDialog.dialog("isOpen")){$mapToolsDialog.dialog("close").dialog("open")}if($layerPickerDialog.dialog("isOpen")){$layerPickerDialog.dialog("close").dialog("open")}},false)}}return launch}},{"./deactivate_controls.js":17,"./print.js":43,"./search.js":45,"./set_google_analytics_events.js":48,"./splash.js":54}],28:[function(require,module,exports){module.exports=function($,app){var stringContainsChar=require("./stringContainsChar.js");function Layer(settings){EventEmitter.call(this);if(!settings){return}$.extend(true,this,settings);if(this.index==undefined){this.index=0}if(this.type==undefined){this.type="WMS"}this.createOpenLayersLayer=function(){if(this.openLayersLayer!==undefined){return this.openLayersLayer}var options={isBaseLayer:false,transitionEffect:"resize",buffer:0,tileSize:new OpenLayers.Size(2048,2048)};if(this.type==="WMTS"){var settings={name:this.name,url:this.url,layer:this.layers,style:this.style,matrixSet:this.srs,isBaseLayer:false,transitionEffect:"resize",format:"image/jpg",sphericalMercator:true};if(this.lid.indexOf("GLAM")>-1){$.extend(true,settings,{serverResolutions:[156543.033928041,78271.5169640205,39135.7584820102,19567.8792410051,9783.9396205026,4891.9698102513,2445.9849051256,1222.9924525628,611.4962262814,305.7481131407048],units:"m",tileOrigin:new OpenLayers.LonLat(-20037508.34,20037508.34)})}this.openLayersLayer=new OpenLayers.Layer.WMTS(settings)}else if(this.type==="XYZ"){this.openLayersLayer=new OpenLayers.Layer.XYZ(this.name,this.url,{isBaseLayer:false,projection:new OpenLayers.Projection(seldon.projection)})}else if(this.type==="ArcGIS93Rest"){this.openLayersLayer=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params.mosaicRule?$.extend(true,{},this.params,{mosaicRule:JSON.stringify(this.params.mosaicRule)}):this.params,options)}else{if(this.maxResolution){options.maxResolution=parseFloat(this.maxResolution)}var layer=this.layers+("mask"in this?app.maskModifiers.join(""):"");this.openLayersLayer=new OpenLayers.Layer.WMS(this.name,this.url,{projection:new OpenLayers.Projection(seldon.projection),units:"m",layers:layer,transparent:true},options)}var loadingimage=$('');$("#map").append(loadingimage);this.openLayersLayer.loadingimage=loadingimage;this.openLayersLayer.events.register("loadstart",this.openLayersLayer,function(){this.loadingimage.addClass("loading")});this.openLayersLayer.events.register("loadend",this.openLayersLayer,function(){this.loadingimage.removeClass("loading")});this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);this.openLayersLayer.seldonLayer=this;return this.openLayersLayer};this.activate=function(options){options=options||{};this.addToLegend();this.emit("activate");if(this.mask==="true"&&this.lid.indexOf("MaskFor")===-1){if(app.masks.length>0){app.setMaskByLayer(true,this)}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}var inMaskParentLayers=app.maskParentLayers.filter(function(layer){return this===layer},this).length;if(!inMaskParentLayers){app.maskParentLayers.push(this)}}else{this.visible="true";app.map.addLayer(this.createOpenLayersLayer())}this.setTransparency();vectorServices=["vlayers","fire","ads"];boundaryServices=["boundaries"];allVectorServices=vectorServices;Array.prototype.push.apply(allVectorServices,boundaryServices);var isVectorLayer=function(layer,serviceNames){return serviceNames.filter(function(serviceName){return layer.url&&layer.url.indexOf(serviceName+"?")>-1}).length};if(app.map.getNumLayers()>1){var lyrJustAdded=app.map.layers[app.map.getNumLayers()-1];if(!isVectorLayer(lyrJustAdded,allVectorServices)){for(var i=app.map.getNumLayers()-2;i>0;i--){var nextLayerDown=app.map.layers[i];if(!isVectorLayer(nextLayerDown,allVectorServices)){if(nextLayerDown.seldonLayer.index0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,vectorServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}for(var i=app.map.getNumLayers()-1;i>0;i--){var nextLayerDown=app.map.layers[i];if(isVectorLayer(nextLayerDown,boundaryServices)){app.map.setLayerIndex(nextLayerDown,app.map.layers.length-1)}}}app.updateShareMapUrl();app.map.updateSize()};this.deactivate=function(options){options=options||{};if(this.visible==="true"){app.map.removeLayer(this.openLayersLayer);this.visible="false"}if(!this.parentLayer){app.setMaskByLayer(false,this)}if(options.removeFromLegend){this.removeFromLegend()}if(options.removeFromParentMaskLayers){app.maskParentLayers=app.maskParentLayers.filter(function(layer){return layer.lid!==this.lid},this)}if(this.openLayersLayer&&this.openLayersLayer.loadingimage){this.openLayersLayer.loadingimage.removeClass("loading")}this.emit("deactivate")};this.addToLegend=function(){var that=this;var $legend=$("#legend");var lid=this.parentLayer?this.parentLayer.lid:this.lid;$(document.getElementById("lgd"+lid)).remove();this.$legendItem=$(document.createElement("div")).attr("id","lgd"+lid).prepend($(document.createElement("img")).attr("src",this.legend)).click(function(){that.deactivate();if(that.parentLayer){that.parentLayer.deactivate({removeFromParentMaskLayers:true})}that.removeFromLegend()});if(this.url.indexOf("vlayers")>-1){this.$legendItem.prependTo($legend)}else{this.$legendItem.appendTo($legend)}};this.removeFromLegend=function(){if(this.$legendItem)this.$legendItem.remove()};this.setTransparency=function(transparency){this.transparency=parseFloat(transparency)||this.transparency||0;if(this.openLayersLayer){this.openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100)}try{this.emit({type:"transparency",value:this.transparency})}catch(err){var test=this.transparency;var errTxt=err.Message}if(app.map!==undefined){var currentLayer,openLayersLayer,lid;var i;for(i=app.map.getNumLayers()-2;i>0;i--){currentLayer=app.map.layers[i];openLayersLayer=currentLayer.seldonLayer.openLayersLayer;lid=currentLayer.seldonLayer.lid;if(stringContainsChar(currentLayer.name,"Mask")){if(openLayersLayer&&lid.substring(0,lid.indexOf("MaskFor"))===this.lid){openLayersLayer.setOpacity(1-parseFloat(this.transparency)/100);currentLayer.seldonLayer.transparency=transparency}}}}}}window.EventEmitter.declare(Layer);return Layer}},{"./stringContainsChar.js":55}],29:[function(require,module,exports){module.exports=function($){function createLayerToggleCheckbox(layer){var checkbox=document.createElement("input"),$checkbox;checkbox.type="checkbox";checkbox.id="chk"+layer.lid;checkbox.onclick=function(){if($(this).is(":checked")){layer.activate()}else{layer.deactivate({removeFromLegend:true,removeFromParentMaskLayers:true})}};$checkbox=$(checkbox);$checkbox.addClass(layer.lid);layer.addListener("activate",function(){$("input."+this.lid).attr("checked",true)});layer.addListener("deactivate",function(){$("input."+this.lid).attr("checked",false)});return checkbox}return createLayerToggleCheckbox}},{}],30:[function(require,module,exports){module.exports=function($){function updateTransparency(layer,value){try{layer.setTransparency(value)}catch(e){var errTxt=e.message}}function createLayerPropertiesDialog(layer){var localTransparency=0;var $html=$(""+'
'+""+""+""+""+""+""+"
Transparency:"+'
'+"
"+'%'+"
"+"
");$html.find("input.transparency-text").val(layer.transparency);if(layer.transparency>0){localTransparency=layer.transparency;layer.setTransparency(localTransparency)}$html.find(".transparency-slider").slider({min:0,max:100,step:1,value:localTransparency,slide:function(event,ui){updateTransparency(layer,ui.value)}});$html.find("input.transparency-text").change(function(){var $this=$(this),newValueFloat=parseFloat($this.val());if(isNaN(newValueFloat)||newValueFloat<0||newValueFloat>100){$this.val(layer.transparency);return}layer.setTransparency($this.val())});layer.addListener("transparency",function(e){$html.find("input.transparency-text").val(e.value)});$html.dialog({zIndex:10050,position:"left",autoOpen:true,hide:"explode",title:layer.name,width:"auto",close:function(){$(this).dialog("destroy");$html.remove();createLayerPropertiesDialog.$html[layer.lid]=undefined}});createLayerPropertiesDialog.$html[layer.lid]=$html}createLayerPropertiesDialog.$html={};return createLayerPropertiesDialog}},{}],31:[function(require,module,exports){module.exports=function($){var createLayerPropertiesDialog=require("./layer_dialog.js")($);function createLayerPropertiesIcon(layer){var img=document.createElement("img");img.id=layer.lid;img.src="icons/settings.png";img.className="layerPropertiesIcon";img.onclick=function(){createLayerPropertiesDialog(layer)};return img}return createLayerPropertiesIcon}},{"./layer_dialog.js":30}],32:[function(require,module,exports){module.exports=function($,app){var generalRadioHandler=require("./layer_radio_handler.js")($,app);function createLayerToggleRadioButton(layer,radioGroupName){var checkbox=document.createElement("input"),$checkbox;checkbox.type="radio";checkbox.name=radioGroupName;checkbox.id=layer.lid;if(layer.selectedInConfig){checkbox.checked=true}$checkbox=$(checkbox);$checkbox.change(radioHandler);layer.addListener("activate",function(){$checkbox.attr("checked",true)});layer.addListener("deactivate",function(){$checkbox.attr("checked",false)});return checkbox}function radioHandler(){generalRadioHandler(app)}return createLayerToggleRadioButton}},{"./layer_radio_handler.js":33}],33:[function(require,module,exports){module.exports=function($,app){var Layer=require("./layer.js")($,app);function radioHandler(app){var $selectedOption=$(app.dropdownBoxList[0]).find(":selected");if($selectedOption.text()==="select..."){clearRadioLayers(app,null);return}var selectLayer=app.dropdownBoxLayers[$selectedOption.val()];var wanted_lid=getActiveDropdownBoxRadioLID(app);var wanted_layer=undefined;var i;for(i=0;i0;i--){currLayer=app.map.layers[i].seldonLayer;for(j=0;j"+selectBoxLayers[i].name+"")}selectBox.insertAdjacentHTML("afterbegin","");$(selectBox).change(selectHandler);return selectBox}function selectHandler(){radioHandler(app)}return createLayerToggleDropdownBox}},{"./layer_radio_handler.js":33}],35:[function(require,module,exports){module.exports=function($,app){function isLayerInLegendConfig(layerId){return layerId in app.legendLookup}function getLegendStringFromPixelValue(layerId,pixelValue){var legendString="";if(isLayerInLegendConfig(layerId)){legendString=app.legendLookup[layerId][pixelValue];if(!legendString){console.error("No legend string set for pixel value",pixelValue,"for layer",layerId)}}return legendString}return getLegendStringFromPixelValue}},{}],36:[function(require,module,exports){module.exports=function($,app){var ClickTool=require("./clicktool.js");var saveAs=require("../libs/FileSaver/FileSaver.js").saveAs;var popupId="marker-dialog";var points=[];var pointStyleDefault={pointRadius:4,fillColor:"blue",fillOpacity:.75};var pointStyleHover={pointRadius:5,fillColor:"orange",fillOpacity:.75};var pointStyle=new OpenLayers.StyleMap(pointStyleDefault);function marker(){return new ClickTool(markerHandler)}function markerHandler(e){var coords=app.map.getLonLatFromPixel(e.xy);var lonlat=app.map.getLonLatFromPixel(e.xy);lonlat.transform(app.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));var markerLayer=new OpenLayers.Layer.Vector("markerLayer",{styleMap:pointStyle});var feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(coords.lon,coords.lat));markerLayer.addFeatures(feature);app.map.addLayer(markerLayer);if(!$("#"+popupId).length){createPopup()}if($(".marker-points").length){createPointItem(lonlat,markerLayer)}points.push({lonlat:lonlat,layer:markerLayer});if(typeof ga!=="undefined"){ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Create New Point",eventLabel:lonlat.lon+", "+lonlat.lat})}}function createPointItem(coords,layer){var itemString="";itemString+='
';itemString+='
';itemString+=' Lat:';itemString+=' '+coords.lat+"";itemString+="
";itemString+='
';itemString+=' Lon:';itemString+=' '+coords.lon+"";itemString+="
";itemString+='
';itemString+=' Notes:';itemString+='
';itemString+="
";itemString+="
";var item=$(itemString);item.data("point",layer);item.on("mouseenter",handlePointHoverEnter).on("mouseleave",handlePointHoverLeave);$(".marker-points").append(item)}function handlePointHoverEnter(e){var point=$(this).data("point");point.style=pointStyleHover;point.redraw()}function handlePointHoverLeave(e){var point=$(this).data("point");point.style=pointStyleDefault;point.redraw()}function createPopup(){var popup=$('
');$("body").append(popup);$(".marker-button-download").click(exportFileHandler);$(".marker-button-clear").click(clearPointsHandler);popup.dialog({width:300,height:400,resizable:false,position:{my:"right top",at:"right-5 top+120"},title:"Mark areas of interest",close:function(event,ui){clearPointsHandler();$(this).remove()}})}function exportFileHandler(){var lat,lon,url,notes;var SEP="|";var i;var csvContent="sep="+SEP+"\n";csvContent+="lat"+SEP+"long"+SEP+"google maps link"+SEP+"notes\n";for(i=0;i=0){direction="N"}else if(type==="lat"&&value<0){direction="S"}else if(type==="lon"&&value>=0){direction="E"}else if(type==="lon"&&value<0){direction="W"}value=Math.abs(value);var degree=Math.floor(value);value=(value-degree)*60;var minute=Math.floor(value);var second=(value-minute)*60;return degree+"%C2%B0"+minute+"'"+second+"%22"+direction}function getNotes(index){if(typeof ga!=="undefined"){var label=$(".marker-point-item").eq(index).find(".marker-point-notes").val();ga("send",{hitType:"event",eventCategory:"User Generated Points",eventAction:"Notes",eventLabel:label})}return $(".marker-point-item").eq(index).find(".marker-point-notes").val()}function clearPointsHandler(){var i;for(i=0;i')}else{popup.html('
')}popup.dialog({width:600,resizable:false,position:{my:"center+"+offset+" center+"+offset,at:"center",of:window},title:Mustache.render("Sentinel-3 NDVI for Lat: {{{lat}}} Lon: {{{lon}}}",{lat:sprintf("%.4f",lonlat.lat),lon:sprintf("%.4f",lonlat.lon)}),close:function(event,ui){app.map.removeLayer(markerLayer);$(this).remove()}});var seldonMultigraph=$("#seldonMultigraph"+app.graphCount+""),promise=seldonMultigraph.multigraph({mugl:muglPrefix+lonlat.lon+","+lonlat.lat,swf:"libs/seldon/libs/Multigraph.swf"});seldonMultigraph.multigraph("done",function(m){if(m){$(m.div()).parent().children(".multigraphLoader").remove()}})})}return createMultigraphTool}},{"./clicktool.js":14}],41:[function(require,module,exports){module.exports=function($){Array.prototype.remove=function(value){if(this.indexOf(value)!==-1){this.splice(this.indexOf(value),1);return true}else{return false}};OpenLayers.Map.prototype.getCurrentSize=function(){var size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=this.div.offsetWidth;size.h=this.div.offsetHeight}if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){size.w=parseInt(this.div.style.width,10);size.h=parseInt(this.div.style.height,10)}size.h=size.h-parseInt($(this.div).css("padding-top"),10)-parseInt($(this.div).css("padding-bottom"),10);return size};$.widget("ui.dialog",$.extend({},$.ui.dialog.prototype,{_moveToTop:function(arg){if(arg){if(arg.handleObj.type!="mousedown"){var moved=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;if(moved&&!silent){this._trigger("focus",event)}return moved}}}}))}},{}],42:[function(require,module,exports){module.exports=function($){var createArcGIS93RestParams=require("./create_arcgis_rest_params.js")($);var AccordionGroup=require("./accordion_group.js");var AccordionGroupSublist=require("./accordion_group_sublist.js");var BaseLayer=require("./baselayer.js");var Theme=require("./theme.js");function parseConfig(configXML,shareUrlInfo){var Layer=require("./layer.js")($,this);var createIdentifyTool=require("./identify.js")($,this);var createMultigraphTool=require("./multigraph.js")($,this);var marker=require("./marker.js")($,this);var app=this,$configXML=$(configXML),initialBaseLayer,initialTheme,shareUrlLayerAlpha={},themeOptions={},i,j,k,l,ll,lll;if(shareUrlInfo!==undefined){for(i=0,l=shareUrlInfo.layerLids.length;i0){app.maxExtent={left:parseFloat($extent.attr("xmin")),bottom:parseFloat($extent.attr("ymin")),right:parseFloat($extent.attr("xmax")),top:parseFloat($extent.attr("ymax"))}}var $baseCombo=$("#baseCombo"),$images=$configXML.find("images image"),$image,selected,baseLayer;for(i=0,l=$images.length;ionline.',mapName:"Layers",info:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nThis comprehensive street map includes highways, major roads, minor roads, one-way arrow indicators, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The map also includes building footprints for selected areas in the United States and Europe. Coverage is provided down to ~1:4k with ~1:1k and ~1:2k data available in select urban areas.\nThe street map was developed by Esri using Esri basemap data, DeLorme basemap layers, U.S. Geological Survey (USGS) elevation data, Intact Forest Landscape (IFL) data for the world; NAVTEQ data for Europe, Australia and New Zealand, India, North America, South America (Argentina, Brazil, Chile, Colombia, and Venezuela), and parts of southern Africa (Botswana, Lesotho, Namibia, South Africa, and Swaziland).\n\nFor more information on this map, including the terms of use, visit us online at http://goto.arcgisonline.com/maps/World_Street_Map",copyrightText:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012",layers:[{id:0,name:"World Street Map",parentLayerId:-1,defaultVisibility:true,subLayerIds:null,minScale:0,maxScale:0}],tables:[],spatialReference:{wkid:102100},singleFusedMapCache:true,tileInfo:{rows:256,cols:256,dpi:96,format:"JPEG",compressionQuality:90,origin:{x:-20037508.342787,y:20037508.342787},spatialReference:{wkid:102100},lods:[{level:0,resolution:156543.033928,scale:591657527.591555},{level:1,resolution:78271.5169639999,scale:295828763.795777},{level:2,resolution:39135.7584820001,scale:147914381.897889},{level:3,resolution:19567.8792409999,scale:73957190.948944},{level:4,resolution:9783.93962049996,scale:36978595.474472},{level:5,resolution:4891.96981024998,scale:18489297.737236},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176}]},initialExtent:{xmin:-28872328.0888923,ymin:-11237732.4896886,xmax:28872328.0888923,ymax:11237732.4896886,spatialReference:{wkid:102100}},fullExtent:{xmin:-20037507.0671618,ymin:-19971868.8804086,xmax:20037507.0671618,ymax:19971868.8804086,spatialReference:{wkid:102100}},units:"esriMeters",supportedImageFormatTypes:"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI,BMP",documentInfo:{Title:"World Street Map",Author:"Esri",Comments:"",Subject:"streets, highways, major roads, railways, water features, administrative boundaries, cities, parks, protected areas, landmarks ",Category:"transportation(Transportation Networks) ",Keywords:"World, Global, Europe, Japan, Hong Kong, North America, United States, Canada, Mexico, Southern Africa, Asia, South America, Australia, New Zealand, India, Argentina, Brazil, Chile, Venezuela, Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, Switzerland, Russia, Thailand, Turkey, 2012",Credits:"Sources: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"},capabilities:"Map"};app.initOpenLayers(baseLayerInfo,initialBaseLayer,initialTheme,themeOptions,initialExtent);return $configXML}function displayError(message){}return parseConfig}},{"./accordion_group.js":3,"./accordion_group_sublist.js":5,"./baselayer.js":13,"./create_arcgis_rest_params.js":16,"./identify.js":24,"./layer.js":28,"./marker.js":36,"./multigraph.js":40,"./theme.js":56}],43:[function(require,module,exports){module.exports=function($,app){function printMap($configXML){var offsetX=parseInt(app.map.layerContainerDiv.style.left,10);var offsetY=parseInt(app.map.layerContainerDiv.style.top,10);var size=app.map.getSize();var tiles=[];var layer,tile,position;var i,j,k;for(i=0;i
');printPopup.dialog({resizable:false,height:75,title:"Creating Image for Print...",close:function(event,ui){$(this).remove()}});var service_url=$configXML.find("tools tool[name=Print]").attr("service_url");if(!service_url){service_url="http://"+window.location.hostname+window.location.pathname}service_url=service_url.replace(/\/$/,"");var service_name=$configXML.find("tools tool[name=Print]").attr("service_name");if(!service_name){service_name="cgi-bin/print.cgi"}var title=$configXML.find("tools tool[name=Print]").attr("title");if(!title){title="U.S Forest Change Assessment Viewer"}$.ajax({url:service_url+"/"+service_name,type:"POST",data:OpenLayers.Util.getParameterString({width:size.w,height:size.h,tiles:tiles_json,legends:legends_json,title:title}),headers:{"Content-Type":"application/x-www-form-urlencoded"},success:function(data,status,jqxhr){data=data.replace(/\s+/,"");var href=service_url+"/cgi-bin/printed_map.jpg";if(data){href=service_url+"/"+data}$("#printMapLoader").html('
print image result
');printPopup.dialog("option","title","Print Image Created!")},error:function(jqxhr,status,err){$("#printMapLoader").html("
An error happended.
");printPopup.dialog("option","title","NO Print Image Created!")}})}return printMap}},{}],44:[function(require,module,exports){function RepeatingOperation(op,yieldEveryIteration){var count=0;var instance=this;this.step=function(args){if(++count>=yieldEveryIteration){count=0;setTimeout(function(){op(args)},1,[]);return}op(args)}}module.exports=RepeatingOperation},{}],45:[function(require,module,exports){module.exports=function($){function handle_search(location,app){var rest_endpoint="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text="+location+"&f=json";$.getJSON(rest_endpoint,function(data){var locations=data["locations"][0];if(locations===undefined){return}var extent=locations["extent"];var bounds=new OpenLayers.Bounds(extent.xmin,extent.ymin,extent.xmax,extent.ymax).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));app.zoomToExtent(bounds,true)})}return handle_search}},{}],46:[function(require,module,exports){(function($){"use strict";require("./overrides.js")($);var seldon={App:require("./app.js")($)};var app=new seldon.App;seldon.init=require("./init.js")(app);window.seldon=seldon})(jQuery)},{"./app.js":11,"./init.js":25,"./overrides.js":41}],47:[function(require,module,exports){module.exports=function($){function setBaseLayer(baseLayer){var resolutions=[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,.5971642833948135];var app=this;if(baseLayer.type=="Google"){var layer=new OpenLayers.Layer.Google("Google Streets");handleBaseLayer(app,layer,baseLayer)}else if(baseLayer.type=="ArcGISCache"){$.ajax({url:baseLayer.url+"?f=json&pretty=true",dataType:"jsonp",success:function(layerInfo){var options={layerInfo:layerInfo};if(baseLayer.numZoomLevels){options.numZoomLevels=baseLayer.numZoomLevels;if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);options.serverResolutions=serverResolutions;options.resolutions=resolutions}}var layer=new OpenLayers.Layer.ArcGISCache(baseLayer.name,baseLayer.url,options);handleBaseLayer(app,layer,baseLayer)},error:function(jqXHR,textStatus,errorThrown){alert(textStatus)}})}else if(baseLayer.type=="WMTS"){var settings={isBaseLayer:true,name:baseLayer.name,style:baseLayer.style,url:baseLayer.url,layer:baseLayer.name,matrixSet:baseLayer.tileMatrixSet,sphericalMercator:true};if(baseLayer.numZoomLevels){var serverResolutions=resolutions.slice(0,baseLayer.numZoomLevels);settings.resolutions=resolutions;settings.serverResolutions=serverResolutions}var layer=new OpenLayers.Layer.WMTS(settings);handleBaseLayer(app,layer,baseLayer)}}function handleBaseLayer(app,layer,baseLayer){app.map.removeLayer(app.map.layers[0]);app.currentBaseLayer=baseLayer;app.map.addLayers([layer]);app.map.setLayerIndex(layer,0);app.emit("baselayerchange")}return setBaseLayer}},{}],48:[function(require,module,exports){function ga_events($){var eventAdded=false;try{$.ga.trackEvent;eventAdded=true}catch(err){eventAdded=false}if(typeof ga!=="undefined"){if(eventAdded){seldon.app.map.events.register("moveend",seldon.app.map,function(){var newMapExtent=seldon.app.map.getExtent();$.ga.trackEvent({category:"Map Extent",action:"Change",label:newMapExtent.toString(),nonInteractive:true})});$(".shareMapUrl").click(function(event){$.ga.trackEvent({category:"Share Map URL",action:"Click",label:$(".shareMapUrl").val()})});$("#mapTheme #themeCombo").change(function(event){$.ga.trackEvent({category:"Map Theme",action:"Change",label:$("#mapTheme #themeCombo option:selected").text()})});$("#txtFindArea input#address_field").keyup(function(event){if(event.which===13){$.ga.trackEvent({category:"Find Area",action:"Search Enter",label:$(this).val()})}});$("#txtFindArea #address_lookup img").click(function(event){$.ga.trackEvent({category:"Find Area",action:"Search Button",label:$("#txtFindArea input#address_field").val()})});$("#mapBase #baseCombo").change(function(event){$.ga.trackEvent({category:"Base Map",action:"Change",label:$("#mapBase #baseCombo option:selected").text()})});$(".header-bar .header-bar img.icon").gaTrackEvent({category:"Nav Bar",action:"click",useLabel:true,labelAttribute:"title",useEvent:true,event:"click"});$("#mapToolsDialog label[for^='chk']").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#mapToolsDialog input").gaTrackEvent({category:"Map Tools",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("#layerPickerDialog label[for^='chk']").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"for",useEvent:true,event:"click"});$("#layerPickerDialog input").gaTrackEvent({category:"Base Layer",action:"Toogle",useLabel:true,labelAttribute:"id",useEvent:true,event:"click"});$("h3.ui-accordion-header").gaTrackEvent({category:"Base Layer",action:"Toggle Accordion",useLabel:true,label:function(){return $(this).text()},useEvent:true,event:"click"});$("#marker-dialog .marker-button-wrapper .marker-button-download").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Download Points"})});$("#marker-dialog .marker-button-wrapper .marker-button-clear").click(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Click",label:"Clear Points"})});$("#marker-dialog .marker-point-label .marker-point-coords-label").focusout(function(event){$.ga.trackEvent({category:"User Generated Points",action:"Notes",label:$(this).val()})});$("img[src$='slider.png']").mouseup(function(event){$.ga.trackEvent({category:"OpenLayers Buttons",action:"Slide",label:"Zoom Slider"})});$(".olButton").click(function(event){var eleId=$(this).attr("id");switch(true){case eleId.indexOf("ZoombarOpenLayers_Map")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Bar"});break;case eleId.indexOf("panleft")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan Left"});break;case eleId.indexOf("panright")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan right"});break;case eleId.indexOf("panup")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan up"});break;case eleId.indexOf("pandown")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Pan down"});break;case eleId.indexOf("zoomin")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom in"});break;case eleId.indexOf("zoomout")>-1:$.ga.trackEvent({category:"OpenLayers Buttons",action:"Click",label:"Zoom Out"});break;default:}})}}}module.exports=ga_events},{}],49:[function(require,module,exports){module.exports=function($){function setMaskByLayer(toggle,parentLayer){var Layer=require("./layer.js")($,this);var app=this;var maskLayer,maskName,cleanMaskName;var m,ml,mld;if(toggle){for(m=0;m0;i--){var currLayer=app.map.layers[i];for(var j=0;j0||sublist.break?"":" empty";var collapsibleClass=sublist.collapsible?" collapsible":"";var collapseHeaderIcon=sublist.collapsible?'':"";var sublistInfo=sublist.info?'
'+sublist.info+"
":"";var sublistObj={heading:sublist.label,items:[],collapsible:sublist.collapsible,contentElement:$('
'+'
'+collapseHeaderIcon+"

"+sublist.label+"

"+sublistInfo+"
"+"
")};if(sublist.description){var sublistInfoButton=new MoreInfoButton(sublist);sublistObj.contentElement.children(".sublist-header").append(sublistInfoButton.element)}g.sublists.push(sublistObj);sublistItems.push(sublistObj.contentElement);var sublistLayerItems=[];for(var k=0,l=sublist.layers.length;k=0){name=this.substring(0,i);value=this.substring(i+1)}else{name=this;value=undefined}vars[name]=value});info.themeName=vars.theme;info.accordionGroupGid=vars.accgp;info.baseLayerName=vars.basemap;if(vars.extent){var extentCoords=vars.extent.split(",");info.extent={left:extentCoords[0],bottom:extentCoords[1],right:extentCoords[2],top:extentCoords[3]}}if(vars.layers){$.each(vars.layers.split(","),function(){info.layerLids.push(this)})}if(vars.mask){$.each(vars.mask.split(","),function(){info.layerMask.push(this)})}if(vars.modifiers){$.each(vars.modifiers.split(","),function(){info.maskModifiers.push(this)})}if(vars.alphas){$.each(vars.alphas.split(","),function(){info.layerAlphas.push(this)})}if(info.themeName&&info.baseLayerName){return info}return undefined};ShareUrlInfo.prototype.urlArgs=function(){return Mustache.render(""+"theme={{{theme}}}"+"&layers={{{layers}}}"+"&mask={{{mask}}}"+"{{{modifiers}}}"+"&alphas={{{alphas}}}"+"&accgp={{{accgp}}}"+"&basemap={{{basemap}}}"+"&extent={{{extent.left}}},{{{extent.bottom}}},{{{extent.right}}},{{{extent.top}}}",{theme:this.themeName,layers:this.layerLids.join(","),mask:this.layerMask.join(","),modifiers:this.maskModifiers.length>0?"&modifiers="+this.maskModifiers.join(","):"",alphas:this.layerAlphas.join(","),accgp:this.accordionGroupGid,basemap:this.baseLayerName,extent:this.extent})};module.exports=ShareUrlInfo},{}],53:[function(require,module,exports){module.exports=function($){var stringContainsChar=require("./stringContainsChar.js");var ShareUrlInfo=require("./share.js");function shareUrl(){if(!this.currentTheme){return undefined}if(!this.currentAccordionGroup){return undefined}if(!this.currentBaseLayer){return undefined}var extent=this.map.getExtent(),layerLids=[],layerAlphas=[],layerMask=[],url;if(!extent){return undefined}$.each(this.map.layers,function(){var op,lid,test;if(!this.isBaseLayer){if(this.opacity===1){op="1"}else if(this.opacity===0){op="0"}else{op=sprintf("%.2f",this.opacity)}if(stringContainsChar(this.name,"MaskFor")){lid=this.seldonLayer.lid;test=lid.substring(lid.indexOf("MaskFor"),lid.length).replace("MaskFor","");if(layerMask.indexOf(test)===-1){layerMask.push(test)}test=this.name.substring(0,this.name.indexOf("MaskFor"));if(layerLids.indexOf(test)===-1){layerLids.push(test);layerAlphas.push(op)}}else{if(this.seldonLayer){layerLids.push(this.seldonLayer.lid);layerAlphas.push(op)}}}});if(this.hasOwnProperty("maskModifiers")){var modifiers=this.maskModifiers.filter(function(val){return val!==""})}url=window.location.toString();url=url.replace(/\?.*$/,"");url=url.replace(/\/$/,"");url=url.replace("#","");return url+"?"+new ShareUrlInfo({themeName:this.currentTheme.name,layerLids:layerLids,layerMask:layerMask,maskModifiers:modifiers,layerAlphas:layerAlphas,accordionGroupGid:this.currentAccordionGroup.gid,baseLayerName:this.currentBaseLayer.name,extent:extent}).urlArgs()}return shareUrl}},{"./share.js":52,"./stringContainsChar.js":55}],54:[function(require,module,exports){module.exports=function($){function createSplashScreen(){var $document=$(document),windowWidth=Math.round($document.width()/2);$("#splashScreenContent").load("splashScreen.html");$("#splashScreenContainer").dialog({autoOpen:false,zIndex:10051,maxHeight:$document.height(),width:windowWidth,minWidth:300,dialogClass:"splashScreenStyle",hide:"explode"})}return createSplashScreen}},{}],55:[function(require,module,exports){function stringContainsChar(string,c){return string.indexOf(c)>=0}module.exports=stringContainsChar},{}],56:[function(require,module,exports){function Theme(settings){this.accordionGroups=[];if(!settings){return}this.name=settings.name;this.label=settings.label;this.index=settings.index;this.zoom=settings.zoom;this.xmin=settings.xmin;this.ymin=settings.ymin;this.xmax=settings.xmax;this.ymax=settings.ymax;this.getAccordionGroupIndex=function(accordionGroup){var i;for(i=0;i