// URL Parameters //
var mapLayers = [
   { 
        label: "Imagery08",
        url: "http://gis.caldwellcountync.org/ArcGIS/rest/services/Imagery2008/MapServer",
        type: "tiled", alpha: 1,
        visible: false
    }, { 
        label: "Imagery04",
        url: "http://gis.caldwellcountync.org/ArcGIS/rest/services/Imagery2004/MapServer",
        type: "tiled", alpha: 1,
        visible: false
    },{ 
        label: "DRG",
        url: "http://gis.caldwellcountync.org/ArcGIS/rest/services/DRG/MapServer",
        type: "tiled", alpha: 1,
        visible: false
    },{ 
        label: "Terrain",
        url: "http://gis.caldwellcountync.org/ArcGIS/rest/services/Terrain/MapServer",
        type: "tiled", alpha: 0.75,
        visible: false
    }, { 
        label: "map",
        url: "http://gis.caldwellcountync.org/ArcGIS/rest/services/BaseMap/MapServer",
        type: "dynamic", alpha: 1,
        visible: true
    }, { 
        label: "roads",
        url: "http://gis.caldwellcountync.org/ArcGIS/rest/services/Roads/MapServer",
        type: "dynamic", alpha: 1,
        visible: true
    },{ 
        label: "parcels",
        url: "http://gis.caldwellcountync.org/ArcGIS/rest/services/Parcels/MapServer",
        type: "dynamic", alpha: 1,
        visible: true
    },{ 
        label: "overlay",
        url: "http://gis.caldwellcountync.org/ArcGIS/rest/services/Overlay/MapServer",
        type: "dynamic", alpha: 1,
        visible: true
    }
]

               
var geoServiceUrl = "http://gis.caldwellcountync.org/ArcGIS/rest/services/Geometry/GeometryServer"; //"http://gisappsvr/ArcGIS/rest/services/Geometry/GeometryServer";

// Geocode Locator Variables
var locatorURL= "http://gis.caldwellcountync.org/ArcGIS/rest/services/CaldwellComposite/GeocodeServer";
var orthoLayerURL = "";

var overviewMapServiceURL = "http://gis.caldwellcountync.org/ArcGIS/rest/services/overview/MapServer";

var identifyURL = "http://gis.caldwellcountync.org/ArcGIS/rest/services/Identify/MapServer";

var searchURL = "http://gis.caldwellcountync.org/ArcGIS/rest/services/Search/MapServer"

var dataHandlerURL = "http://gis.caldwellcountync.org/maps/datahandler.ashx";
var WebServiceURL = "./WebService.asmx";



// Parcel Layer Parameters  //
var parcels_layerID = "0";
var parcelSearchLayerURL = "";
var parcelsLayerName = "Parcels";
var parcels_title_content = "<div>County Parcel</div>";

// Searching Parameters //
var defaultIdentifyLayerName = "Parcels";


var proxyPage = "proxy.ashx";

var initialXmin = 1147540.25592717;
var initialYmin = 719640.352000017;
var initialXmax =  1337459.74392719;
var initialYmax = 890359.647999983;

fields = {
    keyfield: "PID",
    ncpin: "NCPIN",
    pid: "PID",
    acctnumber: "AcctNumber",
    owner: "AcctName1",
    mailingaddress: "AcctName2",
    mailcity: "MailCity",
    mailstate: "MailState",
    mailzip: "MailZipCode",
    acreage: "TotalCalcAcres",
    taxvalue: "MarketValue",
    size: "LandUnits",
    units: "UnitsType",
    legaldesc: "LegalDesc",
    address: "FullPropAddress"
}

var parcels_return_fields = ["NCPIN", "PRODNO", "PID","TotalCalcAcres", "LegalDesc", "LandUnits", "UnitsType", "AcctNumber", "AcctName1", "AcctName2", "MailAddr1", "MailAddr2", "MailAddr3", "MailCity", "MailState", "MailZipCode", "MarketValue", "AssessedValue", "FullPropAddress"]
var parcels_quickFind_Fields = ["NCPIN", "AcctNumber", "PID", "AcctName1", "FullPropAddress"];


var zoomPlaceTasks = [
{
    webservice:"./WebService.asmx/SubDivisions",
    attachTo: "ddlsubdivisionzoom",
    searchField: "SubD_NAME",
    searchURL: searchURL + "/2"
}, {
    webservice: "./WebService.asmx/CityNames",
    attachTo: "ddlcityzoom",
    searchField: "CITY_NAME",
    searchURL: searchURL + "/1"
}
];


var olDynMapService = "http://gis.caldwellcountync.org/ArcGIS/rest/services/Overlay/MapServer";
var tocLayerList = [
{
    isService: false,
    text: "Contour Lines",
    mapname: "overlay",
    layers: ["50ft Contours", "10ft Contours", "25ft Contours", "5ft Contours"]
}, {
    isService: true,
    text: "Fire Districts",
    mapname: "fire districts",
    layerIDs: [13],
    url: olDynMapService,
    opacity: 0.75
},  {
    isService: true,
    text: "Zoning",
    mapname: "Zoning",
    layerIDs: [12],
    url: olDynMapService,
    opacity: 0.40
},{
    isService: true,
    text: "Census Tracts",
    mapname: "Census",
    layerIDs: [10],
    url: olDynMapService,
    opacity: 0.40
}, {
    isService: true,
    text: "Townships",
    mapname: "townships",
    layerIDs: [14],
    url: olDynMapService,
    opacity: 0.75
}, {
    isService: true,
    text: "Flood Hazard Zone",
    mapname: "flood",
    layerIDs: [15],
    url: olDynMapService,
    opacity: 0.75
}, {
    isService: false,
    text: "Streams",
    mapname: "overlay",
    layers: []
}, {
    isService: false,
    text: "National Forest",
    mapname: "overlay",
    layers: []
},{
    isService: false,
    text: "Major Roads Anno",
    mapname: "overlay",
    layers: []
}, {
    isService: true,
    text: "Roads",
    mapname: "roads",
    layers: []
}, {
    isService: false,
    text: "Schools",
    mapname: "overlay",
    layers: []
},{
    isService: false,
    text: "Yadkin Valley Planning District",
    mapname: "overlay",
    layers: ["Yadkin Valley Planning District"]
},{
    isService: false,
    text: "Collettsville Planning District",
    mapname: "overlay",
    layers: ["Collettsville Planning District"]
},{
    isService: false,
    text: "Watershed",
    mapname: "overlay",
    layers: ["Watershed"]
},{
    isService: false,
    text: "Voting Districts",
    mapname: "overlay",
    layers: ["Voting District"]
},{
    isService: false,
    text: "School Districts",
    mapname: "overlay",
    layers: ["Elementary School Districts", "Middle School Districts", "High School Districts"]
},{
    isService: false,
    text: "Agricultural Districts",
    mapname: "overlay",
    layers: []
},{
    isService: false,
    text: "Subdivisions",
    mapname: "overlay",
    layers: []
}, {
    isService: false,
    text: "Address Points",
    mapname: "overlay",
    layers: []
}, {
    isService: false,
    text: "Water Lines",
    mapname: "overlay",
    layers: []
},{
    isService: false,
    text: "Lenoir Water Lines",
    mapname: "overlay",
    layers: []
}, {
    isService: false,
    text: "Sewer Lines",
    mapname: "overlay",
    layers: []
}, {
    isService: false,
    text: "Municipalities",
    mapname: "map",
    layers: []
}, {
    isService: true,
    text: "Parcels",
    mapname: "parcels",
    layers: [],
    layerIDs: null,
    url: null
}, {
    isService: false,
    text: "ETJ",
    mapname: "map",
    layers: []
}, {
    isService: false,
    text: "Lake",
    mapname: "map",
    layers: []
}, {
    isService: true,
    text: "Terrain",
    mapname: "Terrain",
    layers: [],
    layerIDs: null,
    url: null
},{
    isService: true,
    text: "DRG",
    mapname: "DRG",
    layers: [],
    layerIDs: null,
    url: null
}
];


var mapViewButtons = [
 { label: "Imagery 04", turnOff: ["map","Imagery08","parcels","roads", "overlay"], turnOn: ["Imagery04"] },
 { label: "Imagery 08", turnOff: ["map","Imagery04","parcels","roads", "overlay"], turnOn: ["Imagery08"] },
 { label: "Hybrid", turnOff: ["map", "Imagery04"], turnOn: ["Imagery08","parcels","roads","overlay"] },
 { label: "Map", turnOff: ["Imagery08", "Imagery04"], turnOn: ["map","parcels","roads","overlay"] }
];






