From 7c665997308d17be5ab436423e704469f38380f2 Mon Sep 17 00:00:00 2001 From: DafyddLlyr Date: Sun, 21 Nov 2021 21:15:47 +0000 Subject: [PATCH 1/4] Setup gazetteer branch --- main.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/main.js b/main.js index e4c1fee..5d019a6 100644 --- a/main.js +++ b/main.js @@ -12,14 +12,14 @@ import initGazetteer from "./gazetteer"; // Create layer from imported functions const mastermapWMTS = await getWMTSLayer("os_licensed_background_colour"); -const woodlandWMS = getWMSLayer("sf_nwss"); -const scenicAreasWFS = getWFSLayer("osmm:osmm_topographicarea") +// const woodlandWMS = getWMSLayer("sf_nwss"); +// const scenicAreasWFS = getWFSLayer("osmm:osmm_topographicarea") -// Set up a new Tile Layer -const openStreetMap = new TileLayer({ - // OL has a number of built in sources, such as Stamen, OpenStreetMap, and BingMaps - source: new OSM(), -}); +// // Set up a new Tile Layer +// const openStreetMap = new TileLayer({ +// // OL has a number of built in sources, such as Stamen, OpenStreetMap, and BingMaps +// source: new OSM(), +// }); // Set up an instance of an OpenLayers map const map = new Map({ @@ -28,7 +28,7 @@ const map = new Map({ layers: [ // openStreetMap, mastermapWMTS, - woodlandWMS, + // woodlandWMS, // scenicAreasWFS, ], // A View object represents a simple 2D view of the map. @@ -50,6 +50,6 @@ function zoomTo(coord_string) { } } -initPopover(map, woodlandWMS); +// initPopover(map, woodlandWMS); // initInteractions(map); -// initGazetteer(zoomTo); +initGazetteer(zoomTo); From ca161e11be8f3f8f22aa1d45b6644eaa788fc7a3 Mon Sep 17 00:00:00 2001 From: DafyddLlyr Date: Sun, 21 Nov 2021 21:58:49 +0000 Subject: [PATCH 2/4] Fix variable name --- main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 8ff2637..ad18334 100644 --- a/main.js +++ b/main.js @@ -12,7 +12,7 @@ import initInteractions from "./interactions"; // Create layer from imported functions const mastermapWMTS = await getWMTSLayer("os_licensed_background_colour"); // const woodlandWMS = getWMSLayer("sf_nwss"); -// const scenicAreasWFS = getWFSLayer("osmm:osmm_topographicarea") +// const mastermapWFS = getWFSLayer("osmm:osmm_topographicarea") // Set up a new Tile Layer const openStreetMap = new TileLayer({ @@ -28,7 +28,7 @@ const map = new Map({ // openStreetMap, mastermapWMTS, // woodlandWMS, - // scenicAreasWFS, + // mastermapWFS, ], // A View object represents a simple 2D view of the map. // This is the object to act upon to change the center, resolution, and rotation of the map From baaa793c3551c4b850b7ccd77c8fbd45367101fc Mon Sep 17 00:00:00 2001 From: DafyddLlyr Date: Mon, 22 Nov 2021 15:28:45 +0000 Subject: [PATCH 3/4] Simplify out error handling --- gazetteer.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gazetteer.js b/gazetteer.js index 4ec1f82..8018e01 100644 --- a/gazetteer.js +++ b/gazetteer.js @@ -93,7 +93,7 @@ async function callGazetteerApi(searchFor) { headers: { "Accept": "application/json", } - }).catch((/*error*/) => handleNetworkError()); + }); // On success, convert the result to json return response.json(); } @@ -129,11 +129,6 @@ function handleGazetteerResponses(data) { }); } -// Error handler -function handleNetworkError() { - console.log("Network Error: Please check that you're connected to VPN"); -} - // Asyncronous call to the AddressBase API async function callAddressBaseApi(postcode) { // construct the url @@ -144,7 +139,7 @@ async function callAddressBaseApi(postcode) { headers: { "Accept": "application/json", } - }).catch((/*error*/) => handleNetworkError()); + }); // On success, convert the result to json return response.json(); } From 419ef153f09a773a64a822ea14912f4a81fb5a27 Mon Sep 17 00:00:00 2001 From: Dafydd Pearson Date: Tue, 23 Nov 2021 15:02:30 +0000 Subject: [PATCH 4/4] import gazetteer --- main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/main.js b/main.js index ad18334..1fb3a7c 100644 --- a/main.js +++ b/main.js @@ -8,6 +8,7 @@ import getWMSLayer from "./wms"; import initPopover from "./popover"; import getWFSLayer from "./wfs"; import initInteractions from "./interactions"; +import initGazetteer from "./gazetteer"; // Create layer from imported functions const mastermapWMTS = await getWMTSLayer("os_licensed_background_colour");