JS API: Measurement dijit doesn't work with non-Web Mercator maps

1115
4
Jump to solution
08-22-2014 09:31 AM
SimonHodge
New Contributor III

I've just tried adding the esri/dijit/Measurement widget to a web map application.  It works fine when the map is using a Web Mercator projection, for example when used with the ESRI base maps.  However, when I instead load our own maps which are in ED50 / UTM zone 31N (sref: 23031) the measurement widget does not appear to work correctly.

Firstly, when using the area tool, you can draw an area on screen as expected.  When you double-click to end drawing, while previously it would then have calculated and displayed the area, nothing is displayed.  However, I can see that it does at this point make a call to the geometry service (which it doesn't do when using Web Mercator) and the geometry service replies with a length and area.  It therefore appears to be doing the work, but the result is just not displayed.

Secondly, and I might just be confused here, but the length and location measure tools both work in the same way as they did when used with a Web Mercator map in that the length tool immediately calculates and displays the measured length while you click and the location tool immediately displays the lat and lon of the mouse position in degrees or DMS as you move around.  Both without making a call to the geometry service which I thought should be required because of the map not being in Web Mercator.

Has anyone else had either of these issues.  Does anyone know how to go about fixing or logging a support call with ESRI?

Thanks!

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
SimonHodge
New Contributor III

Solved!  I noticed that the sample code I'd copied was using API version 3.10.  I was still using 3.9.  I changed my application to use 3.9 and voila, problem solved.  So, looks like it was a bug in the Measurement dijit in v3.9.

View solution in original post

0 Kudos
4 Replies
JonathanUihlein
Esri Regular Contributor

Hi Simon,

What is the version number of your custom geometry service?


Could you provide a simple sample that shows off these specific issues?

Thanks!

0 Kudos
SimonHodge
New Contributor III

Hi Jonathan,

The geometry service is running on an ArcGIS Server Enterprise Standard install, version 10.21.

The web application isn't yet finished so hasn't been uploaded to an external site.  However, I could put a quick example page together and just copy in the measurement related code.  I'll get this done ASAP next week and post the URL.  Thanks for your quick reply.

Simon

0 Kudos
SimonHodge
New Contributor III

I created a simplified page to show the problem - I basically just took the measurement sample code and changed it to load one of our own map services in SRef 23031.  However, the area measure worked properly!

On the full application where the problem is occurring, I have determined that the measure-end event simply isn't raised when using the area measure tool.  It is raised when using the line and location tools.  I'll keep digging.  Any tips or advice to help diagnose the issue?

Thanks!

0 Kudos
SimonHodge
New Contributor III

Solved!  I noticed that the sample code I'd copied was using API version 3.10.  I was still using 3.9.  I changed my application to use 3.9 and voila, problem solved.  So, looks like it was a bug in the Measurement dijit in v3.9.

0 Kudos