123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- 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='<Configuration>' +
- '<defaultConfigName></defaultConfigName>' +
- '<map>'+
- '<maptype>2D</maptype>'+
- '<initialextent></initialextent>'+
- '<WebServiceURL>https://10.101.35.50/zhwjWebservice/Webservice/WebService.asmx</WebServiceURL>'+
- '<MYQueryLayer>https://10.101.35.46:6443/arcgis/rest/services/zhwj/MapServer</MYQueryLayer>'+
- '<basemaps3D>'+
- ' <Layer type="scene" label="建筑物" visible="true" >https://10.101.35.50:5443/i3s_svc/baimo/SceneServer/layers/0</Layer>' +
- ' <Layer type="scene" label="水箱" visible="false" >https://10.101.35.50:5443/i3s_svc/sx0629/SceneServer/layers/0</Layer>' +
- ' <Layer type="tiled" label="地面" visible="true" >https://10.101.35.50/arcgis/rest/services/zhwjlm4/MapServer</Layer>' +
- ' <Layer type="dynamic" label="动态数据" visible="true" >https://10.101.35.50/arcgis/rest/services/zhwj/MapServer</Layer>' +
- ' <Layer type="density" label="density_1" visible="true" > https://10.101.35.50/arcgis/rest/services/zhwj/MapServer</Layer>'+
- '</basemaps3D>'+
- '<containExtraLayer>0</containExtraLayer>'+
- '<portalItemId>76eb30639aff4e70bbecfd74a93226c4</portalItemId>' +
- ' <fullextent>-10696.497436769,267.175033188,13967.733349092,9822.324974442</fullextent>' +
- ' <extent1>-17221.816,-5450.66,-15189.445,-4297.402</extent1>' +
- ' <extent2>-25930.782,-10527.042,-5599.259,647.995</extent2>' +
- ' <extent3>-89836.648,-56485.216,70797.201,31738.557</extent3>' +
- ' <viewxmax>237744.475488951</viewxmax>' +
- ' <viewxmin>-237744.475488951</viewxmin>' +
- ' <viewymax>76538.81974430617</viewymax>' +
- ' <viewymin>-76538.81974430617</viewymin>' +
- ' <basemaps>' +
- ' <Layer type="tiled" label="基础数据" visible="true" >https://10.101.35.50/arcgis/rest/services/zhwjlm4/MapServer</Layer>' +
- ' <Layer type="dynamic" label="动态数据" visible="true" >https://10.101.35.50/arcgis/rest/services/zhwj/MapServer</Layer>' +
- ' <Layer type="density" label="density_1" visible="true" >https://10.101.35.50/arcgis/rest/services/zhwj/MapServer</Layer>' +
- ' </basemaps>'+
- '</map>'+
- '</Configuration>';
- 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;
- }
|