mirror of
https://github.com/NASAWorldWind/WebWorldWind.git
synced 2026-02-01 16:38:15 +00:00
Refactor failure and document retrieval handling
This commit is contained in:
parent
5082d06413
commit
9d3c7f3464
@ -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"));
|
||||
|
||||
});
|
||||
@ -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"));
|
||||
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user