Open sudoritz opened 10 months ago
i wonder if i might have to update the heatLayer.js to add another variable maybe we can add like like heatmapStatus i wonder if heatmapColorGradient is only 1 value it sees and not dynamic per drawing
// Example of extending the data model to include 'status'
initialize: function (latlngs, options) {
// Example latlngs format: [{lat: x, lng: y, alt: z, status: s}, ...]
this._latlngs = latlngs;
// ... rest of the initialization
},
// Example of customizing the gradient calculation based on 'status'
_redraw: function () {
// ... existing code to process points ...
for (let i = 0, len = grid.length; i < len; i++) {
// ... existing code to process grid cells ...
if (cell) {
let status = this._latlngs[i].status;
let color = this.getStatusBasedColor(status); // Custom function to determine color
data.push([
Math.round(cell[0]),
Math.round(cell[1]),
Math.min(cell[2], this._max),
color // Include color in the data
]);
}
}
// ... existing drawing code, modified to use the color ...
},
// Example of a custom function to determine color based on 'status'
getStatusBasedColor: function (status) {
// Implement logic to return a color based on the status value
// For example, return 'red' for high status, 'blue' for low status
},
Im looking to see if we can use heatmapColorGradient with results to change the heatmap color on the GPS path or along the device that is in path. so where ever we are moving we have a consistent ping going to a server but it would be cool to show red when ping is over >100ms range or >300ms and green between. I think i did the eval but to use maps+ i cant seem to get the colors to display along the GPS path track