﻿

var baseUrl = "http://www.mdimap.us/ArcGIS/rest/services/";
var legendImage = "images/legendkey2b.jpg";
var bannerImage = "images/banner2.jpg";

var url = [];
var id = [];
var opacity = [];
var title = [];
var tiled = [];
var identify = [];
var myidTab = [];
var displayFields = [];
var showOnStart = [];
var helpText = [];



url[0] = baseUrl + "/Environment/MD.State.UnprotectedTargetedEcologicalAreas/MapServer";
id[0] = "UPTEA";
opacity[0] = ".50";
title[0] = "Unprotected Targeted Ecological Areas";
tiled[0] = true;
identify[0] = false;
myidTab[0] = null;
displayFields[0] = null;
showOnStart[0] = true;
helpText[0] = null;

url[1] = baseUrl + "/Environment/MD.State.ProtectedTargetedEcologicalAreas/MapServer";
id[1] = "PTEA";
opacity[1] = ".50";
title[1] = "Protected Targeted Ecological Areas";
tiled[1] = true;
identify[1] = false;
myidTab[1] = null;
displayFields[1] = null;
showOnStart[1] = true;
helpText[1] = null;

url[2] = baseUrl + "/Environment/MD.State.ProtLandsOutsideTargetedEcologicalAreas/MapServer";
id[2] = "PTEAO";
opacity[2] = ".50";
title[2] = "Protected Lands outside of Targeted <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ecological Areas";
tiled[2] = true;
identify[2] = false;
myidTab[2] = null;
displayFields[2] = null;
showOnStart[2] = true;
helpText[2] = null;

url[3] = baseUrl + "/PlanningCadastre/MD.State.Parcels/MapServer";
id[3] = "Parcels";
opacity[3] = null;
title[3] = "Parcels";
tiled[3] = true;
identify[3] = true;
myidTab[3] = "ParcelsTab";
displayFields[3] = ""; //"\'ACCTID\'";
showOnStart[3] = true;
helpText[3] = null;

url[4] = baseUrl + "/InlandWaters/MD.State.TributaryStrategyBasin/MapServer";
id[4] = "Basins";
opacity[4] = null;
title[4] = "Tributary Strategy Basin";
tiled[4] = false;
identify[4] = true;
myidTab[4] = "BasinsTab";
displayFields[4] = null;
showOnStart[4] = null;
helpText[4] = "The Tributary Strategy Basins represent the major drainage basins of Maryland's portion of the Chesapeake Bay.  Each basin has a Tributary Team comprised of local citizens, farmers, business leaders and government officials appointed by the Governor.  They are working to keep local waterways clean and healthy. ";


url[5] = baseUrl + "/Environment/MD.State.ProgramOpenSpace/MapServer";
id[5] = "POS";
opacity[5] = null;
title[5] = "Program Open Space";
tiled[5] = false;
identify[5] = true;
myidTab[5] = "ProgramTab";
displayFields[5] = null;
showOnStart[5] = null;
helpText[5] = "These data represent parcels acquired by Program Open Space (Stateside) by calendar year.  Select the Documentation Tab for more information.";

url[6] = baseUrl + "/Environment/MD.State.RuralLegacy/MapServer";
id[6] = "RL";
opacity[6] = null;
title[6] = "Rural Legacy";
tiled[6] = false;
identify[6] = true;
myidTab[6] = "RuralLegTab";
displayFields[6] = null;
showOnStart[6] = null;
helpText[6] = "These data represent parcels acquired by Rural Legacy funds by calendar year.  Select the Documentation Tab for more information.";


url[7] = baseUrl + "/Environment/MD.State.MarylandEnvironmentalTrust/MapServer";
id[7] = "MET";
opacity[7] = null;
title[7] = "MD Environmental Trust";
tiled[7] = false;
identify[7] = true;
myidTab[7] = "METTab";
displayFields[7] = null;
showOnStart[7] = null;
helpText[7] = "These data represent parcels acquired by MET by calendar year. Select the Documentation Tab for more information";



url[8] = baseUrl + "/Environment/MD.State.MALPF/MapServer";
id[8] = "MALPF";
opacity[8] = null;
title[8] = "MD Agric Land Preservation Foundation";
tiled[8] = false;
identify[8] = true;
myidTab[8] = "MALPFTab";
displayFields[8] = null;
showOnStart[8] = null;
helpText[8] = "These data represent parcels acquired by MALPF by calendar year. Select the Documentation Tab for more information";


url[9] = baseUrl + "/UtilitiesCommunication/MD.State.MajorWWTPs/MapServer";
id[9] = "WWTPs";
opacity[9] = null;
title[9] = "Wastewater Treatment Plants";
tiled[9] = false;
identify[9] = true;
myidTab[9] = "WWTPsTab";
displayFields[9] = null;
showOnStart[9] = null;
helpText[9] = "The major wastewater treatment plants (WWTPs) are in the process of being upgraded with enhanced nutrient removal technology. The status of the upgrade process ranges from pre-planning to construction complete - operating at ENR levels.";



// DO NOT EDIT BELOW THIS LINE

var layerUrls = [];
var layerOptions = [];
for (var c = 0; c < url.length; c++) {
    layerUrls[c] = url[c];
    var optionsString = "{ ";
    if (id[c] != null) {
        optionsString += "\"id\": \"" + id[c] + "\",";
    }
    if (opacity[c] != null) {
        optionsString += "\"opacity\": \"" + opacity[c] + "\",";
    }
    if (title[c] != null) {
        optionsString += "\"title\": \"" + title[c] + "\",";
    }
    if (tiled[c] != null) {
        optionsString += "\"tiled\": " + tiled[c] + ",";
    }
    if (identify[c] != null) {
        optionsString += "\"identify\": " + identify[c] + ",";
    }
    if (myidTab[c] != null) {
        optionsString += "\"idTab\": \"" + myidTab[c] + "\",";
    }
    if (displayFields[c] != null) {
    }
    if (showOnStart[c] != null) {
        optionsString += "\"showOnStart\": " + showOnStart[c] + ",";
    }
    if (helpText[c] != null) {
        optionsString += "\"helpText\": \"" + helpText[c] + "\",";
    }

    optionsString = optionsString.substr(0, optionsString.length - 1) + " }";

    var jsonString = "(" + optionsString + ")";
    layerOptions[c] = eval(jsonString);

}



