Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.js #386

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions site/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r
var urlParams = new URLSearchParams(window.location.search);
var default_suburb = null;
var default_state = null;
var default_commit = "main";
var default_commit = "latest";
var combined_info = null;
if (urlParams.has("suburb") && urlParams.has("state")) {
default_suburb = urlParams.get("suburb");
default_state = urlParams.get("state");
}
if (urlParams.has("commit")) {
default_commit = urlParams.get("commit");
default_commit = default_commit == "main" ? "latest" : default_commit;
}

if (window.matchMedia('(display-mode: standalone)').matches) {
Expand Down Expand Up @@ -244,7 +245,7 @@ function loadSuburb(state_file, commit, first_load=false) {
if (state_file == "") {
return;
}
url = "https://raw.githubusercontent.com/LukePrior/nbn-upgrade-map/" + commit + "/results/" + state_file + ".geojson"
url = "https://cdn.jsdelivr.net/gh/LukePrior/nbn-upgrade-map@" + commit + "/results/" + state_file + ".geojson"
default_state = state_file.split('/')[0]
default_suburb = state_file.split('/')[1]
default_commit = commit
Expand Down