Leaflet/Leaflet.heat

Uncaught TypeError: L.heatLayer is not a function

ttheodorou96 opened this issue · 2 comments

Uncaught TypeError: L.heatLayer is not a function
I imagine something is wrong with lealet-heat.js file, I included it like this <script src="leaflet-heat.js"></script> as documentation says, because it's not recognizing LheatLayer as a function. (I have also downloaded the eaflet-heat.js file to my project directory)
I also included version 1.7.1 of leaflet (https://leafletjs.com/examples/quick-start/) and but i still get this error while the marker object in leaflet works fine so i assume it's not an L object problem..
My code :
var heat = L.heatLayer(
[52.352, 4.9392, 14],
{radius: 25},
{0.4: 'blue', 0.65: 'lime', 1: 'red'},
{minOpacity: 0.4}
).addTo(map);

i have created a map object, i added a baselayer and finally when i create a heatLayer object i get the above error. PLEASE help i've tried literally everything. Thanks in advance!

You can get this error when your leaflet-heat.js file included after your leaflet.js file