Comments (11)
并且我使用ol5.3.3和"ol5-wind": "^1.0.0-alpha.2"时运行错误:
Uncaught (in promise) TypeError: data.checkFields is not a function
at OlWind.push../node_modules/ol5-wind/dist/ol-wind.esm.js.OlWind.setData (ol-wind.esm.js:1488)
at new OlWind (ol-wind.esm.js:1363)
at index.vue?0f4e:59
from wind-layer.
"ol5-wind": "^1.0.0-alpha.2"的问题出现在
ol-wind-esm.js 1488
/**
* set layer data
* @param data
* @returns {BMapWind}
*/
OlWind.prototype.setData = function (data) {
if (data && data.checkFields()) {
this.field = data;
}
else if (isArray(data)) {
this.field = formatData(data);
}
else {
console.error('Illegal data');
}
var map = this.getMap();
if (map && this.canvas && this.field) {
this.render(this.canvas);
}
return this;
};
应该修改为
/**
* set layer data
* @param data
* @returns {BMapWind}
*/
OlWind.prototype.setData = function (data) {
if (data && data.checkFields && data.checkFields()) {
this.field = data;
}
else if (isArray(data)) {
this.field = formatData(data);
}
else {
console.error('Illegal data');
}
var map = this.getMap();
if (map && this.canvas && this.field) {
this.render(this.canvas);
}
return this;
};
缺少一个data.checkFields判断
from wind-layer.
但还时有问题,ol5-wind只能显示在当前的世界,在经度0为不显示的分隔线
from wind-layer.
@linrong 收到,目前还处于alpha版本,不建议生产环境用,如果自己测试有BUG我先记录下来,最近可能没有时间处理
from wind-layer.
0.1.2版本的ol6也会背景变白,覆盖住地图的显示,我觉得应该是renderer.js的问题,但我却不知道怎么修改
from wind-layer.
@linrong 高清屏上没有这个问题,你可以从pixelRadio这块入手
from wind-layer.
@sakitam-fdd 基于0.1.2版本的ol6,我目前发现问题如图:
风场数据覆盖了地图的显示
目前我是使用的设备为:
win10 1920x1080 谷歌浏览器版本80.0.3987.132 / EDGE 都出现问题
win7 笔记本 1366x768 谷歌浏览器 出现此问题
iphone8 谷歌浏览器 显示正常
在win10调试中我获得的devicePixelRatio 和 frameState.pixelRatio 都为 1
请问上面的信息能够说明是pixelRadio的问题嘛?或者你有其他方面的建议?
谢谢你的回复
from wind-layer.
@sakitam-fdd 基于0.1.2版本的ol6,我目前发现问题如图:
风场数据覆盖了地图的显示
目前我是使用的设备为:
win10 1920x1080 谷歌浏览器版本80.0.3987.132 / EDGE 都出现问题
win7 笔记本 1366x768 谷歌浏览器 出现此问题
iphone8 谷歌浏览器 显示正常
在win10调试中我获得的devicePixelRatio 和 frameState.pixelRatio 都为 1
请问上面的信息能够说明是pixelRadio的问题嘛?或者你有其他方面的建议?
谢谢你的回复
这个问题的关键是地图(layer)和风场(layer)共用同一个convas。所以在创建风场(layer)要新生成一个convas。
解决方法:renderer.js中,重新定义成员函数:
useContainer (target, transform, opacity) {
target = null;
super.useContainer(target, transform, opacity);
}
强制在新的convas作图。
from wind-layer.
@wwfeng990 强制使用新的canvas图层时可行的,但是这块也不完全是由于这个问题;ol其实本身没有 animate layer这个概念,如果做动态图层官方推荐的是使用 map.render() 来实时重绘所有图层,但是这样显然性能不好;另外就是由于在有些情况下会进行图层复用,现在是由于图层复用但是context没做隔离,其实还可以wind-core单独使用一个离屏画布进行粒子绘制,在postrender回调中将粒子画布同步到ol图层上,但是这样相对来说要麻烦一些。如果有兴趣可以发个pr,感谢
from wind-layer.
@wwfeng990 感谢你提供的方法,目前测试修改可以使用,但还是会有一些问题,当我设置风场和晨昏线同时显示时,风场的动画会被阻止,风场使用GeoJSON.Terminator/仿照leaflet的插件的。不过目前我还是使用ol5进行开发,所以暂时这个问题对我影响不是很大
@sakitam-fdd 对于白屏的问题我提供一些别的信息
- 浏览器出现地图覆盖白底,设置电脑显示设置的缩放比例>100%可以正常,目前在多台电脑验证
- 谷歌浏览器的移动端调试中无论如何设置比例都是正常的
from wind-layer.
@linrong 收到
from wind-layer.
Related Issues (20)
- maptalks版本依赖问题 HOT 1
- The mapbox-wind's particles and scalarFill layer cannot overlap with each other HOT 3
- wind layer bounds decrease as zoom increases HOT 8
- 色斑图错位 HOT 7
- 气象上的windbarb是否支持 HOT 1
- When mapbox loads windlayer, it ends at 180 degrees east longitude HOT 1
- ol-wind加载流场 在隐藏图层/显示图层 后流场的流动效果停止 HOT 2
- 粒子绘制过程中会产生轨迹残留,影响视觉效果,如何解决呢。求助,急!!! HOT 1
- 移动端没有适配 HOT 1
- openlayers 叠加色斑图 HOT 1
- 风场在跨东经180度时断开 HOT 1
- 高德api2.0版本报错 HOT 1
- 高德地图报错
- 高德2.0报错,什么时候更新对2.0的支持?报错信息如下: HOT 3
- 调试源码时playground运行失败 HOT 9
- 引入mapbox-wind找不到ScalarFill、WindLayer等类 HOT 1
- 关于mapbox-wind示例代码运行报错,导入的WindLayer, ScalarFill都为undefined HOT 1
- 风场跨东西半球,风场只显示一半的问题 HOT 2
- 地图缩放后风场有轨迹残留问题
- Issues with toggling the wind layer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wind-layer.