Last year I had a post asking about a new trackmode. I had asked about how to use the Custom track mode if necessary to create what we were looking for. I didn't need the tool then so didn't pursue the topic much. I was told back then there was no current method for drawing a curved line or arc and "If you want to add a custom track mode, you’ll need to inherit from the TrackInteractiveOverlay class and override some of its virtual methods. ". I was wondering if there has been any new updates to the drawing tools or if there would be a sample of overriding the TrackInteractiveOverlay we could use to get a start on a new draw mode.
Drawing Tools
Jake,
I am afraid there is no new update for the drawing tools, but we have provided some sample code to let you easy to track custom shapes. Here are some:
wiki.thinkgeo.com/wiki/Map_S...Track_Line
wiki.thinkgeo.com/wiki/Map_S...ck_Polygon
I am still looking for other samples, if I find some I will update to you.
Thanks,
James
James,
Neither of those samples are really custom drawing tools, they are just taking an existing drawing method and changing the mouse click events. What I am looking for is a way to make a smooth curved line, most drawing products have a method for this, some work better for our purposes than others. We like autocad's version, but even MSPaint has a curve drawing function that we could make work.
Jake
Jake,
I found a sample code which related with TrackMode.Custom, I think it’s what you want.
Thanks,
James
MeasureTrackInteractiveOverlay.zip (3.97 KB)
I appear to be missing some items from that file. I have done a quick search and I don’t know where to reference some of those items they are using. What is an IconTextStyle and is that a part of this “using ThinkGeo.MapSuite.WpfExplorer;”? Where can I reference that from? I will continue searching but any help would be appreciated.
Jake,
It’s probably internally type, so you couldn’t reference it, but you can treat it as a style because it’s inherit from Style, and you can remove the related code, they’re not big deal. But the other code, such as MouseDownCore, MouseMoveCore, you need to pay attention that will help you understand how to implement a custom track mode.
Thanks,
James