amachadoubi

Can't use MeasureAction with a GraphicLayer anymore? It's a bug?

Discussion created by amachadoubi on Jan 18, 2012
Latest reply on Jan 23, 2012 by amachadoubi
Hello,

I'm having a problem to make the MeasureAction work with a GraphicsLayer when using version 2.2 (final) or greater. The MeasureAction was working without any problems with my GraphicsLayer while I was using the ArcGIS WPF API 2.2 BETA (v 2.2.0.525). But when I migrated to the final version (2.2.0.629) the code simple does not work anymore. That's not the only problem that I have with this new version... I'm still waiting for a response on the problem about Tiles from a custom TiledMapServiceLayer class don't load anymore after migration

But for this one, I've tested with versions v2.3 and v2.4 but the problem persists. With the exact same come, if I add a REST based layer (like the ArcGISTiledMapServiceLayer), event if it's invisible, the MeasureAction will work correctly. But if I remove this layer I've an exception:

Exception details:
System.NullReferenceException: Object reference not set to an instance of an object.
   at ESRI.ArcGIS.Client.Behaviors.Utilities.Measure.map_MouseMove(Object sender, MouseEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)


Why I can't use a MeasureAction with a GraphicLayer anymore? This is the expected beahvior or a bug?

If you need, I can attach a sample. But it's very simple to reproduce. Just put a map with one GraphicsLayer and a MeasureAction and it will fail. Change for an ArcGISTiledMapServiceLayer and it'll work. Both can be added to the same map... and the ArcGISTiledMapServiceLayer  can be even invisible. But I think that the GraphicsLayer can't be alone...

Thank you,

Andre

Outcomes