Skip to content

Commit

Permalink
Merge pull request #142 from seifriedc/master
Browse files Browse the repository at this point in the history
Updated library and 311 WPRDC IDs and Sidebar fix
  • Loading branch information
kingsman142 committed Jan 25, 2018
2 parents 212b8ed + b3c36a6 commit 621380e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions data.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@

// City of Pittsburgh 311 data
"311": {
id: "40776043-ad00-40f5-9dc8-1fde865ff571",
id: "76fda9d0-69be-4dd5-8108-0de7907fc5a4",
primaryFiltering: "WHERE \"NEIGHBORHOOD\" LIKE '%Oakland' AND \"CREATED_ON\" >= (NOW() - '30 day'::INTERVAL) ORDER BY \"CREATED_ON\" DESC",
latLong: ["Y", "X"],
icon: iconTypes.CITY_311_ICON,
Expand All @@ -261,7 +261,7 @@
}
},
"Library": {
id: "2ba0788a-2f35-43aa-a47c-89c75f55cf9d",
id: "14babf3f-4932-4828-8b49-3c9a03bae6d0",
primaryFiltering: "WHERE \"Name\" LIKE '%OAKLAND%'",
latLong: ["Lat", "Lon"],
icon: iconTypes.LIBRARY_ICON,
Expand Down
28 changes: 15 additions & 13 deletions map.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,6 @@
const sidebar = document.getElementById("sidebar");
const sidebarToggle = document.getElementById("sidebarToggle");

//Start with sidebar closed if mobile
if (screen.width <= 800) {
sidebarToggle.open = 0;
sidebar.className = "mapMode hidden";
sidebarToggle.className = "fa fa-chevron-right fa-2x";
} else {
sidebarToggle.open = 1;
sidebar.className = "mapMode shown";
sidebarToggle.className = "fa fa-chevron-left fa-2x";
}

L.tileLayer("http:https://{s}.tile.osm.org/{z}/{x}/{y}.png", {
attribution: "&copy; <a href=\"http:https://osm.org/copyright\">OpenStreetMap</a> contributors"
}).addTo(map);
Expand Down Expand Up @@ -243,14 +232,16 @@
function displayMapMode() {
document.getElementById("radioMap").style.backgroundColor = "lightgrey";
document.getElementById("radioData").style.backgroundColor = "#fff";
sidebar.className = "mapMode controlsShown shown";
sidebar.classList.add("mapMode");
sidebar.classList.remove("dataMode");
document.getElementById("dataArea").className = "hidden";
}

function displayDataMode() {
document.getElementById("radioMap").style.backgroundColor = "#fff";
document.getElementById("radioData").style.backgroundColor = "lightgrey";
sidebar.className = "dataMode controlsShown shown";
sidebar.classList.remove("mapMode");
sidebar.classList.add("dataMode");
document.getElementById("dataArea").className = "controlsShown shown";
}

Expand Down Expand Up @@ -688,6 +679,17 @@
});
}

//Start with sidebar closed if mobile
if (screen.width <= 800) {
sidebarToggle.open = 0;
sidebar.className = "mapMode hidden";
sidebarToggle.className = "fa fa-chevron-right fa-2x";
} else {
sidebarToggle.open = 1;
sidebar.className = "mapMode shown";
sidebarToggle.className = "fa fa-chevron-left fa-2x";
}

//Helper function that returns difference between two dates in days
function getDateDifference(dateA, dateB) {
return Math.floor(Math.abs(dateA.getTime() - dateB.getTime()) / 86400000);
Expand Down

0 comments on commit 621380e

Please sign in to comment.