I have to draw Military Tactical Graphics using the ArcGIS API for WPF - has anyone ever done this before, that can give me some guidance on where to start? What map objects to use to draw military graphics? Any help/suggestions would be very much appreciated.
Thanks for your reply - the problem is really both - but I guess once I know the proper map objects to use to draw military graphics I can figure out the WPF drawing part - so I would appreciate any help you can give me whether its for both or jus tfor the map objects to draw the graphics - I need a good start?
Okay "rr gg"... About the wpf app, you should be more specific. If you haven't any experience with wpf (Silverlight is the same), probably you'll drive crazy quickly, because it's a programming style "different" enough from the classic (imperative) style (e.g. WinForms). After this point, I've to do the same thing as you: editing and drawing objects on a map. The editor offered with the ArcGis APIs is powerful, but it's not convenient for my target, for example. So I'm creating my own and it's not easy. For example, I have a database hosting some data serving the graphic objects on the map. What's the target of your project? Mario
I have a WPF app that is using the ArcGIS API for WPF to load a map - I allow the user to touch the map & do random drawings on the map using the WPF InkCanvas which I overlay on top of the map - then I capture the stroke & insert them into a ESRI.ArcGIS.Client.Geometry Polyline object & then I create a ESRI.ArcGIS.Client.Graphic object & assign the Polyline geometry to the graphic - Then I add the graphic to a GraphicLayer & add it to the map liek this: graphicsLayer.Graphics.Add(graphic); But with Tactical graphics they have their own symbol codes to be draw with - I don't think the InkCanvas is the way to go - how do you draw your graphic objects - what tool are you using?
BTW I found a project on CodePlex that does what I need, but it is using the Bing Maps - Have you seen it - I guess once I know how to replace the Bing map specific objects with the Esri ones I may be able to convert it? The link for that project is: http://milsym.codeplex.com/documentation
Ha-ha!...Gotcha!...My same problem (came to a stall weeks ago!) That's (one of) the way the ESRI editor won't fit for our targets. Anyway, you may try to insert an ElementLayer: maybe your case could be solved in that way. I also have tried with an ElementLayer, 'cos I may insert any UIElement and that will be "anchored" to the map (and scaled too). The problem is that an ElementLayer is not a Panel and (usually) an editor works adding elements to a panel (e.g. canvas). At the moment I'm arranging other stuffs, but I'll try to overlay a canvas to the map and move the elements accordingly (via events). Hope it helps. Cheers Mario
Thanks for your feedback -I guess I can try an ElementLayer - so If I understand you correctly - once I have the coordinates of the graphic & the symbol code to draw it I can place it in a UIElement object & then add that to the ElementLayer - do you have any sample code of when you worked on it that you can possibly show me? What did you use to allow for drawing on the map?
(I wouldn't count on the Envelope values, because I had hard time to understand how to convert). Basically the ElementLayer class defines an Attached-DP that defines the rectangle (Envelope) on the map where your UIElement will be projected. In this way, by panning and zooming the map, you'll see your UIElement scaled/moved accordingly. That's great. The problem is just HOW TO draw. Well, I confess that I'd try to build up the editor from an existent base. Taht's not only for having code ready, but because the same component will be used to draw on a non-map background. As I told you, the editing comes easily on a panel, such a canvas, and this is quite impossible to share with any "Layer" derived class. I've tried (briefly enough) to overlap the ESRI Map control (with a normal map layer) and a transparent canvas (i.e. make them children of a grid). Consider to draw/host your UIElements in the canvas. Now intercept the ExtentChanged/ExtentChanging events of the Map control and "bind" the UIElement position/size to the extent of the map. That works, even not so elegant. But it allows me to use tons of examples of drag-drop/scale/move snippets already tested without any trouble. However I reserve to work in this direction deeply to see if there's something bad.
Personally I think that these APIs are much more web-oriented (i.e. Silverlight), than the desktop. Furthermore, I'd consider to open the sources: shouldn't any loss for ESRI, only gain.
The preferred ESRI way to do this is to define all your symbology on the server using ArcMap and and a .style database, then publishing an MXD as a map service with feature access. Then using the editor widget on the client, you get all the symbols (more or less) automatically populated.
Dan, thanks for clarify, but my case is toward small-mid systems, where the cost of the server is prohibitive. Moreover, in our solution the map is an option, not a must, because lot of customers haven't any internet connection. That's the way I prefer to develop my own editing system, where I MAY use the maps, but not compulsory. Probably the military project could take more seriously your suggestion. Thanks again. Cheers Mario