From 9d3c7f3464974503cb7d4f497992c68d2487a1b4 Mon Sep 17 00:00:00 2001 From: Zach Glueckert Date: Wed, 22 Feb 2017 22:15:51 -0500 Subject: [PATCH] Refactor failure and document retrieval handling --- examples/WMS.js | 9 +-------- examples/WMTS.js | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/examples/WMS.js b/examples/WMS.js index 5093540b..c10b26be 100644 --- a/examples/WMS.js +++ b/examples/WMS.js @@ -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")); }); \ No newline at end of file diff --git a/examples/WMTS.js b/examples/WMTS.js index ac086dca..a9e53556 100644 --- a/examples/WMTS.js +++ b/examples/WMTS.js @@ -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")); }); \ No newline at end of file