测试热力图时显示L.heatLayer未定义,已经引用了leaflet.heat请问是哪里引用错了吗
<script
type="text/javascript"
include="leaflet.heat"
src="dist/leaflet/include-leaflet.js"
></script>
// 进行热力图的显示
loadHeatMap();
function loadHeatMap() {
var heatNumbers = 150,
heatRadius = 30;
var num = parseInt(heatNumbers);
num = num > 0 ? num : 0;
var radius = parseInt(heatRadius);
radius = radius > 0 ? radius : 0;
var heatPoints = [];
for (var i = 0; i < num; i++) {
heatPoints[i] = [
Math.random() * 0.28 + 39.78,
Math.random() * 0.5 + 116.12,
Math.random() * 80,
];
}
resultLayer = L.heatLayer(heatPoints, {
radius: radius,
minOpacity: 0.5,
}).addTo(map);
}