Deck.gl: heatmap is not supported to use in the following ways?

Created on 18 Sep 2019  路  12Comments  路  Source: visgl/deck.gl

heatmap is not supported to use in the following ways? eg:
let mapOpt = { style: "mapbox://styles/mapbox/streets-v9", container: "map-view", zoom: 12, center: [-74.0080413171491, 40.70498574162349], }; let map = new mapboxgl.Map(mapOpt); let deck = new Deck({ gl: map.painter.context.gl, controller: true, onWebGLInitialized: function(gl) { gl.enable(gl.BLEND); gl.blendEquation(gl.FUNC_ADD); gl.blendFunc(gl.SRC_ALPHA, gl.ONE); } }); let heatmapData = "data/uber-pickup-locations.json"; let heatmapLayer = new HeatmapLayer({ id: "my-heatmap", data: heatmapData, opacity: 1, pickable: false, getPosition: d => [d[0], d[1]], getWeight: d => d[2], intensity: "1", threshold: "0.03" }); map.on("load", function() { map.addLayer(new MapboxLayer({ id: "my-deck", deck })); deck.setProps({ layers: [heatmapLayer] }); });

question

Most helpful comment

@huashaoxu , upcoming deck.gl 7.3.0 release should support HeatmapLayer in WebGL1.

All 12 comments

What is the issue you are observing, is it a crash (if so can you provide a log) or is it a rendering issue (provide an image?)

Looks like you are overwriting deck.gl default blending, this is going to affect final rendering color, is that the problem? Is this affecting just heatmap layer?

sorry, I didn't describe the problem clearly.I load heatmap layer with this example:https://github.com/uber/deck.gl/blob/master/docs/api-reference/mapbox/mapbox-layer.md
but,the layer loading failure, i got a error:"deck: HeatmapLayer my-heatmap is not supported on this browser, requires WebGL2", remove "onWebGLInitialized "property,The problem still exists.

mapbox-gl creates a WebGL1 context, which is not supported.

whether or not to consider supporting it?

An alternative to back-porting layers to WebGL1, could be to trick mapbox into creating/using a WebGL2 context.

We could override canvas.getContext to return a WebGL2 context, and we could override gl.getExtension() to return WebGL1 extensions that mapbox uses (just forwarding tthem to the corresponding WebGL2 APIs).

Kind of a "reverse WebGL2 polyfill"

@tsherif @1chandu

@huashaoxu , upcoming deck.gl 7.3.0 release should support HeatmapLayer in WebGL1.

@1chandu great!

@huashaoxu , please try deck.gl '7.3.0-beta.9 ', it should work with WebGL1 context.

whether or not use heatmap layer render like this :

image

@huashaoxu , I didn't understand your previous comment, is the above rendering is from HeatmapLayer.

Also we made few fixes and published deck.gl 7.3.2, please re-test with this version.

Does heatmaplayer support this rendering effect?

@huashaoxu , yes, HeatmapLayer can be used similar to any other deck.gl layer, as long as you set the props as per the docs, please use 7.3.2 that includes several fixes.

Was this page helpful?
0 / 5 - 0 ratings