Refactor failure and document retrieval handling

This commit is contained in:
Zach Glueckert 2017-02-22 22:15:51 -05:00
parent 5082d06413
commit 9d3c7f3464
2 changed files with 2 additions and 16 deletions

View File

@ -38,13 +38,6 @@ requirejs(['../src/WorldWind',
// Named layer displaying Average Temperature data
var layerName = "MOD_LSTD_CLIM_M";
var getDocument = function (serviceAddress) {
return $.get(serviceAddress)
.fail(function () {
console.log("There was an error while retrieving the WMS Capabilities document");
});
};
var createLayer = function (xmlDom) {
// Create a WmsCapabilities object from the XML DOM
var wms = new WorldWind.WmsCapabilities(xmlDom);
@ -62,6 +55,6 @@ requirejs(['../src/WorldWind',
layerManger.synchronizeLayerList();
};
getDocument(serviceAddress).done(createLayer);
$.get(serviceAddress).done(createLayer).fail(console.log("There was an error while retrieving the WMS Capabilities document"));
});

View File

@ -40,13 +40,6 @@ requirejs([
// Layer displaying Global Hillshade based on GMTED2010
var layerName = "hillshade";
var getDocument = function (serviceAddress) {
return $.get(serviceAddress)
.fail(function () {
console.log("There was an error while retrieving the WMTS Capabilities document");
});
};
var createLayer = function (xmlDom) {
// Create a WmtsCapabilities object from the XML DOM
var wmtsCapabilities = new WorldWind.WmtsCapabilities(xmlDom);
@ -62,6 +55,6 @@ requirejs([
layerManger.synchronizeLayerList();
}
getDocument(serviceAddress).done(createLayer);
$.get(serviceAddress).done(createLayer).fail(console.log("There was an error while retrieving the WMTS Capabilities document"));
});