Esempio n. 1
0
        private void MapMain_ActualCameraChanged(MapControl sender, MapActualCameraChangedEventArgs args)
        {
            // Stop following the user if he changed the view
            if (MapState != MapPositionState.None && args.ChangeReason == MapCameraChangeReason.UserInteraction &&
                Math.Abs(args.Camera.Location.Position.Latitude - CurrentPosition.Point.Position.Latitude) > 0.0000001 &&
                Math.Abs(args.Camera.Location.Position.Longitude - CurrentPosition.Point.Position.Longitude) > 0.0000001)
            {
                MapState = MapPositionState.None;
            }

            // Stop rotating the map if the user rotates
            if (MapState == MapPositionState.FollowAndRotate && args.ChangeReason == MapCameraChangeReason.UserInteraction &&
                Math.Abs(args.Camera.Heading - CurrentHeading.HeadingTrueNorth.Value) > 0.0000001)
            {
                MapState = MapPositionState.None;
            }
        }
Esempio n. 2
0
        private void MapMain_ActualCameraChanged(MapControl sender, MapActualCameraChangedEventArgs args)
        {
            // Stop following the user if he changed the view
            if (MapState != MapPositionState.None && args.ChangeReason == MapCameraChangeReason.UserInteraction &&
                Math.Abs(args.Camera.Location.Position.Latitude - CurrentPosition.Point.Position.Latitude) > 0.0000001 &&
                Math.Abs(args.Camera.Location.Position.Longitude - CurrentPosition.Point.Position.Longitude) > 0.0000001)
                MapState = MapPositionState.None;

            // Stop rotating the map if the user rotates
            if (MapState == MapPositionState.FollowAndRotate && args.ChangeReason == MapCameraChangeReason.UserInteraction &&
                Math.Abs(args.Camera.Heading - CurrentHeading.HeadingTrueNorth.Value) > 0.0000001)
                MapState = MapPositionState.None;
        }