| New file |
| | |
| | | define(["base/AppEvent", |
| | | "dojo/request", |
| | | "base/ConfigData", |
| | | "dojo/_base/declare", |
| | | "esri/config"], |
| | | function(AppEvent, |
| | | request, |
| | | ConfigData, |
| | | declare, |
| | | esriConfig){ |
| | | return declare("ConfigManager",null, |
| | | { |
| | | loadconfig:function(url) |
| | | { |
| | | request.get(url, |
| | | { |
| | | handleAs: "json" |
| | | }).then(function(result) |
| | | { |
| | | esriConfig.defaults.io.proxyUrl = result.proxyurl; |
| | | esriConfig.defaults.io.alwaysUseProxy = false; |
| | | ConfigData.geometryServiceUrl = result.geometryServiceUrl; |
| | | ConfigData.areaQueryURL = result.areaQueryURL; |
| | | ConfigData.ajaxURL = result.ajaxURL; |
| | | ConfigData.monitorSpotURL = result.monitorSpotURL; |
| | | ConfigData.gpserverURL = result.gpserverURL; |
| | | ConfigData.basemap = result.basemap; |
| | | ConfigData.copyright = result.copyright; |
| | | ConfigData.widgets=result.widgets; |
| | | ConfigData.hockId=result.hockId; |
| | | ConfigData.busServices = result.busServices; |
| | | ConfigData.XZQUrl = result.XZQUrl; |
| | | ConfigData.countyUrl = result.countyUrl; |
| | | ConfigData.printUrl = result.printUrl; |
| | | ConfigData.intersect_custom = result.intersect_custom; |
| | | ConfigData.intersect = result.intersect; |
| | | ConfigData.intersect_new = result.intersect_new; |
| | | ConfigData.shpAjax=result.shpAjax; |
| | | ConfigData.kmlAjax=result.kmlAjax; |
| | | ConfigData.txtAjax=result.txtAjax; |
| | | AppEvent.dispatchAppEvent(AppEvent.CONFIG_LOADED); |
| | | //this.parseConfig(result); |
| | | },function(err) |
| | | { |
| | | console.log("load config err! ", err); |
| | | }); |
| | | } |
| | | }); |
| | | }); |