Comments (5)
I changed to use the esm version but with the same results. But I think I resolved this issue by making the following changes:
In wind-layer/dist/OlWindy.esm.js:11
by changing it to:
import { get as getProj, transformExtent } from 'ol/proj';
and changing L844 to be:
this.getSource().projection_ = getProj(this._getProjectionCode());
Now I don't get the above error, but when I turn on the animation, it runs while tiles are loading, but stops when all the tiles have loaded. If zoom or pan and new tiles are loaded the animation starts and runs as long as tiles are loading.
Any help would be greatly appreciated.
from wind-layer.
One additional piece of info is that I get please create new instance
messages in the console log, which I just noticed are generated from OlWindy.setData()
function, so I'm guessing I'm not using the API correctly. What is the correct way to turn on/off/clear the Windy layer, and what steps to I need to take to reload new data.
from wind-layer.
- Can you provide the openlayers version you are using? As far as I know, there's something about projection for openlayers v6.
setData
method must afterappendTo
method,When you just want to clear the layer, you can use the clearWind
method, setData method for reload new data. UseremoveLayer
only when you really want to remove layers
function toggleWindy() {
if ($(this).prop('checked')) {
if (windData) {
windy.appendTo(map);
windy.setData(windData);
}
}
else {
windy.clearWind();
}
}
from wind-layer.
"dependencies": {
"chart.js": "^2.9.3",
"core-js": "^3.6.3",
"jquery": "^3.4.1",
"jquery-modal": "^0.9.2",
"ol": "^5.3.3",
"ol-layerswitcher": "github:woodbri/ol-layerswitcher#addcontrol",
"ol-popup": "^4.0.0",
"sidebar-v2": "github:umbe1987/sidebar-v2#ol5-sidebar",
"wind-layer": "^0.1.1"
},
"devDependencies": {
"parcel-bundler": "^1.12.4"
}
from wind-layer.
OK, changing toggleWindy the way you have it improves things, now when I toggle it on the first time, the wind starts and runs as expected but I still get the please create new instance
warning in the console. When I toggle it off it starts, but the next time I toggle it back on again it displays the wind but it is not animated and I get this uncaught exception error:
uncaught exception: AssertionError: Assertion failed.
See https://openlayers.org/en/v5.3.3/doc/errors/#58 for details.
Collection.js:281:14
assertUnique_ Collection.js:281
push Collection.js:202
addLayer PluggableMap.js:502
setData index.js:76
toggleWindy index.js:427
jQuery 2
EDIT: I fixed this by moving the appendTo() out of the on/off control and placing it after the windy layer definition. So it looks to be working with only the change in defining the projection object.
from wind-layer.
Related Issues (20)
- ol-wind, setData报错 HOT 2
- The mapbox-wind cannot be rendered using 'jsonArray'. HOT 4
- 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
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.