ThinkGeo.com    |     Documentation    |     Premium Support

Map click confusion

I'm still upgrading my existing software to RC1. Before I had a map click event that I set on the map. (map.MapClick +=)


When I'm tracking a shape, this event still fires. Do I have to catch the fact that I'm tracking in my mapclick event and ignore it? I think I'm just doing something wrong.


An explanation of how this should ideally work would be great!


Thanks,


Kimberly



Kimberly,


Thanks for your post and questions!


As you said, when you are tracking a shape, the MapClick event will still fire when it meets the fire condition, you have to determine it in your mapClick event and ignore it.


Following is the code you can take a reference to ignore the event when you track shapes:



void winformsMap1_MapClick(object sender, MapClickWinformsMapEventArgs e)
{
  if (winformsMap1.TrackOverlay.TrackMode == TrackMode.None)
  {
     System.Diagnostics.Debug.WriteLine("Fire the normal MapClick event");
  }
}

Any other problems just let me know.


Thanks.


Yale



Hi Yale,


Thanks for the response! I think I understand where I got confused. This makes sense though!


Kimberly



Follow on question: Obviously, this event also fires while I’m editing a tracked shape. I’m suppressing the method with a check on the count of the features in the editoverlay. Is this the best way to tell that I’m editing? 
  
 Thanks!

Kimberly, 
  
 Thanks for your post! 
  
 I think you got the main idea about it, checking the count of InternalFeatures is a very good and efficient way to achieve this! 
  
 Any more questions just let me know. 
  
 Thanks 
  
 Yale