I am trying to use Leaflet.TimeDimesion library on my heatmap.js project. I have tried to follow example 12 and I tried to create a heat map with 1 data point (so I can understand how the library works and avoid getting distracted with data). Unfortunately, all the different ways I have tried to do this throws the following error:
main.js:97 Uncaught RangeError: Maximum call stack size exceeded
at new L.TimeDimension.Layer.HeatMapTemperature (main.js:97)
I guess I am doing something wrong. I am new to JavaScript and I would really appreciate any help.
// SETTING THE BOUNDS OF THE MAP SO IT CANT GO OUTSIDE THESE REGIONS AND THEN WITHIN THE MAP SETTING THE MAXBOUNDS TO THESE BOUNDS.
// set bounds of map
var topLeft = L.latLng(62.5, -21.75);
var bottomRight = L.latLng(34.5, 18.5);
var bounds = L.latLngBounds(topLeft, bottomRight);
var currentTime = new Date();
currentTime.setUTCDate(1, 0, 0, 0, 0);
// initialize the map on the "map" div with a given center and zoom
var map = new L.map('map', { //L. it means that we are dealing with leaflet commands
center: new L.latLng(53.1424, -7.6921), //here your put ireland coordinates
zoom: 7, //the scale we are mapping
zoom: 0, //the scale we are mapping
minZoom: 6, //makes smaller the images
maxZoom: 8, //makes bigger the images
ZoomControl: false,
maxBounds: bounds,
timeDimension: true,
timeDimensionOptions: {//t
TimeInterval: "2018-06-07/2018-06-07",
period: "P1M",
//currentTime: currentTime,
timeDimensionControl: true,
}
});
map.addLayer(baseLayer);
var layerTemperature = L.TimeDimension.Layer.HeatMapTemperature({baseURL:""});
layerTemperature.addTo(map);
Hi All,
I am trying to use Leaflet.TimeDimesion library on my heatmap.js project. I have tried to follow example 12 and I tried to create a heat map with 1 data point (so I can understand how the library works and avoid getting distracted with data). Unfortunately, all the different ways I have tried to do this throws the following error:
main.js:97 Uncaught RangeError: Maximum call stack size exceeded at new L.TimeDimension.Layer.HeatMapTemperature (main.js:97) I guess I am doing something wrong. I am new to JavaScript and I would really appreciate any help.
Thank you
//main.js file Date.prototype.format = function (mask, utc) { return dateFormat(this, mask, utc); };
L.TimeDimension.Layer.HeatMapTemperature = L.TimeDimension.Layer.extend({
});
L.TimeDimension.Layer.HeatMapTemperature = function(options) { return new L.TimeDimension.Layer.HeatMapTemperature(options); }
//Creates a baseLayer i.e. world map var baseLayer = L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}.{ext}', { maxZoom: 22, ext: 'png' });
var layerTemperature = L.TimeDimension.Layer.HeatMapTemperature({baseURL:""}); layerTemperature.addTo(map);
L.Control.TimeDimensionCustom = L.Control.TimeDimension.extend({ _getDisplayDateFormat: function(date){ return date.format("ddd - HH:MM"); } });
console.log("hello");
var timeDimensionControl = new L.Control.TimeDimensionCustom({ speedSlider: false, backwardButton: false, forwardButton: false, timeSlider: false, //position: 'topleft', displayDate: true, playerOptions: { buffer: 1, minBufferReady: -1, transitionTime: 900, // 1500 loop: true, startOver: true } });
map.addControl(this.timeDimensionControl);
//html file <!doctype html>