Skip to content

GetColor missmatch color #9637

Answered by diegoposba
diegoposba asked this question in Q&A
Discussion options

You must be logged in to vote

Hi everyone, I finally found a solution:

const layers = [
    new PointCloudLayer({
      id: 'LazPointCloudLayer',
      data: LAZ_URL,
      onDataLoad,
      opacity: 1.0, 
      pointSize: 1.5, 
      loaders: [LASLoader],
      loadOptions: {
        las: {
          colorDepth: 'auto' 
        }
      },
      getColor: (point) => {
        if (point.color) {
          return point.color;
        }
        if (point.hasOwnProperty('r') && point.hasOwnProperty('g') && point.hasOwnProperty('b')) {
          return [point.r, point.g, point.b];
        }
        const normalizedZ = (point.position[2] - viewState.target[2]) / 50; 
        return [
          Math.min(255, Math.max(0, 128 …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by diegoposba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant