implement measurement widget (version 2.3)  to a different wkid

1068
9
05-19-2011 06:47 AM
GabiVoicu
Occasional Contributor
I am trying to implement the new measurement widget from the new version of the api 2.3 but my wkid it is different where can i specify what wkid
....
      var measurement = new esri.dijit.Measurement({
            map: map
          }, dojo.byId('measurementDiv'));
.........

I did try to implement the widget in our stateplane sample but I am prompted to specify wkid and I don't know where or how?!
Thank you
0 Kudos
9 Replies
KellyHutchins
Esri Frequent Contributor
This is a bug with the measurement widget and we'll fix it for the next release.  You can workaround this issue by creating a global variable in your application called wkid and assigning the spatial reference number to it:

 var wkid = 26912;
0 Kudos
GabiVoicu
Occasional Contributor
This is a bug with the measurement widget and we'll fix it for the next release.  You can workaround this issue by creating a global variable in your application called wkid and assigning the spatial reference number to it:

 var wkid = 26912;


Well thank you - thank you that certainly helped!...

sample not working here
http://maps.collincountytx.gov/testmeasure.html

Thank you
0 Kudos
JianHuang
Occasional Contributor III
wkid should be global variable. Please put the line of code outside any functions.
We are going to patch the bug. Sorry about any inconvenience.
0 Kudos
JianHuang
Occasional Contributor III
Gabi,

After looking at your app, I realized that it points to a 9.3.1 geometry service, which results in a different value when calculating area. Please use a version 10 server geometry service.

Well thank you - thank you that certainly helped!...
Thank you
0 Kudos
GabiVoicu
Occasional Contributor
Gabi,

After looking at your app, I realized that it points to a 9.3.1 geometry service, which results in a different value when calculating area. Please use a version 10 server geometry service.


sorry..... i thought i have fixed my issue .....but now i'm not sure anymore about the 9.3.1 geometry service...really not the right values for 9.3.1 geometry service...they look fine seems like it though

http://maps.collincountytx.gov/testmeasureO.html


not ready for 10 services to implement yet because of the print functionality..
0 Kudos
KellyHutchins
Esri Frequent Contributor
We have a patch for the measurement widget when working with projected data. To use the patch reference the attached .js file in your application after the jsapi script tag:

<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.3"></script>

<script type="text/javascript" src="./patch.js"></script>


0 Kudos
JosephTauer
New Contributor II
Kelly,  Is there a way to get this simple measure tool in as a compiled widget??? (with all patches/fixes)
0 Kudos
JesseRaymond
New Contributor
I completely agree with GISJJT. Is there a pre-compiled version of this anywhere, or at least some less vague instructions? This "simple" Measure Tool has proven to be anything but simple...
0 Kudos
KevinMacLeod1
Occasional Contributor III
Does this bug still exist?

I added just one of our layers to the Measure dijit sample, and it causes it to not work (the ruler and scalebar to measure distance and area do not show up in the titlePane).

I comment them back out and it works again.

Our layers are in Georgia State Plane Ft. But shouldn't this tool know how to deal with multiple projections?

Also I put the patch.js in as a reference to the sample which uses the 3.3 API and it didn't seem to do anything, still the same.

Thanks all. I also called ESRI and I will post back here when I figure this out.
0 Kudos