stuartmatthews / leaflet-geotiff

Leaflet plugin for displaying geoTIFF raster data
MIT License
172 stars 78 forks source link

getting "too many webgl contexts" warnings #3

Open monemihir opened 6 years ago

monemihir commented 6 years ago

Not sure how to solve this.

I currently have tiled geotiffs that I would like to plot on the map. There are between 20-90 tiles depending on various scenarios.

After plotting about 10-12 tiles, every subsequent call throws "too many webgl contexts" warning on all browsers.

Also noticed that the calls made to the plotty library are different in draw and reset functions. One passes useWebGL: false and the other doesn't.

stuartmatthews commented 6 years ago

This seems to be a common problem with WebGL contexts not being cleaned up by the GC. A simple fix might be to put useWebGL: false after line 175 in _preLoadColorScale.

    clampHigh: this.options.clampHigh,
    useWebGL: false
});

Can you please see if this works for you?

I plan to do a new version soon which uses WebGL properly as plotty gets quite slow for large files if WebGL is not used.

cpfreitas commented 5 years ago

I'm getting this warning, how can I solve?