Skip to content

Commit

Permalink
Remove experimental searchParams code that does not work in many brow…
Browse files Browse the repository at this point in the history
…sers
  • Loading branch information
bartromgens committed Jun 27, 2016
1 parent 03355fa commit dcfdd7b
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions website/climatemaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,6 @@ var sliderChanged = function() {
}
console.log("slider changed to: " + monthNr);

searchParams.set('month', monthNr);
window.history.replaceState({}, '', `${location.pathname}?${searchParams}`);

showOrCreateContour(monthNr);
updateColorBarLegend(getSelectedType(), monthNr);
};
Expand Down Expand Up @@ -317,8 +314,6 @@ var getSelectedType = function() {

var typeChanged = function() {
var selection = getSelectedType();
searchParams.set('datatype', selection);
window.history.replaceState({}, '', `${location.pathname}?${searchParams}`);
sliderChanged();
};

Expand All @@ -340,21 +335,8 @@ map.on("moveend", function() {
});


var currentUrl = window.location.href;
var url = new URL(window.location.href);
var searchParams = new URLSearchParams(url.search.slice(1));
console.log(searchParams);
console.log(searchParams.get('datatype')); // outputs "m2-m3-m4-m5"

var initialDataType = 'precipitation';
if (searchParams.has('datatype')) {
initialDataType = searchParams.get('datatype');
};

var initialMonth = 1;
if (searchParams.has('month')) {
initialMonth = searchParams.get('month');
};


var onLoad = function() {
Expand Down

0 comments on commit dcfdd7b

Please sign in to comment.