Beruflich Dokumente
Kultur Dokumente
Leaflet.js
1
{
2
type: "FeatureCollection",
3
totalFeatures: 7212,
4
features: [
5
{
6
type: "Feature",
7
id: "traffic_counts.1",
8
geometry: {
9
type: "Point",
10
coordinates: [
11
-104.72345298814763,
12
39.66841013830322
13
]
14
},
15
geometry_name: "the_geom",
16
properties: {
17
gid: 1,
18
location: "E-470: s/o Jewell Ave @ Toll Plaza B",
19
counted: "2/7/2012",
20
alldayvol: 24699
21
}
22
}
23
],
24
crs: {
25
type: "EPSG",
26
properties: {
27
code: "4326"
28
}
29
}
30 }
This is what the code looks like to prep the original data for input to leaflet.heat:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
This is what the resulting data looks like (an array of Leaflet latLng objects):
1 [
2
LatLng(39.66841, -104.72345),
3
LatLng(39.66841, -104.72345),
4
LatLng(39.66841, -104.72345),
5
...
6 ]
This is how you initialize and add the data to the heat layer object: