)));
}
+const map = L.map("map");
const statusSpan = document.querySelector("#status > span");
const progressBar = document.querySelector("#status > progress");
localStorage[PARCEL_LOAD_KEY] = "1";
} else {
console.error(geoJsonResponse);
- alert("Parcel data request failed");
+ throw new Error("Parcel data request failed");
}
}
statusSpan.innerText = "ready";
}
-document.getElementById("picked-zones").innerText = [...PICK_ZONINGS].join(", ");
-document.getElementById("lot-size").innerText =
- `${MIN_LOT_SIZE_ACRES} to ${MAX_LOT_SIZE_ACRES} acres`;
+try {
+ document.getElementById("picked-zones").innerText = [...PICK_ZONINGS].join(", ");
+ document.getElementById("lot-size").innerText =
+ `${MIN_LOT_SIZE_ACRES} to ${MAX_LOT_SIZE_ACRES} acres`;
-const map = L.map("map");
-const tileLayer = L.tileLayer(
- "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
- {maxZoom: 19, attribution: "© OpenStreetMap"},
-);
-tileLayer.addTo(map);
+ const tileLayer = L.tileLayer(
+ "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
+ {maxZoom: 19, attribution: "© OpenStreetMap"},
+ );
+ tileLayer.addTo(map);
-// Snap to a view of Madison.
-map.setView([43.073051, -89.401230], 13);
+ // Snap to a view of Madison.
+ map.setView([43.073051, -89.401230], 13);
-asyncMain();
+ await asyncMain();
+} catch (error) {
+ statusSpan.innerText = "error, see console";
+ throw error;
+}