var layers = [];
layers = layers.concat(
[
  {
    "type": "generic",
    "url": window.location.origin + "/service/prism/image?type=ytd&dataType=pa&layerType=ppt&date=11/02/2025", //+ new Date(Date.now() - 86400000).toLocaleDateString(),
    "title": "Water Year to Date % of Average",
    "options": {
      "uniqueid": 1,
      "layerName": "Water Year to Date % of Average",
      "layertype": "image",
      "extent": {xmin: -124.405, xmax: -134.70, ymin: 32.54167, ymax: 42},
      "legend": window.location.origin + "/resources/images/map/legend_precip_t.png",///service/prism/image/legend?type=ytd&layerType=ppt",
      "symbolUpdated": false,
      "searchOverride": false
    },
    "layers": [{}],
    "startEnabled": false,
    "opacity": 1
  }
]);
layers = layers.concat(
[
  {
    "type": "generic",
    "url": window.location.origin + "/service/prism/image?dataType=pa&type=ytd&layerType=tmean&date=11/02/2025", //+ new Date(Date.now() - 86400000).toLocaleDateString(),
    "title": "Average YTD Mean Temperature Departure from Average",
    "options": {
      "uniqueid": 1000,
      "layerName": "Average YTD Mean Temperature Departure from Average",
      "layertype": "image",
      "extent": {xmin: -124.405, xmax: -134.70, ymin: 32.54167, ymax: 42},
      "legend": window.location.origin + "/resources/images/map/legend_temp_t.png",///service/prism/image/legend?layerType=tmax",
      "symbolUpdated": false,
      "searchOverride": false
    },
    "layers": [{}],
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "generic",
    "url": window.location.origin + "/service/prism/image?dataType=val&type=day&layerType=tmax&date=11/02/2025", //+ new Date(Date.now() - 86400000).toLocaleDateString(),
    "title": "Maximum",
    "options": {
      "uniqueid": 1001,
      "layerName": "Maximum",
      "layertype": "image",
      "extent": {xmin: -124.405, xmax: -134.70, ymin: 32.54167, ymax: 42},
      "legend": window.location.origin + "/resources/images/map/temp_max.png",///service/prism/image/legend?layerType=tmax",
      "symbolUpdated": false,
      "searchOverride": false
    },
    "layers": [{}],
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "generic",
    "url": window.location.origin + "/service/prism/image?dataType=val&type=day&layerType=tmean&date=11/02/2025", //+ new Date(Date.now() - 86400000).toLocaleDateString(),
    "title": "Average",
    "options": {
      "uniqueid": 1002,
      "layerName": "Average",
      "layertype": "image",
      "extent": {xmin: -124.405, xmax: -134.70, ymin: 32.54167, ymax: 42},
      "legend": window.location.origin + "/resources/images/map/temp_mean.png",///service/prism/image/legend?layerType=tmean",
      "symbolUpdated": false,
      "searchOverride": false
    },
    "layers": [{}],
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "generic",
    "url": window.location.origin + "/service/prism/image?dataType=val&type=day&layerType=tmin&date=11/02/2025", //+ new Date(Date.now() - 86400000).toLocaleDateString(),
    "title": "Minimum",
    "options": {
      "uniqueid": 1003,
      "layerName": "Minimum",
      "layertype": "image",
      "extent": {xmin: -124.405, xmax: -134.70, ymin: 32.54167, ymax: 42},
      "legend": window.location.origin + "/resources/images/map/temp_min.png",///service/prism/image/legend?layerType=tmin",
      "symbolUpdated": false,
      "searchOverride": false
    },
    "layers": [{}],
    "startEnabled": false,
    "opacity": 1
  }
]);
layers = layers.concat(
[
  {
    "type": "generic",
    //"url": window.location.origin + "/service/reservoirs",
    "url": "https://cdec.water.ca.gov/resapp/service/res/conditions?date=11/03/2025",
    "title": "Reservoirs (145)",
    "options": {
      "disableInfoWindow": false,
      "serviceName": "Reservoirs",
      "extension": "geojson",
      "servicename": "Reservoirs",
      //"lonAttr": "lon",
      //"latAttr": "lat",
      //"arrAttr": "data",
      "lonAttr": "longitude",
      "latAttr": "latitude",
      "arrAttr": "",
      "layerAttributeList": [],
      "uniqueid": 2000,
      "infowindow": {
        "primaryKeyAttribute": "stationId",
        "titleAttribute": "reservoirName",
        //"html": '',
        "html": '
',
        "width": 500,
        "height": 350,
        "events": {
          onTabClick: function(tab, attributes){
            $(tab.controlButton.domNode).find('span.tabLabel').text(attributes.reservoirName);
            var options = { year: 'numeric', month: 'long', day: 'numeric' };
            var currentDate = new Date();
            var yesterday = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate() - 1);
            var month = currentDate.getMonth() + 1; 
            var day = currentDate.getDate() - 1; //yesterday
            if(day < 10) {
              day = '0' + day;
            }
            var formattedDate = (yesterday.getMonth()+1) + '/' + yesterday.getDate() + '/' + yesterday.getFullYear();
            var querydate = currentDate.getFullYear() + '' + month + '' + day;
            var storage = attributes.storage
            if(storage && typeof storage === 'string') {
              storage = storage.replaceAll(',', '');
              storage = parseInt(storage);
            }
            var dailyavg = attributes.avg
            if(dailyavg && typeof dailyavg === 'string') {
              dailyavg = dailyavg.replaceAll(',', '');
              dailyavg = parseInt(dailyavg);
            }
            var capacity = attributes.cap
            if(capacity && typeof capacity === 'string') {
              capacity = capacity.replaceAll(',', '');
              capacity = parseInt(capacity);
            }
            //yesterday.toLocaleDateString("en-US", options)
            var content = "";
            $(tab.domNode).find('.resInfoWindow').html(content);
            
            require([SERVER_CONTEXT + "/resources/js/util/utils.js"+'?v=1.0.8'], function(utils){
              utils.updateText();
              $("#"+attributes.stationId + "-dl").click(function (gd) {
                utils.html2image(attributes.reservoirName, "Reservoir Info-" + attributes.reservoirName);
              });
            });
            
            if(capacity) {
              var $resChart = $('#reservoirChart-'+attributes.stationId);
              var trace1 = {
                x: [1],
                y: [capacity],
                textposition: 'inside',
                name: 'Hist. Max: ' + capacity.toLocaleString(),
                type: 'bar',
                marker: {
                  color: 'rgb(247,214,116)',
                  opacity: 0.8,
                  line: {
                    color: 'rgb(8,48,107)',
                    width: 1.5
                  }
                },
                width: .475
              };
              var trace2 = {
                x: [1],
                y: [storage],
                width: [0.4],
                textposition: 'outside',
                name: 'Storage:: ' + storage.toLocaleString(),
                type: 'bar',
                mode: 'markers',
                hovertemplate: 'Storage: %{y}',
                marker: {
                  color: 'rgb(0,0,179)',
                  opacity: 1,
                  line: {
                    color: 'rgb(8,48,107)',
                    width: 1.5
                  }
                }
              };
              var trace3 = {
                x: [0.55, 1.45],
                y: [dailyavg, dailyavg],
                textposition: ['top center', 'top center'],
                name: dailyavg.toLocaleString(),
                type: 'scatter',
                mode: 'lines',
                marker: {
                  color: 'rgb(255,0,0)',
                  opacity: 1
                }
              };
              var chartdata = [trace1, trace2, trace3];
              var layout = {
                barmode: 'overlay',
                width: 175,
                height: 250,
                hovermode: false,
                xaxis: {
                  showticklabels: false,
                  linecolor: '#007',
                  linewidth: 2
                },
                yaxis: {
                  title: 'Reservoir Storage (AF)',
                  linecolor: '#007',
                  linewidth: 2
                },
                margin: {
                  b: 20,
                  l: 55,
                  r: 50,
                  t: 20
                },
                pad: {
                  t: 20
                },
                showlegend: false
              };
              if(!$(tab.domNode).parent().is(':visible')) {
                $(tab.domNode).parent().show();
                Plotly.newPlot($resChart.attr('id'), chartdata, layout, {displayModeBar: false});
                $(tab.domNode).parent().hide();
              } else {
                Plotly.newPlot($resChart.attr('id'), chartdata, layout, {displayModeBar: false});
              }
            }
            
          }
        }
      },
      "customSymbol": {
        "type": "classBreaks",
        "field": "pctAvg",
        "defaultSymbol": {
          "type": "esriSMS",
          "style": "esriSMSCircle",
          "size": 5,
          "color": {
            "r": 255,
            "g": 255,
            "b": 255,
            "a": 0.784314
          },
          "outline": {
            "type": "esriSLS",
            "style": "esriSLSSolid",
            "color": {
              "r": 0,
              "g": 0,
              "b": 0,
              "a": 1
            },
            "width": "0.2"
          }
        },
        "classBreakInfos": [
          {
            "maxValue": "",
            "minValue": "",
            "label": " Not Ranked",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 255,
                "g": 255,
                "b": 255,
                "a": 0.784314
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 19.999,
            "minValue": 0,
            "label": " 0 - 20%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 128,
                "g": 128,
                "b": 128,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 39.999,
            "minValue": 20,
            "label": " 20 - 40%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 192,
                "g": 0,
                "b": 0,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 59.999,
            "minValue": 40,
            "label": " 40 - 60%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 253,
                "g": 191,
                "b": 2,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 79.999,
            "minValue": 60,
            "label": " 60 - 80%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 215,
                "g": 251,
                "b": 4,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 99.999,
            "minValue": 80,
            "label": " 80 - 100%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 136,
                "g": 251,
                "b": 4,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 119.999,
            "minValue": 100,
            "label": " 100 - 120%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 4,
                "g": 251,
                "b": 25,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 139.999,
            "minValue": 120,
            "label": " 120 - 140%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 48,
                "g": 208,
                "b": 158,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 159.999,
            "minValue": 140,
            "label": " 140 - 160%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 110,
                "g": 185,
                "b": 236,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 179.999,
            "minValue": 160,
            "label": " 160 - 180%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 4,
                "g": 140,
                "b": 251,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 199.999,
            "minValue": 180,
            "label": " 180 - 200%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 2,
                "g": 22,
                "b": 253,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 9999,
            "minValue": 200,
            "label": " > 200%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 147,
                "g": 4,
                "b": 251,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          }
        ]
      },
      "reloaded": true,
      "events": {},
      "layerName": "Reservoirs",
      "layerDefinition": {
        "objectIdField": "OBJECT_ID",
        "geometryType": "esriGeometryPoint",
        "fields": [
          {
            "name": "pctAvg",
            "type": "esriFieldTypeString"
          }
        ]
      },
    },
    "layers": [{}],
    "startEnabled": false,
    "opacity": 1
  }
]);
layers = layers.concat(
[
  /*{
    "type": "generic",
    "url": "https://waterdata.usgs.gov/ca/nwis/current?index_pmcode_STATION_NM=1&index_pmcode_DATETIME=2&group_key=NONE&format=sitefile_output&sitefile_output_format=xml&column_name=agency_cd&column_name=site_no&column_name=station_nm&column_name=site_tp_cd&column_name=dec_lat_va&column_name=dec_long_va&sort_key_2=site_no&html_table_group_key=NONE&rdb_compression=file&list_of_search_criteria=realtime_parameter_selection",
    "title": "USGS Daily Streamflow Conditions",
    "options": {
      "filename": "https://waterdata.usgs.gov/ca/nwis/current?index_pmcode_STATION_NM=1&index_pmcode_DATETIME=2&group_key=NONE&format=sitefile_output&sitefile_output_format=xml&column_name=agency_cd&column_name=site_no&column_name=station_nm&column_name=site_tp_cd&column_name=dec_lat_va&column_name=dec_long_va&sort_key_2=site_no&html_table_group_key=NONE&rdb_compression=file&list_of_search_criteria=realtime_parameter_selection",
      "disableInfoWindow": false,
      "extension": "xml",
      "xml": {
        key: "site",
        latitude: "dec_lat_va",
        longitude: "dec_long_va",
        type: "point"
      },
      "fileid": "https://waterdata.usgs.gov/ca/nwis/current?index_pmcode_STATION_NM=1&index_pmcode_DATETIME=2&group_key=NONE&format=sitefile_output&sitefile_output_format=xml&column_name=agency_cd&column_name=site_no&column_name=station_nm&column_name=site_tp_cd&column_name=dec_lat_va&column_name=dec_long_va&sort_key_2=site_no&html_table_group_key=NONE&rdb_compression=file&list_of_search_criteria=realtime_parameter_selection",
      "isFile": true,
      "parameters": [],
      "uniqueid": 3000,
      "layerName": "USGS Daily Streamflow Conditions",
      "layerDefinition": {
        "objectIdField": "OBJECT_ID",
        "geometryType": "esriGeometryPoint",
        "fields": [
          {
            "name": "agency_cd",
            "alias": "Agency",
            "type": "esriFieldTypeString"
          },
          {
            "name": "site_no",
            "alias": "Site Number",
            "type": "esriFieldTypeString"
          },
          {
            "name": "station_nm",
            "alias": "Station Number",
            "type": "esriFieldTypeString"
          },
          {
            "name": "site_tp_cd",
            "alias": "Type",
            "type": "esriFieldTypeString"
          },
          {
            "name": "dec_lat_va",
            "alias": "Latitude",
            "type": "esriFieldTypeDouble"
          },
          {
            "name": "dec_long_va",
            "alias": "Longitude",
            "type": "esriFieldTypeDouble"
          }
        ],
        "spatialReference": {"wkid": 102100},
        "fieldAliases": {
          "agency_cd": "Agency",
          "site_no": "Site Number",
          "station_nm": "Station Number",
          "site_tp_cd": "Type",
          "dec_lat_va": "Latitude",
          "dec_long_va": "Longitude",
          "OBJECT_ID": "OBJECT_ID"
        },
        "displayFieldName": "site_no",
        "drawingInfo": {"renderer": {
          "type": "simple",
          "symbol": {
            "angle": 0,
            "xoffset": 0,
            "yoffset": 0,
            "type": "esriSMS",
            "size": 8,
            "color": [
              40,
              128,
              191,
              255
            ],
            "outline": {
              "color": [
                255,
                255,
                255,
                255
              ],
              "width": 1,
              "type": "esriSLS",
              "style": "esriSLSSolid"
            },
            "style": "esriSMSCircle"
          }
        }}
      },
      "customSymbol": {
        "angle": 0,
        "xoffset": 0,
        "yoffset": 0,
        "type": "esriSMS",
        "size": 8,
        "color": [
          40,
          128,
          191,
          255
        ],
        "outline": {
          "color": [
            255,
            255,
            255,
            255
          ],
          "width": 1,
          "type": "esriSLS",
          "style": "esriSLSSolid"
        },
        "style": "esriSMSCircle"
      },
      "symbolUpdated": false,
      "searchOverride": false
    },
    "layers": [{}],
    "startEnabled": false,
    "opacity": 1
  },*/
  {
    "type": "generic",
    "url": "https://dashboard.waterdata.usgs.gov/service/cwis/1.0/odata/CurrentConditions?$filter=(StateCode%20eq%20%2706%27%20and%20ParameterCode%20eq%20%2700060%27)",
    "title": "USGS Daily Streamflow Conditions (467)",
    "options": {
      "filename": "https://dashboard.waterdata.usgs.gov/service/cwis/1.0/odata/CurrentConditions?$filter=(StateCode%20eq%20%2706%27%20and%20ParameterCode%20eq%20%2700060%27)",
      "disableInfoWindow": false,
      "extension": "geojson",
      "fileid": "https://dashboard.waterdata.usgs.gov/service/cwis/1.0/odata/CurrentConditions?$filter=(StateCode%20eq%20%2706%27%20and%20ParameterCode%20eq%20%2700060%27)",
      "parameters": [],
      "uniqueid": 3000,
      "lonAttr": "Longitude",
      "latAttr": "Latitude",
      "arrAttr": "value",
      "infowindow": {
        "primaryKeyAttribute": "SiteNumber",
        "html": '',
        "width": 620,
        "height": 450,
        "events": {
          onTabClick: function(tab, attributes){
            $(tab.domNode).find('.streamflowIframe').attr('src', window.location.origin + '/map/streamflow?attributes='+encodeURI(JSON.stringify(attributes)));
          }
        }
      },
      "customSymbol": {
        "type": "uniqueValue",
        "uvrJson": {
          "type": "uniqueValue",
          "field1": "StatisticStatusCode",
          "defaultSymbol": {
            "color": [
              255,
              255,
              255,
              200
            ],
            "outline": {
              "color": [
                0,
                0,
                0,
                255
              ],
              "width": 0.5,
              "type": "esriSLS",
              "style": "esriSLSSolid"
            },
            "size": 5,
            "type": "esriSMS",
            "style": "esriSMSCircle"
          },
          "defaultLabel": null,
          "uniqueValueInfos": [
            {
              "symbol": {
                "color": [
                  0,
                  0,
                  0,
                  200
                ],
                "outline": {
                  "color": [
                    0,
                    0,
                    0,
                    255
                  ],
                  "width": 0.5,
                  "type": "esriSLS",
                  "style": "esriSLSSolid"
                },
                "size": 5,
                "type": "esriSMS",
                "style": "esriSMSCircle"
              },
              "value": "P100",
              "label": "High",
              "description": ""
            },
            {
              "symbol": {
                "color": [
                  0,
                  0,
                  255,
                  255
                ],
                "outline": {
                  "color": [
                    0,
                    0,
                    0,
                    255
                  ],
                  "width": 0.5,
                  "type": "esriSLS",
                  "style": "esriSLSSolid"
                },
                "size": 5,
                "type": "esriSMS",
                "style": "esriSMSCircle"
              },
              "value": "P90_100",
              "label": "> 90th Percentile",
              "description": ""
            },
            {
              "symbol": {
                "color": [
                  64,
                  233,
                  208,
                  255
                ],
                "outline": {
                  "color": [
                    0,
                    0,
                    0,
                    255
                  ],
                  "width": 0.5,
                  "type": "esriSLS",
                  "style": "esriSLSSolid"
                },
                "size": 5,
                "type": "esriSMS",
                "style": "esriSMSCircle"
              },
              "value": "P75_90",
              "label": "76th - 90th Percentile",
              "description": ""
            },
            {
              "symbol": {
                "color": [
                  0,
                  255,
                  0,
                  255
                ],
                "outline": {
                  "color": [
                    0,
                    0,
                    0,
                    255
                  ],
                  "width": 0.5,
                  "type": "esriSLS",
                  "style": "esriSLSSolid"
                },
                "size": 5,
                "type": "esriSMS",
                "style": "esriSMSCircle"
              },
              "value": "P25_75",
              "label": "25th - 75th Percentile",
              "description": ""
            },
            {
              "symbol": {
                "color": [
                  255,
                  164,
                  0,
                  255
                ],
                "outline": {
                  "color": [
                    0,
                    0,
                    0,
                    255
                  ],
                  "width": 0.5,
                  "type": "esriSLS",
                  "style": "esriSLSSolid"
                },
                "size": 5,
                "type": "esriSMS",
                "style": "esriSMSCircle"
              },
              "value": "P10_25",
              "label": "10th - 24th Percentile",
              "description": ""
            },
            {
              "symbol": {
                "color": [
                  177,
                  33,
                  33,
                  255
                ],
                "outline": {
                  "color": [
                    0,
                    0,
                    0,
                    255
                  ],
                  "width": 0.5,
                  "type": "esriSLS",
                  "style": "esriSLSSolid"
                },
                "size": 5,
                "type": "esriSMS",
                "style": "esriSMSCircle"
              },
              "value": "P0_10",
              "label": "< 10th Percentile",
              "description": ""
            },
            {
              "symbol": {
                "color": [
                  255,
                  0,
                  0,
                  255
                ],
                "outline": {
                  "color": [
                    0,
                    0,
                    0,
                    255
                  ],
                  "width": 0.5,
                  "type": "esriSLS",
                  "style": "esriSLSSolid"
                },
                "size": 5,
                "type": "esriSMS",
                "style": "esriSMSCircle"
              },
              "value": "P0",
              "label": "Low",
              "description": ""
            },
            {
              "symbol": {
                "color": [
                  255,
                  255,
                  255,
                  200
                ],
                "outline": {
                  "color": [
                    0,
                    0,
                    0,
                    255
                  ],
                  "width": 0.5,
                  "type": "esriSLS",
                  "style": "esriSLSSolid"
                },
                "size": 5,
                "type": "esriSMS",
                "style": "esriSMSCircle"
              },
              "value": "",
              "label": "Not Ranked",
              "description": ""
            }
          ],
          "fieldDelimiter": ""
        },
        "subLayerType": "esriPMS",
        "labels": [
          "High",
          "> 90th Percentile",
          "76th - 90th Percentile",
          "25th - 75th Percentile",
          "10th - 24th Percentile",
          "< 10th Percentile",
          "Low",
          "Not Ranked"
        ]
      },
      "layerDefinition": {
        "objectIdField": "OBJECT_ID",
        "geometryType": "esriGeometryPoint",
        "fields": [
          {
            "name": "StatisticStatusCode",
            "type": "esriFieldTypeString"
          }
        ],
        "spatialReference": {"wkid": 4326},
        "displayFieldName": "SiteNumber",
        "drawingInfo": {"renderer": {
          "type": "simple",
          "symbol": {
            "color": [
              40,
              128,
              191,
              255
            ],
            "size": "8",
            "type": "esriSMS",
            "style": "esriSMSCircle",
            "outline": {
              "color": [
                255,
                255,
                255,
                255
              ],
              "width": "1",
              "type": "esriSLS",
              "style": "esriSLSSolid"
            }
          }
        }}
      },
      "layerName": "USGS Daily Streamflow Conditions"
    },
    "layers": [{}],
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "generic",
    "url": window.location.origin + "/resources/data/usgs-stream-flows.json",
    "title": "All USGS Streamflow Points (587)",
    "options": {
      "filename": window.location.origin + "/resources/data/usgs-stream-flows.json",
      "extension": "geojson",
      "fileid": window.location.origin + "/resources/data/usgs-stream-flows.json",
      "parameters": [],
      "uniqueid": 3001,
      "lonAttr": "lon",
      "latAttr": "lat",
      "arrAttr": "data",
      "layerName": "USGS Daily Streamflow Conditions",
      "customSymbol": {
        "angle": 0,
        "xoffset": 0,
        "yoffset": 0,
        "type": "esriSMS",
        "size": "7",
        "color": {
          "r": 40,
          "g": 128,
          "b": 191,
          "a": 1
        },
        "outline": {
          "color": {
            "r": 255,
            "g": 255,
            "b": 255,
            "a": 1
          },
          "width": "1",
          "type": "esriSLS",
          "style": "esriSLSSolid"
        },
        "style": "esriSMSCircle"
      },
      "infowindow": {
        "primaryKeyAttribute": "siteNumber",
        "html": '',
        "width": 400,
        "height": 450,
        "events": {
          afterInit: function(tab, attributes){
            var html = 
              ''+attributes.agency+'
'+
              '' +
              ''+attributes.siteName+'
' +
              ''+attributes.lat+'
' +
              ''+attributes.lon+'
' +
              ''+attributes.huc+'
' +
              ''+attributes.drainageArea+'
' +
              ""
            ;
            $(tab.domNode).find('.usgs-content').html(html);
          }
        }
      },
    },
    "layers": [{}],
    "startEnabled": false,
    "opacity": 1
  }
]);
layers = layers.concat(
[
  {
    "type": "generic",
    //"url": window.location.origin + "/service/allsnow?actualDate=11/03/2025&minElevation=5000&maxElevation=15000&f=pjson",
    "url": "https://ferix.water.ca.gov/snow/service/station/sensor/all?actualDate=11/03/2025&minElevation=5000&maxElevation=15000&f=pjson",
    "title": "Snow Sensors",
    "options": {
      "extension": "geojson",
      "serviceName": "Snow Sensors",
      "lonAttr": "longitude",
      "latAttr": "latitude",
      "arrAttr": "data",
      "uniqueid": 4000,
      "layerName": "Snow Sensors",
      "infowindow": {
        "primaryKeyAttribute": "sta",
        //"html": '',
        "html": '',
        "width": 550,
        "height": 350,
        "events": {
          onTabClick: function(tab, attributes){
            $(tab.controlButton.domNode).find('span.tabLabel').text(attributes.stationName);
            var obs_val = attributes.obs_val;
            var percent_mean_avg = attributes.percent_mean_avg;
            var maxSwe = 0;
            if(attributes.mean != null && attributes.mean != 0) {
              maxSwe = Math.round((attributes.maxval/attributes.mean) * 100);
            }
            var minSwe = 0;
            if(attributes.mean != null && attributes.mean != 0) {
              minSwe = Math.round((attributes.minval/attributes.mean) * 100);
            }
            if(percent_mean_avg < 0 || obs_val == null || obs_val < 0 || obs_val === "") {
              percent_mean_avg = null;
            }
            if(minSwe < 0) {
              minSwe = null;
            }
            var content = "";
            $(tab.domNode).find('.snowInfoWindow').html(content);
            
            require([SERVER_CONTEXT + "/resources/js/util/utils.js"+'?v=1.0.8'], function(utils){
              utils.updateText();
              $("#"+attributes.sta + "-dl").click(function (gd) {
                utils.html2image("snow"+attributes.sta, "Snow Info-"+attributes.sta);
              });
            });
            
            var $snowChart = $('#snowChart-'+attributes.sta);
            var traces = [];
            if(maxSwe) {
              var trace1 = {
                x: [1],
                y: [maxSwe],
                textposition: 'inside',
                name: 'Hist. Max: ' + maxSwe.toLocaleString(),
                type: 'bar',
                marker: {
                  color: 'rgb(189, 215, 238)',
                  opacity: 0.8,
                  line: {
                    color: 'rgb(8,48,107)',
                    width: 1.5
                  }
                },
                width: .475
              };
              traces.push(trace1);
            }
            
            if(percent_mean_avg) {
              var trace2 = {
                x: [1],
                y: [percent_mean_avg],
                width: [0.4],
                textposition: 'outside',
                name: 'Percent Average: ' + percent_mean_avg.toLocaleString(),
                type: 'bar',
                mode: 'markers',
                hovertemplate: 'Percent Average: %{y}',
                marker: {
                  color: 'rgb(0, 112, 192)',
                  opacity: 1,
                  line: {
                    color: 'rgb(8,48,107)',
                    width: 1.5
                  }
                }
              };
              traces.push(trace2);
            }
            if(minSwe) {
              var trace3 = {
                x: [0.55, 1.45],
                y: [minSwe, minSwe],
                textposition: ['top center', 'top center'],
                name: minSwe.toLocaleString(),
                type: 'scatter',
                mode: 'lines',
                marker: {
                  color: 'rgb(0,0,0)',
                  opacity: 1
                }
              };
              traces.push(trace3);
            }
            
              var chartdata = traces;
            if(chartdata.length > 0) {
              var layout = {
                barmode: 'overlay',
                width: 185,
                height: 225,
                hovermode: false,
                xaxis: {
                  showticklabels: false,
                  linecolor: '#007',
                  linewidth: 2
                },
                yaxis: {
                  linecolor: '#007',
                  linewidth: 2,
                  title: {
                    text: 'Snow Water Equivalent % of Average (%)',
                    font: {
                      size: 10
                    }
                  }
                  
                },
                margin: {
                  b: 20,
                  l: 60,
                  r: 50,
                  t: 20
                },
                pad: {
                  t: 20
                },
                showlegend: false                
              };
              if(!$(tab.domNode).parent().is(':visible')) {
                $(tab.domNode).parent().show();
                Plotly.newPlot($snowChart.attr('id'), chartdata, layout, {displayModeBar: false});
                $(tab.domNode).parent().hide();
              } else {
                Plotly.newPlot($snowChart.attr('id'), chartdata, layout, {displayModeBar: false});
              }
            }
            
          }
          /*onTabClick: function(tab, attributes){
            function toOracleDate(dateString) {
              var date = new Date(dateString);
              var year = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(date);
              var month = new Intl.DateTimeFormat('en', { month: 'short' }).format(date);
              var day = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(date);
              return day + "-" + month + "-" + year;
            }
            $(tab.domNode).find('.snowIframe').attr('src', window.location.origin + '/map/snow?date='+toOracleDate($('#actualDate').val())+'&attributes='+encodeURI(JSON.stringify(attributes)));
            
          }*/
        }
      },
      /*"customLabelInfo": {
        "labelExp": [{
          "checkbox": false,
          "preText": "",
          "fieldText": "sta",
          "appText": ""
        }],
        "position": "above-center",
        "textColor": "rgb(255,255,255)",
        "textSize": "11",
        "setHalo": false,
        "haloColor": "rgb(0,0,0)",
        "haloSize": "1",
        "minZoom": "-1"
      },*/
      "layerFilters": {"useDatepicker": true},
      "searchOverride": true,
      "reloaded": true,
      "layerAttributeList": [],
      "layerDefinition": {
        "objectIdField": "objectId",
        "geometryType": "esriGeometryPoint",
        "fields": [
          {
            "name": "percent_mean_avg",
            "type": "esriFieldTypeString",
            "nullable": true
          }
        ]
      },
      "customSymbol": {
        "type": "classBreaks",
        "field": "percent_mean_avg",
        "defaultSymbol": {
          "type": "esriSMS",
          "style": "esriSMSCircle",
          "size": 5,
          "color": {
            "r": 255,
            "g": 255,
            "b": 255,
            "a": 0.784314
          },
          "outline": {
            "type": "esriSLS",
            "style": "esriSLSSolid",
            "color": {
              "r": 0,
              "g": 0,
              "b": 0,
              "a": 1
            },
            "width": "0.2"
          }
        },
        "classBreakInfos": [
          {
            "maxValue": '',
            "minValue": '',
            "label": " Not Ranked",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 255,
                "g": 255,
                "b": 255,
                "a": 0.784314
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 19.999,
            "minValue": 0,
            "label": " 0 - 20%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 128,
                "g": 128,
                "b": 128,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 39.999,
            "minValue": 20,
            "label": " 20 - 40%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 192,
                "g": 0,
                "b": 0,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 59.999,
            "minValue": 40,
            "label": " 40 - 60%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 253,
                "g": 191,
                "b": 2,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 79.999,
            "minValue": 60,
            "label": " 60 - 80%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 215,
                "g": 251,
                "b": 4,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 99.999,
            "minValue": 80,
            "label": " 80 - 100%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 136,
                "g": 251,
                "b": 4,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 119.999,
            "minValue": 100,
            "label": " 100 - 120%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 4,
                "g": 251,
                "b": 25,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 139.999,
            "minValue": 120,
            "label": " 120 - 140%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 48,
                "g": 208,
                "b": 158,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 159.999,
            "minValue": 140,
            "label": " 140 - 160%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 110,
                "g": 185,
                "b": 236,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 179.999,
            "minValue": 160,
            "label": " 160 - 180%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 4,
                "g": 140,
                "b": 251,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 199.999,
            "minValue": 180,
            "label": " 180 - 200%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 2,
                "g": 22,
                "b": 253,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          },
          {
            "maxValue": 9999,
            "minValue": 200,
            "label": " > 200%",
            "symbol": {
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "size": 5,
              "color": {
                "r": 147,
                "g": 4,
                "b": 251,
                "a": 255
              },
              "outline": {
                "type": "esriSLS",
                "style": "esriSLSSolid",
                "color": {
                  "r": 0,
                  "g": 0,
                  "b": 0,
                  "a": 1
                },
                "width": "0.2"
              }
            }
          }
        ]
      },
      "defaultFilters": [
        {
          "clause": "AND"
          ,"filters": [{
              "clause": "AND"
              ,"field": "isSnowSensor"
              ,"value": "1"
              ,"operator": "="
          }]
        }
        
      ]
    },
    "layers": [{}],
    "startEnabled": false,
    "opacity": 0.9
  }/*,
  {
    "type": "simple",
    "url": "https://ferix.water.ca.gov/arcgis/rest/services/ferix/MonthlyFNFWatersheds/MapServer",
    "options": {
      "uniqueid": 4001,
      "layertype": "feature",
      "layerName": "Watersheds",
      "customSymbol": {
        "type": "esriSFS",
        "style": "esriSFSSolid",
        "color": {
          "r": 0,
          "g": 0,
          "b": 0,
          "a": 0
        },
        "outline": {
          "type": "esriSLS",
          "style": "esriSLSSolid",
          "color": {
            "r": 0,
            "g": 0,
            "b": 0,
            "a": 1
          },
          "width": "1"
        }
      }
    },
    "layers": [0],
    "startEnabled": false,
    "opacity": 0.6
  }*/
]);
layers = layers.concat(
[
/*  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Geoscientific/i08_GroundwaterStations_EnterpriseWaterManagement/MapServer",
    "layers": [0],
    "options": {
      "uniqueid": 5000,
      "layerName": "DWR Periodic GW Measurements",
      "dataset": {
        "csv": "https://data.cnra.ca.gov/dataset/dd9b15f5-6d08-4d8c-bace-37dc761a9c08/resource/af157380-fb42-4abf-b72a-6f9f98868077/download/stations.csv",
        "kml": "",
        "shape": "https://data.cnra.ca.gov/dataset/dd9b15f5-6d08-4d8c-bace-37dc761a9c08/resource/c51e0af9-5980-4aa3-8965-e9ea494ad468/download/periodicgwlbulkdatadownload.zip"
      },
      "apiset": {
        "geojson": "",
        "geoservice": ""
      },
      "reloaded": true,
      "events": {},
      "hideNullValues": true
    },
    "title": "DWR Periodic GW Measurements",
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "generic",
    "url": "",
    "title": "DWR Continuous GW Measurements",
    "options": {
      arrAttr: "records",
      extension: "geojson",
      latAttr: "LATITUDE",
      lonAttr: "LONGITUDE",
      reloaded: true,
      "uniqueid": 5001,
      "layerDefinition": {
        "objectIdField": "OBJECT_ID",
        "geometryType": "esriGeometryPoint",
        "fields": [
          {
            "name": "BASIN_CODE",
            "alias": "BASIN_CODE",
            "type": "esriFieldTypeString"
          },
          {
            "name": "ELEVDATUM",
            "alias": "ELEVDATUM",
            "type": "esriFieldTypeString"
          },
          {
            "name": "WDL",
            "alias": "WDL",
            "type": "esriFieldTypeString"
          },
          {
            "name": "STATION",
            "alias": "STATION",
            "type": "esriFieldTypeString"
          },
          {
            "name": "LLDATUM",
            "alias": "LLDATUM",
            "type": "esriFieldTypeString"
          },
          {
            "name": "COMMENT",
            "alias": "COMMENT",
            "type": "esriFieldTypeString"
          },
          {
            "name": "WELL_DEPTH",
            "alias": "WELL_DEPTH",
            "type": "esriFieldTypeString"
          },
          {
            "name": "SITE_CODE",
            "alias": "SITE_CODE",
            "type": "esriFieldTypeString"
          },
          {
            "name": "WELL_TYPE",
            "alias": "WELL_TYPE",
            "type": "esriFieldTypeString"
          },
          {
            "name": "COUNTY_NAME",
            "alias": "COUNTY_NAME",
            "type": "esriFieldTypeString"
          },
          {
            "name": "ELEV",
            "alias": "ELEV",
            "type": "esriFieldTypeString"
          },
          {
            "name": "STNAME",
            "alias": "STNAME",
            "type": "esriFieldTypeString"
          },
          {
            "name": "LONGITUDE",
            "alias": "LONGITUDE",
            "type": "esriFieldTypeString"
          },
          {
            "name": "WELL_USE",
            "alias": "WELL_USE",
            "type": "esriFieldTypeString"
          },
          {
            "name": "ELEVACC",
            "alias": "ELEVACC",
            "type": "esriFieldTypeString"
          },
          {
            "name": "WELL_NAME",
            "alias": "WELL_NAME",
            "type": "esriFieldTypeString"
          },
          {
            "name": "BASIN_NAME",
            "alias": "BASIN_NAME",
            "type": "esriFieldTypeString"
          },
          {
            "name": "POSACC",
            "alias": "POSACC",
            "type": "esriFieldTypeString"
          },
          {
            "name": "_full_text",
            "alias": "_full_text",
            "type": "esriFieldTypeString"
          },
          {
            "name": "WCR_NO",
            "alias": "WCR_NO",
            "type": "esriFieldTypeString"
          },
          {
            "name": "LATITUDE",
            "alias": "LATITUDE",
            "type": "esriFieldTypeString"
          },
          {
            "name": "_id",
            "alias": "_id",
            "type": "esriFieldTypeString"
          },
          {
            "name": "OBJECT_ID",
            "alias": "OBJECT_ID",
            "type": "esriFieldTypeOID"
          }
        ],
        "spatialReference": {
          "wkid": 4326
        },
        "fieldAliases": {
          "BASIN_CODE": "BASIN_CODE",
          "ELEVDATUM": "ELEVDATUM",
          "WDL": "WDL",
          "STATION": "STATION",
          "LLDATUM": "LLDATUM",
          "COMMENT": "COMMENT",
          "WELL_DEPTH": "WELL_DEPTH",
          "SITE_CODE": "SITE_CODE",
          "WELL_TYPE": "WELL_TYPE",
          "COUNTY_NAME": "COUNTY_NAME",
          "ELEV": "ELEV",
          "STNAME": "STNAME",
          "LONGITUDE": "LONGITUDE",
          "WELL_USE": "WELL_USE",
          "ELEVACC": "ELEVACC",
          "WELL_NAME": "WELL_NAME",
          "BASIN_NAME": "BASIN_NAME",
          "POSACC": "POSACC",
          "_full_text": "_full_text",
          "WCR_NO": "WCR_NO",
          "LATITUDE": "LATITUDE",
          "_id": "_id",
          "OBJECT_ID": "OBJECT_ID"
        },
        "displayFieldName": "BASIN_CODE",
        "drawingInfo": {
          "renderer": {
            "type": "simple",
            "symbol": {
              "color": [
                40,
                128,
                191,
                255
              ],
              "size": "8",
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "outline": {
                "color": [
                  255,
                  255,
                  255,
                  255
                ],
                "width": "1",
                "type": "esriSLS",
                "style": "esriSLSSolid"
              }
            }
          }
        }
      },
      "dataset": {
        "csv": "https://data.cnra.ca.gov/dataset/618c73fe-b28c-4399-a824-43d0278fe974/resource/03967113-1556-4100-af2c-b16a4d41b9d0/download/gwlstations.csv",
        "kml": "",
        "shape": ""
      },
      "extent": {
        "ymin": 37.80969444,
        "xmin": -123.3685,
        "ymax": 41.99801206,
        "xmax": -121.1169,
        "spatialReference": {"wkid": 4326}
      },
      "customSymbol": {
        "color": {
          "r": 0,
          "g": 191,
          "b": 171,
          "a": 1
        },
        "size": "9",
        "angle": 0,
        "xoffset": 0,
        "yoffset": 0,
        "type": "esriSMS",
        "style": "esriSMSCircle",
        "outline": {
          "color": {
            "r": 0,
            "g": 0,
            "b": 0,
            "a": 1
          },
          "width": "0.25",
          "type": "esriSLS",
          "style": "esriSLSSolid"
        }
      },
      "windowConfig": {
        "layerOption": null,
        "iconradio": false
      },
      "reloaded": true,
      "events": {},
      "layerName": "DWR Continuous GW Measurements"
    },
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "generic",
    "url": "https://waterservices.usgs.gov/nwis/site/?format=ge&stateCd=ca&siteOutput=expanded&seriesCatalogOutput=true&siteType=GW&siteStatus=active&hasDataTypeCd=gw ",
    "title": "USGS Periodic GW Measurements",
    "options": {
      "filename": "https://waterservices.usgs.gov/nwis/site/?format=ge&stateCd=ca&siteOutput=expanded&seriesCatalogOutput=true&siteType=GW&siteStatus=active&hasDataTypeCd=gw ",
      "extension": "kml",
      "fileid": "https://waterservices.usgs.gov/nwis/site/?format=ge&stateCd=ca&siteOutput=expanded&seriesCatalogOutput=true&siteType=GW&siteStatus=active&hasDataTypeCd=gw ",
      "isFile": true,
      "parameters": [],
      "uniqueid": 5002,
      "layerName": "USGS Periodic GW Measurements",
      "layerDefinition": {
        "objectIdField": "OBJECT_ID",
        "geometryType": "esriGeometryPoint",
        "fields": [
          {
            "name": "Placemark",
            "alias": "Placemark",
            "type": "esriFieldTypeString"
          },
          {
            "name": "Point",
            "alias": "Point",
            "type": "esriFieldTypeString"
          },
          {
            "name": "altitudeMode",
            "alias": "altitudeMode",
            "type": "esriFieldTypeString"
          },
          {
            "name": "coordinates",
            "alias": "coordinates",
            "type": "esriFieldTypeString"
          },
          {
            "name": "styleUrl",
            "alias": "styleUrl",
            "type": "esriFieldTypeString"
          },
          {
            "name": "name",
            "alias": "name",
            "type": "esriFieldTypeString"
          },
          {
            "name": "description",
            "alias": "description",
            "type": "esriFieldTypeString"
          }
        ],
        "spatialReference": {"wkid": 102100},
        "fieldAliases": {
          "Placemark": "Placemark",
          "Point": "Point",
          "altitudeMode": "altitudeMode",
          "coordinates": "coordinates",
          "styleUrl": "styleUrl",
          "name": "name",
          "description": "description"
        },
        "displayFieldName": "Placemark",
        "drawingInfo": {"renderer": {
          "type": "simple",
          "symbol": {
            "angle": 0,
            "xoffset": 0,
            "yoffset": 0,
            "type": "esriPMS",
            "url": "https://groundwaterwatch.usgs.gov/GoogleMaps/Symbols/orange-triangle.gif",
            "width": 10,
            "height": 10
          }
        }}
      },
      "customSymbol": {
        "type": "esriSMS",
        "style": "esriSMSDiamond",
        "color": {
          "r": 116,
          "g": 161,
          "b": 191,
          "a": 1
        },
        "size": "11",
        "angle": 0,
        "xoffset": 0,
        "yoffset": 0,
        "outline": {
          "type": "esriSLS",
          "style": "esriSLSSolid",
          "color": {
            "r": 0,
            "g": 0,
            "b": 0,
            "a": 1
          },
          "width": "0.5625"
        }
      },
      "useRendererSymbol": true,
      "windowConfig": {
        "layerOption": null,
        "iconradio": false
      },
      "reloaded": true,
      "events": {}
    },
    "layers": [{}],
    "startEnabled": false,
    "opacity": 1
  },*/
  {
    "type": "simple",
    "url": "https://services.arcgis.com/aa38u6OgfNoCkTJ6/arcgis/rest/services/GroundwaterLevelPercentileClass_gdb/FeatureServer",
    "layers": [0],
    "options": {
      "uniqueid": 5000,
      "layerName": "DWR GW Level Percentile Statistics",
      "reloaded": true,
      "events": {},
      "hideNullValues": true,
      "infowindow": {
        "html": '',
        "width": 750,
        "height": 575,
        "primaryKeyAttribute": "SITE_CODE",
        "events": {
          onTabClick: function(tab, attributes) {
            if(!$(tab.controlButton.domNode).attr('chartLoaded')) {
              $(tab.domNode).find('.iframe').attr('src', window.location.origin + SERVER_CONTEXT + '/map/waterlevel?siteCode=' + attributes.SITE_CODE);
            }
            $(tab.controlButton.domNode).attr('chartLoaded', true);
            $(tab.controlButton.domNode).removeAttr('loaded');
            if($(tab.domNode).find('.iframe')[0] && $(tab.domNode).find('.iframe')[0].contentWindow && $(tab.domNode).find('.iframe')[0].contentWindow.waterLevelChart) {
              var chart = $(tab.domNode).find('.iframe')[0].contentWindow.waterLevelChart;
              setTimeout(function(){
                chart.draw();
              },0)
            }
          }
        }
      },
      "displayFieldName": "PercentileClass",
      "customSymbol": {
        "type": "uniqueValue",
        "uvrJson":{
          "type":"uniqueValue",
          "field1":"PercentileClass",
          "defaultSymbol":null,
          "subLayerType": "esriSFS",
          "labels": [],
          "uniqueValueInfos":[
            {
              "value":"High",
              "symbol":{
                "color":[ 26, 26, 26, 255 ],
                "size":6,
                "angle":0,
                "xoffset":0,
                "yoffset":0,
                "type":"esriSMS",
                "style":"esriSMSCircle",
                "outline":{
                  "color":[ 153, 153, 153, 0 ],
                  "width":0,
                  "type":"esriSLS",
                  "style":"esriSLSSolid"
                }
              },
              "label":"High"
            },
            {
              "value":"\u003e90",
              "symbol":{
                "color":[ 0, 92, 230, 255 ],
                "size":6,
                "angle":0,
                "xoffset":0,
                "yoffset":0,
                "type":"esriSMS",
                "style":"esriSMSCircle",
                "outline":{
                  "color":[ 153, 153, 153, 0 ],
                  "width":0,
                  "type":"esriSLS",
                  "style":"esriSLSSolid"
                }
              },
              "label":"\u003e90 (Much Above Normal)"
            },
            {
              "value":"75-90",
              "symbol":{
                "color":[ 115, 223, 255, 255 ],
                "size":6,
                "angle":0,
                "xoffset":0,
                "yoffset":0,
                "type":"esriSMS",
                "style":"esriSMSCircle",
                "outline":{
                  "color":[ 153, 153, 153, 0 ],
                  "width":0,
                  "type":"esriSLS",
                  "style":"esriSLSSolid"
                }
              },
              "label":"76-90 (Above Normal)"
            },
            {
              "value":"50-75",
              "symbol":{
                "color":[ 85, 255, 0, 255 ],
                "size":6,
                "angle":0,
                "xoffset":0,
                "yoffset":0,
                "type":"esriSMS",
                "style":"esriSMSCircle",
                "outline":{
                  "color":[ 153, 153, 153, 0 ],
                  "width":0,
                  "type":"esriSLS",
                  "style":"esriSLSSolid"
                }
              },
              "label":"50-75 (Normal)"
            },
            {
              "value":"25-50",
              "symbol":{
                "color":[ 85, 255, 0, 255 ],
                "size":6,
                "angle":0,
                "xoffset":0,
                "yoffset":0,
                "type":"esriSMS",
                "style":"esriSMSCircle",
                "outline":{
                  "color":[ 153, 153, 153, 0 ],
                  "width":0,
                  "type":"esriSLS",
                  "style":"esriSLSSolid"
                }
              },
              "label":"25-50 (Normal)"
            },
            {
              "value":"10-25",
              "symbol":{
                "color":[ 255, 170, 0, 255 ],
                "size":6,
                "angle":0,
                "xoffset":0,
                "yoffset":0,
                "type":"esriSMS",
                "style":"esriSMSCircle",
                "outline":{
                  "color":[ 153, 153, 153, 0 ],
                  "width":0,
                  "type":"esriSLS",
                  "style":"esriSLSSolid"
                }
              },
              "label":"10-25 (Below Normal)"
            },
            {
              "value":"\u003c10",
              "symbol":{
                "color":[ 115, 0, 0, 255 ],
                "size":6,
                "angle":0,
                "xoffset":0,
                "yoffset":0,
                "type":"esriSMS",
                "style":"esriSMSCircle",
                "outline":{
                  "color":[ 153, 153, 153, 0 ],
                  "width":0,
                  "type":"esriSLS",
                  "style":"esriSLSSolid"
                }
              },
              "label":"\u003c10 (Much Below Normal)"
            },
            {
              "value":"Low",
              "symbol":{
                "color":[ 230, 0, 0, 255 ],
                "size":6,
                "angle":0,
                "xoffset":0,
                "yoffset":0,
                "type":"esriSMS",
                "style":"esriSMSCircle",
                "outline":{
                  "color":[ 153, 153, 153, 0 ],
                  "width":0,
                  "type":"esriSLS",
                  "style":"esriSLSSolid"
                }
              },
              "label":"Low"
            },
            {
              "value":"Not Ranked",
              "symbol":{
                "color":[ 153, 153, 153, 62 ],
                "size":3.75,
                "angle":0,
                "xoffset":0,
                "yoffset":0,
                "type":"esriSMS",
                "style":"esriSMSCircle",
                "outline":{
                  "color":[ 153, 153, 153, 60 ],
                  "width":1,
                  "type":"esriSLS",
                  "style":"esriSLSSolid"
                }
              },
              "label":"Not Ranked"
            }
          ]
        }
      }
    },
    "title": "DWR GW Level Percentile Statistics",
    "startEnabled": false,
    "opacity": 1
  }
  /*
  {
    "type": "generic",
    "url": "https://mydrywatersupply.water.ca.gov/report/reportservice/tableau",
    "title": "Reported Dry Water Sources",
    "options": {
      "serviceName": "Reported Dry Water Sources",
      "extension": "geojson",
      "servicename": "Reported Dry Water Sources",
      "lonAttr": "lon",
      "latAttr": "lat",
      "arrAttr": "data",
      "layerAttributeList": [],
      "uniqueid": 5004,
      "useRendererSymbol": true,
      "customSymbol": {
        "type": "uniqueValue",
        "uvrJson": {
          "type": "uniqueValue",
          "field1": "reported",
          "fieldDelimiter": ",",
          "defaultSymbol": {
            "color": [
              89,161,79,255
            ],
            "outline": {
              "color": [
                255,
                255,
                255,
                255
              ],
              "width": 1,
              "type": "esriSLS",
              "style": "esriSLSNull"
            },
            "size": "6",
            "type": "esriSMS",
            "style": "esriSMSCircle"
          },
          "defaultLabel": "",
          "uniqueValueInfos": [
            {
              "value": "Last Month",
              "symbol": {
                "color": [
                  225,87,89,255
                ],
                "outline": {
                  "color": [
                    255,
                    255,
                    255,
                    255
                  ],
                  "width": 1,
                  "type": "esriSLS",
                  "style": "esriSLSSolid"
                },
                "size": "6",
                "type": "esriSMS",
                "style": "esriSMSCircle"
              },
              "label": "Last Month"
            },
            {
              "value": "Last Year",
              "symbol": {
                "color": [
                  237,201,72,255
                ],
                "outline": {
                  "color": [
                    255,
                    255,
                    255,
                    255
                  ],
                  "width": 1,
                  "type": "esriSLS",
                  "style": "esriSLSSolid"
                },
                "size": "6",
                "type": "esriSMS",
                "style": "esriSMSCircle"
              },
              "label": "Last Year"
            },
            {
              "value": "Earlier",
              "symbol": {
                "color": [
                  89,161,79,255
                ],
                "outline": {
                  "color": [
                    255,
                    255,
                    255,
                    255
                  ],
                  "width": 1,
                  "type": "esriSLS",
                  "style": "esriSLSSolid"
                },
                "size": "6",
                "type": "esriSMS",
                "style": "esriSMSCircle"
              },
              "label": "Earlier"
            }
          ]
        },
        "subLayerType": "esriSFS",
        "labels": [
          "Last Month",
          "Last Year",
          "Earlier"
        ]
      },
      "layerName": "Reported Dry Water Sources"
    },
    "startEnabled": false
  },
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Geoscientific/i08_GroundwaterDepthSeasonal_Points/MapServer",
    "layers": [0],
    "options": {
      "uniqueid": 5005,
      "layerName": "Depth Points",
      "defaultLayerDef": [
        null,
        "(MSMT_YEAR = '2017') and (MSMT_SEASON = 'Spring')"
      ],
      "dataset": {
        "csv": "",
        "kml": "",
        "shape": "https://gis.water.ca.gov/app/gicima/downloads/GIC_Depth/Spring_2017_Depth_Points.zip"
      },
      "apiset": {
        "geojson": "",
        "geoservice": ""
      },
      "reloaded": true,
      "events": {}
    },
    "defaultLayerDef": [
      null,
      "(MSMT_YEAR = '2017') and (MSMT_SEASON = 'Spring')"
    ],
    "title": "DEPTH POINTS",
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Geoscientific/i08_GroundwaterDepthSeasonal_Contours/MapServer",
    "layers": [0],
    "options": {
      "uniqueid": 5006,
      "layerName": "Depth Contour",
      "dataset": {
        "csv": "",
        "kml": "",
        "shape": "https://gis.water.ca.gov/app/gicima/downloads/GIC_Depth/Spring_2017_Depth_Contours.zip"
      },
      "apiset": {
        "geojson": "",
        "geoservice": ""
      },
      "defaultLayerDef": [
        null,
        "(MSMT_YEAR = '2017') and (MSMT_SEASON = 'Spring') and (CONTOUR_LEVEL_TYPE ='Depth')"
      ],
      "reloaded": true,
      "events": {}
    },
    "defaultLayerDef": [
      null,
      "(MSMT_YEAR = '2017') and (MSMT_SEASON = 'Spring') and (CONTOUR_LEVEL_TYPE ='Depth')"
    ],
    "title": "DEPTH CONTOURS",
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Geoscientific/i08_GroundwaterElevationSeasonal_Points/MapServer",
    "layers": [0],
    "options": {
      "uniqueid": 5007,
      "layerName": "ELEVATION POINTS",
      "defaultLayerDef": ["(MSMT_YEAR = '2017') and (MSMT_SEASON = 'Spring')"],
      "dataset": {
        "csv": "",
        "kml": "",
        "shape": "https://gis.water.ca.gov/app/gicima/downloads/GIC_Elevation/Spring_2017_Elevation_Points.zip"
      },
      "apiset": {
        "geojson": "",
        "geoservice": ""
      },
      "reloaded": true,
      "events": {}
    },
    "defaultLayerDef": ["(MSMT_YEAR = '2017') and (MSMT_SEASON = 'Spring')"],
    "title": "ELEVATION POINTS",
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Geoscientific/i08_GroundwaterElevationSeasonal_Contours/MapServer",
    "layers": [0],
    "options": {
      "uniqueid": 5008,
      "layerName": "ELEVATION CONTOURS",
      "dataset": {
        "csv": "",
        "kml": "",
        "shape": "https://gis.water.ca.gov/app/gicima/downloads/GIC_Elevation/Spring_2017_Elevation_Contours.zip"
      },
      "apiset": {
        "geojson": "",
        "geoservice": ""
      },
      "defaultLayerDef": [
        null,
        null,
        "(MSMT_YEAR = '2017') and (MSMT_SEASON = 'Spring') and (CONTOUR_LEVEL_TYPE ='Elevation')"
      ],
      "reloaded": true,
      "events": {}
    },
    "defaultLayerDef": [
      null,
      null,
      "(MSMT_YEAR = '2017') and (MSMT_SEASON = 'Spring') and (CONTOUR_LEVEL_TYPE ='Elevation')"
    ],
    "title": "ELEVATION CONTOURS",
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Geoscientific/i08_GroundwaterLevelChangeSeasonal_Points/MapServer",
    "layers": [0],
    "options": {
      "uniqueid": 5009,
      "layerName": "CHANGE POINTS",
      "dataset": {
        "csv": "",
        "kml": "",
        "shape": "https://gis.water.ca.gov/app/gicima/downloads/GIC_Change/F2014_F2004_Change_Points.zip"
      },
      "apiset": {
        "geojson": "",
        "geoservice": ""
      },
      "defaultLayerDef": [
        null,
        "(MSMT_SEASON = 'Fall') and (MSMT_YEAR_LATE = 2014) and (MSMT_YEAR_EARLY = 2004)"
      ],
      "reloaded": true,
      "events": {}
    },
    "defaultLayerDef": [
      null,
      "(MSMT_SEASON = 'Fall') and (MSMT_YEAR_LATE = 2014) and (MSMT_YEAR_EARLY = 2004)"
    ],
    "title": "CHANGE POINTS",
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Geoscientific/i08_GroundwaterLevelChangeSeasonal_Contours/MapServer",
    "layers": [0],
    "options": {
      "uniqueid": 5010,
      "layerName": "CHANGE CONTOURS",
      "dataset": {
        "csv": "",
        "kml": "",
        "shape": "https://gis.water.ca.gov/app/gicima/downloads/GIC_Change/F2014_F2004_Change_Contours.zip"
      },
      "apiset": {
        "geojson": "",
        "geoservice": ""
      },
      "defaultLayerDef": [
        null,
        null,
        null,
        "(MSMT_SEASON = 'Fall') and (MSMT_YEAR_LATE = 2014) and (MSMT_YEAR_EARLY = 2004)"
      ],
      "reloaded": true,
      "events": {}
    },
    "defaultLayerDef": [
      null,
      null,
      null,
      "(MSMT_SEASON = 'Fall') and (MSMT_YEAR_LATE = 2014) and (MSMT_YEAR_EARLY = 2004)"
    ],
    "title": "CHANGE CONTOURS",
    "startEnabled": false,
    "opacity": 1
  } */
]);
layers = layers.concat(
[
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Boundaries/i03_CaliforniaCounties/MapServer",
    "options": {
      "uniqueid": 6000,
      "layerName": "County Boundaries",
      "reloaded": true,
      "hideLegendLabel": true,
      "dataset": {
        "csv": "https://atlas-dwr.opendata.arcgis.com/datasets/f26ff0ccda6e48a8b923927cfdb2a451_0.csv",
        "kml": "https://atlas-dwr.opendata.arcgis.com/datasets/f26ff0ccda6e48a8b923927cfdb2a451_0.kml",
        "shape": "https://atlas-dwr.opendata.arcgis.com/datasets/f26ff0ccda6e48a8b923927cfdb2a451_0.zip"
      },
      "events": {}
    },
    "layers": [0],
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Boundaries/i03_WaterDistricts/MapServer",
    "options": {
      "uniqueid": 6001,
      "layerName": "Water Agencies Boundaries",
      "reloaded": true,
      "dataset": {
        "csv": "https://atlas-dwr.opendata.arcgis.com/datasets/45d26a15b96346f1816d8fe187f8570d_0.csv",
        "kml": "https://atlas-dwr.opendata.arcgis.com/datasets/45d26a15b96346f1816d8fe187f8570d_0.kml",
        "shape": "https://atlas-dwr.opendata.arcgis.com/datasets/45d26a15b96346f1816d8fe187f8570d_0.zip"
      },
      "events": {},
      "customSymbol": {
        "type": "esriSFS",
        "style": "esriSFSSolid",
        "color": {
          "r": 192,
          "g": 203,
          "b": 252,
          "a": 1
        },
        "outline": {
          "type": "esriSLS",
          "style": "esriSLSSolid",
          "color": {
            "r": 110,
            "g": 110,
            "b": 110,
            "a": 1
          },
          "width": "0.4"
        }
      },
      "windowConfig": {
        "layerOption": "0",
        "iconradio": false
      }
    },
    "layers": [0],
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "generic",
    "url": "https://sgma.water.ca.gov/portal/service/gsadocument/exclusivegsa",
    "title": "Exclusive GSA Boundaries",
    "opacity": 0.72,
    "options": {
      "dataset": {"shape": "https://sgma.water.ca.gov/portal/service/gsadocument/exclusivegsa"},
      "graphicsOpacity": 0.7,
      "layerName": "Exclusive GSA",
      "filename": "https://sgma.water.ca.gov/portal/service/gsadocument/exclusivegsa",
      "extension": "zip",
      "fileid": "https://sgma.water.ca.gov/portal/service/gsadocument/exclusivegsa",
      "isFile": true,
      "uniqueid": 6002,
      "parameters": [],
      "useIconMarker": false,
      "style": "circle",
      "symbol_size": "8",
      "reloaded": true,
      "events": {},
      "layerDefinition": {
        "objectIdField": "OBJECT_ID",
        "geometryType": "esriGeometryPolygon",
        "fields": [
          {
            "name": "DWR GSA ID",
            "alias": "DWR GSA ID",
            "type": "esriFieldTypeString"
          },
          {
            "name": "GSA Name",
            "alias": "GSA Name",
            "type": "esriFieldTypeString"
          },
          {
            "name": "Basin",
            "alias": "Basin",
            "type": "esriFieldTypeString"
          },
          {
            "name": "Local ID",
            "alias": "Local ID",
            "type": "esriFieldTypeString"
          },
          {
            "name": "Posted DT",
            "alias": "Posted DT",
            "type": "esriFieldTypeString"
          },
          {
            "name": "GSA URL",
            "alias": "GSA URL",
            "type": "esriFieldTypeString"
          },
          {
            "name": "POC Name",
            "alias": "POC Name",
            "type": "esriFieldTypeString"
          },
          {
            "name": "POC Phone",
            "alias": "POC Phone",
            "type": "esriFieldTypeString"
          },
          {
            "name": "POC Email",
            "alias": "POC Email",
            "type": "esriFieldTypeString"
          },
          {
            "name": "GSA_ID",
            "alias": "GSA_ID",
            "type": "esriFieldTypeString"
          },
          {
            "name": "OBJECT_ID",
            "alias": "OBJECT_ID",
            "type": "esriFieldTypeOID"
          }
        ],
        "spatialReference": {"wkid": 102100},
        "fieldAliases": {
          "DWR GSA ID": "DWR GSA ID",
          "GSA Name": "GSA Name",
          "Basin": "Basin",
          "Local ID": "Local ID",
          "Posted DT": "Posted DT",
          "GSA URL": "GSA URL",
          "POC Name": "POC Name",
          "POC Phone": "POC Phone",
          "POC Email": "POC Email",
          "GSA_ID": "GSA_ID",
          "OBJECT_ID": "OBJECT_ID"
        },
        "displayFieldName": "DWR GSA ID",
        "drawingInfo": {"renderer": {
          "type": "simple",
          "symbol": {
            "type": "esriSFS",
            "style": "esriSFSSolid"
          }
        }}
      },
      "customSymbol": {
        "color": {
          "r": 51,
          "g": 183,
          "b": 25,
          "a": 0.5
        },
        "outline": {
          "color": {
            "r": 0,
            "g": 0,
            "b": 0,
            "a": 1
          },
          "width": 0.5,
          "type": "esriSLS",
          "style": "esriSLSSolid"
        },
        "type": "esriSFS",
        "style": "esriSFSSolid"
      },
      "windowConfig": {
        "layerOption": null,
        "iconradio": false
      }
    },
    "layers": [{}],
    "startEnabled": false
  },
  {
    "type": "simple",
    "url": "https://gispublic.waterboards.ca.gov/portalserver/rest/services/Drinking_Water/California_Drinking_Water_System_Area_Boundaries/MapServer",
    "options": {
      "uniqueid": 6003,
      "layerName": "Public Water System (Drinking Water Supplier) Boundaries",
      "searchOverride": true,
      "hideLegendLabel": true
    },
    "layers": [0],
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/InlandWaters/WBD_HUC8_CA/MapServer",
    "options": {
      "uniqueid": 6004,
      "layerName": "Watershed (HUC-8) Boundaries",
      "searchOverride": true,
      "hideLegendLabel": true
    },
    "layers": [0],
    "startEnabled": false,
    "opacity": 1
  }
/*  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Boundaries/i03_Hydrologic_Regions/MapServer",
    "options": {
      "uniqueid": 6001,
      "layerName": "Hydrologic Regions",
      "reloaded": true,
      "dataset": {
        "csv": "https://atlas-dwr.opendata.arcgis.com/datasets/2a572a181e094020bdaeb5203162de15_0.csv",
        "kml": "https://atlas-dwr.opendata.arcgis.com/datasets/2a572a181e094020bdaeb5203162de15_0.kml",
        "shape": "https://atlas-dwr.opendata.arcgis.com/datasets/2a572a181e094020bdaeb5203162de15_0.zip"
      },
      "events": {}
    },
    "layers": [0],
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/InlandWaters/i12_Canals_and_Aqueducts_local/MapServer",
    "options": {
      "dataset": {
        "csv": "https://atlas-dwr.opendata.arcgis.com/datasets/b788fb2628844f54b92e46dac5bb7229_0.csv",
        "kml": "https://atlas-dwr.opendata.arcgis.com/datasets/b788fb2628844f54b92e46dac5bb7229_0.kml",
        "shape": "https://atlas-dwr.opendata.arcgis.com/datasets/b788fb2628844f54b92e46dac5bb7229_0.zip"
      },
      "uniqueid": 6002,
      "layerName": "Local Canals and Aqueducts",
      "reloaded": true,
      "events": {}
    },
    "layers": [0],
    "startEnabled": false,
    "opacity": 1
  }, 
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/InlandWaters/i12_Canals_and_Aqueducts_Federal/MapServer",
    "options": {
//          "dataset": {
//            "csv": "https://atlas-dwr.opendata.arcgis.com/datasets/b788fb2628844f54b92e46dac5bb7229_0.csv",
//            "kml": "https://atlas-dwr.opendata.arcgis.com/datasets/b788fb2628844f54b92e46dac5bb7229_0.kml",
//            "shape": "https://atlas-dwr.opendata.arcgis.com/datasets/b788fb2628844f54b92e46dac5bb7229_0.zip"
//          },
      "uniqueid": 6003,
      "layerName": "Federal Canals and Aqueducts",
      "reloaded": true,
      "events": {}
    },
    "layers": [0],
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Structure/i17_StateWaterProject_Centerline/FeatureServer",
    "options": {
//          "dataset": {
//            "csv": "https://atlas-dwr.opendata.arcgis.com/datasets/b788fb2628844f54b92e46dac5bb7229_0.csv",
//            "kml": "https://atlas-dwr.opendata.arcgis.com/datasets/b788fb2628844f54b92e46dac5bb7229_0.kml",
//            "shape": "https://atlas-dwr.opendata.arcgis.com/datasets/b788fb2628844f54b92e46dac5bb7229_0.zip"
//          },
      "uniqueid": 6004,
      "layerName": "State Canals and Aqueducts",
      "reloaded": true,
      "events": {}
    },
    "layers": [0],
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Boundaries/i03_Adjudicated_Areas/MapServer",
    "options": {
      "uniqueid": 6005,
      "layerName": "Adjudicated Areas",
      "reloaded": true,
      "dataset": {
        "csv": "https://atlas-dwr.opendata.arcgis.com/datasets/3c1cfb54ea6443549acbd0eef960055d_0.csv",
        "kml": "https://atlas-dwr.opendata.arcgis.com/datasets/3c1cfb54ea6443549acbd0eef960055d_0.kml",
        "shape": "https://atlas-dwr.opendata.arcgis.com/datasets/3c1cfb54ea6443549acbd0eef960055d_0.zip"
      },
      "events": {},
      "customSymbol": {
        "type": "esriSFS",
        "style": "esriSFSForwardDiagonal",
        "color": {
          "r": 85,
          "g": 115,
          "b": 128,
          "a": 1
        },
        "outline": {
          "type": "esriSLS",
          "style": "esriSLSSolid",
          "color": {
            "r": 110,
            "g": 110,
            "b": 110,
            "a": 1
          },
          "width": "0.4"
        }
      },
      "windowConfig": {
        "layerOption": "0",
        "iconradio": false
      }
    },
    "layers": [0],
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Boundaries/i03_Census_BlockGroup_DisadvantagedCommunities_2016/MapServer",
    "options": {
      "uniqueid": 6006,
      "layerName": "Disadvantaged Communities Block Groups",
      "reloaded": true,
      "dataset": {
        "csv": "https://atlas-dwr.opendata.arcgis.com/datasets/cf909978f984483980de38c30a8c2cf9_0.csv",
        "kml": "https://atlas-dwr.opendata.arcgis.com/datasets/cf909978f984483980de38c30a8c2cf9_0.kml",
        "shape": "https://atlas-dwr.opendata.arcgis.com/datasets/cf909978f984483980de38c30a8c2cf9_0.zip"
      },
      "events": {},
      "defaultLayerDef": ["(DAC16 = 'Y') and (Pop16 > 0)"],
      "customSymbol": {
        "type": "esriSFS",
        "style": "esriSFSSolid",
        "color": {
          "r": 204,
          "g": 15,
          "b": 15,
          "a": 1
        },
        "outline": {
          "type": "esriSLS",
          "style": "esriSLSSolid",
          "color": {
            "r": 110,
            "g": 110,
            "b": 110,
            "a": 1
          },
          "width": "0.4"
        }
      },
      "windowConfig": {
        "layerOption": "0",
        "iconradio": false
      }
    },
    "layers": [0],
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Boundaries/i03_Census_Place_DisadvantagedCommunities_2016/MapServer",
    "options": {
      "uniqueid": 6007,
      "layerName": "Disadvantaged Communities Places",
      "reloaded": true,
      "dataset": {
        "csv": "https://atlas-dwr.opendata.arcgis.com/datasets/bb510859b2a246d3944606b12842c237_0.csv",
        "kml": "https://atlas-dwr.opendata.arcgis.com/datasets/bb510859b2a246d3944606b12842c237_0.kml",
        "shape": "https://atlas-dwr.opendata.arcgis.com/datasets/bb510859b2a246d3944606b12842c237_0.zip"
      },
      "events": {},
      "defaultLayerDef": ["(DAC16 = 'Y') and (Pop16 > 0)"],
      "customSymbol": {
        "type": "esriSFS",
        "style": "esriSFSSolid",
        "color": {
          "r": 0,
          "g": 255,
          "b": 197,
          "a": 1
        },
        "outline": {
          "type": "esriSLS",
          "style": "esriSLSSolid",
          "color": {
            "r": 110,
            "g": 110,
            "b": 110,
            "a": 1
          },
          "width": "0.4"
        }
      },
      "windowConfig": {
        "layerOption": "1",
        "iconradio": false
      }
    },
    "layers": [0],
    "startEnabled": false,
    "opacity": 1
  },
  {
    "type": "simple",
    "url": "https://gis.water.ca.gov/arcgis/rest/services/Boundaries/i03_Census_Tract_DisadvantagedCommunities_2016/MapServer",
    "options": {
      "uniqueid": 6008,
      "layerName": "Disadvantaged Communities Tracts",
      "reloaded": true,
      "dataset": {
        "csv": "https://atlas-dwr.opendata.arcgis.com/datasets/a47bb0a534e640249f7037fb015f32a1_0.csv",
        "kml": "https://atlas-dwr.opendata.arcgis.com/datasets/a47bb0a534e640249f7037fb015f32a1_0.kml",
        "shape": "https://atlas-dwr.opendata.arcgis.com/datasets/a47bb0a534e640249f7037fb015f32a1_0.zip"
      },
      "events": {},
      "defaultLayerDef": ["(DAC16 = 'Y') and (Pop16 > 0)"],
      "customSymbol": {
        "type": "esriSFS",
        "style": "esriSFSSolid",
        "color": {
          "r": 168,
          "g": 112,
          "b": 0,
          "a": 1
        },
        "outline": {
          "type": "esriSLS",
          "style": "esriSLSSolid",
          "color": {
            "r": 110,
            "g": 110,
            "b": 110,
            "a": 1
          },
          "width": "0.4"
        }
      },
      "windowConfig": {
        "layerOption": "1",
        "iconradio": false
      }
    },
    "layers": [0],
    "startEnabled": false,
    "opacity": 1
  }, */
]);
layers = layers.concat(
[
  {
    "type": "generic",
  /*  "url": window.location.origin + "/service/prism/image?type=ytd&dataType=val&layerType=ppt&date=12/31/2024", //+ new Date(Date.now() - 86400000).toLocaleDateString(), */
    "url": window.location.origin + "/service/prism/image?type=day&dataType=val&layerType=soil&date=12/31/2024",
    "title": "Soil Moisture",
    "options": {
      "uniqueid": 7000,
      "layerName": "Water Year to Date",
      "layertype": "image",
      "extent": {xmin: -124.405, xmax: -134.70, ymin: 32.54167, ymax: 42},
      "legend": window.location.origin + "/resources/images/map/legend_soil_t.png?v=2",///service/prism/image/legend?type=ytd&layerType=ppt",
      "symbolUpdated": false,
      "searchOverride": false,
      
    },
    "layers": [{}],
    "startEnabled": false,
    "opacity": 1
  }
]
);
layers = layers.concat(
[
  {
    "type": "generic",
  /*  "url": window.location.origin + "/service/prism/image?dataType=val&type=day&layerType=tmax&date=11/02/2025", //+ new Date(Date.now() - 86400000).toLocaleDateString(), */
    "url": window.location.origin + "/service/prism/image?type=day&dataType=val&layerType=evap&date=11/02/2025",
    "title": "Evaporative Stress Index (ESI)",
    "options": {
      "uniqueid": 8000,
      "layerName": "Vegetation",
      "layertype": "image",
      "extent": {xmin: -124.405, xmax: -114.11, ymin: 32.54167, ymax: 42},
      "legend": window.location.origin + "/resources/images/map/legend_veg_t.png",///service/prism/image/legend?layerType=tmax",
      "symbolUpdated": false,
      "searchOverride": false,
      
    },
    "layers": [{}],
    "startEnabled": false,
    "opacity": 1
  }
]);
var precipDate = '11/02/2025';
var tempDate = '11/02/2025';
var soilDate = '12/31/2024';
var evapDate = '11/02/2025';
configOptions = {
  "hideDescription": true,
  "title": "California Water Watch",
  "titleUrl": "",
  "tolerance": "6",
  "useGeometry": true,
  "hideNoData": true,
  "showLayerWin": false,
  "locations_uploader": true,
  "basemap_gallery": true,
  "showFullScreen": true,
  "style": "flat",
  "hideSingleTab": true,
  "hideLayerSettingsDropdown": true,
  "infowinSaveData": {
    "6000": [
      {
        "visible": false,
        "field": "OBJECTID",
        "alias": "OBJECTID",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "COUNTY_NAME",
        "alias": "NAME",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "COUNTY_ABBREV",
        "alias": "COUNTY ABBREV",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "COUNTY_NUM",
        "alias": "COUNTY NUM",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "COUNTY_CODE",
        "alias": "COUNTY CODE",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "COUNTY_FIPS",
        "alias": "COUNTY FIPS",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Shape",
        "alias": "Shape",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Shape.STArea()",
        "alias": "Shape.STArea()",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Shape.STLength()",
        "alias": "Shape.STLength()",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      }
    ],
    "6004": [
      {
        "visible": false,
        "field": "FID",
        "alias": "OBJECTID",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Shape",
        "alias": "Shape",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "AreaAcres",
        "alias": "AreaAcres",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "AreaSqKm",
        "alias": "AreaSqKm",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "Name",
        "alias": "Name",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "HUC8",
        "alias": "HUC8",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Shape_Leng",
        "alias": "Shape Leng",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Shape.STArea()",
        "alias": "Shape.STArea()",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Shape.STLength()",
        "alias": "Shape.STLength()",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      }
    ],
    "6001": [
      {
        "visible": false,
        "field": "OBJECTID",
        "alias": "OBJECTID",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "AgencyName",
        "alias": "Agency Name",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Source",
        "alias": "SOURCE",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "AgencyUniqueID",
        "alias": "AGENCYUNIQUEID",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "LastModifiedDate",
        "alias": "LASTMODIFIEDDATE",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "ModifiedBy",
        "alias": "MODIFIEDBY",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "SourceComments",
        "alias": "SOURCECOMMENTS",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Date_Data_Applies_To",
        "alias": "Date Data_Applies_To",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "GlobalID",
        "alias": "GlobalID",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Shape",
        "alias": "Shape",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Shape.STArea()",
        "alias": "Shape.STArea()",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Shape.STLength()",
        "alias": "Shape.STLength()",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      }
    ],
    "6002": [
      {
        "visible": false,
        "field": "GSA_ID",
        "alias": "GSA ID",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "DWR_GSA_ID",
        "alias": "DWR GSA_ID",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "GSA_Name",
        "alias": "GSA Name",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "Basin",
        "alias": "Basin",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "Local_ID",
        "alias": "Local ID",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "Posted_DT",
        "alias": "Posted DT",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "GSA_URL",
        "alias": "GSA URL",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "POC_Name",
        "alias": "POC Name",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "POC_Phone",
        "alias": "POC Phone",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "POC_Email",
        "alias": "POC Email",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "90_Days",
        "alias": "90 Days",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "OBJECT_ID",
        "alias": "OBJECT ID",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      }
    ],
    "6003": [
      {
        "visible": false,
        "field": "OBJECTID_1",
        "alias": "OBJECTID 1",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "SABL_PWSID",
        "alias": "SABL PWSID",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "Water System Name",
        "alias": "WATER SYSTEM NAME",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "Boundary Type",
        "alias": "BOUNDARY TYPE",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Water System Number",
        "alias": "WATER SYSTEM_NUMBER",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Created User",
        "alias": "CREATED USER",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Created Date",
        "alias": "CREATED DATE",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Last Edited User",
        "alias": "LAST EDITED_USER",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Last Edited Date",
        "alias": "LAST EDITED_DATE",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "OBJECTID",
        "alias": "OBJECTID",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "System Activity Status",
        "alias": "ACTIVITY STATUS_CD",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "System Activity Date",
        "alias": "ACTIVITY DATE",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Ownership Type Code",
        "alias": "OWNER TYPE_CODE",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "County",
        "alias": "COUNTY",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Population",
        "alias": "POPULATION",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": true,
        "field": "Regulating Agency",
        "alias": "REGULATING AGENCY",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Federal Classification",
        "alias": "FEDERAL CLASSIFICATION",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "State Classification",
        "alias": "STATE CLASSIFICATION",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Address Line 1",
        "alias": "ADDR LINE_ONE_TXT",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Address Line 2",
        "alias": "ADDR LINE_TWO_TXT",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "City",
        "alias": "ADDRESS CITY_NAME",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "State",
        "alias": "ADDRESS STATE_CODE",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Zip Code",
        "alias": "ADDRESS ZIP_CODE",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Service Connections",
        "alias": "SERVICE CONNECTIONS",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "SHAPE",
        "alias": "SHAPE",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "GLOBALID",
        "alias": "GLOBALID",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Contact Phone Number",
        "alias": "AC PHONE_NUMBER",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Contact Email",
        "alias": "AC EMAIL",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Boundary File Type",
        "alias": "BOUNDARY FILETYPE",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Date Verified",
        "alias": "DT VERIFIED",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Verification Status",
        "alias": "VERIFIED STATUS",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Verified By Name",
        "alias": "VERIFIED NAME",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "Verifier Type",
        "alias": "VERIFIED TYPE",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "SHAPE.AREA",
        "alias": "SHAPE.AREA",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      },
      {
        "visible": false,
        "field": "SHAPE.LEN",
        "alias": "SHAPE.LEN",
        "hyperlink_override": [false],
        "hyperlink": [""],
        "hyperlink_key": [""],
        "add_key": "",
        "mask": "",
        "extra_rows": []
      }
    ]
  },
  "map": {
    "minZoom": "",
    "maxZoom": "16",
    "basemap": "topo",
    "extent": {
      "xmin": -1.5787057108834863E7,
      "ymin": 3324704.2530874424,
      "xmax": -1.1090766090994883E7,
      "ymax": 5616592.109189559,
      "spatialReference": {"wkid": 102100}
    }
  },
  "tabs": [{
      "type": "empty",
      "enabled": true,
      "options": {
        "tabName": "Custom Tab 1",
        "off": true,
        "opacity": 0.72,
        "uniqueid": 12
      },
      "addtl": layers
    }],
  "hideTitleBar": true,
  "hideSearchBar": false,
  "hideEditTool": true,
  "hideDrawingTool": true,
  "hideFullscreenTool": true,
  "hasMultiAppAccess": false,
  "hideBookmarkTool": true,
  "hideEmbedTool": true,
  "hideSaveTool": true,
  "hidePrintTool": true,
  "hideMeasureTool": true,
  "hideLegendTool": true,
  "hideSelectedBoundary": true,
  "showDisclaimer": false,
  "disclaimer": "",
  "login": {"requireLogin": false},
  "title_option": "California Water Watch",
  "disableMenuPanout": false,
  "hideToolsBar": false,
  "hideLayersTool": true,
  "hideElevationTool": true,
  "hideLeveeMileTool": true,
  "hidePrintTaskTool": true,
  "hideBasemapTool": true,
  "makeInfowindowDraggable": true,
  "disableClicks": false,
  "featureSetInfowin": false,
  "infowindow_width": "",
  "infowindow_height": "",
  "infoWindowResizable": true,
  "infowinToBottom": true,
  "resizeInfowinToFitContent": true,
  "layerWidthCfg": "",
  "hideLayerSettingsDropdown": false,
  "alwayShowLayerBar": true,
  "layerwindow_height": "300",
  "layerwindow_width": "",
  "appLabel": "",
  "useInfoGrid": false,
  "useTree": false,
  "hideSelectTool": true,
  "hideLayerOptions": false,
  "hideInFeatureTool" : true,
  "sliderOrientation": 'horizontal'
};