0

I try to take first array of a sub array. So I have it like this:

  Map: map;

 Map() {
    Service
      
        });
  }

and this is the interface:



export interface map { 
   
}

But I get this error:

ERROR TypeError: Cannot set property 'heatmap' of undefined

so what I have to change?

I still get this error:

core.js:4442 ERROR TypeError: Cannot read property 'map' of null
    
.pipe(map((res) => res.map.slice(0, 1)))

and this is how I have it:

 Map() {
    
        });
  }

yes,

so I have this now:

 dMap() {

    console.log(this.Map.map);

    this.Service
      
        });
  }

But when I hover the mouse over this line:

console.log(this.Map.heatmap);

1
  • 2
    Your cameraAgretateHeadMap property is undefined. Just initialize it before your subscription. Commented Dec 9, 2020 at 17:39

1 Answer 1

4

change

 cameraAgretateHeadMap: CameraAggregationHeatmap;

to

 cameraAgretateHeadMap: CameraAggregationHeatmap = {};
Sign up to request clarification or add additional context in comments.

3 Comments

can you please elaborate?
Oke, I see now that heatmap has 100 elements. But I still dont see anything in the view. So yes, the data is loaded. But I dont anything on the web page.
@CodeIsNice, that's a separate issue, you can raise separate stackoverflow question for that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.