- var entry = $(this),
- csrf_param = $("meta[name=csrf-param]").attr("content"),
- csrf_token = $("meta[name=csrf-token]").attr("content"),
- params = {
- zoom: map.getZoom(),
- minlon: map.getBounds().getWest(),
- minlat: map.getBounds().getSouth(),
- maxlon: map.getBounds().getEast(),
- maxlat: map.getBounds().getNorth()
- };
- params[csrf_param] = csrf_token;
- $.ajax({
- url: entry.data("href"),
+ const entry = $(this),
+ csrf_param = $("meta[name=csrf-param]").attr("content"),
+ csrf_token = $("meta[name=csrf-token]").attr("content"),
+ params = new URLSearchParams({
+ zoom: map.getZoom(),
+ minlon: map.getBounds().getWest(),
+ minlat: map.getBounds().getSouth(),
+ maxlon: map.getBounds().getEast(),
+ maxlat: map.getBounds().getNorth()
+ });
+ params.set(csrf_param, csrf_token);
+ fetch(entry.data("href"), {