Hi,
Does the Silverlight Edition support features such as draggable markers and right-click context menu that are available in the Web Edition?
To drag a marker, I tried using the MouseLeftButtonDown and MouseLeftButtonUp events on the SimpleMarkerOverlay and the MouseMove event on the Map as follows:
private bool mouseHeldOnMarker = false; // Flag to check whether the user has held a marker using the left mouse buttonprivate Marker currentlyHeldMarker = null; // Marker object to store the marker currently held by the user using the left mouse button
{
mouseHeldOnMarker =
currentlyHeldMarker =
}
{
mouseHeldOnMarker =
currentlyHeldMarker = e.CurrentMarker;
}
{
{
// Update position of the marker
}
}
void markerOverlay_MouseLeftButtonUp(object sender, MarkerOverlayMouseEventArgs e)false;null;void markerOverlay_MouseLeftButtonDown(object sender, MarkerOverlayMouseEventArgs e)true;private void Map1_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)if (mouseHeldOnMarker && currentlyHeldMarker != null)PointShape newPoint = Map1.ToWorldCoordinate(e.GetPosition(Map1));
When I try to drag the marker, the map catches the mouse down event and pans around. After I release the mouse button and move the mouse, the marker keeps moving around with the cursor because the marker overlay does not catch the mouse up event. I can try fixing it but might still end up being messy.
Would you be able to provide some sample code to implement those features if they are not already available?
Thanks,
Nirish