maptalks / maptalks/maptalks.js
sortByDistanceToCamera doesn't work for PointLayer
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 4.5k
- Forks
- 511
- Avg merge
- 3d 58m
- Merged PRs (30d)
- 1
Description
maptalks's version and what browser you use?
maptalks-gl v0.105.3
chrome
Issue description
The VectorLayer option sortByDistanceToCamera: true doesn't work for PointLayer (and/or GroupGLLayer).
All image markers in PointLayer render in random depth (or rather, in the add order), it's a big issue.
Tried orderByCamera: true from GroupGLLayer.ts, it doesn't work either.
Tried adding markerAllowOverlap: true, to symbol and collision: true, to layer, the order somehow inverted but still wrong.
Observed with markers that are in the same layer, so it doesn't depend on other layers.
It worked for VectorLayer just perfectly. Do I need another option? Something zBuffer-related, perhaps?
Please provide a reproduction URL (on any jsfiddle like site)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduction URL and inspect GroupGLLayer.ts, then compare PointLayer's handling of sortByDistanceToCamera with the VectorLayer behavior described in the report. Done means image markers in the same PointLayer render in the correct camera-distance order rather than random or add order.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100