ThinkGeo.com    |     Documentation    |     Premium Support

Trackmode.Point new behavior as of RC

Hello,


I have an identify tool in my project that relied on the Point TrackMode in order to prepare my data for display. The last known version of Map Suite this worked on was 271. In this version, clicking once was sufficient to generate a point shape.


As of version 304, it seems I must click once to start the shape and then twice to end it. So essentially, what felt natural clicking once now requires three perfectly timed clicks in order to generate a valid shape. This is problematic for a lot of reasons but in general it just doesn't make a lot of sense to triple-click to any end-user.


Is there a way to change this behavior back to the way it was previously?



Nelson,


Thanks for your post!
 
I think this “triple click” to track point is our default behavior. You can rewrite your own logic for it if you want.
 
Following is a sample code which you make tracks a point only by one click.
 
Create a CustomInterativeTrackOverlay as following:

    public class CustomInterativeTrackOverlay : TrackInteractiveOverlay
    {
        public CustomInterativeTrackOverlay()
            : base()
        { }

        protected override InteractiveResult MouseDoubleClickCore(InteractionArguments interactionArguments)
        {
            if (TrackMode != TrackMode.Point)
            {
                return base.MouseDoubleClickCore(interactionArguments);
            }
            else
            {
                return new InteractiveResult();
            }
        }

        protected override InteractiveResult MouseUpCore(InteractionArguments interactionArguments)
        {

            if (TrackMode != TrackMode.Point)
            {
                return base.MouseUpCore(interactionArguments);
            }
            else
            {
                return base.MouseDoubleClickCore(interactionArguments);
            }
        }
    }

Then hook it up in Map control:



winformsMap1.TrackOverlay = new CustomInterativeTrackOverlay();

Any more questions just let me know.


Thanks.
 
Yale

Thanks for the code, Yale.   But I agree with Nelson that a track-point should be executed with a single-click by default.

I don’t even care so much if it’s the default behavior or not; just an enumeration option with the ability to change behaviors would be nice. Perhaps a TrackMode.PointOneClick or something? 
  
 At any rate, thanks for the code, Yale. I’ll give it a shot.

Guys, 
  
   The triple click is crazy!  I will talk with the guys and stop the madness. 
  
 David

Hi, Guys, 
  
 We have changed the behaviour from triple click to one click as Nelson talked about. 
  
 Thanks for your ideas and great suggestions. 
  
 Let me know if you have any more questions. 
  
 Thanks. 
  
 Yale

Thanks, Yale.

You are welcome! Nelson! 
  
 Let me know if any more questions! 
  
 Thanks again for your great suggestions. 
  
 Yale