openlayers - Openlayers 4.6.5 热图并不总是在 Mac Chrome 版本 94.0.4606.71 上呈现
问题描述
好的,所以我在下面定义了这个变量。
var heatmapLayer = new ol.layer.Heatmap({
source: new ol.source.Vector({
format: new ol.format.GeoJSON()
}),
opacity: .65
});
我想通过执行下面的代码在网站上绘制热图。
$.getJSON(url, con).done(function(json) {
var max = json.reduce(function(a, b) { return com.toInt(a) > com.toInt(b.val) ? com.toInt(a) : com.toInt(b.val); },0);
var fs = [];
json.forEach(function(e) {
var f = new ol.Feature({
geometry: map.geoWKT.readGeometry(e.geom),
weight: (com.toInt(e.val) / max),
id: e.recordid,
val: com.toInt(e.val)
});
fs.push(f);
});
heatmapLayer.getSource().clear();
heatmapLayer.getSource().addFeatures(fs);
heatmapLayer.setVisible(true);
});
在 Windows Chrome 上,上述方法可以正常工作,但在 Mac Chrome 上,它们似乎并不总是有效。特别是当 fs 被传递给 addFeatures 方法时,在 Windows Chrome 上它一直有效,但在 Mac Chrome 上却不行。是什么导致了这个问题?Openlayers 4.6.5 Heatmap 与 Mac Chrome 不兼容吗?我必须修复我的代码以适应 Mac Chrome 吗?需要帮助
解决方案
推荐阅读
- asp.net-core - 尝试在 C# ASP.NET Core 的数据表中水平存储图像
- javascript - 即使我的 package.json 和 node_modules 文件夹中有未定义的包,我也会收到它们
- python - Groupby,聚合并检查 Pandas 中的条件
- android-studio - 将 android studio 更新到 Android Studio Arctic Fox 后调试停止工作 | 2020.3.1 补丁 3 - 应用程序正在等待调试器附加
- sql - 尝试使用 CTE 使用同一表中其他列的计算值更新列 - postgresql
- wix - Wix 工具集在条件下使用 var
- sql - Postgresql - 多个约束冲突
- node.js - 安装赛普拉斯的问题
- javascript - 开玩笑 - 从源文件中导入的函数在同一文件中使用函数的模拟实例
- php - 为什么我的 MYSQL 表在我的新 PC 上不存在?