function ConfigManger(configPath) { var m_configPath = ""; var m_xmlDoc = null; if (configPath != null && configPath != "") m_configPath = configPath; else m_configPath = "config_local.xml"; if (m_configPath == null || m_configPath == "") return null; var xmlHelper = new XmlHelper(); var m_xmlDoc = xmlHelper.loadFileXml(m_configPath); //获取工具栏信息 if (m_xmlDoc == null) return null; //获取配置信息 this.GetConfigValue = function (keyName) { if (m_xmlDoc == null) return null; var data = m_xmlDoc.getElementsByTagName(keyName); //获得所有子节点 //var value = data[0].text; var xmlHelper = new XmlHelper(); var value = xmlHelper.getNodeValue(data[0]); return value; } } var xmlUtil; var xmlDoc; var configXML='' + '' + ''+ '2D'+ ''+ 'https://10.101.35.50/zhwjWebservice/Webservice/WebService.asmx'+ 'https://10.101.35.46:6443/arcgis/rest/services/zhwj/MapServer'+ ''+ ' https://10.101.35.50:5443/i3s_svc/baimo/SceneServer/layers/0' + ' https://10.101.35.50:5443/i3s_svc/sx0629/SceneServer/layers/0' + ' https://10.101.35.50/arcgis/rest/services/zhwjlm4/MapServer' + ' https://10.101.35.50/arcgis/rest/services/zhwj/MapServer' + ' https://10.101.35.50/arcgis/rest/services/zhwj/MapServer'+ ''+ '0'+ '76eb30639aff4e70bbecfd74a93226c4' + ' -10696.497436769,267.175033188,13967.733349092,9822.324974442' + ' -17221.816,-5450.66,-15189.445,-4297.402' + ' -25930.782,-10527.042,-5599.259,647.995' + ' -89836.648,-56485.216,70797.201,31738.557' + ' 237744.475488951' + ' -237744.475488951' + ' 76538.81974430617' + ' -76538.81974430617' + ' ' + ' https://10.101.35.50/arcgis/rest/services/zhwjlm4/MapServer' + ' https://10.101.35.50/arcgis/rest/services/zhwj/MapServer' + ' https://10.101.35.50/arcgis/rest/services/zhwj/MapServer' + ' '+ ''+ ''; function GetConfigData(){ xmlUtil = new XMLUtil(); //xmlDoc = xmlUtil.loadXmlFromFile("config/config_local.xml"); xmlDoc = xmlUtil.loadXML(configXML); } function GetConfigValueByTagName(tagName) { if(isEmptyValue(xmlUtil)) GetConfigData(); var configNode = xmlDoc.getElementsByTagName(tagName); var stringUrl = xmlUtil.getNodeValue(configNode[0]); return stringUrl; } function getRootPath_web() { //获取当前网址,如: http://localhost:8083/uimcardprj/share/meun.jsp var curWwwPath = window.document.location.href; //获取主机地址之后的目录,如: uimcardprj/share/meun.jsp var pathName = window.document.location.pathname; var pos = curWwwPath.indexOf(pathName); //获取主机地址,如: http://localhost:8083 var localhostPaht = curWwwPath.substring(0, pos); //获取带"/"的项目名,如:/uimcardprj var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1); return (localhostPaht + projectName); } function getRootPath_dc() { var pathName = window.location.pathname.substring(1); var webName = pathName == '' ? '' : pathName.substring(0, pathName.indexOf('/')); if (webName == "") { return window.location.protocol + '//' + window.location.host; } else { return window.location.protocol + '//' + window.location.host + '/' + webName; } } function GetConfigDataByName(nodeName) { var nodeXml = xmlDoc.getElementsByTagName(nodeName); var nodeValue = xmlUtil.getNodeValue(nodeXml[0]); return nodeValue; }