GibbyAR

Measurement Dijit Not Working

Discussion created by GibbyAR on Oct 29, 2013
Latest reply on Feb 13, 2014 by bridgji
Given the code below, I receive the error: "Uncaught TypeError: Cannot call method 'areasAndLengths' of null" when finishing the area measurement. And receive the error: "Uncaught TypeError: Cannot call method 'project' of null" when attempting the line and point measurements. Has anyone else seen this?

dojo.require("esri.dijit.Measurement");

.....

gsvc = new esri.tasks.GeometryService("http://myServerURLHere/arcgis/rest/services/Utilities/Geometry/GeometryServer");

.....

var measurement = new esri.dijit.Measurement({
  map: map,
  defaultAreaUnit: esri.Units.ACRES,
  defaultLengthUnit: esri.Units.FEET
}, dojo.byId('measurementDiv'));
measurement.startup();

....

<div style="position:absolute; left:20px; bottom:20px; z-Index:999;">
   <div id="titlePane" data-dojo-type="dijit.TitlePane" data-dojo-props="title:'Measurement', style: 'font-family: Tahoma; font-size: 12px', closable:'false', open:0">
     <div id="measurementDiv"></div>    
   </div>   
</div>

Outcomes