appswithmaps

Issues with Measurement Widget

Discussion created by appswithmaps on Jun 1, 2014
Latest reply on Jun 4, 2014 by JUihlein-esristaff
Hi all,

I'm having problems with the Measurement widget. When I attempt to use it, the lines aren't drawn between the markers, but vertically downwards instead. Hard to describe, so I attach a screenshot:

[ATTACH=CONFIG]34242[/ATTACH]

I'm use Alaska state plane coordinates for my operational layers, but a web mercator base map, so my map's spatial reference is web mercator too. I know I need to instantiate a Geometry service in esri/config/defaults, which I have done, and when I step through my code in Firebug I can see that the Measurement widget's  _geometryService property is populated correctly.

The code I use to instantiate the widget is simple enough:

this.measure = new Measurement({
 map : this.map,
 defaultAreaUnit : (this.configOptions.units === "metric") ? "esriSquareKilometers" : "esriSquareMiles",
 defaultLengthUnit : (this.configOptions.units === "metric") ? "esriKilometers" : "esriMiles",
 id : 'measureTool'
}, 'measureDiv');

this.measure.startup();


I'm using the ArcGIS Server API for JavaScript v3.9.

Any suggestions would be greatly appreciated as I'm stuck and past deadline! :O

Mark

Outcomes