Shared planar heatmap layers
Standard addLayer(type:heatmap) now references GeoJSON points or MVT point source layers; MVT requires source-layer. Rendering reuses the independently implemented GPU heat module and shared ordering,filters,visibility,zoom,credits and state weights. Applications provide their own tool UI.
import {map} from 'sqsmap';
map.addSource('points',{type:'geojson',data:{type:'Feature',id:1,properties:{weight:1},geometry:{type:'Point',coordinates:[0,0]}}});
map.addLayer({id:'heat',type:'heatmap',source:'points',paint:{
'heatmap-weight':['number',['get','weight'],1],
'heatmap-radius':36,'heatmap-intensity':1,'heatmap-opacity':0.8,
'heatmap-color':['interpolate',['linear'],['heatmap-density'],0,'#00000000',1,'#ff0000ff']
}});
await map.sqs.flush({render:true});
console.log(await map.queryRenderedFeatures(await map.project([0,0]),{layers:['heat']}));
Radius is positive and at most256 CSS pixels,intensity0..1000,opacity0..1. The color ramp uses linear heatmap-density with strictly increasing0..1 stops,at most32 constant colors. Weights accept attributes/state/variables,finite nonnegative values,and no zoom; rendered weight×intensity clamps to128. Radius/intensity/opacity accept constants and existing zoom interpolation. Owned display caches permit16384 heat points per map,including hidden layers.
Rendered queries use nonzero weight/intensity/opacity and kernel radius. Color descriptions retain the ramp rather than inventing per-point density colors; state snapshots remain source/source-layer scoped. Invalid weights are omitted and counted as warnings. Invalid/over-budget writes leave no partial layer/source reference.
Currently planar,including planar overlays on URL basemaps. Pitch,globe and combinations with shared raster layers reject explicitly and continue in3D tasks. This is a documented subset,with exponential ramps,additional parameter combinations and the mobile host still pending. Capabilities commonHeatmapLayers/heatmapPlanar are true.
The complete HTML includes weight,opacity,radius,visibility,order,query and disposal handlers. The portable script uses identical logic in native/main-thread/strict Worker. Example points are locally generated; provide required credits for real data.