Select to view content in your preferred language

Projected MeasureAction with WebMercator

1282
6
05-20-2011 11:00 AM
MarcusHarner
Regular Contributor
I have a simple SL map that is using the Web Mercator SR.  The base map is coming from ESRI and operational locally hosted dynamic layer showing parcels.  The parcels (and service) have been projected into Web Mercator to match ESRI, Google, Bing, etc.  When measuring lengths and areas using the MeasureAction, incorrect lengths and areas are reported. 
The reported values are the same that I get when using the Measure tool in ArcMap with the same parcel service and source feature classes.  In ArcMap there is the option to measure using the Geodesic, which returns the correct lengths, but not areas.  And there is no property on the MeasureAction to distinguish between a Planar or Geodesic measurement.

To get an accurate measuring tool in SL, the method I am now working on is to have two Maps in the SL app; a MainMap with all of the operational and base layers, and a MeasureMap which has no layers, uses a UTM SR, is transparent and is initially collapsed.  When the user uses the measure tool on the map, via the MaeasureAction, the MeasureMap will become Visible (although the user still can't see it because it is transparent and has no layers) an zoom to the extent of the MainMap.  The MeasureAction Map property is set to use the MeasureMap, thus hopefully measuring lengths and areas with UTM instead of WebMercator.

Does anyone know of an easier way to get accurate length/area measurements and also have the MebMercator SR.
Thanks much for any ideas.
0 Kudos
6 Replies
OrenGal
Regular Contributor
There are some posts in my Blog about Web-Mercator
http://www.gal-systems.com/blog.html
click the Web Mercator keyword in the Categories
Oren
0 Kudos
DominiqueBroux
Esri Frequent Contributor
From the version 2.2, the MeasureAction is taken into account the WebMercator spatial reference.

If you are using a previous version, I suggest you test the latest version that might avoid the workarounds you did.
0 Kudos
MarcusHarner
Regular Contributor
Thanks much Oren and Dominique. 
I signed up for, downloaded, installed and tested the version 2.2 (Beta) of the SL API and unfortunately the MeasureAction was still giving the same results as with version 2.1.  I reported it as a bug to the 2.2 beta site and got a response that it is a known issue and then closed. I assume this means it's not really a bug and might be low on the list of things to work on.  
It still begs the question that if one makes a simple map using a esri tiled layer as the base map (and hense WebMercator as the Map's spatial reference) how do you add the MeasureAction and get a correct area/distance result?
I'll follow Oren's (and Morten's) code samples and work on a custom tool or workflow in version 2.1
Thanks again for the leads and be well.
-Marcus
0 Kudos
RyanCoodey
Frequent Contributor
Marcus,

From what I can tell, 2.2 Beta has this issue, but the 2.2 Final will have it fixed (not released yet).  Check out the post I made here: http://forums.arcgis.com/threads/27909-MeasureAction-in-Web-Mercator-Issues...?highlight=web+mercato...
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Marcus,

Ryan is right, that will be solved with 2.2 final but it's not with beta.
My former post was unclear. Sorry about that.

I tested the latest version and results look good : see attached screenshots:
0 Kudos
MarcusHarner
Regular Contributor
Oh how fantastic! and thanks for the clarification, I was a bit confused.  You esri people rawk.  Do you think the final will be out before the UC?  If there is not a clear date I totally understand, just curious.
0 Kudos