feat(layers): add getPixelOffset prop to ScatterplotLayer#10178
feat(layers): add getPixelOffset prop to ScatterplotLayer#10178felixpalmer merged 3 commits intovisgl:masterfrom
Conversation
|
@officialasishkumar Can you share your use case for this feature? |
5b231ed to
352bddf
Compare
|
@missx-oai The use case is screen-space nudging for circles that share the same geographic anchor without altering the underlying coordinates. That is useful for decluttering overlapping scatterplot markers and for aligning a circle with nearby text or icon layers that already support pixel offsets. |
|
Will resolve the merge conflicts |
|
Please update the documentation for ScatterplotLayer. |
Add a getPixelOffset accessor to ScatterplotLayer that allows shifting the rendered circle by a fixed number of screen pixels, independently of zoom level. This is useful for preventing overlap between circles and other layers (e.g. icons, text) without modifying the underlying data positions. The implementation follows the same pattern used by IconLayer and TextLayer: - New instance attribute `instancePixelOffset` (vec2, transition-enabled) - In billboard mode, the pixel offset is added to the screen-space offset before clip-space projection - In non-billboard mode, the pixel offset is converted to common space via project_pixel_size and added to the common-space offset - Both GLSL and WGSL shader variants are updated - Default value is [0, 0] for backward compatibility Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Add documentation for the new getPixelOffset accessor prop, following the same format used by IconLayer and TextLayer documentation. Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
352bddf to
b1f4e01
Compare
|
Updated the ScatterplotLayer documentation with the |
|
Is there an ETA on the release of this? I assume it will be with next release but do we know when that will be? |
|
@mikemicmike I do not have an ETA for the release timing. This PR is approved but still open, so timing depends on the maintainers merging it and cutting a release. |
Closes #10057
Change List
getPixelOffsetaccessor prop toScatterplotLayerthat shifts the rendered circle by a fixed number of screen pixels, independently of zoom levelinstancePixelOffset(vec2, transition-enabled) with a default value of[0, 0]for full backward compatibilityproject_pixel_sizeand added to the common-space offsetIconLayerandTextLayerUsage