sakitam-fdd / wind-layer

:flags: :rocket: wind-layer | a openlayers && maptalks && amap && bmap && leaflet && mapbox-gl && maplibre-gl extension like windy.com for weather visualization
https://sakitam-fdd.github.io/wind-layer/
Other
542 stars 145 forks source link

Background without transparency #159

Closed larsurilch closed 1 year ago

larsurilch commented 2 years ago

I'm using Openlayers 6.5 and when I add it as in the example the background is white.

import { WindLayer } from 'ol-wind';

const windLayer = new WindLayer(res, {
    forceRender: false,
    windOptions: {
      velocityScale: 1 / 20,
      paths: 5000,
      colorScale: () => {
        return '#ff473c';
      },
      width: 3,
      generateParticleOption: false
    }
});

map.addLayer(windLayer);

background

When I use the map as an option it works with transparency but I have problems removing the layer.

import { WindLayer } from 'ol-wind';

new WindLayer(res, {
    forceRender: false,
    windOptions: {
      velocityScale: 1 / 20,
      paths: 5000,
      colorScale: () => {
        return '#ff473c';
      },
      width: 3,
      generateParticleOption: false
    },
    map: map
});

transparent

Are there any parameters to solve the transparency problem?

Thanks

sakitam-fdd commented 1 year ago

@larsurilch use windLayer.setMap(null); remove layer and windLayer.setMap(map); add layer is it feasible?

sakitam-fdd commented 1 year ago

@larsurilch try v1.1.1,close this issues for now, unless there is another problem