Skip to content
Snippets Groups Projects
Verified Commit 026e479e authored by Robert Metcalf's avatar Robert Metcalf
Browse files

handle addresses without latlong on interactive map

parent eab33bf9
No related branches found
No related tags found
No related merge requests found
......@@ -59,8 +59,11 @@ with Connection() as conn:
def lookup_address(address: str):
with Connection() as conn:
conn.execute("SELECT latlong FROM AddressToLatLong WHERE address = ?", (address,))
res = conn.cursor.fetchone()[0]
(lat, long) = res.split(",")
res = conn.cursor.fetchone()
if res == None:
return None
(lat, long) = res[0].split(",")
return (float(lat), float(long))
def set_address_latlong(address: str, latlong: Tuple[float, float]):
......
......@@ -5,6 +5,9 @@ L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
}).addTo(map);
for (let workspace of mapData) {
if (workspace.latlong == null)
continue;
L.marker(workspace.latlong).addTo(map)
.bindPopup(`<div class="popup"><div><a href="/workspace/${ encodeURIComponent(workspace.id) }" class="popup-title">${
escapeHTML(workspace.name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment