function update() {
const data = new URLSearchParams();
- if (window.location.pathname === "/history") {
+ if (location.pathname === "/history") {
data.set("bbox", map.getBounds().wrap().toBBoxString());
const feedLink = $("link[type=\"application/atom+xml\"]"),
feedHref = feedLink.attr("href").split("?")[0];
data.set("list", "1");
- fetch(window.location.pathname + "?" + data)
+ fetch(location.pathname + "?" + data)
.then(response => response.text())
.then(function (html) {
displayFirstChangesets(html);
updateBounds();
- if (window.location.pathname !== "/history") {
+ if (location.pathname !== "/history") {
const bounds = group.getBounds();
if (bounds.isValid()) map.fitBounds(bounds);
}
page.load = function () {
map.addLayer(group);
- if (window.location.pathname === "/history") {
+ if (location.pathname === "/history") {
map.on("moveend", update);
}