Example #1
0
        // While a geometry is being drawn, follow the mouse to calculate measurements
        // on the fly and reposition the popup
        private void map_MouseMove(object sender, MouseEventArgs e)
        {
            if (!AssociatedObject.IsEnabled)
            {
                return;
            }

            // get the mouse position
            MapPoint mapPoint = e.GetMapPoint(_map);

            // Calculate measurements based on the new point
            if (!requiresProjection() && _currentDrawVertices.Count > 0)
            {
                updateMeasurements(mapPoint);
            }

            // Set the position of the popup relative to the mouse event (i.e. cursor)
            updatePopupPosition(e.GetPosition(Popup));
        }