I am trying to add measurement tool to my existing code.
What I did was:
1. add "esri/dijit/Measurement" and variable
2. add the following code after loading feature layer
//dojo.keys.copyKey maps to CTRL on windows and Cmd on Mac., but has wrong code for Chrome on Mac
var snapManager = map.enableSnapping({
snapKey: has("mac") ? keys.META : keys.CTRL
});
var layerInfos = [{
layer: parcelsLayer
}];
snapManager.setLayerInfos(layerInfos);
var measurement = new Measurement({
map: map
}, dom.byId("measurementDiv"));
measurement.startup();
3. add <div id="measurementDiv"></div> in the end
However, the measurement tool does not display.
Please let know what is missing.
Thank you.
Keisuke