123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- 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/>' +
- '<WebServiceURL>' +
- 'http://10.101.35.46/WJWebService/Webservice/WebService.asmx' +
- '</WebServiceURL>' +
- '<WebServiceConvertCoordinateURL>' +
- 'https://map.wx.shdata.com/ConvertCoordinate/Service.asmx' +
- '</WebServiceConvertCoordinateURL>' +
- '<WebServiceExtraURL>' +
- 'https://map.wx.shdata.com/gisservice/GISService.asmx' +
- '</WebServiceExtraURL>' +
- '<PrintTaskURL>' +
- 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task' +
- '</PrintTaskURL>' +
- '<uploadUrl>http://localhost/media/</uploadUrl>' +
- '<map>' +
- '<maptype>2D</maptype>' +
- '<initialextent/>' +
- '<!-- 3d图层 -->' +
- '<FeatureLayer>' +
- 'https://services8.arcgis.com/wUIATpkD1eTGk5lC/arcgis/rest/services/HKScene3D1_WFL1/FeatureServer/' +
- '</FeatureLayer>' +
- '<MYQueryLayer>' +
- 'http://map.wx.shdata.com:6080/arcgis/rest/services/citygisnew/MapServer' +
- '</MYQueryLayer><MYFeatureLayerLayer>http://map.wx.shdata.com:6080/arcgis/rest/services/citygisnew/FeatureServer</MYFeatureLayerLayer>' +
- '<MYQXFeatureLayer>' +
- 'http://map.wx.shdata.com:6080/arcgis/rest/services/citygisnew/FeatureServer' +
- '</MYQXFeatureLayer>' +
- '<EditLayer>' +
- 'http://192.168.90.97:6080/arcgis/rest/services/fy/FeatureServer' +
- '</EditLayer>' +
- '<!-- 总图层数量 -->' +
- '<basemaps3D>' +
- '<Layer type="dynamic" label="动态数据" visible="true">' +
- 'http://139.196.105.31:6080/arcgis/rest/services/lgmap/MapServer' +
- '</Layer>' +
- '<Layer type="scene" label="建筑物" visible="true">' +
- 'https://tiles.arcgis.com/tiles/wUIATpkD1eTGk5lC/arcgis/rest/services/%E4%B8%B4%E6%B8%AF%E5%BB%BA%E7%AD%91%E7%89%A9/SceneServer' +
- '</Layer>' +
- '<Layer type="vector" label="地面" visible="true">' +
- 'https://tiles.arcgis.com/tiles/wUIATpkD1eTGk5lC/arcgis/rest/services/%E4%B8%B4%E6%B8%AF%E5%9F%BA%E7%A1%80%E5%BA%95%E5%9B%BE1954/VectorTileServer' +
- '</Layer>' +
- '</basemaps3D>' +
- '<containExtraLayer>0</containExtraLayer>' +
- '<extraFeatureServerURL>' +
- 'http://120.55.160.15:6080/arcgis/rest/services/HKDATA/FeatureServer' +
- '</extraFeatureServerURL>' +
- '<!-- 虹口道路图层id -->' +
- '<HKRoadLayerId>2</HKRoadLayerId>' +
- '<HKRoadLayerName>$feature.名称</HKRoadLayerName>' +
- '<!-- 小区图层id -->' +
- '<communityLayerId>2</communityLayerId>' +
- '<communityLayerName>$feature.name</communityLayerName>' +
- '<SceneLayer>' +
- 'http://gisswweb.hkq.gov.hk/server/rest/services/Hosted/HKBuildingColorPlus/SceneServer' +
- '</SceneLayer>' +
- '<portalUrl>https://gisswweb.hkq.gov.hk/arcgis</portalUrl>' +
- '<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>60000</viewxmax>' +
- '<viewxmin>-68000</viewxmin>' +
- '<viewymax>85246</viewymax>' +
- '<viewymin>-77128</viewymin>' +
- '<basemaps>' +
- '<Layer type="tiled" label="基础数据" visible="true">' +
- 'http://map.wx.shdata.com:6080/arcgis/rest/services/jcsj/MapServer' +
- '</Layer>' +
- '<Layer type="dynamic" label="动态数据" visible="true">' +
- 'http://map.wx.shdata.com:6080/arcgis/rest/services/citygisnew/MapServer' +
- '</Layer>' +
- '</basemaps>' +
- '<geometryservice>' +
- 'http://192.168.90.97:6080/arcgis/rest/services/Utilities/Geometry/GeometryServer' +
- '</geometryservice>' +
- '<QueryLayer>' +
- 'http://map.wx.shdata.com:6080/arcgis/rest/services/citygisnew/MapServer' +
- '</QueryLayer>' +
- ' </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;
- }
|