Git Product home page Git Product logo

Comments (3)

nickcam avatar nickcam commented on May 31, 2024

Hi @hlam94 - I haven't tested this on v4.19 yet. Apparently esri have removed dojo dependencies in that release, so their module / class system has changed. I can see this causing all sort of problems without some refactoring.

What you've done to remove the declared call is correct, that was an old style way to extend their Accessor classes. It's probably not that which is the problem though, but instead major changes to their api.

If I get a chance I'll look at upgrading this, but I don't use it anymore personally and haven't looked at the arcgis js api for a while as well - I can't guarantee I'll get around to it. If you work something out feel free to submit a PR.

from animatedenvironmentlayer.

Brandonpellis avatar Brandonpellis commented on May 31, 2024

We did 2 things to get vectors to show up in 4.20

1.) We found no documented changes to the BaseLayerView2D object, but found that the extended attach method was not being called by ESRI as it had been in previous API versions. It is unknown whether the issue is with the way the ESRI object is behaving or that this object is not able to extended the method properly. Once we confirmed that this.attach() was no longer being triggered the same way post 4.15, the issue was resolved by manually calling this.attach() when AnimatedEnvironmentLayerView2D was called. We tried to call the attach method in predraw because BaseLayerView2D is reported to call its attach method just before the layer draws but doing so in this code would destroy the data because the windy object is overwritten and the data is destroyed. I do not think that this is a proper fix, but it is a slap job for now. Maybe a bigger brain has a proper way to resolve the issue.

function AnimatedEnvironmentLayerView2D(props) {
            var _this = _super.call(this) || this;
            _this.view = props.view;
            _this.layer = props.layer;
            _this.view.on("resize", function () {
                if (!_this.context)
                    return;
                // resize the canvas
                _this.context.canvas.width = _this.view.width;
                _this.context.canvas.height = _this.view.height;
            });
            watchUtils.watch(_this.layer, "visible", function (nv, olv, pn, ta) {
                if (!nv) {
                    _this.clear();
                }
                else {
                    _this.prepDraw();
                }
            });   
        
            this.attach();

            return _this;
        }

2.) 4.15 release notes suggested that .otherwise() will no longer be supported as they have moved to native promises rather than dojo promises. (https://developers.arcgis.com/javascript/latest/4.15/#return-native-promises)

We experienced fails here that were likely unrelated to this change, but we made it anyway and it seems to work without issue.

 esriRequest(this.url, {
                    responseType: "json"
                })
                    .then(function (response) {
                    _this.dataFetchRequired = false;
                    _this.doDraw(response.data); // all sorted draw now.
                    _this.dataLoading = false;
                })
                    .catch(function (err) {
                    console.error("Error occurred retrieving data. " + err);
                    _this.dataLoading = false;
                    _this.isErrored = true;
                });

from animatedenvironmentlayer.

nickcam avatar nickcam commented on May 31, 2024

I merged a PR recently that provided support for v4.21. So closing this.

#11 PR to update to 4.21

from animatedenvironmentlayer.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.