通过 HERE OLP 数据可视化库在自定义数据中使用 64 位整数
Using 64 bit integers in custom data with HERE OLP Data Visulization Library
当使用包含具有 int64
/sint64
类型字段的消息的 protobuf 架构并尝试使用自定义渲染器插件对其进行可视化时,传递给渲染器插件的解码数据包含类型为 number
而不是 https://github.com/dcodeIO/Long.js/ 中的 Long
的字段。我已经能够通过用
修补 GeoJsonDataStoreHelper.js
在我的本地 webapp 中解决这个问题
var Protobuf = require("protobufjs");
var Long = require("long");
Protobuf.util.Long = Long;
Protobuf.configure();
有什么办法可以在不更改可视化库代码的情况下解决这个问题吗?否则无法在 OLP 上渲染。
它不能直接在 GeoJSON 插件中使用,但在传递给该插件的 MapUtils 中用于某些特定用例。基本上在渲染器插件中,mapUtils 可用作 toGeoJSON 方法的第 4 个参数
https://developer.here.com/olp/documentation/data-visualization-library/dev_guide/pages/renderer-plugins.html
此时您只能像直接修改 geojson-datasource 代码那样暂时修复它。我们正在努力在我们的 geojson 包中正确支持 int64。
当使用包含具有 int64
/sint64
类型字段的消息的 protobuf 架构并尝试使用自定义渲染器插件对其进行可视化时,传递给渲染器插件的解码数据包含类型为 number
而不是 https://github.com/dcodeIO/Long.js/ 中的 Long
的字段。我已经能够通过用
GeoJsonDataStoreHelper.js
在我的本地 webapp 中解决这个问题
var Protobuf = require("protobufjs");
var Long = require("long");
Protobuf.util.Long = Long;
Protobuf.configure();
有什么办法可以在不更改可视化库代码的情况下解决这个问题吗?否则无法在 OLP 上渲染。
它不能直接在 GeoJSON 插件中使用,但在传递给该插件的 MapUtils 中用于某些特定用例。基本上在渲染器插件中,mapUtils 可用作 toGeoJSON 方法的第 4 个参数 https://developer.here.com/olp/documentation/data-visualization-library/dev_guide/pages/renderer-plugins.html
此时您只能像直接修改 geojson-datasource 代码那样暂时修复它。我们正在努力在我们的 geojson 包中正确支持 int64。