Hello,
I'm new to Web AppBuilder custom widget programming and I try to modify the advanced identify widget by @RobertScheitlin__GISP as a learning project.
I got the DrawBox tool inside my widget to show up in the widget panel and I want to make the DrawBox point draw function active on panelOpen. But when I click on the point draw icon
it fails in DrawBox.js on this.drawToolBar.activate(tool); with drawToolBar being null.
I'm attaching my current state. What am I doing wrong?
Solved! Go to Solution.
Richard,
Your mistake is that you are decalring this.drawBox = new Drawbox. You can remove that line all together, since you have already declared that div to be a DrawBox in the html template.
initDrawBox: function () {
//this.drawBox = new Drawbox;
this.drawBox.setMap(this.map);
this.drawBox.geoTypes = ['POINT'];
this.drawBox._initTypes();
this.drawBox.setPointSymbol(new SimpleMarkerSymbol(this.config.symbols.simplemarkersymbol));
this.drawBox.deactivateAfterDrawing = false;
},
Please can someone have a look at my test widget 😕 ? The whole widget is attached.
Thank you very much
Richard,
Your mistake is that you are decalring this.drawBox = new Drawbox. You can remove that line all together, since you have already declared that div to be a DrawBox in the html template.
initDrawBox: function () {
//this.drawBox = new Drawbox;
this.drawBox.setMap(this.map);
this.drawBox.geoTypes = ['POINT'];
this.drawBox._initTypes();
this.drawBox.setPointSymbol(new SimpleMarkerSymbol(this.config.symbols.simplemarkersymbol));
this.drawBox.deactivateAfterDrawing = false;
},
Thank you very much Robert. It's working as expected now.