简体   繁体   English

如何在开放层中组合热图?

[英]How to combine heatmaps in open layers?

I thought that Heatmap.source accepts array of sources but seems like it doesn't.我认为Heatmap.source接受源数组,但似乎没有。

I tried creating 2 heatmap layers and displaying them on map but it creates this strange transition between them.我尝试创建 2 个热图图层并在 map 上显示它们,但它在它们之间产生了这种奇怪的过渡。

在此处输入图像描述

Layers are drawn one on top of the others so this is expected.图层是在其他图层之上绘制的,因此这是意料之中的。

If you want to show two layers you will have to use transparency ( opacity when creating a layer).如果要显示两个图层,则必须使用透明度(创建图层时的opacity )。

However if you want both layers to be simply merged without any visible difference, you will have to merge the data.但是,如果您希望简单地合并两个图层而没有任何明显的差异,则必须合并数据。 What prevents you from merging the data?是什么阻止您合并数据? Where is it coming from?它来自哪里? The are multiple ways to do it, you can add manually the features to the source (passing a features array when constructing it), you can also create a custom loader.有多种方法可以做到这一点,您可以手动将特征添加到源中(在构造它时传递features数组),您还可以创建自定义加载器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM