I found this script on GeoNet where all the buttons and measurements created in the Measurement Widget are automatically closed when closing the Measurement panel.
I am trying to duplicate this behaviour on a Calcite theme JSBin but the widget is still active when closing it's panel:
var titlePane = dijit.byId("panelMeasure");
titlePane.on("hide", function(){
measurement.setTool("location",false);
measurement.setTool("area",false);
measurement.setTool("distance",false);
app.map.graphics.clear();
})
Am I missing something in these code lines?
John
Solved! Go to Solution.
John,
This is what you need then:
// Deactivate Measurement widget on panel close
query("#panelMeasure").on("hide.bs.collapse", function(e) {
app.measurement.setTool("location", false);
app.measurement.setTool("area", false);
app.measurement.setTool("distance", false);
app.map.graphics.clear();
});
John,
This is what you need then:
// Deactivate Measurement widget on panel close
query("#panelMeasure").on("hide.bs.collapse", function(e) {
app.measurement.setTool("location", false);
app.measurement.setTool("area", false);
app.measurement.setTool("distance", false);
app.map.graphics.clear();
});
Thank you