Closed kjmueller closed 8 years ago
I assume you are talking about the Nearby widget (issues in this repo are for all the widgets listed). Be sure to configure the widget with mapClickMode: true
when including it in the CMV. That option should prevent map clicks from other widgets from being executed.
I am referring to the Nearby widget and thanks for the response! I currently have the widget configured with mapClickMode: true but the identify widget still executes when I drop the point.
kjnueller,
I solved the issue by adding the connectMapClick and disconnectMapClick functions to the widget, and modifying the activateMapPointDrop and handleDrawEnd functions. Also, require the "dojo/topic" module.
disconnectMapClick: function () {
topic.publish('mapClickMode/setCurrent', 'draw');
},
connectMapClick: function () {
topic.publish('mapClickMode/setDefault');
},
activateMapPointDrop: function (evt) {
this.disconnectMapClick();
// this.mapClickMode.current = 'draw';
this.clearResults();
this.dropPointButton.set('label', 'Waiting for point drop');
this.dropPointButton.set('disabled', true);
this.drawTool.activate(Draw.POINT);
},
handleDrawEnd: function (evt) {
this.connectMapClick();
// this.mapClickMode.current = this.mapClickMode.defaultMode;
this.droppedPoint = evt;
this.drawTool.deactivate();
this.showPoint(this.droppedPoint.geometry);
this.dropPointButton.set('label', 'Change point location');
this.dropPointButton.set('disabled', false);
put(this.clearDropButton.domNode, '!off');
// do the analysis
this.doNearbyAnalysis();
},
darinatch,
Thanks for responding! I haven't had a chance to dive in to this. Your improvement would make a great addition. Would you consider doing a pull request?
Brian, Let me read the documentation of how to create a pull request, and I will do it. :)
Brian, I did the pull request, but I am not sure I did it right. I chose to create a new branch, and I probably should have just committed to master. It is waiting to be merged. Please, let me know if I should do anything else. Thank you!
Looks like you did the pull request on your own repository. You need to choose my repository when creating the pull request.
I would like to utilize this widget but when I add it to the viewer and attempt to drop a point the identify executes and seems to prevent the analysis from occurring. The buffer draws but no features are returned. Thanks in advance for any help you can provide!