简体   繁体   English

openlayers热图在地图上显示红线

[英]openlayers heatmap shows red lines on map

i got a problems using the heatmap-openlayers.js, i loaded a page with some default points that only shows the heatmap gradient, but when i dragged the image (map) or moved the gradient to the bottom of the image i found out that i also have a red line on the map, it's seems to be a replication of the gradient's set of points but couldn't figure out why it's happening.. 我在使用heatmap-openlayers.js时遇到问题,我在页面上加载了一些仅显示热图渐变的默认点,但是当我拖动图像(地图)或将渐变移动到图像底部时,我发现我在地图上也有一条红线,似乎是渐变点集的复制,但无法弄清楚它为什么发生。

i uploaded a sample to: http://hightech-library.com/heatmap 我将样本上传到: http : //hightech-library.com/heatmap

and i added a bit css so you will see the problem on the go, if you will drag the image to the left the red line will disappear like something is blocking it, and when dragging back it will reappear.. 并且我添加了一点CSS,因此您将在旅途中看到问题,如果将图像拖到左侧,则红线将消失,就像有东西在挡住它,而向后拖动时,它将重新出现。

check out the source of the page and you'll see the sample code. 查看该页面的源代码,您将看到示例代码。

can anyone tell me if i'm doing anything wrong or how to fix it.. 谁能告诉我我做错了什么或如何解决。

i figured out what the red line were, when drawing a heatmap it draws all the points with the max gradient color with an offset of 1000 from the position you requested and then it makes a shadow on the canvas of these points instead, this shadow is the heatmap that you see with all the gradient's colors. 我弄清楚了红线是什么,当绘制热图时,它将绘制所有最大渐变颜色的点,这些点与您请求的位置之间的偏移为1000,然后在这些点的画布上绘制阴影,而该阴影是您使用所有渐变颜色看到的热图。

When drawing on an image with a fixed color this offset of 1000 wasn't enough and when i dragged the map i saw the source of the shadow as "red lines".My solution was to increase this offset and push those "red lines" outside the canvas. 在具有固定颜色的图像上绘制时,此偏移量1000不够,当我拖动地图时,我看到阴影的源为“红线”。我的解决方案是增加此偏移量并推动那些“红线”在画布外面。

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

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