示例#1
0
        private void CreateRoute(object sender, EventArgs e)
        {
            StopRoute();

            NCDeviceInfo  res               = navigineCore.DeviceInfo;
            NCSublocation sublocation       = navigineCore.Location.Sublocations.GetItem <NCSublocation>(currentSublocationIndex);
            CGSize        imageSizeInMeters = new CGSize(sublocation.Width, sublocation.Height);
            double        xPoint            = pressedRoutePin.CenterX() / (mapView.Width() / scrollView.ZoomScale) * imageSizeInMeters.Width;
            double        yPoint            = (1.0f - pressedRoutePin.CenterY() / (mapView.Height() / scrollView.ZoomScale)) * imageSizeInMeters.Height;

            NCLocationPoint point = NCLocationPoint.PointWithLocation(res.Location, res.Sublocation, xPoint, yPoint);

            activeRoutePin = new RouteMapPin();
            activeRoutePin.SetImage(UIImage.FromBundle("MapUser"), UIControlState.Normal);
            activeRoutePin.SetImage(UIImage.FromBundle("MapUser"), UIControlState.Highlighted);
            activeRoutePin.SizeToFit();
            mapView.AddSubview(activeRoutePin);
            scrollView.BringSubviewToFront(activeRoutePin);
            activeRoutePin.Center = pressedRoutePin.Center;

            if (pressedRoutePin != null)
            {
                pressedRoutePin.PopUp.RemoveFromSuperview();
                pressedRoutePin.RemoveFromSuperview();
            }

            navigineCore.AddTatget(point);

            isRouting = true;
            cancelRouteButton.Hidden = false;
        }
示例#2
0
        private void SetupNavigine()
        {
            navigineCore.StartNavigine();
            navigineCore.StartPushManager();

            location   = navigineCore.Location;
            deviceInfo = navigineCore.DeviceInfo;

            SetCurrentSublocation(0);
        }
示例#3
0
        private void PopUpPressed(object sender, EventArgs e)
        {
            StopRoute();
            NCDeviceInfo  res               = navigineCore.DeviceInfo;
            NCSublocation sublocation       = navigineCore.Location.Sublocations.GetItem <NCSublocation>(currentSublocationIndex);
            CGSize        imageSizeInMeters = new CGSize(sublocation.Width, sublocation.Height);
            double        xPoint            = pressedPin.CenterX() / (mapView.Width() / scrollView.ZoomScale) * imageSizeInMeters.Width;
            double        yPoint            = (1.0f - pressedPin.CenterY() / (mapView.Height() / scrollView.ZoomScale)) * imageSizeInMeters.Height;

            NCLocationPoint point = NCLocationPoint.PointWithLocation(res.Location, res.Sublocation, xPoint, yPoint);

            navigineCore.AddTatget(point);

            pressedPin.PopUp.RemoveFromSuperview();
            pressedPin.PopUp.Hidden = true;
            isRouting = true;
            cancelRouteButton.Hidden = false;
        }