Comments (10)
@slarosa Will be fixed in the next version
from wind-layer.
@slarosa Try v1.0.0-alpha.3
from wind-layer.
@slarosa For this question, you may be interested in external and globals of rollup. You can see some code in:
- https://github.com/sakitam-fdd/wind-layer/blob/master/rollup/external/ol.js
- https://github.com/sakitam-fdd/wind-layer/blob/master/packages/ol/src/renderer.ts#L5
- https://github.com/sakitam-fdd/wind-layer/blob/master/packages/ol/src/renderer.ts#L14
with official OL6 library, ol.proj
and ol.transform
some of the modules used are not exposed,I just modified some things according to the official documents to expose these modules.
For example, add @api
under the required function annotation:
https://github.com/openlayers/openlayers/blob/master/src/ol/transform.js#L35
/**
* Resets the given transform to an identity transform.
* @param {!Transform} transform Transform.
* @return {!Transform} Transform.
* @api
*/
export function reset(transform) {
return set(transform, 1, 0, 0, 1, 0, 0);
}
from wind-layer.
@sakitam-fdd thanks.
It seems is not enough to change version to the source of the script tag. I done it but it has not worked.
Anyway, I tried the following different way:
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/ol-wind.min.js"></script>
but i get TypeError: OlWind is not a constructor
Also it throws the error:
ol-wind.min.js:23 Uncaught TypeError: Object prototype may only be an Object or null: undefined
at setPrototypeOf (<anonymous>)
at s (ol-wind.min.js:23)
at a (ol-wind.min.js:23)
at ol-wind.min.js:44
at ol-wind.min.js:44
at ol-wind.min.js:8
at ol-wind.min.js:8
Any hint?
Thank you.
from wind-layer.
@slarosa There are some changes to the API for the new version,Here are some minimal examples https://codesandbox.io/s/map-ol-wind-2vc8v.
In addition, for the new version of OL, it may rely more on packaging tools, and may not be very friendly to CDN references, and for OL, there are many internal functions that are not exposed, so it is difficult to be compatible.
from wind-layer.
Use custom build-legacy build ol packages, Here's a simple example https://codepen.io/sakitam-fdd/pen/NWGOBoj
from wind-layer.
Thank you for your help @sakitam-fdd .
It now is working well. So I don't know why before it was not working.
<script src="//cdn.jsdelivr.net/npm/[email protected]/dist/ol-wind.js"></script>
fetch('https://danwild.github.io/leaflet-velocity/wind-global.json')
.then(res => res.json())
.then(res => {
var wind = new WindLayer(res, {
title: 'Wind',
visible: false,
wrapX: true,
forceRender: false,
windOptions: {
addLayer: true,
globalAlpha: 0.8,
maxAge: 90,
velocityScale: 0.01,
paths: 2000,
colorScale: [
'rgb(36,104, 180)',
'rgb(60,157, 194)',
'rgb(128,205,193 )',
'rgb(151,218,168 )',
'rgb(198,231,181)',
'rgb(238,247,217)',
'rgb(255,238,159)',
'rgb(252,217,125)',
'rgb(255,182,100)',
'rgb(252,150,75)',
'rgb(250,112,52)',
'rgb(245,64,32)',
'rgb(237,45,28)',
'rgb(220,24,32)',
'rgb(180,0,35)'
],
lineWidth: 3,
},
});
map.addLayer(wind);
});
However, I now have another problem but it concerns another topic so I will open a new issue for it.
Thanks much for the amazing job
from wind-layer.
@slarosa For the previous error, you can use codepen or codesandbox to give me a simple example, I will check it out tomorrow
from wind-layer.
@sakitam-fdd here a simple example which shows the previous error. https://codepen.io/slarosa/pen/yLYQzad
If the javascript source links to //cdn.jsdelivr.net/npm/@sakitam-gis/[email protected]/dist/ol.js
your own OL6 library (6.3.3) all works fine. While with official OL6 library (6.3.1 as in codepen) it does not work.
from wind-layer.
@sakitam-fdd thank you so much for the exhaustive explanation.
from wind-layer.
Related Issues (20)
- maptalks-wind adding gl rendering mode HOT 1
- 色斑图必须采用图片吗? HOT 4
- OpenLayers 绘制色斑图 HOT 2
- 风流场渲染之后,其他的交互会导致其重新渲染,底图加载也是如此😂😂😂😂 HOT 4
- 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
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.