AnsweredAssumed Answered

Recent Custom Widget problem

Question asked by Mark.Kendall@cbre.com_dimension on Apr 18, 2018
Latest reply on Apr 18, 2018 by Mark.Kendall@cbre.com_dimension

When I compile the Recenter widget from your online example- using tsc 2.8- it creates a slightly different .js file and does not show custom widget in right corner of web page- if I change to use the source code on the site it works-

(but I cannot compile so no changes)

https://developers.arcgis.com/javascript/latest/sample-code/widgets-custom-recenter/index.html

 

The new compilation produces an error also

 

From website (works)

 

define(["require", "exports", "esri/core/tsSupport/declareExtendsHelper", "esri/core/tsSupport/decorateHelper", "esri/core/accessorSupport/decorators", "esri/widgets/Widget", "esri/core/watchUtils", "esri/widgets/support/widget"], function (require, exports, __extends, __decorate, decorators_1, Widget, watchUtils, widget_1) {

 

Using tsc 2.8 (doesn’t work)

 

define("Recenter", ["require", "exports", "esri/core/tsSupport/declareExtendsHelper", "esri/core/tsSupport/decorateHelper", "esri/core/accessorSupport/decorators", "esri/widgets/Widget", "esri/core/watchUtils", "esri/widgets/support/widget"], function (require, exports, __extends, __decorate, decorators_1, Widget, watchUtils, widget_1) {

 

From website (works)

 

Recenter.prototype._defaultCenter = function () {

            this.view.goTo(this.initialCenter);

        };

        return Recenter;

    }(decorators_1.declared(Widget)));

    __decorate([

        decorators_1.property(),

        widget_1.renderable()

    ], Recenter.prototype, "view", void 0);

    __decorate([

        decorators_1.property(),

        widget_1.renderable()

    ], Recenter.prototype, "initialCenter", void 0);

    __decorate([

        decorators_1.property(),

        widget_1.renderable()

    ], Recenter.prototype, "state", void 0);

    Recenter = __decorate([

        decorators_1.subclass("esri.widgets.Recenter")

    ], Recenter);

    return Recenter;

});

//# sourceMappingURL=Recenter.js.map

 

 

Using tic 2.8 (doesn’t work)

 

Recenter.prototype._defaultCenter = function () {

            this.view.goTo(this.initialCenter);

        };

        __decorate([

            decorators_1.property(),

            widget_1.renderable()

        ], Recenter.prototype, "view", void 0);

        __decorate([

            decorators_1.property(),

            widget_1.renderable()

        ], Recenter.prototype, "initialCenter", void 0);

        __decorate([

            decorators_1.property(),

            widget_1.renderable()

        ], Recenter.prototype, "state", void 0);

        Recenter = __decorate([

            decorators_1.subclass("esri.widgets.Recenter")

        ], Recenter);

        return Recenter;

    }(decorators_1.declared(Widget)));

    return Recenter;

});

//# sourceMappingURL=Recenter.js.map

 

Any help would be appreciated- as this is the guide to further development I would like it to compile correctly.

 

 

     

 

Attachments

Outcomes