Custom Module Issue

1583
2
Jump to solution
10-24-2013 06:23 AM
PeterMcBride
New Contributor
Hi,

I am trying to create a widget which will allow a user to enter a lat and long value, click a button and the map will zoom to that location. I have set up the widget and I am trying to call it in my page but I get an error message which says

'Error: declare: mixin #0 is not a callable constructor.constructor'

I have posted my complete code for the HTML page and for the ZoomtoXY widget as attachments as I can't seem to figure out what is wrong here.

Many thanks in advance for your help.

Peter
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: odoe

You're mising a few references in the dependencies of your module.
In the ZoomToXY file
define([     "dojo/Evented",     "dojo/_base/declare",     "dojo/_base/lang",     "dojo/has",     "esri/kernel",     "esri/arcgis/utils",     "dijit/_WidgetBase",     "dijit/_OnDijitClickMixin",     "dijit/_TemplatedMixin",     "dojo/on",     "dijit/layout/ContentPane",     "dijit/form/TextBox",     "dijit/form/Button", // load template         "dojo/text!./templates/ZoomtoXY.html",     "dojo/dom-class",     "dojo/dom-style" ], function (     Evented,     declare,     lang,     has, esriNS,     arcgisUtils,     _WidgetBase, _OnDijitClickMixin, _TemplatedMixin,     on,     dijitTemplate,     domClass, domStyle ) ...


Although it doesn't look like you're using it so you can delete it.

In the Index_zoomWY_AMD file.
    require([          "esri/map",          "dojo/parser",           // You don't reference these in the alias of the function          "dojo/dom",          "esri/toolbars/navigation",          "dijit/form/Button",          "dijit/Toolbar",          "dijit/layout/BorderContainer",          "dijit/layout/ContentPane",          "dijit/layout/AccordionContainer",                    "esri/dijit/BasemapGallery",          "esri/arcgis/utils",          "ERMWidgets/ZoomToXY",          "dojo/domReady!" domReady! should be last argument          ], function (Map, parser, BasemapGallery, arcgisUtils, /* This Navigation is in wrong order */Navigation , ZoomToXY) {         ...


Order is important when defining the dependencies in your modules.

Check out this Esri blog post for some more info.
http://blogs.esri.com/esri/arcgis/2013/10/14/the-abcs-of-amd/

View solution in original post

0 Kudos
2 Replies
by Anonymous User
Not applicable
Original User: odoe

You're mising a few references in the dependencies of your module.
In the ZoomToXY file
define([     "dojo/Evented",     "dojo/_base/declare",     "dojo/_base/lang",     "dojo/has",     "esri/kernel",     "esri/arcgis/utils",     "dijit/_WidgetBase",     "dijit/_OnDijitClickMixin",     "dijit/_TemplatedMixin",     "dojo/on",     "dijit/layout/ContentPane",     "dijit/form/TextBox",     "dijit/form/Button", // load template         "dojo/text!./templates/ZoomtoXY.html",     "dojo/dom-class",     "dojo/dom-style" ], function (     Evented,     declare,     lang,     has, esriNS,     arcgisUtils,     _WidgetBase, _OnDijitClickMixin, _TemplatedMixin,     on,     dijitTemplate,     domClass, domStyle ) ...


Although it doesn't look like you're using it so you can delete it.

In the Index_zoomWY_AMD file.
    require([          "esri/map",          "dojo/parser",           // You don't reference these in the alias of the function          "dojo/dom",          "esri/toolbars/navigation",          "dijit/form/Button",          "dijit/Toolbar",          "dijit/layout/BorderContainer",          "dijit/layout/ContentPane",          "dijit/layout/AccordionContainer",                    "esri/dijit/BasemapGallery",          "esri/arcgis/utils",          "ERMWidgets/ZoomToXY",          "dojo/domReady!" domReady! should be last argument          ], function (Map, parser, BasemapGallery, arcgisUtils, /* This Navigation is in wrong order */Navigation , ZoomToXY) {         ...


Order is important when defining the dependencies in your modules.

Check out this Esri blog post for some more info.
http://blogs.esri.com/esri/arcgis/2013/10/14/the-abcs-of-amd/
0 Kudos
PeterMcBride
New Contributor
Thanks odoe, that worked perfectly!

Peter
0 Kudos