You can try out the demo of a Silverlight & Live Maps overlay with synchronized dragging to pan (it's not yet integrated into RaceReplay.net).
It was a relatively simple implementation of the sample code provided by then Silverlight Mouse Support documentation on MSDN. As with most Silverlight stuff, you can just View Source to see how it works...
Look out MapCruncher (joking!)
UPDATE: zooming now works too. When 'implementing' the Mouse Support example, I blindly copied
canvasT.X = canvasPixel.x;into onMouseUp(), forgetting that I was also updating
canvasT.Y = canvasPixel.y;
sender["Canvas.Left"] += currX - beginX;in onMouseMove(). Oops. Better to update that same property and avoid applying the 'transformation' twice...
sender["Canvas.Top"] += currY - beginY;
sender["Canvas.Left"] = canvasPixel.x;Also added a new cursor to indicate the map is 'draggable' - unfortunately Silverlight has a limited set of cursors to choose from, so the hand-pointing is used rather than open-hand.
sender["Canvas.Top"] = canvasPixel.y;
No comments:
Post a Comment
Note: only a member of this blog may post a comment.