Select to view content in your preferred language

Can this be done?

783
5
05-06-2010 10:55 AM
TimParis
Emerging Contributor
I want to load an view a local map (mxd or similar) as if I was using axMapControl.
I can get an axMapControl to load and function within my WPF application, but it covers (thus rendering useless) all of my existing WPF elements with no way to force them to play nice together.

I just want to show a map and be able to plot moving points based on live GPS data.  I can do it in a windows form application using axMapControl, but the final UI has been designed using WPF.  I cannot use ESRI.ArcGIS.Client.Map as it does not seem to allow loading of a local file.  This is not Silverlight, so I have access to the local file system.

How can I make this work?

Thanks,
Tim
0 Kudos
5 Replies
DominiqueBroux
Esri Frequent Contributor
Silverlight/WPF API can't directly read mxd/mxt files : you need a map service.

Another option is you to use the map engine control in  a WPF application.

See:
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/how_to_host_an_arcgis_e...

But there are some limitations : http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/limitations_on_using_ar...

/Dominique
0 Kudos
TimParis
Emerging Contributor
If you look at my original post, I have already tried that.  It is unusable as the axMapControl obect takes over the foreground of the WPF application rendering the rest of it inaccessable.  To use that method I would still need to re-write all of the WPF controls and incorperate them into the axMapControl.

Is there a way to get the Map data from axMapControl.loadMxFile() transferred into its corresponding object in the Client Map object?
0 Kudos
DominiqueBroux
Esri Frequent Contributor
You are right, I had missed your issue with map control in your original post. Sorry about that.

For your problem, I am in lack of idea.  It's probably possible to use an underlying map control for generating a bitmap image and then to reuse this bitmap image in your WPF application. But I never tested that and it should not be that easy to implement. Hoepfully somebody will have a better idea.

/Dominique
0 Kudos
dotMorten_esri
Esri Notable Contributor
If you are not afraid of getting your hands dirty, there is another way to do it using ArcObjects and the WPF API. Basically you would create a custom dynamic layer that reads and renders an MXD using ArcObjects. Unfortunately I don't have any code I can show or pointers to give, but I've seen people do this, so it is possible.
The layer itself is fairly easy to implement. It's a matter of inheriting from DynamicLayer, overriding GetSource and return the image based on the parsed in extent and size, and during initialize set the spatial reference and full extent of the layer.
0 Kudos
TimParis
Emerging Contributor
That sounds like what I am looking for.
Any advice on how to go about rendering an MXD with ArcObjects?
Or what class to use to load it (MapReader, MapDocument, etc)
0 Kudos