When using any of the TrackShapes, specifically, polygon, point and line, the user is able to click, and move the cursor and the beginning point of the trackshape is in a different location. I have been able to reproduce this behavior fairly consistantly. The mouse click is complete and the cursor moves and the point is in a different location.
I'm not really sure how to explain any better on how to reproduce the error. It just seems the the trackstarted event is lagging behind. I have included the x,y I am capturing, notice how far off the MouseDown x,y are from the MapMouseDown x,y This data was captured at a scale of about 9,000,000, which is about full extent for texas. Where I clicked and where the track started was almost a whole county difference. The numbers below are generated from console.writeline in each method
Thanks for your post. I am wondering which version are your using now? You can get the version information by calling the StaticAPI WinformsMap.GetVersion().
Following is my test codes to recreate your problem: winformsMap1.MouseDown += new MouseEventHandler(winformsMap1_MouseDown); winformsMap1.MouseUp += new MouseEventHandler(winformsMap1_MouseUp);
winformsMap1.TrackOverlay.MapMouseDoubleClick += new EventHandler<MapMouseDoubleClickInteractiveOverlayEventArgs>(TrackOverlay_MapMouseDoubleClick); winformsMap1.TrackOverlay.MapMouseDown += new EventHandler<MapMouseDownInteractiveOverlayEventArgs>(TrackOverlay_MapMouseDown); winformsMap1.TrackOverlay.MapMouseClick += new EventHandler<MapMouseClickInteractiveOverlayEventArgs>(TrackOverlay_MapMouseClick); winformsMap1.TrackOverlay.TrackStarting += new EventHandler<TrackStartingTrackInteractiveOverlayEventArgs>(TrackOverlay_TrackStarting); winformsMap1.TrackOverlay.TrackStarted += new EventHandler<TrackStartedTrackInteractiveOverlayEventArgs>(TrackOverlay_TrackStarted); winformsMap1.TrackOverlay.MapMouseUp += new EventHandler<MapMouseUpInteractiveOverlayEventArgs>(TrackOverlay_MapMouseUp);
I am using the release version for winforms. I agree that if you just click and dont move the mouse it works properly, but if you click then immediately move the mouse there will be a descripency in the screen coordinates as my numbers show. In may take a few times but he have had instances where you can click and move the mouse like 1/2 second later and the points will register differently. This behavior has been happening since we started using the product in april, but i didn’t start digging deeper on the issue until clients started complaining.
I have extended our TrackInteractiveOverlay and make the new track overlay fit your requirement, it will fixed the first point which position is exactly the same as mouse down.
And my sample just contains track point, doesn’t contain track polygon and line, because I can not reproduce your issue from them. Can you check it? If polygon and line also has problem, can you tell me how to reproduce the problem? I will give your solution to fix the problem.
TrackOverlay_TrackStarted started vertex x,y 979647.031430327 1263165.45204355
TrackOverlay_MapMouseUp screen x,y 727 248
We are able to reproduce this fairly consistantly, all we are doing is clicking the map and moving the mouse and eventually it will fail. It seems easier to produce with the polygon, and it only happens on the first point where the track shape is being created, after that the points always match. The behavior is the same with the line, when the first point of the line is created it can fail, but after that it works as expected.
I added some additional debugging in the trackoverlay that may give you some more information. It looks like that winforms map and trackoverlay are able to get out of sync. Notice the x is off by 4 pixels. We are using version
Have you ever seen the result, it definitely correct no matter the debug infromation is. I doubt that you haven’t used my new TrackOverlay, because the original one will show that information from debug. But if using my extended one, it only show winformsMap1_MouseUp and winformsMap1_MouseDown.
Please attached your screen-shot both the sample form and Output window.
James, I implemented the code you sent, which was to send new interactionargs if the trackmode == point, into my solution and the result was the same as I stated in my code at 10:33 this morning. If you want I will use your solution tomorrow and send you the results.
In my post at 11 you should note that after the map_mouseup event fires, the trackoverlay mousemove code is executed before the track overlay onmapclick event occurs, this results in the behavior that i am describing. The map mouse events are not directly wired the the trackoverlay mouse events.
I will use you solution tomorrow and send the results.
I ran you demo as you can see from the screen shot. There is no debug info in the code so there is nothing in the output window. I am submitting this as a bug.
Thanks for your post and sorry for the delay for some problem in the discussion forum in the past few days.
I think James’ idea is that when tracking point shape, the location of the point shape will be determined in MouseDown instead of MouseUp(by default), so the following events will not be fired any more. In this way, this is not a bug.
Yale, I implemented his solution and it still failed. I’m not sure where the communication is failing because the number I have supplied show that the map mouse click coordinates to not match the trackoverlay mouse click coordinates.
I am still waiting for a response to my support ticket.
I just make sure one thing at first, the fail which you mentioned is that the times of map mouse click event raised and your mouse click times are not matched, is that right? And the problem is only this?
Our MapMouseClick event is not like Microsoft mouse click event which you unusually use.
It is just raised when your mouse down and mouse up exactly at the same screen coordinate within 500 milliseconds, So I am sure that if you want to test it, our MapMouseClick event raise times will be less than or equal to your think, because you usually click mouse and then will move a little which you can not sense it. But if you click your mouse very carefully, and you will find the times are equal.
It is not about the times, the numbers i have been showing are the screen coordinates. I was using the winformsmap.mouseclick x and y to show that they do not match the trackoverlay.mouseclick x and y. Our users are trying to start drawing a polygon in a certain county, and when they move the mouse to continue the polygon, the click is registered at the current position of the cursor. This means the trackshape is started in a completely different area than the user expected.
I sort of understand your explaination, but that does not resolve the issue. It does not sense that a click event would have to wait until the mouse stops moving before firing for the track overlay.
If you review my debug info, you will see that the mouse up and mouse down on the map are the same coordinates, and the user is able to move the mouse and then the track overlaymapmouseclick event fires.
James, I have some additional information for you. We changed the InteractiveClickInterval to 50. Changing that value seemed to mitigate the points not lining up, but in turn the double click would not fire.
It appears that even though the InteractiveClickInterval is for the double click, it is affecting the click event as well. Our theory is that once the interval has passed and determined that it is NOT a dbl click, it registers the current position of the cursor instead of the original click. We are only able to recreate this behavior on the first click when creating a track shape. It would appear that the original mouse coordinates that the user initiated should be rethrown, not where the cursur position is after the 500 ms delay.
I want to clear your problem, so I have updated my sample code, and this time I added the debug information, but it only show winformsMap1_MouseUp and winformsMap1_MouseDown like I said at 12-03-2009 09:46 PM. Overlaymapmouseclick event won't be raised.
I can see the first point is exactly match the coordinate of mouse down.
If you think the sample is not reflected your problem, can you update it and make it can easy reproduce what you said?
The InteractiveClickInterval will affect the double click, if you set to 50, that means your double click should within 50 ms, so if you can not click so quickly the event won't be raised.