I am trying to add a drawing capability to a widget. I looked to the Draw widget as an example. The widget uses 'jimu/dijit/DrawBox'. I can not find documentation for this dijit in the API reference.
Does anyone know if there is additional API documentation?
Thank you
-Marcus Harner
Marcus,
That eror just means that you have a dijit/widget in your widgets template that you have not defined in your Widget.js file. If you attach your Widget.html I can take a look for you.
Hello Robert,
I only added 'jimu/dijit/DrawBox' into define([],
The Draw widget that I ma using for an example does not have a corresponding 'DrawBox' in function().
It is like
define([...'jimu/dijit/DrawBox',...
],
fuction(...){
...});
where '...' is text that is not seemling related to the DrawBox
To Widget.js I add'jimu/dijit/DrawBox' reference in define([],
To Widget.js I add
'jimu/dijit/DrawBox' reference in define([],
Did you also add the DrawBox parameter to the defines parameters list. In the AMD word you have defines and then each define has a parameter that coincides with it.
Specifically, and trying to follow the example of the Draw widget:
To Widget.html, I add the div
div data-dojo-attach-point="drawBox" data-dojo-type="jimu/dijit/DrawBox" data-dojo-props='types:["point","polyline","polygon"],showClear:false' style="margin-top:5px;"></div>
In the postCreate are simply these lines:
this.inherited(arguments);
this.drawBox.setMap(this.map);
When I test it in Chrome, it breaks with this error
"TypeError: this.drawBox.setMap is not a function(…) "TypeError: this.drawBox.setMap is not a function..."
Is there a way to see the exposed methods and properties? Coming from Silverlight, and without documentation WAB widget development is at least an order of magnitude slower I am finding.
Thanks for any insight!
There is no documentation for most of the internal jimu dijits. The DrawBox is a very simple dijit as far as exposed methods and properties. If you look at the Draw widget or or custom widgets like the eSearch you will see that using the DrawBox is not hard at all. Let me know if you have any specific questions.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.