nickcam / AnimatedEnvironmentLayer

A custom arcgis js api layer to display GRIB data formatted as json as animated particles on a canvas
https://animatedenvironmentlayer.azurewebsites.net/index.html
44 stars 10 forks source link

[esri.support.LayersMixin] #add() The item being added is not a Layer or a Promise that resolves to a Layer. #9

Closed Shruthi48 closed 3 years ago

Shruthi48 commented 3 years ago

arcgis-js-api v4.20, I tried to integrate AnimatedEnvironmentLayer by adding compiled ael/animatedEnvironmentLayer.js and reference it like the other javascript esri amd modules.

when I do

map.add(environmentLayer)

I am getting the error below. Is there a way I can resolve this error?

Screenshot 2021-08-11 at 1 03 27 PM
Shruthi48 commented 3 years ago

found the solution , had to add this instead

map.layers.add(environmentLayer);

the other issues were related to this.attach() not being invoked as mentioned here https://github.com/nickcam/AnimatedEnvironmentLayer/issues/8. After explicitly invoking this.attach() it started to work perfectly

nickcam commented 3 years ago

Ok cool. I obviously haven't upgraded it to work with later versions of the api. Glad you got it going.