Ejemplo n.º 1
0
        protected void DoPan(SkeletonPoint handPoint)
        {
            var mapExtentDeltaX = (_startExtent.XMax - _startExtent.XMin);
            var mapExtentDeltaY = (_startExtent.YMax - _startExtent.YMin);

            var relativeDeltaDistance = _startHandPoint.DistanceVectorFrom(handPoint, _map.ActualWidth, _map.ActualHeight);
            var deltaX = relativeDeltaDistance.X * mapExtentDeltaX;
            var deltaY = relativeDeltaDistance.Y * mapExtentDeltaY;

            var nextExtent = new Envelope
                                 {
                                     XMin = _startExtent.XMin + deltaX,
                                     XMax = _startExtent.XMax + deltaX,
                                     YMin = _startExtent.YMin - deltaY,
                                     YMax = _startExtent.YMax - deltaY
                                 };

            _map.Extent = nextExtent;

            if (KinectPanning != null)
            {
                var handCoordinate = handPoint.ToEsriWebMercatorMapPoint(_map);
                KinectPanning(handCoordinate.ToMapCoord());
            }
        }
Ejemplo n.º 2
0
 protected override void DoMapClick(SkeletonPoint handPoint)
 {
     var mapPoint = handPoint.ToEsriWebMercatorMapPoint(_map);
     if (KinectMapClick != null)
     {
         KinectMapClick(mapPoint.ToMapCoord());
     }
 }
        protected override void RunZooming(SkeletonPoint rightHandPoint, SkeletonPoint leftHandPoint)
        {
            var rightHandCoordinate = rightHandPoint.ToEsriWebMercatorMapPoint(_map);
            var leftHandCoordinate = leftHandPoint.ToEsriWebMercatorMapPoint(_map);

            DoZoomMap(rightHandCoordinate, leftHandCoordinate);

            if (KinectZooming != null)
            {
                KinectZooming();
            }
        }
        protected override void StartZoom(SkeletonPoint rightHandPoint, SkeletonPoint leftHandPoint)
        {
            IsZooming = true;
            _startMapResolution = _map.Resolution;
            _startRightHandCoordinate = rightHandPoint.ToEsriWebMercatorMapPoint(_map);
            _startLeftHandCoordinate = leftHandPoint.ToEsriWebMercatorMapPoint(_map);

            _startDistance = _startRightHandCoordinate.DistanceFrom(_startLeftHandCoordinate);

            if (KinectZoomStarted!= null)
            {
                KinectZoomStarted();
            }
        }
Ejemplo n.º 5
0
        public void DrawHandsBrowsing(SkeletonPoint rightHandPoint, bool rightHandTracked, SkeletonPoint leftHandPoint, bool leftHandTracked)
        {
            if (rightHandTracked)
            {
                var rightHandCoordinate = rightHandPoint.ToEsriWebMercatorMapPoint(map);
                DrawHandBrowsing(rightHandCoordinate, JointType.HandRight);
            }
            else
            {
                HideHand(JointType.HandRight);
            }

            if (leftHandTracked)
            {
                var leftHandCoordinate = leftHandPoint.ToEsriWebMercatorMapPoint(map);
                DrawHandBrowsing(leftHandCoordinate, JointType.HandLeft);
            }
            else
            {
                HideHand(JointType.HandLeft);
            }
        }
Ejemplo n.º 6
0
        protected override void StartPan(SkeletonPoint handPoint)
        {
            IsPanning = true;
            _startHandPoint = handPoint;
            _startHandCoordinate = handPoint.ToEsriWebMercatorMapPoint(_map);
            _startExtent = new Envelope(_map.Extent.XMin, _map.Extent.YMin, _map.Extent.XMax, _map.Extent.YMax);

            if (KinectPanStart != null)
            {
                KinectPanStart(_startHandCoordinate.ToMapCoord());
            }
        }