Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

图层拾取功能错误 #230

Open
yudeqang opened this issue Jul 25, 2024 · 5 comments
Open

图层拾取功能错误 #230

yudeqang opened this issue Jul 25, 2024 · 5 comments
Assignees

Comments

@yudeqang
Copy link

我添加了一个气温图层,点击图层返回的数据异常,基本都是0。
复现代码:点击
image

@sakitam-fdd sakitam-fdd self-assigned this Jul 25, 2024
@yudeqang
Copy link
Author

maplibre-gl没有这个问题

@sakitam-fdd
Copy link
Owner

@yudeqang 这个已定位到 BUG,是 leaflet 鼠标位置 unproject 实现的问题,下个版本修复

临时解决的话可以覆盖 picker 方法:

wind.picker = async function(coordinates) {
  if (!this.options.picking) {
    console.warn('[Layer]: please enable picking options!');
    return null;
  }
  if (!this.layer || !coordinates || !this._map) {
    console.warn('[Layer]: layer not initialized!');
    return null;
  }
  const point = this._map.latLngToContainerPoint(coordinates);
  return this.layer.picker([point.x, point.y]);
}

示例

@yudeqang
Copy link
Author

yudeqang commented Aug 1, 2024

大佬,请教个问题,我在图层中加了个marker用于显示图层的数值,当切换图层的时候我不能立即调用layer.pikcer刷新数值,因为图层还没有渲染好,我想问下哪个变量表示图层已经渲染好了

@yudeqang
Copy link
Author

yudeqang commented Aug 1, 2024

还有个问题,请问怎么渲染nodata数据,比如想要渲染土壤墒情,海洋中就是nodata值,我如果在原始数据中写入0,然后指定显示>0的数据,0在插值中就会污染附近的有效值,请问怎么让0不参与插值运算呢?
image
示例

@sakitam-fdd
Copy link
Owner

@yudeqang

  1. 图片数据加载完成
source.sourceCache.on('tilesLoadEnd', (e) => {
  console.log(e);
});

// 手动判断

console.log(source.sourceCache.loaded());
  1. nodata数据这目前没有这个配置哈,不过已经测试过,配置 nodata 效果提升不明显,主要问题是数据纹理 minFilter和 magFilter 这个配置,不过后面可以加上配置,可能要晚一点

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants