CesiumHeatmap
A library to add heatmaps (using heatmap.js and Cesium.Entity.Rectangle
or Cesium.SingleTileImageryProvider
) to the Cesium framework.
To use this on your page do the following:
- Import the CesiumHeatmap.js file into your page using the
<script>
tag. This file includes heatmap.js. - Initialize a CesiumHeatmap instance using the
CesiumHeatmap.create()
call. See the function in the code for more information on parameters. - Add the data points to the CesiumHeatmap instance using the
instance.setData()
or more likelyinstance.setWGS84Data()
. See the functions in the code for more information on the parameters. - After new data is added to the CesiumHeatmap instance it will automatically show/update the layer.
Example
let bounds = west: 14713833844 east: 14713856899 south: -4143606916 north: -4143582929; // init heatmaplet heatMap = CesiumHeatmap; // random example datalet data = "x":1471383442264"y":-414360048372"value":76"x":1471384363011"y":-414360298848"value":63"x":147138368102"y":-414358360603"value":1"x":1471385627739"y":-414358799123"value":21"x":1471385138501"y":-414359327669"value":28"x":1471385031219"y":-414359730105"value":41"x":1471384127393"y":-41435928255"value":75"x":1471384551136"y":-414359450132"value":3"x":1471384927196"y":-414359158649"value":45"x":1471384938639"y":-414358498311"value":45"x":1471385183299"y":-414360213794"value":93"x":1471384007925"y":-414359860133"value":46"x":1471383604844"y":-414358298672"value":54"x":14713851025"y":-414359098303"value":39"x":1471383874733"y":-414358511035"value":34"x":1471384981796"y":-414359355403"value":81"x":1471384504107"y":-414360332348"value":39"x":1471385582664"y":-414359788335"value":20"x":1471383967364"y":-414360581999"value":35"x":1471383839615"y":-41436016316"value":47"x":1471384082712"y":-414358423338"value":36"x":1471385092651"y":-414358577623"value":69"x":147138360356"y":-41436046789"value":90"x":147138471893"y":-414359184292"value":88"x":1471385605689"y":-414360271359"value":81"x":1471383585714"y":-414359362476"value":32"x":1471384939114"y":-414358844253"value":67"x":147138466724"y":-41436019121"value":17"x":1471385504355"y":-414360614056"value":49"x":1471383883832"y":-414358733544"value":82"x":1471385670669"y":-414359650236"value":25"x":1471383416534"y":-414359310876"value":82"x":147138525285"y":-414359394661"value":66"x":1471385487719"y":-414360137656"value":73"x":1471385496029"y":-414359187277"value":73"x":1471383989222"y":-414358556562"value":61"x":1471385499424"y":-414359149305"value":67"x":147138404523"y":-414359563326"value":90"x":1471383883675"y":-414359794855"value":78"x":1471383967187"y":-41435891185"value":15"x":1471384610005"y":-414359044797"value":15"x":1471384688489"y":-414360396127"value":91"x":1471384431875"y":-414360684409"value":8"x":1471385411067"y":-414360645847"value":42"x":1471385237178"y":-414358843181"value":31"x":1471384406464"y":-414360003831"value":51"x":1471384679169"y":-414359950456"value":96"x":1471384194314"y":-414358419739"value":22"x":1471385049792"y":-414359574813"value":44"x":1471384097378"y":-414358598672"value":82"x":1471384993219"y":-414360352975"value":84"x":1471383640499"y":-414359839518"value":81;let valueMin = 0;let valueMax = 100; // add data to heatmapheatMap;
HeatmapImageryProvider.js
A library to add heatmaps (using heatmap.js) to the Cesium framework using a custom Cesium.ImageryProvider
.
To use this on your page do the following:
- Follow the steps in the comment on the first few lines of the file to add the class to Cesium.
- Create a HeatmapImageryProvider instance like so:
new Cesium.HeatmapImageryProvider()
. See the function in the code for more information on the parameters. - Add the instance to the
widget.scene.imageryLayers
list like so:var layer = widget.scene.imageryLayers.addImageryProvider(instance)
. After this you can use layer like any other layer in Cesium.